@wordpress/edit-site 5.25.0 → 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 (438) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/components/block-editor/back-button.js +3 -2
  3. package/build/components/block-editor/back-button.js.map +1 -1
  4. package/build/components/block-editor/resizable-editor.js +2 -2
  5. package/build/components/block-editor/resizable-editor.js.map +1 -1
  6. package/build/components/block-editor/use-post-link-props.js +27 -0
  7. package/build/components/block-editor/use-post-link-props.js.map +1 -0
  8. package/build/components/block-editor/use-site-editor-settings.js +7 -24
  9. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  10. package/build/components/create-template-part-modal/index.js +15 -7
  11. package/build/components/create-template-part-modal/index.js.map +1 -1
  12. package/build/components/editor/index.js +15 -16
  13. package/build/components/editor/index.js.map +1 -1
  14. package/build/components/editor-canvas-container/index.js +9 -7
  15. package/build/components/editor-canvas-container/index.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
  17. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  19. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/context.js +5 -5
  21. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
  23. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/index.js +38 -21
  25. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  27. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -2
  29. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/local-fonts.js +26 -10
  31. package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
  33. package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  35. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  36. package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
  37. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  38. package/build/components/global-styles/preview.js +43 -1
  39. package/build/components/global-styles/preview.js.map +1 -1
  40. package/build/components/global-styles/screen-color-palette.js +16 -12
  41. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  42. package/build/components/global-styles/screen-revisions/index.js +52 -52
  43. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  44. package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -35
  45. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  46. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  47. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  48. package/build/components/global-styles/ui.js +13 -62
  49. package/build/components/global-styles/ui.js.map +1 -1
  50. package/build/components/header-edit-mode/document-tools/index.js +8 -106
  51. package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
  52. package/build/components/header-edit-mode/index.js +7 -11
  53. package/build/components/header-edit-mode/index.js.map +1 -1
  54. package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
  55. package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  56. package/build/components/header-edit-mode/more-menu/index.js +10 -7
  57. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  58. package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
  59. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  60. package/build/components/keyboard-shortcuts/register.js +0 -36
  61. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  62. package/build/components/layout/index.js +6 -13
  63. package/build/components/layout/index.js.map +1 -1
  64. package/build/components/page-main/index.js +4 -4
  65. package/build/components/page-main/index.js.map +1 -1
  66. package/build/components/page-pages/index.js +84 -37
  67. package/build/components/page-pages/index.js.map +1 -1
  68. package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
  69. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  70. package/build/components/page-patterns/dataviews-patterns.js +307 -0
  71. package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
  72. package/build/components/page-patterns/duplicate-menu-item.js +1 -1
  73. package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
  74. package/build/components/page-patterns/grid-item.js +4 -3
  75. package/build/components/page-patterns/grid-item.js.map +1 -1
  76. package/build/components/page-patterns/patterns-list.js +2 -1
  77. package/build/components/page-patterns/patterns-list.js.map +1 -1
  78. package/build/components/page-patterns/use-patterns.js +23 -13
  79. package/build/components/page-patterns/use-patterns.js.map +1 -1
  80. package/build/components/page-templates/index.js +312 -36
  81. package/build/components/page-templates/index.js.map +1 -1
  82. package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
  83. package/build/components/pagination/index.js.map +1 -0
  84. package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
  85. package/build/components/post-preview/index.js.map +1 -0
  86. package/build/components/preferences-modal/enable-feature.js +3 -2
  87. package/build/components/preferences-modal/enable-feature.js.map +1 -1
  88. package/build/components/preferences-modal/enable-panel-option.js +33 -0
  89. package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
  90. package/build/components/preferences-modal/index.js +57 -9
  91. package/build/components/preferences-modal/index.js.map +1 -1
  92. package/build/components/revisions/index.js +3 -7
  93. package/build/components/revisions/index.js.map +1 -1
  94. package/build/components/routes/link.js +6 -2
  95. package/build/components/routes/link.js.map +1 -1
  96. package/build/components/save-button/index.js +6 -3
  97. package/build/components/save-button/index.js.map +1 -1
  98. package/build/components/sidebar/index.js +3 -11
  99. package/build/components/sidebar/index.js.map +1 -1
  100. package/build/components/sidebar-dataviews/add-new-view.js +2 -2
  101. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  102. package/build/components/sidebar-dataviews/default-views.js +18 -5
  103. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  104. package/build/components/sidebar-dataviews/index.js +3 -3
  105. package/build/components/sidebar-dataviews/index.js.map +1 -1
  106. package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
  107. package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  108. package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
  109. package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  110. package/build/components/sidebar-edit-mode/page-panels/index.js +1 -1
  111. package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  112. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  113. package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  114. package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
  115. package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  116. package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  117. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  118. package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  119. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  120. package/build/components/sidebar-navigation-screen-page/index.js +4 -1
  121. package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
  122. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
  123. package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  124. package/build/components/sidebar-navigation-screen-templates/index.js +63 -8
  125. package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  126. package/build/components/style-book/index.js +38 -8
  127. package/build/components/style-book/index.js.map +1 -1
  128. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  129. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  130. package/build/hooks/commands/use-edit-mode-commands.js +11 -6
  131. package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
  132. package/build/index.js +12 -7
  133. package/build/index.js.map +1 -1
  134. package/build/store/actions.js +39 -44
  135. package/build/store/actions.js.map +1 -1
  136. package/build/store/private-actions.js +6 -2
  137. package/build/store/private-actions.js.map +1 -1
  138. package/build/store/reducer.js +0 -46
  139. package/build/store/reducer.js.map +1 -1
  140. package/build/store/selectors.js +32 -41
  141. package/build/store/selectors.js.map +1 -1
  142. package/build/utils/get-is-list-page.js +1 -1
  143. package/build/utils/get-is-list-page.js.map +1 -1
  144. package/build-module/components/block-editor/back-button.js +4 -3
  145. package/build-module/components/block-editor/back-button.js.map +1 -1
  146. package/build-module/components/block-editor/resizable-editor.js +2 -2
  147. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  148. package/build-module/components/block-editor/use-post-link-props.js +20 -0
  149. package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
  150. package/build-module/components/block-editor/use-site-editor-settings.js +8 -25
  151. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  152. package/build-module/components/create-template-part-modal/index.js +14 -7
  153. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  154. package/build-module/components/editor/index.js +16 -17
  155. package/build-module/components/editor/index.js.map +1 -1
  156. package/build-module/components/editor-canvas-container/index.js +9 -7
  157. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  158. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
  159. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  160. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  161. package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  162. package/build-module/components/global-styles/font-library-modal/context.js +7 -7
  163. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  164. package/build-module/components/global-styles/font-library-modal/font-collection.js +8 -4
  165. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  166. package/build-module/components/global-styles/font-library-modal/index.js +39 -22
  167. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  168. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
  169. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  170. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +5 -2
  171. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  172. package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
  173. package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
  174. package/build-module/components/global-styles/font-library-modal/resolvers.js +5 -5
  175. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
  176. package/build-module/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
  177. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
  178. package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
  179. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  180. package/build-module/components/global-styles/preview.js +45 -3
  181. package/build-module/components/global-styles/preview.js.map +1 -1
  182. package/build-module/components/global-styles/screen-color-palette.js +17 -13
  183. package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
  184. package/build-module/components/global-styles/screen-revisions/index.js +53 -53
  185. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  186. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -36
  187. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  188. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
  189. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  190. package/build-module/components/global-styles/ui.js +15 -64
  191. package/build-module/components/global-styles/ui.js.map +1 -1
  192. package/build-module/components/header-edit-mode/document-tools/index.js +13 -110
  193. package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
  194. package/build-module/components/header-edit-mode/index.js +7 -11
  195. package/build-module/components/header-edit-mode/index.js.map +1 -1
  196. package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
  197. package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  198. package/build-module/components/header-edit-mode/more-menu/index.js +10 -7
  199. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  200. package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
  201. package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  202. package/build-module/components/keyboard-shortcuts/register.js +0 -36
  203. package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
  204. package/build-module/components/layout/index.js +6 -13
  205. package/build-module/components/layout/index.js.map +1 -1
  206. package/build-module/components/page-main/index.js +4 -4
  207. package/build-module/components/page-main/index.js.map +1 -1
  208. package/build-module/components/page-pages/index.js +83 -36
  209. package/build-module/components/page-pages/index.js.map +1 -1
  210. package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
  211. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
  212. package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
  213. package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
  214. package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
  215. package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
  216. package/build-module/components/page-patterns/grid-item.js +4 -3
  217. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  218. package/build-module/components/page-patterns/patterns-list.js +2 -1
  219. package/build-module/components/page-patterns/patterns-list.js.map +1 -1
  220. package/build-module/components/page-patterns/use-patterns.js +23 -13
  221. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  222. package/build-module/components/page-templates/index.js +314 -38
  223. package/build-module/components/page-templates/index.js.map +1 -1
  224. package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
  225. package/build-module/components/pagination/index.js.map +1 -0
  226. package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
  227. package/build-module/components/post-preview/index.js.map +1 -0
  228. package/build-module/components/preferences-modal/enable-feature.js +3 -2
  229. package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
  230. package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
  231. package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
  232. package/build-module/components/preferences-modal/index.js +57 -9
  233. package/build-module/components/preferences-modal/index.js.map +1 -1
  234. package/build-module/components/revisions/index.js +4 -8
  235. package/build-module/components/revisions/index.js.map +1 -1
  236. package/build-module/components/routes/link.js +5 -2
  237. package/build-module/components/routes/link.js.map +1 -1
  238. package/build-module/components/save-button/index.js +6 -3
  239. package/build-module/components/save-button/index.js.map +1 -1
  240. package/build-module/components/sidebar/index.js +3 -11
  241. package/build-module/components/sidebar/index.js.map +1 -1
  242. package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
  243. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  244. package/build-module/components/sidebar-dataviews/default-views.js +17 -5
  245. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  246. package/build-module/components/sidebar-dataviews/index.js +2 -2
  247. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  248. package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
  249. package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
  250. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
  251. package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
  252. package/build-module/components/sidebar-edit-mode/page-panels/index.js +2 -2
  253. package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
  254. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
  255. package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
  256. package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
  257. package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
  258. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  259. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
  260. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
  261. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  262. package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
  263. package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
  264. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
  265. package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
  266. package/build-module/components/sidebar-navigation-screen-templates/index.js +64 -9
  267. package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
  268. package/build-module/components/style-book/index.js +40 -10
  269. package/build-module/components/style-book/index.js.map +1 -1
  270. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
  271. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  272. package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
  273. package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
  274. package/build-module/index.js +12 -7
  275. package/build-module/index.js.map +1 -1
  276. package/build-module/store/actions.js +36 -41
  277. package/build-module/store/actions.js.map +1 -1
  278. package/build-module/store/private-actions.js +6 -2
  279. package/build-module/store/private-actions.js.map +1 -1
  280. package/build-module/store/reducer.js +0 -44
  281. package/build-module/store/reducer.js.map +1 -1
  282. package/build-module/store/selectors.js +30 -38
  283. package/build-module/store/selectors.js.map +1 -1
  284. package/build-module/utils/get-is-list-page.js +1 -1
  285. package/build-module/utils/get-is-list-page.js.map +1 -1
  286. package/build-style/style-rtl.css +366 -268
  287. package/build-style/style.css +366 -268
  288. package/package.json +42 -42
  289. package/src/components/add-new-template/style.scss +2 -1
  290. package/src/components/block-editor/back-button.js +4 -2
  291. package/src/components/block-editor/resizable-editor.js +1 -1
  292. package/src/components/block-editor/style.scss +1 -2
  293. package/src/components/block-editor/use-post-link-props.js +20 -0
  294. package/src/components/block-editor/use-site-editor-settings.js +10 -41
  295. package/src/components/code-editor/style.scss +0 -4
  296. package/src/components/create-template-part-modal/index.js +83 -82
  297. package/src/components/editor/index.js +24 -31
  298. package/src/components/editor-canvas-container/index.js +8 -6
  299. package/src/components/global-styles/font-library-modal/collection-font-variant.js +7 -2
  300. package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
  301. package/src/components/global-styles/font-library-modal/context.js +7 -7
  302. package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
  303. package/src/components/global-styles/font-library-modal/index.js +44 -24
  304. package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
  305. package/src/components/global-styles/font-library-modal/library-font-variant.js +7 -2
  306. package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
  307. package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
  308. package/src/components/global-styles/font-library-modal/style.scss +5 -2
  309. package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
  310. package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
  311. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
  312. package/src/components/global-styles/preview.js +55 -3
  313. package/src/components/global-styles/screen-color-palette.js +16 -26
  314. package/src/components/global-styles/screen-revisions/index.js +91 -92
  315. package/src/components/global-styles/screen-revisions/revisions-buttons.js +37 -38
  316. package/src/components/global-styles/screen-revisions/style.scss +77 -20
  317. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
  318. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
  319. package/src/components/global-styles/ui.js +13 -74
  320. package/src/components/header-edit-mode/document-tools/index.js +33 -165
  321. package/src/components/header-edit-mode/index.js +6 -17
  322. package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
  323. package/src/components/header-edit-mode/more-menu/index.js +9 -7
  324. package/src/components/header-edit-mode/style.scss +0 -47
  325. package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
  326. package/src/components/keyboard-shortcuts/register.js +0 -43
  327. package/src/components/layout/index.js +8 -27
  328. package/src/components/layout/style.scss +10 -3
  329. package/src/components/list/style.scss +0 -5
  330. package/src/components/page/style.scss +1 -1
  331. package/src/components/page-main/index.js +8 -8
  332. package/src/components/page-pages/index.js +112 -41
  333. package/src/components/page-pages/style.scss +3 -2
  334. package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
  335. package/src/components/page-patterns/dataviews-patterns.js +380 -0
  336. package/src/components/page-patterns/duplicate-menu-item.js +1 -1
  337. package/src/components/page-patterns/grid-item.js +3 -2
  338. package/src/components/page-patterns/patterns-list.js +2 -1
  339. package/src/components/page-patterns/style.scss +89 -26
  340. package/src/components/page-patterns/use-patterns.js +24 -15
  341. package/src/components/page-templates/index.js +399 -64
  342. package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
  343. package/src/components/pagination/style.scss +5 -0
  344. package/src/components/post-preview/index.js +16 -0
  345. package/src/components/preferences-modal/enable-feature.js +9 -5
  346. package/src/components/preferences-modal/enable-panel-option.js +23 -0
  347. package/src/components/preferences-modal/index.js +107 -22
  348. package/src/components/revisions/index.js +8 -15
  349. package/src/components/routes/link.js +11 -3
  350. package/src/components/save-button/index.js +16 -3
  351. package/src/components/sidebar/index.js +6 -13
  352. package/src/components/sidebar-dataviews/add-new-view.js +1 -1
  353. package/src/components/sidebar-dataviews/default-views.js +23 -6
  354. package/src/components/sidebar-dataviews/index.js +2 -2
  355. package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
  356. package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
  357. package/src/components/sidebar-edit-mode/page-panels/index.js +15 -1
  358. package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
  359. package/src/components/sidebar-edit-mode/style.scss +0 -10
  360. package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
  361. package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
  362. package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
  363. package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
  364. package/src/components/sidebar-navigation-screen-page/index.js +2 -1
  365. package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
  366. package/src/components/sidebar-navigation-screen-templates/index.js +85 -28
  367. package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
  368. package/src/components/site-hub/style.scss +5 -2
  369. package/src/components/style-book/index.js +65 -21
  370. package/src/components/style-book/style.scss +3 -3
  371. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
  372. package/src/hooks/commands/use-edit-mode-commands.js +8 -12
  373. package/src/index.js +11 -5
  374. package/src/store/actions.js +35 -45
  375. package/src/store/private-actions.js +7 -3
  376. package/src/store/reducer.js +0 -44
  377. package/src/store/selectors.js +32 -38
  378. package/src/store/test/actions.js +11 -39
  379. package/src/store/test/reducer.js +1 -82
  380. package/src/store/test/selectors.js +0 -24
  381. package/src/style.scss +2 -1
  382. package/src/utils/get-is-list-page.js +2 -3
  383. package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  384. package/build/components/global-styles/screen-revisions/get-revision-changes.js +0 -146
  385. package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
  386. package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
  387. package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  388. package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
  389. package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  390. package/build/components/page-pages/side-editor.js.map +0 -1
  391. package/build/components/page-patterns/pagination.js.map +0 -1
  392. package/build/components/page-templates/dataviews-templates.js +0 -317
  393. package/build/components/page-templates/dataviews-templates.js.map +0 -1
  394. package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
  395. package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  396. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
  397. package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  398. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
  399. package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  400. package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
  401. package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  402. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
  403. package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  404. package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
  405. package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +0 -139
  406. package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
  407. package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
  408. package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
  409. package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
  410. package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
  411. package/build-module/components/page-pages/side-editor.js.map +0 -1
  412. package/build-module/components/page-patterns/pagination.js.map +0 -1
  413. package/build-module/components/page-templates/dataviews-templates.js +0 -309
  414. package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
  415. package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
  416. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  417. package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
  418. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  419. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
  420. package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
  421. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
  422. package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
  423. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
  424. package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
  425. package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
  426. package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
  427. package/src/components/global-styles/screen-revisions/get-revision-changes.js +0 -171
  428. package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +0 -191
  429. package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
  430. package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
  431. package/src/components/page-pages/side-editor.js +0 -14
  432. package/src/components/page-templates/dataviews-templates.js +0 -360
  433. package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
  434. package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
  435. package/src/components/secondary-sidebar/style.scss +0 -65
  436. package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
  437. package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
  438. package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_coreData","_router","_store","_lockUnlock","_constants","useLocation","unlock","routerPrivateApis","postTypesWithoutParentTemplate","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","user","useResolveEditedEntityAndContext","postId","postType","hasLoadedAllDependencies","homepageId","url","frontPageTemplateId","useSelect","select","getSite","getUnstableBase","getEntityRecords","coreDataStore","siteData","base","templates","per_page","_frontPateTemplateId","frontPageTemplate","find","t","slug","id","show_on_front","page_on_front","toString","home","resolvedTemplateId","includes","undefined","getEditedEntityRecord","getDefaultTemplateId","__experimentalGetTemplateForLink","resolveTemplateForPostTypeAndId","postTypeToResolve","postIdToResolve","editedEntity","currentTemplateSlug","template","currentTemplate","context","useMemo","isReady","useInitEditedEntity","params","setEditedEntity","useDispatch","editSiteStore","useEffect","useInitEditedEntityFromURL"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nfunction useResolveEditedEntityAndContext( { postId, postType } ) {\n\tconst { hasLoadedAllDependencies, homepageId, url, frontPageTemplateId } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getSite, getUnstableBase, getEntityRecords } =\n\t\t\t\tselect( coreDataStore );\n\t\t\tconst siteData = getSite();\n\t\t\tconst base = getUnstableBase();\n\t\t\tconst templates = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t);\n\t\t\tlet _frontPateTemplateId;\n\t\t\tif ( templates ) {\n\t\t\t\tconst frontPageTemplate = templates.find(\n\t\t\t\t\t( t ) => t.slug === 'front-page'\n\t\t\t\t);\n\t\t\t\t_frontPateTemplateId = frontPageTemplate\n\t\t\t\t\t? frontPageTemplate.id\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thasLoadedAllDependencies: !! base && !! siteData,\n\t\t\t\thomepageId:\n\t\t\t\t\tsiteData?.show_on_front === 'page'\n\t\t\t\t\t\t? siteData.page_on_front.toString()\n\t\t\t\t\t\t: null,\n\t\t\t\turl: base?.home,\n\t\t\t\tfrontPageTemplateId: _frontPateTemplateId,\n\t\t\t};\n\t\t}, [] );\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetDefaultTemplateId,\n\t\t\t\t__experimentalGetTemplateForLink,\n\t\t\t} = select( coreDataStore );\n\n\t\t\tfunction resolveTemplateForPostTypeAndId(\n\t\t\t\tpostTypeToResolve,\n\t\t\t\tpostIdToResolve\n\t\t\t) {\n\t\t\t\t// For the front page, we always use the front page template if existing.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\thomepageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\t// We're still checking whether the front page template exists.\n\t\t\t\t\t// Don't resolve the template yet.\n\t\t\t\t\tif ( frontPageTemplateId === undefined ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !! frontPageTemplateId ) {\n\t\t\t\t\t\treturn frontPageTemplateId;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst editedEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeToResolve,\n\t\t\t\t\tpostIdToResolve\n\t\t\t\t);\n\t\t\t\tif ( ! editedEntity ) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\t// First see if the post/page has an assigned template and fetch it.\n\t\t\t\tconst currentTemplateSlug = editedEntity.template;\n\t\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\t\tconst currentTemplate = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t}\n\t\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\t\treturn currentTemplate.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If no template is assigned, use the default template.\n\t\t\t\treturn getDefaultTemplateId( {\n\t\t\t\t\tslug: `${ postTypeToResolve }-${ editedEntity?.slug }`,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( ! hasLoadedAllDependencies ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// If we're rendering a specific page, post... we need to resolve its template.\n\t\t\tif ( postType && postId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( postType, postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homepageId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', homepageId );\n\t\t\t}\n\n\t\t\t// If we're not rendering a specific page, use the front page template.\n\t\t\tif ( url ) {\n\t\t\t\tconst template = __experimentalGetTemplateForLink( url );\n\t\t\t\treturn template?.id;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thomepageId,\n\t\t\thasLoadedAllDependencies,\n\t\t\turl,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfrontPageTemplateId,\n\t\t]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\n\t\tif ( homepageId ) {\n\t\t\treturn { postType: 'page', postId: homepageId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homepageId, postType, postId ] );\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( hasLoadedAllDependencies ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport function useInitEditedEntity( params ) {\n\tconst { postType, postId, context, isReady } =\n\t\tuseResolveEditedEntityAndContext( params );\n\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\tsetEditedEntity( postType, postId, context );\n\t\t}\n\t}, [ isReady, postType, postId, context, setEditedEntity ] );\n}\n\nexport default function useInitEditedEntityFromURL() {\n\tconst { params = {} } = useLocation();\n\treturn useInitEditedEntity( params );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAMA;AACA;AACA;;AAUA,MAAM;EAAEO;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEnD,MAAMC,8BAA8B,GAAG,CACtCC,6BAAkB,EAClBC,kCAAuB,EACvBC,+BAAoB,EACpBC,wBAAa,CAACC,IAAI,CAClB;AAED,SAASC,gCAAgCA,CAAE;EAAEC,MAAM;EAAEC;AAAS,CAAC,EAAG;EACjE,MAAM;IAAEC,wBAAwB;IAAEC,UAAU;IAAEC,GAAG;IAAEC;EAAoB,CAAC,GACvE,IAAAC,eAA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D,CAAC,EAAE,CAAEE,OAAO,EAAExC,QAAQ,EAAED,MAAM,EAAEuC,OAAO,EAAEK,eAAe,CAAG,CAAC;AAC7D;AAEe,SAASI,0BAA0BA,CAAA,EAAG;EACpD,MAAM;IAAEL,MAAM,GAAG,CAAC;EAAE,CAAC,GAAGrD,WAAW,CAAC,CAAC;EACrC,OAAOoD,mBAAmB,CAAEC,MAAO,CAAC;AACrC"}
1
+ {"version":3,"names":["_element","require","_data","_coreData","_router","_store","_lockUnlock","_constants","useLocation","unlock","routerPrivateApis","postTypesWithoutParentTemplate","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","user","useResolveEditedEntityAndContext","postId","postType","hasLoadedAllDependencies","homepageId","url","frontPageTemplateId","useSelect","select","getSite","getUnstableBase","getEntityRecords","coreDataStore","siteData","base","templates","per_page","_frontPateTemplateId","frontPageTemplate","find","t","slug","id","show_on_front","includes","page_on_front","toString","home","resolvedTemplateId","undefined","getEditedEntityRecord","getDefaultTemplateId","__experimentalGetTemplateForLink","resolveTemplateForPostTypeAndId","postTypeToResolve","postIdToResolve","editedEntity","currentTemplateSlug","template","currentTemplate","context","useMemo","isReady","useInitEditedEntity","params","setEditedEntity","useDispatch","editSiteStore","useEffect","useInitEditedEntityFromURL"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nfunction useResolveEditedEntityAndContext( { postId, postType } ) {\n\tconst { hasLoadedAllDependencies, homepageId, url, frontPageTemplateId } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getSite, getUnstableBase, getEntityRecords } =\n\t\t\t\tselect( coreDataStore );\n\t\t\tconst siteData = getSite();\n\t\t\tconst base = getUnstableBase();\n\t\t\tconst templates = getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t);\n\t\t\tlet _frontPateTemplateId;\n\t\t\tif ( templates ) {\n\t\t\t\tconst frontPageTemplate = templates.find(\n\t\t\t\t\t( t ) => t.slug === 'front-page'\n\t\t\t\t);\n\t\t\t\t_frontPateTemplateId = frontPageTemplate\n\t\t\t\t\t? frontPageTemplate.id\n\t\t\t\t\t: false;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\thasLoadedAllDependencies: !! base && !! siteData,\n\t\t\t\thomepageId:\n\t\t\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t\t\t[ 'number', 'string' ].includes(\n\t\t\t\t\t\ttypeof siteData.page_on_front\n\t\t\t\t\t)\n\t\t\t\t\t\t? siteData.page_on_front.toString()\n\t\t\t\t\t\t: null,\n\t\t\t\turl: base?.home,\n\t\t\t\tfrontPageTemplateId: _frontPateTemplateId,\n\t\t\t};\n\t\t}, [] );\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetDefaultTemplateId,\n\t\t\t\t__experimentalGetTemplateForLink,\n\t\t\t} = select( coreDataStore );\n\n\t\t\tfunction resolveTemplateForPostTypeAndId(\n\t\t\t\tpostTypeToResolve,\n\t\t\t\tpostIdToResolve\n\t\t\t) {\n\t\t\t\t// For the front page, we always use the front page template if existing.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\thomepageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\t// We're still checking whether the front page template exists.\n\t\t\t\t\t// Don't resolve the template yet.\n\t\t\t\t\tif ( frontPageTemplateId === undefined ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !! frontPageTemplateId ) {\n\t\t\t\t\t\treturn frontPageTemplateId;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst editedEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeToResolve,\n\t\t\t\t\tpostIdToResolve\n\t\t\t\t);\n\t\t\t\tif ( ! editedEntity ) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\t// First see if the post/page has an assigned template and fetch it.\n\t\t\t\tconst currentTemplateSlug = editedEntity.template;\n\t\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\t\tconst currentTemplate = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t}\n\t\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\t\treturn currentTemplate.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If no template is assigned, use the default template.\n\t\t\t\treturn getDefaultTemplateId( {\n\t\t\t\t\tslug: `${ postTypeToResolve }-${ editedEntity?.slug }`,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( ! hasLoadedAllDependencies ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// If we're rendering a specific page, post... we need to resolve its template.\n\t\t\tif ( postType && postId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( postType, postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homepageId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', homepageId );\n\t\t\t}\n\n\t\t\t// If we're not rendering a specific page, use the front page template.\n\t\t\tif ( url ) {\n\t\t\t\tconst template = __experimentalGetTemplateForLink( url );\n\t\t\t\treturn template?.id;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thomepageId,\n\t\t\thasLoadedAllDependencies,\n\t\t\turl,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfrontPageTemplateId,\n\t\t]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\n\t\tif ( homepageId ) {\n\t\t\treturn { postType: 'page', postId: homepageId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homepageId, postType, postId ] );\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( hasLoadedAllDependencies ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport function useInitEditedEntity( params ) {\n\tconst { postType, postId, context, isReady } =\n\t\tuseResolveEditedEntityAndContext( params );\n\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\tsetEditedEntity( postType, postId, context );\n\t\t}\n\t}, [ isReady, postType, postId, context, setEditedEntity ] );\n}\n\nexport default function useInitEditedEntityFromURL() {\n\tconst { params = {} } = useLocation();\n\treturn useInitEditedEntity( params );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAMA;AACA;AACA;;AAUA,MAAM;EAAEO;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEnD,MAAMC,8BAA8B,GAAG,CACtCC,6BAAkB,EAClBC,kCAAuB,EACvBC,+BAAoB,EACpBC,wBAAa,CAACC,IAAI,CAClB;AAED,SAASC,gCAAgCA,CAAE;EAAEC,MAAM;EAAEC;AAAS,CAAC,EAAG;EACjE,MAAM;IAAEC,wBAAwB;IAAEC,UAAU;IAAEC,GAAG;IAAEC;EAAoB,CAAC,GACvE,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxB,MAAM;MAAEC,OAAO;MAAEC,eAAe;MAAEC;IAAiB,CAAC,GACnDH,MAAM,CAAEI,eAAc,CAAC;IACxB,MAAMC,QAAQ,GAAGJ,OAAO,CAAC,CAAC;IAC1B,MAAMK,IAAI,GAAGJ,eAAe,CAAC,CAAC;IAC9B,MAAMK,SAAS,GAAGJ,gBAAgB,CACjC,UAAU,EACVhB,6BAAkB,EAClB;MACCqB,QAAQ,EAAE,CAAC;I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rC,OAAOoD,mBAAmB,CAAEC,MAAO,CAAC;AACrC"}
@@ -211,16 +211,21 @@ function useEditUICommands() {
211
211
  isDistractionFree
212
212
  } = (0, _data.useSelect)(select => {
213
213
  const {
214
- isListViewOpened,
214
+ get
215
+ } = select(_preferences.store);
216
+ const {
215
217
  getEditorMode
216
218
  } = select(_store.store);
219
+ const {
220
+ isListViewOpened
221
+ } = select(_editor.store);
217
222
  return {
218
223
  canvasMode: (0, _lockUnlock.unlock)(select(_store.store)).getCanvasMode(),
219
224
  editorMode: getEditorMode(),
220
225
  activeSidebar: select(_interface.store).getActiveComplementaryArea(_store.store.name),
221
- showBlockBreadcrumbs: select(_preferences.store).get('core/edit-site', 'showBlockBreadcrumbs'),
226
+ showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
222
227
  isListViewOpen: isListViewOpened(),
223
- isDistractionFree: select(_preferences.store).get(_store.store.name, 'distractionFree')
228
+ isDistractionFree: get('core', 'distractionFree')
224
229
  };
225
230
  }, []);
226
231
  const {
@@ -275,7 +280,7 @@ function useEditUICommands() {
275
280
  callback: ({
276
281
  close
277
282
  }) => {
278
- toggle('core/edit-site', 'focusMode');
283
+ toggle('core', 'focusMode');
279
284
  close();
280
285
  }
281
286
  });
@@ -295,7 +300,7 @@ function useEditUICommands() {
295
300
  callback: ({
296
301
  close
297
302
  }) => {
298
- toggle('core/edit-site', 'fixedToolbar');
303
+ toggle('core', 'fixedToolbar');
299
304
  if (isDistractionFree) {
300
305
  toggleDistractionFree();
301
306
  }
@@ -336,7 +341,7 @@ function useEditUICommands() {
336
341
  callback: ({
337
342
  close
338
343
  }) => {
339
- toggle('core/edit-site', 'showBlockBreadcrumbs');
344
+ toggle('core', 'showBlockBreadcrumbs');
340
345
  close();
341
346
  createInfoNotice(showBlockBreadcrumbs ? (0, _i18n.__)('Breadcrumbs hidden.') : (0, _i18n.__)('Breadcrumbs visible.'), {
342
347
  id: 'core/edit-site/toggle-breadcrumbs/notice',
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_i18n","_icons","_commands","_htmlEntities","_router","_preferences","_interface","_notices","_editor","_store","_useEditedEntityRecord","_interopRequireDefault","_isTemplateRemovable","_isTemplateRevertable","_keyboardShortcutHelpModal","_preferencesModal","_patternModal","_lockUnlock","_constants","useHistory","unlock","routerPrivateApis","usePageContentFocusCommands","record","template","useEditedEntityRecord","isPage","canvasMode","renderingMode","useSelect","select","_isPage","getCanvasMode","editSiteStore","getRenderingMode","editorStore","setRenderingMode","useDispatch","isLoading","commands","push","name","label","sprintf","decodeEntities","title","icon","layout","callback","close","__","page","useEditorModeCommands","switchEditorMode","editorMode","getEditorMode","code","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","isTemplateRevertable","type","TEMPLATE_POST_TYPE","isRTL","rotateRight","rotateLeft","isTemplateRemovable","path","trash","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","toggleDistractionFree","setIsListViewOpened","activeSidebar","showBlockBreadcrumbs","isListViewOpen","isDistractionFree","isListViewOpened","interfaceStore","getActiveComplementaryArea","preferencesStore","get","openModal","toggle","createInfoNotice","noticesStore","drawerLeft","drawerRight","blockDefault","PREFERENCES_MODAL_NAME","keyboard","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","id","listView","usePatternCommands","pattern","edit","PATTERN_MODALS","rename","symbol","duplicate","useEditModeCommands","useCommandLoader","hook","context"],"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tedit,\n\ttrash,\n\trotateLeft,\n\trotateRight,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcode,\n\tkeyboard,\n\tlistView,\n\tsymbol,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { PATTERN_MODALS } from '../../components/pattern-modal';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, renderingMode } = useSelect( ( select ) => {\n\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { getRenderingMode } = select( editorStore );\n\t\treturn {\n\t\t\tisPage: _isPage(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t};\n\t}, [] );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( renderingMode !== 'template-only' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\t/* translators: %1$s: template title */\n\t\t\tlabel: sprintf(\n\t\t\t\t'Edit template: %s',\n\t\t\t\tdecodeEntities( template.title )\n\t\t\t),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-only' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-locked' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useEditorModeCommands() {\n\tconst { switchEditorMode } = useDispatch( editSiteStore );\n\tconst { canvasMode, editorMode } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tif ( canvasMode !== 'edit' || editorMode !== 'text' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( editorMode === 'text' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/exit-code-editor',\n\t\t\tlabel: __( 'Exit code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'visual' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst isEditingPage = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editSiteStore ).isPage() &&\n\t\t\tselect( editorStore ).getRenderingMode() !== 'template-only',\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tconst path =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? '/wp_template'\n\t\t\t\t: '/wp_template_part/all';\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\ttoggleDistractionFree,\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t} = useDispatch( editSiteStore );\n\tconst {\n\t\tcanvasMode,\n\t\teditorMode,\n\t\tactiveSidebar,\n\t\tshowBlockBreadcrumbs,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t} = useSelect( ( select ) => {\n\t\tconst { isListViewOpened, getEditorMode } = select( editSiteStore );\n\t\treturn {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowBlockBreadcrumbs: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\teditSiteStore.name,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: __( 'Toggle distraction free' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggleDistractionFree();\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'fixedToolbar' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t}\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tif ( editorMode === 'visual' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-code-editor',\n\t\t\tlabel: __( 'Open code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'text' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Editor preferences' ),\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-breadcrumbs',\n\t\tlabel: showBlockBreadcrumbs\n\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t: __( 'Show block breadcrumbs' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-site', 'showBlockBreadcrumbs' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-breadcrumbs/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: __( 'Toggle list view' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction usePatternCommands() {\n\tconst { isLoaded, record: pattern } = useEditedEntityRecord();\n\tconst { openModal } = useDispatch( interfaceStore );\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( pattern?.type === 'wp_block' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/rename-pattern',\n\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\ticon: edit,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.rename );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t\tcommands.push( {\n\t\t\tname: 'core/duplicate-pattern',\n\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\ticon: symbol,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.duplicate );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/exit-code-editor',\n\t\thook: useEditorModeCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/patterns',\n\t\thook: usePatternCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAeA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,sBAAA,GAAAC,sBAAA,CAAAZ,OAAA;AACA,IAAAa,oBAAA,GAAAD,sBAAA,CAAAZ,OAAA;AACA,IAAAc,qBAAA,GAAAF,sBAAA,CAAAZ,OAAA;AACA,IAAAe,0BAAA,GAAAf,OAAA;AACA,IAAAgB,iBAAA,GAAAhB,OAAA;AACA,IAAAiB,aAAA,GAAAjB,OAAA;AACA,IAAAkB,WAAA,GAAAlB,OAAA;AACA,IAAAmB,UAAA,GAAAnB,OAAA;AAvCA;AACA;AACA;;AA0BA;AACA;AACA;;AAWA,MAAM;EAAEoB;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAElD,SAASC,2BAA2BA,CAAA,EAAG;E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CJ,IAAI,EAAEyD,aAAM;MACZvD,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1BqC,SAAS,CAAEe,4BAAc,CAACG,SAAU,CAAC;QACrCvD,KAAK,CAAC,CAAC;MACR;IACD,CAAE,CAAC;EACJ;EAEA,OAAO;IAAEX,SAAS,EAAE,KAAK;IAAEC;EAAS,CAAC;AACtC;AAEO,SAASkE,mBAAmBA,CAAA,EAAG;EACrC,IAAAC,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,uBAAuB;IAC7BkE,IAAI,EAAEvD,qBAAqB;IAC3BwD,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,mCAAmC;IACzCkE,IAAI,EAAErF,2BAA2B;IACjCsF,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,oCAAoC;IAC1CkE,IAAI,EAAElD;EACP,CAAE,CAAC;EAEH,IAAAiD,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,yBAAyB;IAC/BkE,IAAI,EAAET,kBAAkB;IACxBU,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,wBAAwB;IAC9BkE,IAAI,EAAEnC;EACP,CAAE,CAAC;AACJ"}
1
+ {"version":3,"names":["_data","require","_i18n","_icons","_commands","_htmlEntities","_router","_preferences","_interface","_notices","_editor","_store","_useEditedEntityRecord","_interopRequireDefault","_isTemplateRemovable","_isTemplateRevertable","_keyboardShortcutHelpModal","_preferencesModal","_patternModal","_lockUnlock","_constants","useHistory","unlock","routerPrivateApis","usePageContentFocusCommands","record","template","useEditedEntityRecord","isPage","canvasMode","renderingMode","useSelect","select","_isPage","getCanvasMode","editSiteStore","getRenderingMode","editorStore","setRenderingMode","useDispatch","isLoading","commands","push","name","label","sprintf","decodeEntities","title","icon","layout","callback","close","__","page","useEditorModeCommands","switchEditorMode","editorMode","getEditorMode","code","useManipulateDocumentCommands","isLoaded","removeTemplate","revertTemplate","history","isEditingPage","isTemplateRevertable","type","TEMPLATE_POST_TYPE","isRTL","rotateRight","rotateLeft","isTemplateRemovable","path","trash","useEditUICommands","openGeneralSidebar","closeGeneralSidebar","toggleDistractionFree","setIsListViewOpened","activeSidebar","showBlockBreadcrumbs","isListViewOpen","isDistractionFree","get","preferencesStore","isListViewOpened","interfaceStore","getActiveComplementaryArea","openModal","toggle","createInfoNotice","noticesStore","drawerLeft","drawerRight","blockDefault","PREFERENCES_MODAL_NAME","keyboard","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","id","listView","usePatternCommands","pattern","edit","PATTERN_MODALS","rename","symbol","duplicate","useEditModeCommands","useCommandLoader","hook","context"],"sources":["@wordpress/edit-site/src/hooks/commands/use-edit-mode-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tedit,\n\ttrash,\n\trotateLeft,\n\trotateRight,\n\tlayout,\n\tpage,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tcode,\n\tkeyboard,\n\tlistView,\n\tsymbol,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport useEditedEntityRecord from '../../components/use-edited-entity-record';\nimport isTemplateRemovable from '../../utils/is-template-removable';\nimport isTemplateRevertable from '../../utils/is-template-revertable';\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { PATTERN_MODALS } from '../../components/pattern-modal';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nfunction usePageContentFocusCommands() {\n\tconst { record: template } = useEditedEntityRecord();\n\tconst { isPage, canvasMode, renderingMode } = useSelect( ( select ) => {\n\t\tconst { isPage: _isPage, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { getRenderingMode } = select( editorStore );\n\t\treturn {\n\t\t\tisPage: _isPage(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t};\n\t}, [] );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tif ( ! isPage || canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( renderingMode !== 'template-only' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-template-focus',\n\t\t\t/* translators: %1$s: template title */\n\t\t\tlabel: sprintf(\n\t\t\t\t'Edit template: %s',\n\t\t\t\tdecodeEntities( template.title )\n\t\t\t),\n\t\t\ticon: layout,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-only' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t} else {\n\t\tcommands.push( {\n\t\t\tname: 'core/switch-to-page-focus',\n\t\t\tlabel: __( 'Back to page' ),\n\t\t\ticon: page,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetRenderingMode( 'template-locked' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useEditorModeCommands() {\n\tconst { switchEditorMode } = useDispatch( editSiteStore );\n\tconst { canvasMode, editorMode } = useSelect(\n\t\t( select ) => ( {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: select( editSiteStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tif ( canvasMode !== 'edit' || editorMode !== 'text' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( editorMode === 'text' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/exit-code-editor',\n\t\t\tlabel: __( 'Exit code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'visual' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nfunction useManipulateDocumentCommands() {\n\tconst { isLoaded, record: template } = useEditedEntityRecord();\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst isEditingPage = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editSiteStore ).isPage() &&\n\t\t\tselect( editorStore ).getRenderingMode() !== 'template-only',\n\t\t[]\n\t);\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( isTemplateRevertable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Reset template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tcommands.push( {\n\t\t\tname: 'core/reset-template',\n\t\t\tlabel,\n\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\trevertTemplate( template );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tif ( isTemplateRemovable( template ) && ! isEditingPage ) {\n\t\tconst label =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? /* translators: %1$s: template title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t )\n\t\t\t\t: /* translators: %1$s: template part title */\n\t\t\t\t sprintf(\n\t\t\t\t\t\t'Delete template part: %s',\n\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t );\n\t\tconst path =\n\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t? '/wp_template'\n\t\t\t\t: '/wp_template_part/all';\n\t\tcommands.push( {\n\t\t\tname: 'core/remove-template',\n\t\t\tlabel,\n\t\t\ticon: trash,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tremoveTemplate( template );\n\t\t\t\t// Navigate to the template list\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t} );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tisLoading: ! isLoaded,\n\t\tcommands,\n\t};\n}\n\nfunction useEditUICommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\ttoggleDistractionFree,\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t} = useDispatch( editSiteStore );\n\tconst {\n\t\tcanvasMode,\n\t\teditorMode,\n\t\tactiveSidebar,\n\t\tshowBlockBreadcrumbs,\n\t\tisListViewOpen,\n\t\tisDistractionFree,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorMode } = select( editSiteStore );\n\t\tconst { isListViewOpened } = select( editorStore );\n\t\treturn {\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tif ( canvasMode !== 'edit' ) {\n\t\treturn { isLoading: false, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/template' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/template' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-site/block-inspector' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-site/block-inspector' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: __( 'Toggle distraction free' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggleDistractionFree();\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t}\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tif ( editorMode === 'visual' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-code-editor',\n\t\t\tlabel: __( 'Open code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( 'text' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Editor preferences' ),\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-breadcrumbs',\n\t\tlabel: showBlockBreadcrumbs\n\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t: __( 'Show block breadcrumbs' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'showBlockBreadcrumbs' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-site/toggle-breadcrumbs/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: __( 'Toggle list view' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction usePatternCommands() {\n\tconst { isLoaded, record: pattern } = useEditedEntityRecord();\n\tconst { openModal } = useDispatch( interfaceStore );\n\n\tif ( ! isLoaded ) {\n\t\treturn { isLoading: true, commands: [] };\n\t}\n\n\tconst commands = [];\n\n\tif ( pattern?.type === 'wp_block' ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/rename-pattern',\n\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\ticon: edit,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.rename );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t\tcommands.push( {\n\t\t\tname: 'core/duplicate-pattern',\n\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\ticon: symbol,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( PATTERN_MODALS.duplicate );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nexport function useEditModeCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/exit-code-editor',\n\t\thook: useEditorModeCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/page-content-focus',\n\t\thook: usePageContentFocusCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: useManipulateDocumentCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/patterns',\n\t\thook: usePatternCommands,\n\t\tcontext: 'site-editor-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/edit-ui',\n\t\thook: useEditUICommands,\n\t} );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GA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,IAAAF,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,mCAAmC;IACzCkE,IAAI,EAAErF,2BAA2B;IACjCsF,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,oCAAoC;IAC1CkE,IAAI,EAAElD;EACP,CAAE,CAAC;EAEH,IAAAiD,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,yBAAyB;IAC/BkE,IAAI,EAAET,kBAAkB;IACxBU,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBjE,IAAI,EAAE,wBAAwB;IAC9BkE,IAAI,EAAEnC;EACP,CAAE,CAAC;AACJ"}
package/build/index.js CHANGED
@@ -92,16 +92,21 @@ function initializeEditor(id, settings) {
92
92
  // so that we won't trigger unnecessary re-renders with useEffect.
93
93
  (0, _data.dispatch)(_preferences.store).setDefaults('core/edit-site', {
94
94
  editorMode: 'visual',
95
- fixedToolbar: false,
96
- focusMode: false,
97
- distractionFree: false,
98
- keepCaretInsideBlock: false,
99
95
  welcomeGuide: true,
100
96
  welcomeGuideStyles: true,
101
97
  welcomeGuidePage: true,
102
- welcomeGuideTemplate: true,
103
- showListViewByDefault: false,
104
- showBlockBreadcrumbs: true
98
+ welcomeGuideTemplate: true
99
+ });
100
+ (0, _data.dispatch)(_preferences.store).setDefaults('core', {
101
+ allowRightClickOverrides: true,
102
+ distractionFree: false,
103
+ fixedToolbar: false,
104
+ focusMode: false,
105
+ inactivePanels: [],
106
+ keepCaretInsideBlock: false,
107
+ openPanels: ['post-status'],
108
+ showBlockBreadcrumbs: true,
109
+ showListViewByDefault: false
105
110
  });
106
111
  (0, _data.dispatch)(_interface.store).setDefaultComplementaryArea('core/edit-site', 'edit-site/template');
107
112
  (0, _data.dispatch)(_store.store).updateSettings(settings);
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_blockLibrary","_data","_deprecated","_interopRequireDefault","_element","_editor","_interface","_preferences","_widgets","_store","_app","_pluginSidebar","_pluginSidebarMoreMenuItem","_pluginMoreMenuItem","_pluginTemplateSettingPanel","initializeEditor","id","settings","target","document","getElementById","root","createRoot","dispatch","blocksStore","reapplyBlockTypeFilters","coreBlocks","__experimentalGetCoreBlocks","filter","name","registerCoreBlocks","setFreeformFallbackBlockName","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","preferencesStore","setDefaults","editorMode","fixedToolbar","focusMode","distractionFree","keepCaretInsideBlock","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","showListViewByDefault","showBlockBreadcrumbs","interfaceStore","setDefaultComplementaryArea","editSiteStore","updateSettings","editorStore","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tdistractionFree: false,\n\t\tkeepCaretInsideBlock: false,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t\tshowListViewByDefault: false,\n\t\tshowBlockBreadcrumbs: true,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAQAA,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,IAAA,GAAAP,sBAAA,CAAAJ,OAAA;AA0EA,IAAAY,cAAA,GAAAR,sBAAA,CAAAJ,OAAA;AACA,IAAAa,0BAAA,GAAAT,sBAAA,CAAAJ,OAAA;AACA,IAAAc,mBAAA,GAAAV,sBAAA,CAAAJ,OAAA;AACA,IAAAe,2BAAA,GAAAX,sBAAA,CAAAJ,OAAA;AAtGA;AACA;AACA;;AAkBA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACO,SAASgB,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAG;EAChD,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEJ,EAAG,CAAC;EAC5C,MAAMK,IAAI,GAAG,IAAAC,mBAAU,EAAEJ,MAAO,CAAC;EAEjC,IAAAK,cAAQ,EAAEC,aAAY,CAAC,CAACC,uBAAuB,CAAC,C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C2C;EACpC,CAAE,CAAC;;EAEH;EACAC,MAAM,CAACC,gBAAgB,CAAE,UAAU,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzEH,MAAM,CAACC,gBAAgB,CAAE,MAAM,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErE3C,IAAI,CAAC4C,MAAM,CAAE,IAAAC,MAAA,CAAAC,aAAA,EAACzD,IAAA,CAAA0D,OAAG,MAAE,CAAE,CAAC;EAEtB,OAAO/C,IAAI;AACZ;AAEO,SAASgD,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
1
+ {"version":3,"names":["_blocks","require","_blockLibrary","_data","_deprecated","_interopRequireDefault","_element","_editor","_interface","_preferences","_widgets","_store","_app","_pluginSidebar","_pluginSidebarMoreMenuItem","_pluginMoreMenuItem","_pluginTemplateSettingPanel","initializeEditor","id","settings","target","document","getElementById","root","createRoot","dispatch","blocksStore","reapplyBlockTypeFilters","coreBlocks","__experimentalGetCoreBlocks","filter","name","registerCoreBlocks","setFreeformFallbackBlockName","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","preferencesStore","setDefaults","editorMode","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","interfaceStore","setDefaultComplementaryArea","editSiteStore","updateSettings","editorStore","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\teditorMode: 'visual',\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( interfaceStore ).setDefaultComplementaryArea(\n\t\t'core/edit-site',\n\t\t'edit-site/template'\n\t);\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginSidebar } from './components/sidebar-edit-mode/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header-edit-mode/plugin-sidebar-more-menu-item';\nexport { default as PluginMoreMenuItem } from './components/header-edit-mode/plugin-more-menu-item';\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAA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IAAA,CAAA6D,OAAG,MAAE,CAAE,CAAC;EAEtB,OAAOlD,IAAI;AACZ;AAEO,SAASmD,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
@@ -11,8 +11,7 @@ exports.setEditedEntity = setEditedEntity;
11
11
  exports.setEditedPostContext = setEditedPostContext;
12
12
  exports.setHasPageContentFocus = void 0;
13
13
  exports.setHomeTemplateId = setHomeTemplateId;
14
- exports.setIsInserterOpened = setIsInserterOpened;
15
- exports.setIsListViewOpened = void 0;
14
+ exports.setIsListViewOpened = exports.setIsInserterOpened = void 0;
16
15
  exports.setIsNavigationPanelOpened = setIsNavigationPanelOpened;
17
16
  exports.setIsSaveViewOpened = setIsSaveViewOpened;
18
17
  exports.setNavigationMenu = setNavigationMenu;
@@ -311,23 +310,39 @@ function setIsNavigationPanelOpened() {
311
310
  }
312
311
 
313
312
  /**
314
- * Opens or closes the inserter.
313
+ * Returns an action object used to open/close the inserter.
315
314
  *
316
- * @param {boolean|Object} value Whether the inserter should be
317
- * opened (true) or closed (false).
318
- * To specify an insertion point,
319
- * use an object.
320
- * @param {string} value.rootClientId The root client ID to insert at.
321
- * @param {number} value.insertionIndex The index to insert at.
315
+ * @deprecated
322
316
  *
323
- * @return {Object} Action object.
317
+ * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).
324
318
  */
325
- function setIsInserterOpened(value) {
326
- return {
327
- type: 'SET_IS_INSERTER_OPENED',
328
- value
329
- };
330
- }
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
+ };
331
346
 
332
347
  /**
333
348
  * Returns an action object used to update the settings.
@@ -336,6 +351,7 @@ function setIsInserterOpened(value) {
336
351
  *
337
352
  * @return {Object} Action object.
338
353
  */
354
+ exports.setIsListViewOpened = setIsListViewOpened;
339
355
  function updateSettings(settings) {
340
356
  return {
341
357
  type: 'UPDATE_SETTINGS',
@@ -343,33 +359,12 @@ function updateSettings(settings) {
343
359
  };
344
360
  }
345
361
 
346
- /**
347
- * Sets whether the list view panel should be open.
348
- *
349
- * @param {boolean} isOpen If true, opens the list view. If false, closes it.
350
- * It does not toggle the state, but sets it directly.
351
- */
352
- const setIsListViewOpened = isOpen => ({
353
- dispatch,
354
- registry
355
- }) => {
356
- const isDistractionFree = registry.select(_preferences.store).get('core/edit-site', 'distractionFree');
357
- if (isDistractionFree && isOpen) {
358
- dispatch.toggleDistractionFree();
359
- }
360
- dispatch({
361
- type: 'SET_IS_LIST_VIEW_OPENED',
362
- isOpen
363
- });
364
- };
365
-
366
362
  /**
367
363
  * Sets whether the save view panel should be open.
368
364
  *
369
365
  * @param {boolean} isOpen If true, opens the save view. If false, closes it.
370
366
  * It does not toggle the state, but sets it directly.
371
367
  */
372
- exports.setIsListViewOpened = setIsListViewOpened;
373
368
  function setIsSaveViewOpened(isOpen) {
374
369
  return {
375
370
  type: 'SET_IS_SAVE_VIEW_OPENED',
@@ -476,7 +471,7 @@ const openGeneralSidebar = name => ({
476
471
  dispatch,
477
472
  registry
478
473
  }) => {
479
- const isDistractionFree = registry.select(_preferences.store).get('core/edit-site', 'distractionFree');
474
+ const isDistractionFree = registry.select(_preferences.store).get('core', 'distractionFree');
480
475
  if (isDistractionFree) {
481
476
  dispatch.toggleDistractionFree();
482
477
  }
@@ -506,7 +501,7 @@ const switchEditorMode = mode => ({
506
501
  if (mode === 'visual') {
507
502
  (0, _a11y.speak)((0, _i18n.__)('Visual editor selected'), 'assertive');
508
503
  } else if (mode === 'text') {
509
- const isDistractionFree = registry.select(_preferences.store).get('core/edit-site', 'distractionFree');
504
+ const isDistractionFree = registry.select(_preferences.store).get('core', 'distractionFree');
510
505
  if (isDistractionFree) {
511
506
  dispatch.toggleDistractionFree();
512
507
  }
@@ -548,17 +543,17 @@ const toggleDistractionFree = () => ({
548
543
  dispatch,
549
544
  registry
550
545
  }) => {
551
- const isDistractionFree = registry.select(_preferences.store).get('core/edit-site', 'distractionFree');
546
+ const isDistractionFree = registry.select(_preferences.store).get('core', 'distractionFree');
552
547
  if (!isDistractionFree) {
553
548
  registry.batch(() => {
554
- registry.dispatch(_preferences.store).set('core/edit-site', 'fixedToolbar', true);
555
- dispatch.setIsInserterOpened(false);
556
- 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);
557
552
  dispatch.closeGeneralSidebar();
558
553
  });
559
554
  }
560
555
  registry.batch(() => {
561
- registry.dispatch(_preferences.store).set('core/edit-site', 'distractionFree', !isDistractionFree);
556
+ registry.dispatch(_preferences.store).set('core', 'distractionFree', !isDistractionFree);
562
557
  registry.dispatch(_notices.store).createInfoNotice(isDistractionFree ? (0, _i18n.__)('Distraction free off.') : (0, _i18n.__)('Distraction free on.'), {
563
558
  id: 'core/edit-site/distraction-free-mode/notice',
564
559
  type: 'snackbar'
@@ -1 +1 @@
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","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 { store as editorStore } from '@wordpress/editor';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../utils/constants';\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).toggleFeature( featureName )\",\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative:\n\t\t\t\t\t\"dispatch( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t\t}\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-site' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @return {Object} Action object.\n */\nexport function setTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setTemplate\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setTemplate is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @deprecated\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-site' ).addTemplate\", {\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t\thint: 'use saveEntityRecord directly',\n\t\t} );\n\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', TEMPLATE_POST_TYPE, template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tid: newTemplate.id,\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\t// Depending on how the entity was retrieved it's title might be\n\t\t\t// an object or simple string.\n\t\t\tconst templateTitle =\n\t\t\t\ttypeof template.title === 'string'\n\t\t\t\t\t? template.title\n\t\t\t\t\t: template.title?.rendered;\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( templateTitle )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while deleting the template.' );\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n * @param {Object} context The entity's context.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId, context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t\tcontext,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {Object} Action object.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @deprecated\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setPage() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setPage\", {\n\t\tsince: '6.5',\n\t\tversion: '6.8',\n\t\thint: 'The setPage is not needed anymore, the correct entity is resolved from the URL automatically.',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree && isOpen ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\t\tisOpen,\n\t\t} );\n\t};\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tdeprecated( `dispatch( 'core/edit-site' ).setHasPageContentFocus`, {\n\t\t\tsince: '6.5',\n\t\t} );\n\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core/edit-site', 'fixedToolbar', true );\n\t\t\t\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'distractionFree',\n\t\t\t\t\t! isDistractionFree\n\t\t\t\t);\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free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,CAAE,CAAC;EACJ;EACAtG,QAAQ,CAACgH,KAAK,CAAE,MAAM;IACrBhH,QAAQ,CACNI,QAAQ,CAAEC,kBAAiB,CAAC,CAC5BqG,GAAG,CACH,gBAAgB,EAChB,iBAAiB,EACjB,CAAErC,iBACH,CAAC;IACFrE,QAAQ,CACNI,QAAQ,CAAEkC,cAAa,CAAC,CACxB2E,gBAAgB,CAChB5C,iBAAiB,GACd,IAAA5B,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,CAAA0D,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,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AAKA,IAAAa,UAAA,GAAAb,OAAA;AACA,IAAAc,qBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AAtBA;AACA;AACA;;AAeA;AACA;AACA;;AAQA;AACA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