@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
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.setEditorCanvasContainerView = exports.setCanvasMode = void 0;
7
7
  var _blockEditor = require("@wordpress/block-editor");
8
8
  var _preferences = require("@wordpress/preferences");
9
+ var _editor = require("@wordpress/editor");
9
10
  /**
10
11
  * WordPress dependencies
11
12
  */
@@ -26,9 +27,12 @@ const setCanvasMode = mode => ({
26
27
  });
27
28
  // Check if the block list view should be open by default.
28
29
  // If `distractionFree` mode is enabled, the block list view should not be open.
29
- if (mode === 'edit' && registry.select(_preferences.store).get('core/edit-site', 'showListViewByDefault') && !registry.select(_preferences.store).get('core/edit-site', 'distractionFree')) {
30
- dispatch.setIsListViewOpened(true);
30
+ if (mode === 'edit' && registry.select(_preferences.store).get('core', 'showListViewByDefault') && !registry.select(_preferences.store).get('core', 'distractionFree')) {
31
+ registry.dispatch(_editor.store).setIsListViewOpened(true);
32
+ } else {
33
+ registry.dispatch(_editor.store).setIsListViewOpened(false);
31
34
  }
35
+ registry.dispatch(_editor.store).setIsInserterOpened(false);
32
36
  };
33
37
 
34
38
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_preferences","setCanvasMode","mode","registry","dispatch","blockEditorStore","__unstableSetEditorMode","type","select","preferencesStore","get","setIsListViewOpened","exports","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.setIsListViewOpened( true );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7BD,QAAQ,CAACC,QAAQ,CAAEC,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEF,QAAQ,CAAE;IACTG,IAAI,EAAE,iBAAiB;IACvBL;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEP,QAAQ,CACRK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDN,QAAQ,CAACO,mBAAmB,CAAE,IAAK,CAAC;EACrC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAX,aAAA,GAAAA,aAAA;AAKO,MAAMY,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEV;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTG,IAAI,EAAE,kCAAkC;IACxCO;EACD,CAAE,CAAC;AACJ,CAAC;AAACF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
1
+ {"version":3,"names":["_blockEditor","require","_preferences","_editor","setCanvasMode","mode","registry","dispatch","blockEditorStore","__unstableSetEditorMode","type","select","preferencesStore","get","editorStore","setIsListViewOpened","setIsInserterOpened","exports","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'distractionFree' )\n\t\t) {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( true );\n\t\t} else {\n\t\t\tregistry.dispatch( editorStore ).setIsListViewOpened( false );\n\t\t}\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACO,MAAMG,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7BD,QAAQ,CAACC,QAAQ,CAAEC,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEF,QAAQ,CAAE;IACTG,IAAI,EAAE,iBAAiB;IACvBL;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,MAAM,EAAE,uBAAwB,CAAC,IACxC,CAAEP,QAAQ,CACRK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,MAAM,EAAE,iBAAkB,CAAC,EACjC;IACDP,QAAQ,CAACC,QAAQ,CAAEO,aAAY,CAAC,CAACC,mBAAmB,CAAE,IAAK,CAAC;EAC7D,CAAC,MAAM;IACNT,QAAQ,CAACC,QAAQ,CAAEO,aAAY,CAAC,CAACC,mBAAmB,CAAE,KAAM,CAAC;EAC9D;EACAT,QAAQ,CAACC,QAAQ,CAAEO,aAAY,CAAC,CAACE,mBAAmB,CAAE,KAAM,CAAC;AAC9D,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAb,aAAA,GAAAA,aAAA;AAKO,MAAMc,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEZ;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTG,IAAI,EAAE,kCAAkC;IACxCS;EACD,CAAE,CAAC;AACJ,CAAC;AAACF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
@@ -3,10 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.blockInserterPanel = blockInserterPanel;
7
6
  exports.default = void 0;
8
7
  exports.editedPost = editedPost;
9
- exports.listViewPanel = listViewPanel;
10
8
  exports.saveViewPanel = saveViewPanel;
11
9
  exports.settings = settings;
12
10
  var _data = require("@wordpress/data");
@@ -59,48 +57,6 @@ function editedPost(state = {}, action) {
59
57
  return state;
60
58
  }
61
59
 
62
- /**
63
- * Reducer to set the block inserter panel open or closed.
64
- *
65
- * Note: this reducer interacts with the navigation and list view panels reducers
66
- * to make sure that only one of the three panels is open at the same time.
67
- *
68
- * @param {boolean|Object} state Current state.
69
- * @param {Object} action Dispatched action.
70
- */
71
- function blockInserterPanel(state = false, action) {
72
- switch (action.type) {
73
- case 'SET_IS_LIST_VIEW_OPENED':
74
- return action.isOpen ? false : state;
75
- case 'SET_IS_INSERTER_OPENED':
76
- return action.value;
77
- case 'SET_CANVAS_MODE':
78
- return false;
79
- }
80
- return state;
81
- }
82
-
83
- /**
84
- * Reducer to set the list view panel open or closed.
85
- *
86
- * Note: this reducer interacts with the navigation and inserter panels reducers
87
- * to make sure that only one of the three panels is open at the same time.
88
- *
89
- * @param {Object} state Current state.
90
- * @param {Object} action Dispatched action.
91
- */
92
- function listViewPanel(state = false, action) {
93
- switch (action.type) {
94
- case 'SET_IS_INSERTER_OPENED':
95
- return action.value ? false : state;
96
- case 'SET_IS_LIST_VIEW_OPENED':
97
- return action.isOpen;
98
- case 'SET_CANVAS_MODE':
99
- return false;
100
- }
101
- return state;
102
- }
103
-
104
60
  /**
105
61
  * Reducer to set the save view panel open or closed.
106
62
  *
@@ -149,8 +105,6 @@ function editorCanvasContainerView(state = undefined, action) {
149
105
  var _default = (0, _data.combineReducers)({
150
106
  settings,
151
107
  editedPost,
152
- blockInserterPanel,
153
- listViewPanel,
154
108
  saveViewPanel,
155
109
  canvasMode,
156
110
  editorCanvasContainerView
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","settings","state","action","type","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","_default","combineReducers","exports","default"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tsettings,\n\teditedPost,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACF;MACX,CAAC;EACH;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,UAAUA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAChD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACNE,QAAQ,EAAEH,MAAM,CAACG,QAAQ;QACzBC,EAAE,EAAEJ,MAAM,CAACI,EAAE;QACbC,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;IACF,KAAK,yBAAyB;MAC7B,OAAO;QACN,GAAGN,KAAK;QACRM,OAAO,EAA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ASc,yBAAyBA,CAAEd,KAAK,GAAGe,SAAS,EAAEd,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACe,IAAI;EACpB;EAEA,OAAOhB,KAAK;AACb;AAAC,IAAAiB,QAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BnB,QAAQ;EACRI,UAAU;EACVI,kBAAkB;EAClBG,aAAa;EACbC,aAAa;EACbC,UAAU;EACVE;AACD,CAAE,CAAC;AAAAK,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
1
+ {"version":3,"names":["_data","require","settings","state","action","type","editedPost","postType","id","context","saveViewPanel","isOpen","canvasMode","mode","editorCanvasContainerView","undefined","view","_default","combineReducers","exports","default"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tsettings,\n\teditedPost,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,QAAQA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACF;MACX,CAAC;EACH;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,UAAUA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAChD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACNE,QAAQ,EAAEH,MAAM,CAACG,QAAQ;QACzBC,EAAE,EAAEJ,MAAM,CAACI,EAAE;QACbC,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;IACF,KAAK,yBAAyB;MAC7B,OAAO;QACN,GAAGN,KAAK;QACRM,OAAO,EAAEL,MAAM,CAACK;MACjB,CAAC;EACH;EAEA,OAAON,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASO,aAAaA,CAAEP,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACtD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACO,MAAM;IACrB,KAAK,iBAAiB;MACrB,OAAO,KAAK;EACd;EACA,OAAOR,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,UAAUA,CAAET,KAAK,GAAG,MAAM,EAAEC,MAAM,EAAG;EAC7C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAOD,MAAM,CAACS,IAAI;EACpB;EAEA,OAAOV,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,yBAAyBA,CAAEX,KAAK,GAAGY,SAAS,EAAEX,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACY,IAAI;EACpB;EAEA,OAAOb,KAAK;AACb;AAAC,IAAAc,QAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BhB,QAAQ;EACRI,UAAU;EACVI,aAAa;EACbE,UAAU;EACVE;AACD,CAAE,CAAC;AAAAK,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
@@ -17,9 +17,7 @@ exports.getPage = getPage;
17
17
  exports.getReusableBlocks = void 0;
18
18
  exports.getSettings = getSettings;
19
19
  exports.hasPageContentFocus = hasPageContentFocus;
20
- exports.isFeatureActive = void 0;
21
- exports.isInserterOpened = isInserterOpened;
22
- exports.isListViewOpened = isListViewOpened;
20
+ exports.isListViewOpened = exports.isInserterOpened = exports.isFeatureActive = void 0;
23
21
  exports.isNavigationOpened = isNavigationOpened;
24
22
  exports.isPage = isPage;
25
23
  exports.isSaveViewOpened = isSaveViewOpened;
@@ -32,6 +30,7 @@ var _blockEditor = require("@wordpress/block-editor");
32
30
  var _editor = require("@wordpress/editor");
33
31
  var _utils = require("./utils");
34
32
  var _constants = require("../utils/constants");
33
+ var _lockUnlock = require("../lock-unlock");
35
34
  /**
36
35
  * WordPress dependencies
37
36
  */
@@ -183,64 +182,55 @@ function getPage(state) {
183
182
  }
184
183
 
185
184
  /**
186
- * Returns the current opened/closed state of the inserter panel.
185
+ * Returns true if the inserter is opened.
186
+ *
187
+ * @deprecated
187
188
  *
188
189
  * @param {Object} state Global application state.
189
190
  *
190
- * @return {boolean} True if the inserter panel should be open; false if closed.
191
+ * @return {boolean} Whether the inserter is opened.
191
192
  */
192
- function isInserterOpened(state) {
193
- return !!state.blockInserterPanel;
194
- }
193
+ const isInserterOpened = (0, _data.createRegistrySelector)(select => () => {
194
+ (0, _deprecated.default)(`select( 'core/edit-site' ).isInserterOpened`, {
195
+ since: '6.5',
196
+ alternative: `select( 'core/editor' ).isInserterOpened`
197
+ });
198
+ return select(_editor.store).isInserterOpened();
199
+ });
195
200
 
196
201
  /**
197
202
  * Get the insertion point for the inserter.
198
203
  *
204
+ * @deprecated
205
+ *
199
206
  * @param {Object} state Global application state.
200
207
  *
201
208
  * @return {Object} The root client ID, index to insert at and starting filter value.
202
209
  */
203
- const __experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select => state => {
204
- if (typeof state.blockInserterPanel === 'object') {
205
- const {
206
- rootClientId,
207
- insertionIndex,
208
- filterValue
209
- } = state.blockInserterPanel;
210
- return {
211
- rootClientId,
212
- insertionIndex,
213
- filterValue
214
- };
215
- }
216
- if (isPage(state) && select(_editor.store).getRenderingMode() !== 'template-only') {
217
- const [postContentClientId] = select(_blockEditor.store).__experimentalGetGlobalBlocksByName('core/post-content');
218
- if (postContentClientId) {
219
- return {
220
- rootClientId: postContentClientId,
221
- insertionIndex: undefined,
222
- filterValue: undefined
223
- };
224
- }
225
- }
226
- return {
227
- rootClientId: undefined,
228
- insertionIndex: undefined,
229
- filterValue: undefined
230
- };
210
+ exports.isInserterOpened = isInserterOpened;
211
+ const __experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select => () => {
212
+ (0, _deprecated.default)(`select( 'core/edit-site' ).__experimentalGetInsertionPoint`, {
213
+ since: '6.5',
214
+ version: '6.7'
215
+ });
216
+ return (0, _lockUnlock.unlock)(select(_editor.store)).getInsertionPoint();
231
217
  });
232
218
 
233
219
  /**
234
- * Returns the current opened/closed state of the list view panel.
220
+ * Returns true if the list view is opened.
235
221
  *
236
222
  * @param {Object} state Global application state.
237
223
  *
238
- * @return {boolean} True if the list view panel should be open; false if closed.
224
+ * @return {boolean} Whether the list view is opened.
239
225
  */
240
226
  exports.__experimentalGetInsertionPoint = __experimentalGetInsertionPoint;
241
- function isListViewOpened(state) {
242
- return state.listViewPanel;
243
- }
227
+ const isListViewOpened = (0, _data.createRegistrySelector)(select => () => {
228
+ (0, _deprecated.default)(`select( 'core/edit-site' ).isListViewOpened`, {
229
+ since: '6.5',
230
+ alternative: `select( 'core/editor' ).isListViewOpened`
231
+ });
232
+ return select(_editor.store).isListViewOpened();
233
+ });
244
234
 
245
235
  /**
246
236
  * Returns the current opened/closed state of the save panel.
@@ -249,6 +239,7 @@ function isListViewOpened(state) {
249
239
  *
250
240
  * @return {boolean} True if the save panel should be open; false if closed.
251
241
  */
242
+ exports.isListViewOpened = isListViewOpened;
252
243
  function isSaveViewOpened(state) {
253
244
  return state.saveViewPanel;
254
245
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_coreData","require","_data","_deprecated","_interopRequireDefault","_element","_preferences","_blockEditor","_editor","_utils","_constants","isFeatureActive","createRegistrySelector","select","_","featureName","deprecated","since","alternative","preferencesStore","get","exports","__experimentalGetPreviewDeviceType","version","editorStore","getDeviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","state","settings","getHomeTemplateId","getEditedPostType","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isPage","getRenderingMode","postContentClientId","blockEditorStore","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateParts","TEMPLATE_PART_POST_TYPE","clientIds","blocks","getBlocksByClientId","getFilteredTemplatePartBlocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","postId","hasPageContentFocus"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport { TEMPLATE_PART_POST_TYPE } from '../utils/constants';\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( _, featureName ) => {\n\t\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `select( 'core/preferences' ).get`,\n\t\t} );\n\n\t\treturn !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\tfeatureName\n\t\t);\n\t}\n);\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tdeprecated(\n\t\t\"select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t}\n\t);\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the site editor settings.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Settings.\n */\nexport function getSettings( state ) {\n\t// It is important that we don't inject anything into these settings locally.\n\t// The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings.\n\t// If we add computed settings here, we'll be adding these computed settings to the state which is very unexpected.\n\treturn state.settings;\n}\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif (\n\t\t\tisPage( state ) &&\n\t\t\tselect( editorStore ).getRenderingMode() !== 'template-only'\n\t\t) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t'core/template-part'\n\t\t\t);\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector( ( select ) => () => {\n\treturn select( preferencesStore ).get( 'core/edit-site', 'editorMode' );\n} );\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor allows only page content to be edited.\n *\n * @deprecated\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus() {\n\tdeprecated( `select( 'core/edit-site' ).hasPageContentFocus`, {\n\t\tsince: '6.5',\n\t} );\n\n\treturn false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAfA;AACA;AACA;;AASA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMU,eAAe,GAAG,IAAAC,4BAAsB,EAClDC,MAAM,IAAM,CAAEC,CAAC,EAAEC,WAAW,KAAM;EACnC,IAAAC,mBAAU,EAAG,4CAA2C,EAAE;IACzDC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;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AAc,CAAC;AAC9D,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA3C,OAAA,CAAA0C,+BAAA,GAAAA,+BAAA;AAOO,MAAMO,aAAa,GAAG,IAAA1D,4BAAsB,EAAIC,MAAM,IAAM,MAAM;EACxE,OAAOA,MAAM,CAAEM,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAE,YAAa,CAAC;AACxE,CAAE,CAAC;;AAEH;AACA;AACA;AAFAC,OAAA,CAAAiD,aAAA,GAAAA,aAAA;AAGO,SAASC,wCAAwCA,CAAA,EAAG;EAC1D,IAAAvD,mBAAU,EACT,uEAAuE,EACvE;IACCC,KAAK,EAAE,KAAK;IACZM,OAAO,EAAE;EACV,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACO,SAASiD,4BAA4BA,CAAA,EAAG;EAC9C,IAAAxD,mBAAU,EAAE,2DAA2D,EAAE;IACxEC,KAAK,EAAE,KAAK;IACZM,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAASkD,kBAAkBA,CAAA,EAAG;EACpC,IAAAzD,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,KAAK,EAAE,KAAK;IACZM,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS8B,MAAMA,CAAEjB,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACI,UAAU,CAACK,OAAO,EAAE6B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAAA,EAAG;EACrC,IAAA3D,mBAAU,EAAG,gDAA+C,EAAE;IAC7DC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAO,KAAK;AACb"}
1
+ {"version":3,"names":["_coreData","require","_data","_deprecated","_interopRequireDefault","_element","_preferences","_blockEditor","_editor","_utils","_constants","_lockUnlock","isFeatureActive","createRegistrySelector","select","_","featureName","deprecated","since","alternative","preferencesStore","get","exports","__experimentalGetPreviewDeviceType","version","editorStore","getDeviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","state","settings","getHomeTemplateId","getEditedPostType","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","__experimentalGetInsertionPoint","unlock","getInsertionPoint","isListViewOpened","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateParts","TEMPLATE_PART_POST_TYPE","clientIds","blockEditorStore","__experimentalGetGlobalBlocksByName","blocks","getBlocksByClientId","getFilteredTemplatePartBlocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId","hasPageContentFocus"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport { TEMPLATE_PART_POST_TYPE } from '../utils/constants';\nimport { unlock } from '../lock-unlock';\n\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( _, featureName ) => {\n\t\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `select( 'core/preferences' ).get`,\n\t\t} );\n\n\t\treturn !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\tfeatureName\n\t\t);\n\t}\n);\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tdeprecated(\n\t\t\"select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t}\n\t);\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the site editor settings.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Settings.\n */\nexport function getSettings( state ) {\n\t// It is important that we don't inject anything into these settings locally.\n\t// The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings.\n\t// If we add computed settings here, we'll be adding these computed settings to the state which is very unexpected.\n\treturn state.settings;\n}\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-site' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInsertionPoint();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-site' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t'core/template-part'\n\t\t\t);\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector( ( select ) => () => {\n\treturn select( preferencesStore ).get( 'core/edit-site', 'editorMode' );\n} );\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor allows only page content to be edited.\n *\n * @deprecated\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus() {\n\tdeprecated( `select( 'core/edit-site' ).hasPageContentFocus`, {\n\t\tsince: '6.5',\n\t} );\n\n\treturn false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAhBA;AACA;AACA;;AASA;AACA;AACA;;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,eAAe,GAAG,IAAAC,4BAAsB,EAClDC,MAAM,IAAM,CAAEC,CAAC,EAAEC,WAAW,KAAM;EACnC,IAAAC,mBAAU,EAAG,4CAA2C,EAAE;IACzDC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EAEH,OAAO,CAAC,CAAEL,MAAM,CAAEM,kBAAiB,CAAC,CAACC,GAAG,CACvC,gBAAgB,EAChBL,WACD,CAAC;AACF,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;A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xE,OAAOA,MAAM,CAAEM,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAE,YAAa,CAAC;AACxE,CAAE,CAAC;;AAEH;AACA;AACA;AAFAC,OAAA,CAAA0C,aAAA,GAAAA,aAAA;AAGO,SAASC,wCAAwCA,CAAA,EAAG;EAC1D,IAAAhD,mBAAU,EACT,uEAAuE,EACvE;IACCC,KAAK,EAAE,KAAK;IACZM,OAAO,EAAE;EACV,CACD,CAAC;AACF;;AAEA;AACA;AACA;AACO,SAAS0C,4BAA4BA,CAAA,EAAG;EAC9C,IAAAjD,mBAAU,EAAE,2DAA2D,EAAE;IACxEC,KAAK,EAAE,KAAK;IACZM,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAAS2C,kBAAkBA,CAAA,EAAG;EACpC,IAAAlD,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,KAAK,EAAE,KAAK;IACZM,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS4C,MAAMA,CAAE/B,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAACI,UAAU,CAACK,OAAO,EAAEuB,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAAA,EAAG;EACrC,IAAArD,mBAAU,EAAG,gDAA+C,EAAE;IAC7DC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAO,KAAK;AACb"}
@@ -20,7 +20,7 @@ function getIsListPage({
20
20
  categoryType,
21
21
  categoryId
22
22
  }, isMobileViewport) {
23
- return ['/wp_template/all', '/wp_template_part/all', '/pages'].includes(path) || path === '/patterns' && (
23
+ return ['/wp_template/all', '/wp_template_part/all'].includes(path) || path === '/page' && window?.__experimentalAdminViews || path === '/patterns' && (
24
24
  // Don't treat "/patterns" without categoryType and categoryId as a
25
25
  // list page in mobile because the sidebar covers the whole page.
26
26
  !isMobileViewport || !!categoryType && !!categoryId);
@@ -1 +1 @@
1
- {"version":3,"names":["getIsListPage","path","categoryType","categoryId","isMobileViewport","includes"],"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n * @param {string} [params.categoryType] The current category type.\n * @param {string} [params.categoryId] The current category id.\n * @param {boolean} isMobileViewport Is mobile viewport.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage(\n\t{ path, categoryType, categoryId },\n\tisMobileViewport\n) {\n\treturn (\n\t\t[ '/wp_template/all', '/wp_template_part/all', '/pages' ].includes(\n\t\t\tpath\n\t\t) ||\n\t\t( path === '/patterns' &&\n\t\t\t// Don't treat \"/patterns\" without categoryType and categoryId as a\n\t\t\t// list page in mobile because the sidebar covers the whole page.\n\t\t\t( ! isMobileViewport || ( !! categoryType && !! categoryId ) ) )\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAaA,CACpC;EAAEC,IAAI;EAAEC,YAAY;EAAEC;AAAW,CAAC,EAClCC,gBAAgB,EACf;EACD,OACC,CAAE,kBAAkB,EAAE,uBAAuB,EAAE,QAAQ,CAAE,CAACC,QAAQ,CACjEJ,IACD,CAAC,IACCA,IAAI,KAAK,WAAW;EACrB;EACA;EACE,CAAEG,gBAAgB,IAAM,CAAC,CAAEF,YAAY,IAAI,CAAC,CAAEC,UAAY,CAAI;AAEnE"}
1
+ {"version":3,"names":["getIsListPage","path","categoryType","categoryId","isMobileViewport","includes","window","__experimentalAdminViews"],"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n * @param {string} [params.categoryType] The current category type.\n * @param {string} [params.categoryId] The current category id.\n * @param {boolean} isMobileViewport Is mobile viewport.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage(\n\t{ path, categoryType, categoryId },\n\tisMobileViewport\n) {\n\treturn (\n\t\t[ '/wp_template/all', '/wp_template_part/all' ].includes( path ) ||\n\t\t( path === '/page' && window?.__experimentalAdminViews ) ||\n\t\t( path === '/patterns' &&\n\t\t\t// Don't treat \"/patterns\" without categoryType and categoryId as a\n\t\t\t// list page in mobile because the sidebar covers the whole page.\n\t\t\t( ! isMobileViewport || ( !! categoryType && !! categoryId ) ) )\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAaA,CACpC;EAAEC,IAAI;EAAEC,YAAY;EAAEC;AAAW,CAAC,EAClCC,gBAAgB,EACf;EACD,OACC,CAAE,kBAAkB,EAAE,uBAAuB,CAAE,CAACC,QAAQ,CAAEJ,IAAK,CAAC,IAC9DA,IAAI,KAAK,OAAO,IAAIK,MAAM,EAAEC,wBAA0B,IACtDN,IAAI,KAAK,WAAW;EACrB;EACA;EACE,CAAEG,gBAAgB,IAAM,CAAC,CAAEF,YAAY,IAAI,CAAC,CAAEC,UAAY,CAAI;AAEnE"}
@@ -10,7 +10,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
13
- import { TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE } from '../../utils/constants';
13
+ import { TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES } from '../../utils/constants';
14
14
  import { unlock } from '../../lock-unlock';
15
15
  const {
16
16
  useLocation,
@@ -21,9 +21,10 @@ function BackButton() {
21
21
  const history = useHistory();
22
22
  const isTemplatePart = location.params.postType === TEMPLATE_PART_POST_TYPE;
23
23
  const isNavigationMenu = location.params.postType === NAVIGATION_POST_TYPE;
24
+ const isPattern = location.params.postType === PATTERN_TYPES.user;
24
25
  const previousTemplateId = location.state?.fromTemplateId;
25
- const isFocusMode = isTemplatePart || isNavigationMenu;
26
- if (!isFocusMode || !previousTemplateId) {
26
+ const isFocusMode = isTemplatePart || isNavigationMenu || isPattern;
27
+ if (!isFocusMode || !previousTemplateId && !isPattern) {
27
28
  return null;
28
29
  }
29
30
  return createElement(Button, {
@@ -1 +1 @@
1
- {"version":3,"names":["Button","arrowLeft","__","privateApis","routerPrivateApis","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","unlock","useLocation","useHistory","BackButton","location","history","isTemplatePart","params","postType","isNavigationMenu","previousTemplateId","state","fromTemplateId","isFocusMode","createElement","className","icon","onClick","back"],"sources":["@wordpress/edit-site/src/components/block-editor/back-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { arrowLeft } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nfunction BackButton() {\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst isTemplatePart = location.params.postType === TEMPLATE_PART_POST_TYPE;\n\tconst isNavigationMenu = location.params.postType === NAVIGATION_POST_TYPE;\n\tconst previousTemplateId = location.state?.fromTemplateId;\n\n\tconst isFocusMode = isTemplatePart || isNavigationMenu;\n\n\tif ( ! isFocusMode || ! previousTemplateId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-site-visual-editor__back-button\"\n\t\t\ticon={ arrowLeft }\n\t\t\tonClick={ () => {\n\t\t\t\thistory.back();\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Back' ) }\n\t\t</Button>\n\t);\n}\n\nexport default BackButton;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SACCC,uBAAuB,EACvBC,oBAAoB,QACd,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGF,MAAM,CAAEH,iBAAkB,CAAC;AAE/D,SAASM,UAAUA,CAAA,EAAG;EACrB,MAAMC,QAAQ,GAAGH,WAAW,CAAC,CAAC;EAC9B,MAAMI,OAAO,GAAGH,UAAU,CAAC,CAAC;EAC5B,MAAMI,cAAc,GAAGF,QAAQ,CAACG,MAAM,CAACC,QAAQ,KAAKV,uBAAuB;EAC3E,MAAMW,gBAAgB,GAAGL,QAAQ,CAACG,MAAM,CAACC,QAAQ,KAAKT,oBAAoB;EAC1E,MAAMW,kBAAkB,GAAGN,QAAQ,CAACO,KAAK,EAAEC,cAAc;EAEzD,MAAMC,WAAW,GAAGP,cAAc,IAAIG,gBAAgB;EAEtD,IAAK,CAAEI,WAAW,IAAI,CAAEH,kBAAkB,EAAG;IAC5C,OAAO,IAAI;EACZ;EAEA,OACCI,aAAA,CAACrB,MAAM;IACNsB,SAAS,EAAC,sCAAsC;IAChDC,IAAI,EAAGtB,SAAW;IAClBuB,OAAO,EAAGA,CAAA,KAAM;MACfZ,OAAO,CAACa,IAAI,CAAC,CAAC;IACf;EAAG,GAEDvB,EAAE,CAAE,MAAO,CACN,CAAC;AAEX;AAEA,eAAeQ,UAAU"}
1
+ {"version":3,"names":["Button","arrowLeft","__","privateApis","routerPrivateApis","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","unlock","useLocation","useHistory","BackButton","location","history","isTemplatePart","params","postType","isNavigationMenu","isPattern","user","previousTemplateId","state","fromTemplateId","isFocusMode","createElement","className","icon","onClick","back"],"sources":["@wordpress/edit-site/src/components/block-editor/back-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { arrowLeft } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nfunction BackButton() {\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst isTemplatePart = location.params.postType === TEMPLATE_PART_POST_TYPE;\n\tconst isNavigationMenu = location.params.postType === NAVIGATION_POST_TYPE;\n\tconst isPattern = location.params.postType === PATTERN_TYPES.user;\n\tconst previousTemplateId = location.state?.fromTemplateId;\n\n\tconst isFocusMode = isTemplatePart || isNavigationMenu || isPattern;\n\n\tif ( ! isFocusMode || ( ! previousTemplateId && ! isPattern ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-site-visual-editor__back-button\"\n\t\t\ticon={ arrowLeft }\n\t\t\tonClick={ () => {\n\t\t\t\thistory.back();\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Back' ) }\n\t\t</Button>\n\t);\n}\n\nexport default BackButton;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SACCC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,QACP,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,WAAW;EAAEC;AAAW,CAAC,GAAGF,MAAM,CAAEJ,iBAAkB,CAAC;AAE/D,SAASO,UAAUA,CAAA,EAAG;EACrB,MAAMC,QAAQ,GAAGH,WAAW,CAAC,CAAC;EAC9B,MAAMI,OAAO,GAAGH,UAAU,CAAC,CAAC;EAC5B,MAAMI,cAAc,GAAGF,QAAQ,CAACG,MAAM,CAACC,QAAQ,KAAKX,uBAAuB;EAC3E,MAAMY,gBAAgB,GAAGL,QAAQ,CAACG,MAAM,CAACC,QAAQ,KAAKV,oBAAoB;EAC1E,MAAMY,SAAS,GAAGN,QAAQ,CAACG,MAAM,CAACC,QAAQ,KAAKT,aAAa,CAACY,IAAI;EACjE,MAAMC,kBAAkB,GAAGR,QAAQ,CAACS,KAAK,EAAEC,cAAc;EAEzD,MAAMC,WAAW,GAAGT,cAAc,IAAIG,gBAAgB,IAAIC,SAAS;EAEnE,IAAK,CAAEK,WAAW,IAAM,CAAEH,kBAAkB,IAAI,CAAEF,SAAW,EAAG;IAC/D,OAAO,IAAI;EACZ;EAEA,OACCM,aAAA,CAACxB,MAAM;IACNyB,SAAS,EAAC,sCAAsC;IAChDC,IAAI,EAAGzB,SAAW;IAClB0B,OAAO,EAAGA,CAAA,KAAM;MACfd,OAAO,CAACe,IAAI,CAAC,CAAC;IACf;EAAG,GAED1B,EAAE,CAAE,MAAO,CACN,CAAC;AAEX;AAEA,eAAeS,UAAU"}
@@ -49,8 +49,8 @@ function ResizableEditor({
49
49
  maxWidth: "100%",
50
50
  maxHeight: "100%",
51
51
  enable: {
52
- right: enableResizing,
53
- left: enableResizing
52
+ left: enableResizing,
53
+ right: enableResizing
54
54
  },
55
55
  showHandle: enableResizing
56
56
  // The editor is centered horizontally, resizing it only
@@ -1 +1 @@
1
- {"version":3,"names":["useState","useRef","useCallback","ResizableBox","ResizeHandle","HANDLE_STYLES_OVERRIDE","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","ResizableEditor","enableResizing","children","setWidth","resizableRef","resizeWidthBy","deltaPixels","current","offsetWidth","createElement","ref","api","resizable","size","onResizeStop","event","direction","element","style","minWidth","maxWidth","maxHeight","enable","showHandle","resizeRatio","handleComponent","handleClasses","handleStyles"],"sources":["@wordpress/edit-site/src/components/block-editor/resizable-editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useCallback } from '@wordpress/element';\nimport { ResizableBox } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResizeHandle from './resize-handle';\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDE = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nfunction ResizableEditor( { enableResizing, height, children } ) {\n\tconst [ width, setWidth ] = useState( '100%' );\n\tconst resizableRef = useRef();\n\tconst resizeWidthBy = useCallback( ( deltaPixels ) => {\n\t\tif ( resizableRef.current ) {\n\t\t\tsetWidth( resizableRef.current.offsetWidth + deltaPixels );\n\t\t}\n\t}, [] );\n\treturn (\n\t\t<ResizableBox\n\t\t\tref={ ( api ) => {\n\t\t\t\tresizableRef.current = api?.resizable;\n\t\t\t} }\n\t\t\tsize={ {\n\t\t\t\twidth: enableResizing ? width : '100%',\n\t\t\t\theight: enableResizing && height ? height : '100%',\n\t\t\t} }\n\t\t\tonResizeStop={ ( event, direction, element ) => {\n\t\t\t\tsetWidth( element.style.width );\n\t\t\t} }\n\t\t\tminWidth={ 300 }\n\t\t\tmaxWidth=\"100%\"\n\t\t\tmaxHeight=\"100%\"\n\t\t\tenable={ {\n\t\t\t\tright: enableResizing,\n\t\t\t\tleft: enableResizing,\n\t\t\t} }\n\t\t\tshowHandle={ enableResizing }\n\t\t\t// The editor is centered horizontally, resizing it only\n\t\t\t// moves half the distance. Hence double the ratio to correctly\n\t\t\t// align the cursor to the resizer handle.\n\t\t\tresizeRatio={ 2 }\n\t\t\thandleComponent={ {\n\t\t\t\tleft: (\n\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\tdirection=\"left\"\n\t\t\t\t\t\tresizeWidthBy={ resizeWidthBy }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tright: (\n\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\tdirection=\"right\"\n\t\t\t\t\t\tresizeWidthBy={ resizeWidthBy }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t} }\n\t\t\thandleClasses={ undefined }\n\t\t\thandleStyles={ {\n\t\t\t\tleft: HANDLE_STYLES_OVERRIDE,\n\t\t\t\tright: HANDLE_STYLES_OVERRIDE,\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</ResizableBox>\n\t);\n}\n\nexport default ResizableEditor;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,WAAW,QAAQ,oBAAoB;AAClE,SAASC,YAAY,QAAQ,uBAAuB;;AAEpD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;;AAE1C;AACA,MAAMC,sBAAsB,GAAG;EAC9BC,QAAQ,EAAEC,SAAS;EACnBC,UAAU,EAAED,SAAS;EACrBE,MAAM,EAAEF,SAAS;EACjBG,KAAK,EAAEH,SAAS;EAChBI,MAAM,EAAEJ,SAAS;EACjBK,GAAG,EAAEL,SAAS;EACdM,KAAK,EAAEN,SAAS;EAChBO,MAAM,EAAEP,SAAS;EACjBQ,IAAI,EAAER;AACP,CAAC;AAED,SAASS,eAAeA,CAAE;EAAEC,cAAc;EAAEN,MAAM;EAAEO;AAAS,CAAC,EAAG;EAChE,MAAM,CAAER,KAAK,EAAES,QAAQ,CAAE,GAAGnB,QAAQ,CAAE,MAAO,CAAC;EAC9C,MAAMoB,YAAY,GAAGnB,MAAM,CAAC,CAAC;EAC7B,MAAMoB,aAAa,GAAGnB,WAAW,CAAIoB,WAAW,IAAM;IACrD,IAAKF,YAAY,CAACG,OAAO,EAAG;MAC3BJ,QAAQ,CAAEC,YAAY,CAACG,OAAO,CAACC,WAAW,GAAGF,WAAY,CAAC;IAC3D;EACD,CAAC,EAAE,EAAG,CAAC;EACP,OACCG,aAAA,CAACtB,YAAY;IACZuB,GAAG,EAAKC,GAAG,IAAM;MAChBP,YAAY,CAACG,OAAO,GAAGI,GAAG,EAAEC,SAAS;IACtC,CAAG;IACHC,IAAI,EAAG;MACNnB,KAAK,EAAEO,cAAc,GAAGP,KAAK,GAAG,MAAM;MACtCC,MAAM,EAAEM,cAAc,IAAIN,MAAM,GAAGA,MAAM,GAAG;IAC7C,CAAG;IACHmB,YAAY,EAAGA,CAAEC,KAAK,EAAEC,SAAS,EAAEC,OAAO,KAAM;MAC/Cd,QAAQ,CAAEc,OAAO,CAACC,KAAK,CAACxB,KAAM,CAAC;IAChC,CAAG;IACHyB,QAAQ,EAAG,GAAK;IAChBC,QAAQ,EAAC,MAAM;IACfC,SAAS,EAAC,MAAM;IAChBC,MAAM,EAAG;MACRzB,KAAK,EAAEI,cAAc;MACrBF,IAAI,EAAEE;IACP,CAAG;IACHsB,UAAU,EAAGtB;IACb;IACA;IACA;IAAA;IACAuB,WAAW,EAAG,CAAG;IACjBC,eAAe,EAAG;MACjB1B,IAAI,EACHU,aAAA,CAACrB,YAAY;QACZ4B,SAAS,EAAC,MAAM;QAChBX,aAAa,EAAGA;MAAe,CAC/B,CACD;MACDR,KAAK,EACJY,aAAA,CAACrB,YAAY;QACZ4B,SAAS,EAAC,OAAO;QACjBX,aAAa,EAAGA;MAAe,CAC/B;IAEH,CAAG;IACHqB,aAAa,EAAGnC,SAAW;IAC3BoC,YAAY,EAAG;MACd5B,IAAI,EAAEV,sBAAsB;MAC5BQ,KAAK,EAAER;IACR;EAAG,GAEDa,QACW,CAAC;AAEjB;AAEA,eAAeF,eAAe"}
1
+ {"version":3,"names":["useState","useRef","useCallback","ResizableBox","ResizeHandle","HANDLE_STYLES_OVERRIDE","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","ResizableEditor","enableResizing","children","setWidth","resizableRef","resizeWidthBy","deltaPixels","current","offsetWidth","createElement","ref","api","resizable","size","onResizeStop","event","direction","element","style","minWidth","maxWidth","maxHeight","enable","showHandle","resizeRatio","handleComponent","handleClasses","handleStyles"],"sources":["@wordpress/edit-site/src/components/block-editor/resizable-editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useCallback } from '@wordpress/element';\nimport { ResizableBox } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResizeHandle from './resize-handle';\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDE = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nfunction ResizableEditor( { enableResizing, height, children } ) {\n\tconst [ width, setWidth ] = useState( '100%' );\n\tconst resizableRef = useRef();\n\tconst resizeWidthBy = useCallback( ( deltaPixels ) => {\n\t\tif ( resizableRef.current ) {\n\t\t\tsetWidth( resizableRef.current.offsetWidth + deltaPixels );\n\t\t}\n\t}, [] );\n\treturn (\n\t\t<ResizableBox\n\t\t\tref={ ( api ) => {\n\t\t\t\tresizableRef.current = api?.resizable;\n\t\t\t} }\n\t\t\tsize={ {\n\t\t\t\twidth: enableResizing ? width : '100%',\n\t\t\t\theight: enableResizing && height ? height : '100%',\n\t\t\t} }\n\t\t\tonResizeStop={ ( event, direction, element ) => {\n\t\t\t\tsetWidth( element.style.width );\n\t\t\t} }\n\t\t\tminWidth={ 300 }\n\t\t\tmaxWidth=\"100%\"\n\t\t\tmaxHeight=\"100%\"\n\t\t\tenable={ {\n\t\t\t\tleft: enableResizing,\n\t\t\t\tright: enableResizing,\n\t\t\t} }\n\t\t\tshowHandle={ enableResizing }\n\t\t\t// The editor is centered horizontally, resizing it only\n\t\t\t// moves half the distance. Hence double the ratio to correctly\n\t\t\t// align the cursor to the resizer handle.\n\t\t\tresizeRatio={ 2 }\n\t\t\thandleComponent={ {\n\t\t\t\tleft: (\n\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\tdirection=\"left\"\n\t\t\t\t\t\tresizeWidthBy={ resizeWidthBy }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tright: (\n\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\tdirection=\"right\"\n\t\t\t\t\t\tresizeWidthBy={ resizeWidthBy }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t} }\n\t\t\thandleClasses={ undefined }\n\t\t\thandleStyles={ {\n\t\t\t\tleft: HANDLE_STYLES_OVERRIDE,\n\t\t\t\tright: HANDLE_STYLES_OVERRIDE,\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</ResizableBox>\n\t);\n}\n\nexport default ResizableEditor;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,WAAW,QAAQ,oBAAoB;AAClE,SAASC,YAAY,QAAQ,uBAAuB;;AAEpD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;;AAE1C;AACA,MAAMC,sBAAsB,GAAG;EAC9BC,QAAQ,EAAEC,SAAS;EACnBC,UAAU,EAAED,SAAS;EACrBE,MAAM,EAAEF,SAAS;EACjBG,KAAK,EAAEH,SAAS;EAChBI,MAAM,EAAEJ,SAAS;EACjBK,GAAG,EAAEL,SAAS;EACdM,KAAK,EAAEN,SAAS;EAChBO,MAAM,EAAEP,SAAS;EACjBQ,IAAI,EAAER;AACP,CAAC;AAED,SAASS,eAAeA,CAAE;EAAEC,cAAc;EAAEN,MAAM;EAAEO;AAAS,CAAC,EAAG;EAChE,MAAM,CAAER,KAAK,EAAES,QAAQ,CAAE,GAAGnB,QAAQ,CAAE,MAAO,CAAC;EAC9C,MAAMoB,YAAY,GAAGnB,MAAM,CAAC,CAAC;EAC7B,MAAMoB,aAAa,GAAGnB,WAAW,CAAIoB,WAAW,IAAM;IACrD,IAA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is } from '@wordpress/router';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { unlock } from '../../lock-unlock';
10
+ import { getPostLinkProps } from '../routes/link';
11
+ const {
12
+ useHistory
13
+ } = unlock(routerPrivateApis);
14
+ export function usePostLinkProps() {
15
+ const history = useHistory();
16
+ return (params, state) => {
17
+ return getPostLinkProps(history, params, state);
18
+ };
19
+ }
20
+ //# sourceMappingURL=use-post-link-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["privateApis","routerPrivateApis","unlock","getPostLinkProps","useHistory","usePostLinkProps","history","params","state"],"sources":["@wordpress/edit-site/src/components/block-editor/use-post-link-props.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { getPostLinkProps } from '../routes/link';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport function usePostLinkProps() {\n\tconst history = useHistory();\n\n\treturn ( params, state ) => {\n\t\treturn getPostLinkProps( history, params, state );\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,gBAAgB,QAAQ,gBAAgB;AAEjD,MAAM;EAAEC;AAAW,CAAC,GAAGF,MAAM,CAAED,iBAAkB,CAAC;AAElD,OAAO,SAASI,gBAAgBA,CAAA,EAAG;EAClC,MAAMC,OAAO,GAAGF,UAAU,CAAC,CAAC;EAE5B,OAAO,CAAEG,MAAM,EAAEC,KAAK,KAAM;IAC3B,OAAOL,gBAAgB,CAAEG,OAAO,EAAEC,MAAM,EAAEC,KAAM,CAAC;EAClD,CAAC;AACF"}
@@ -1,18 +1,17 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useViewportMatch } from '@wordpress/compose';
5
- import { useDispatch, useSelect } from '@wordpress/data';
4
+ import { useSelect } from '@wordpress/data';
6
5
  import { useMemo } from '@wordpress/element';
7
6
  import { store as coreStore } from '@wordpress/core-data';
8
7
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
9
- import { store as preferencesStore } from '@wordpress/preferences';
10
8
 
11
9
  /**
12
10
  * Internal dependencies
13
11
  */
14
12
  import { store as editSiteStore } from '../../store';
15
13
  import { unlock } from '../../lock-unlock';
14
+ import { usePostLinkProps } from './use-post-link-props';
16
15
  const {
17
16
  useBlockEditorSettings
18
17
  } = unlock(editorPrivateApis);
@@ -83,16 +82,9 @@ function useArchiveLabel(templateSlug) {
83
82
  }, [authorSlug, isAuthor, taxonomy, term]);
84
83
  }
85
84
  export function useSpecificEditorSettings() {
86
- const {
87
- setIsInserterOpened
88
- } = useDispatch(editSiteStore);
89
- const isLargeViewport = useViewportMatch('medium');
85
+ const getPostLinkProps = usePostLinkProps();
90
86
  const {
91
87
  templateSlug,
92
- focusMode,
93
- isDistractionFree,
94
- hasFixedToolbar,
95
- keepCaretInsideBlock,
96
88
  canvasMode,
97
89
  settings,
98
90
  postWithTemplate
@@ -104,9 +96,6 @@ export function useSpecificEditorSettings() {
104
96
  getCanvasMode,
105
97
  getSettings
106
98
  } = unlock(select(editSiteStore));
107
- const {
108
- get: getPreference
109
- } = select(preferencesStore);
110
99
  const {
111
100
  getEditedEntityRecord
112
101
  } = select(coreStore);
@@ -116,32 +105,26 @@ export function useSpecificEditorSettings() {
116
105
  const _context = getEditedPostContext();
117
106
  return {
118
107
  templateSlug: _record.slug,
119
- focusMode: !!getPreference('core/edit-site', 'focusMode'),
120
- isDistractionFree: !!getPreference('core/edit-site', 'distractionFree'),
121
- hasFixedToolbar: !!getPreference('core/edit-site', 'fixedToolbar') || !isLargeViewport,
122
- keepCaretInsideBlock: !!getPreference('core/edit-site', 'keepCaretInsideBlock'),
123
108
  canvasMode: getCanvasMode(),
124
109
  settings: getSettings(),
125
110
  postWithTemplate: _context?.postId
126
111
  };
127
- }, [isLargeViewport]);
112
+ }, []);
128
113
  const archiveLabels = useArchiveLabel(templateSlug);
129
114
  const defaultRenderingMode = postWithTemplate ? 'template-locked' : 'all';
130
115
  const defaultEditorSettings = useMemo(() => {
131
116
  return {
132
117
  ...settings,
118
+ richEditingEnabled: true,
133
119
  supportsTemplateMode: true,
134
- __experimentalSetIsInserterOpened: setIsInserterOpened,
135
- focusMode: canvasMode === 'view' && focusMode ? false : focusMode,
136
- isDistractionFree,
137
- hasFixedToolbar,
138
- keepCaretInsideBlock,
120
+ focusMode: canvasMode !== 'view',
139
121
  defaultRenderingMode,
122
+ getPostLinkProps,
140
123
  // I wonder if they should be set in the post editor too
141
124
  __experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,
142
125
  __experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel
143
126
  };
144
- }, [settings, setIsInserterOpened, focusMode, isDistractionFree, hasFixedToolbar, keepCaretInsideBlock, canvasMode, archiveLabels.archiveTypeLabel, archiveLabels.archiveNameLabel, defaultRenderingMode]);
127
+ }, [settings, canvasMode, defaultRenderingMode, getPostLinkProps, archiveLabels.archiveTypeLabel, archiveLabels.archiveNameLabel]);
145
128
  return defaultEditorSettings;
146
129
  }
147
130
  export default function useSiteEditorSettings() {
@@ -1 +1 @@
1
- {"version":3,"names":["useViewportMatch","useDispatch","useSelect","useMemo","store","coreStore","privateApis","editorPrivateApis","preferencesStore","editSiteStore","unlock","useBlockEditorSettings","useArchiveLabel","templateSlug","taxonomyMatches","match","taxonomy","term","isAuthor","authorSlug","authorMatches","select","getEntityRecords","getTaxonomy","getAuthors","archiveTypeLabel","archiveNameLabel","labels","singular_name","records","slug","per_page","name","authorRecords","useSpecificEditorSettings","setIsInserterOpened","isLargeViewport","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","canvasMode","settings","postWithTemplate","getEditedPostType","getEditedPostId","getEditedPostContext","getCanvasMode","getSettings","get","getPreference","getEditedEntityRecord","usedPostType","usedPostId","_record","_context","postId","archiveLabels","defaultRenderingMode","defaultEditorSettings","supportsTemplateMode","__experimentalSetIsInserterOpened","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel","useSiteEditorSettings","postType"],"sources":["@wordpress/edit-site/src/components/block-editor/use-site-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useBlockEditorSettings } = unlock( editorPrivateApis );\n\nfunction useArchiveLabel( templateSlug ) {\n\tconst taxonomyMatches = templateSlug?.match(\n\t\t/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/\n\t);\n\tlet taxonomy;\n\tlet term;\n\tlet isAuthor = false;\n\tlet authorSlug;\n\tif ( taxonomyMatches ) {\n\t\t// If is for a all taxonomies of a type\n\t\tif ( taxonomyMatches[ 1 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 2 ]\n\t\t\t\t? taxonomyMatches[ 2 ]\n\t\t\t\t: taxonomyMatches[ 1 ];\n\t\t}\n\t\t// If is for a all taxonomies of a type\n\t\telse if ( taxonomyMatches[ 3 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 6 ]\n\t\t\t\t? taxonomyMatches[ 6 ]\n\t\t\t\t: taxonomyMatches[ 4 ];\n\t\t\tterm = taxonomyMatches[ 7 ];\n\t\t}\n\t\ttaxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;\n\n\t\t//getTaxonomy( 'category' );\n\t\t//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );\n\t} else {\n\t\tconst authorMatches = templateSlug?.match( /^(author)$|^author-(.+)$/ );\n\t\tif ( authorMatches ) {\n\t\t\tisAuthor = true;\n\t\t\tif ( authorMatches[ 2 ] ) {\n\t\t\t\tauthorSlug = authorMatches[ 2 ];\n\t\t\t}\n\t\t}\n\t}\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomy, getAuthors } =\n\t\t\t\tselect( coreStore );\n\t\t\tlet archiveTypeLabel;\n\t\t\tlet archiveNameLabel;\n\t\t\tif ( taxonomy ) {\n\t\t\t\tarchiveTypeLabel =\n\t\t\t\t\tgetTaxonomy( taxonomy )?.labels?.singular_name;\n\t\t\t}\n\t\t\tif ( term ) {\n\t\t\t\tconst records = getEntityRecords( 'taxonomy', taxonomy, {\n\t\t\t\t\tslug: term,\n\t\t\t\t\tper_page: 1,\n\t\t\t\t} );\n\t\t\t\tif ( records && records[ 0 ] ) {\n\t\t\t\t\tarchiveNameLabel = records[ 0 ].name;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( isAuthor ) {\n\t\t\t\tarchiveTypeLabel = 'Author';\n\t\t\t\tif ( authorSlug ) {\n\t\t\t\t\tconst authorRecords = getAuthors( { slug: authorSlug } );\n\t\t\t\t\tif ( authorRecords && authorRecords[ 0 ] ) {\n\t\t\t\t\t\tarchiveNameLabel = authorRecords[ 0 ].name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tarchiveTypeLabel,\n\t\t\t\tarchiveNameLabel,\n\t\t\t};\n\t\t},\n\t\t[ authorSlug, isAuthor, taxonomy, term ]\n\t);\n}\n\nexport function useSpecificEditorSettings() {\n\tconst { setIsInserterOpened } = useDispatch( editSiteStore );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\ttemplateSlug,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\tkeepCaretInsideBlock,\n\t\tcanvasMode,\n\t\tsettings,\n\t\tpostWithTemplate,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostType,\n\t\t\t\tgetEditedPostId,\n\t\t\t\tgetEditedPostContext,\n\t\t\t\tgetCanvasMode,\n\t\t\t\tgetSettings,\n\t\t\t} = unlock( select( editSiteStore ) );\n\t\t\tconst { get: getPreference } = select( preferencesStore );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst usedPostType = getEditedPostType();\n\t\t\tconst usedPostId = getEditedPostId();\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tusedPostType,\n\t\t\t\tusedPostId\n\t\t\t);\n\t\t\tconst _context = getEditedPostContext();\n\t\t\treturn {\n\t\t\t\ttemplateSlug: _record.slug,\n\t\t\t\tfocusMode: !! getPreference( 'core/edit-site', 'focusMode' ),\n\t\t\t\tisDistractionFree: !! getPreference(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'distractionFree'\n\t\t\t\t),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\t!! getPreference( 'core/edit-site', 'fixedToolbar' ) ||\n\t\t\t\t\t! isLargeViewport,\n\t\t\t\tkeepCaretInsideBlock: !! getPreference(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'keepCaretInsideBlock'\n\t\t\t\t),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tsettings: getSettings(),\n\t\t\t\tpostWithTemplate: _context?.postId,\n\t\t\t};\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst archiveLabels = useArchiveLabel( templateSlug );\n\tconst defaultRenderingMode = postWithTemplate ? 'template-locked' : 'all';\n\tconst defaultEditorSettings = useMemo( () => {\n\t\treturn {\n\t\t\t...settings,\n\n\t\t\tsupportsTemplateMode: true,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tfocusMode: canvasMode === 'view' && focusMode ? false : focusMode,\n\t\t\tisDistractionFree,\n\t\t\thasFixedToolbar,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tdefaultRenderingMode,\n\n\t\t\t// I wonder if they should be set in the post editor too\n\t\t\t__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,\n\t\t\t__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,\n\t\t};\n\t}, [\n\t\tsettings,\n\t\tsetIsInserterOpened,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\tkeepCaretInsideBlock,\n\t\tcanvasMode,\n\t\tarchiveLabels.archiveTypeLabel,\n\t\tarchiveLabels.archiveNameLabel,\n\t\tdefaultRenderingMode,\n\t] );\n\n\treturn defaultEditorSettings;\n}\n\nexport default function useSiteEditorSettings() {\n\tconst defaultEditorSettings = useSpecificEditorSettings();\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst usedPostType = getEditedPostType();\n\t\tconst usedPostId = getEditedPostId();\n\t\treturn {\n\t\t\tpostType: usedPostType,\n\t\t\tpostId: usedPostId,\n\t\t};\n\t}, [] );\n\treturn useBlockEditorSettings( defaultEditorSettings, postType, postId );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASH,KAAK,IAAII,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAuB,CAAC,GAAGD,MAAM,CAAEH,iBAAkB,CAAC;AAE9D,SAASK,eAAeA,CAAEC,Y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aAAa,CAAC/B;IACpD,CAAC;EACF,CAAC,EAAE,CACFgB,QAAQ,EACRP,mBAAmB,EACnBE,SAAS,EACTC,iBAAiB,EACjBC,eAAe,EACfC,oBAAoB,EACpBC,UAAU,EACVgB,aAAa,CAAChC,gBAAgB,EAC9BgC,aAAa,CAAC/B,gBAAgB,EAC9BgC,oBAAoB,CACnB,CAAC;EAEH,OAAOC,qBAAqB;AAC7B;AAEA,eAAe,SAASK,qBAAqBA,CAAA,EAAG;EAC/C,MAAML,qBAAqB,GAAGzB,yBAAyB,CAAC,CAAC;EACzD,MAAM;IAAE+B,QAAQ;IAAET;EAAO,CAAC,GAAGtD,SAAS,CAAImB,MAAM,IAAM;IACrD,MAAM;MAAEuB,iBAAiB;MAAEC;IAAgB,CAAC,GAAGnC,MAAM,CACpDW,MAAM,CAAEZ,aAAc,CACvB,CAAC;IACD,MAAM2C,YAAY,GAAGR,iBAAiB,CAAC,CAAC;IACxC,MAAMS,UAAU,GAAGR,eAAe,CAAC,CAAC;IACpC,OAAO;MACNoB,QAAQ,EAAEb,YAAY;MACtBI,MAAM,EAAEH;IACT,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OAAO1C,sBAAsB,CAAEgD,qBAAqB,EAAEM,QAAQ,EAAET,MAAO,CAAC;AACzE"}
1
+ {"version":3,"names":["useSelect","useMemo","store","coreStore","privateApis","editorPrivateApis","editSiteStore","unlock","usePostLinkProps","useBlockEditorSettings","useArchiveLabel","templateSlug","taxonomyMatches","match","taxonomy","term","isAuthor","authorSlug","authorMatches","select","getEntityRecords","getTaxonomy","getAuthors","archiveTypeLabel","archiveNameLabel","labels","singular_name","records","slug","per_page","name","authorRecords","useSpecificEditorSettings","getPostLinkProps","canvasMode","settings","postWithTemplate","getEditedPostType","getEditedPostId","getEditedPostContext","getCanvasMode","getSettings","getEditedEntityRecord","usedPostType","usedPostId","_record","_context","postId","archiveLabels","defaultRenderingMode","defaultEditorSettings","richEditingEnabled","supportsTemplateMode","focusMode","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel","useSiteEditorSettings","postType"],"sources":["@wordpress/edit-site/src/components/block-editor/use-site-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { usePostLinkProps } from './use-post-link-props';\n\nconst { useBlockEditorSettings } = unlock( editorPrivateApis );\n\nfunction useArchiveLabel( templateSlug ) {\n\tconst taxonomyMatches = templateSlug?.match(\n\t\t/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/\n\t);\n\tlet taxonomy;\n\tlet term;\n\tlet isAuthor = false;\n\tlet authorSlug;\n\tif ( taxonomyMatches ) {\n\t\t// If is for a all taxonomies of a type\n\t\tif ( taxonomyMatches[ 1 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 2 ]\n\t\t\t\t? taxonomyMatches[ 2 ]\n\t\t\t\t: taxonomyMatches[ 1 ];\n\t\t}\n\t\t// If is for a all taxonomies of a type\n\t\telse if ( taxonomyMatches[ 3 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 6 ]\n\t\t\t\t? taxonomyMatches[ 6 ]\n\t\t\t\t: taxonomyMatches[ 4 ];\n\t\t\tterm = taxonomyMatches[ 7 ];\n\t\t}\n\t\ttaxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;\n\n\t\t//getTaxonomy( 'category' );\n\t\t//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );\n\t} else {\n\t\tconst authorMatches = templateSlug?.match( /^(author)$|^author-(.+)$/ );\n\t\tif ( authorMatches ) {\n\t\t\tisAuthor = true;\n\t\t\tif ( authorMatches[ 2 ] ) {\n\t\t\t\tauthorSlug = authorMatches[ 2 ];\n\t\t\t}\n\t\t}\n\t}\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomy, getAuthors } =\n\t\t\t\tselect( coreStore );\n\t\t\tlet archiveTypeLabel;\n\t\t\tlet archiveNameLabel;\n\t\t\tif ( taxonomy ) {\n\t\t\t\tarchiveTypeLabel =\n\t\t\t\t\tgetTaxonomy( taxonomy )?.labels?.singular_name;\n\t\t\t}\n\t\t\tif ( term ) {\n\t\t\t\tconst records = getEntityRecords( 'taxonomy', taxonomy, {\n\t\t\t\t\tslug: term,\n\t\t\t\t\tper_page: 1,\n\t\t\t\t} );\n\t\t\t\tif ( records && records[ 0 ] ) {\n\t\t\t\t\tarchiveNameLabel = records[ 0 ].name;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( isAuthor ) {\n\t\t\t\tarchiveTypeLabel = 'Author';\n\t\t\t\tif ( authorSlug ) {\n\t\t\t\t\tconst authorRecords = getAuthors( { slug: authorSlug } );\n\t\t\t\t\tif ( authorRecords && authorRecords[ 0 ] ) {\n\t\t\t\t\t\tarchiveNameLabel = authorRecords[ 0 ].name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tarchiveTypeLabel,\n\t\t\t\tarchiveNameLabel,\n\t\t\t};\n\t\t},\n\t\t[ authorSlug, isAuthor, taxonomy, term ]\n\t);\n}\n\nexport function useSpecificEditorSettings() {\n\tconst getPostLinkProps = usePostLinkProps();\n\tconst { templateSlug, canvasMode, settings, postWithTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostType,\n\t\t\t\tgetEditedPostId,\n\t\t\t\tgetEditedPostContext,\n\t\t\t\tgetCanvasMode,\n\t\t\t\tgetSettings,\n\t\t\t} = unlock( select( editSiteStore ) );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst usedPostType = getEditedPostType();\n\t\t\tconst usedPostId = getEditedPostId();\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tusedPostType,\n\t\t\t\tusedPostId\n\t\t\t);\n\t\t\tconst _context = getEditedPostContext();\n\t\t\treturn {\n\t\t\t\ttemplateSlug: _record.slug,\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tsettings: getSettings(),\n\t\t\t\tpostWithTemplate: _context?.postId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst archiveLabels = useArchiveLabel( templateSlug );\n\tconst defaultRenderingMode = postWithTemplate ? 'template-locked' : 'all';\n\tconst defaultEditorSettings = useMemo( () => {\n\t\treturn {\n\t\t\t...settings,\n\n\t\t\trichEditingEnabled: true,\n\t\t\tsupportsTemplateMode: true,\n\t\t\tfocusMode: canvasMode !== 'view',\n\t\t\tdefaultRenderingMode,\n\t\t\tgetPostLinkProps,\n\t\t\t// I wonder if they should be set in the post editor too\n\t\t\t__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,\n\t\t\t__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,\n\t\t};\n\t}, [\n\t\tsettings,\n\t\tcanvasMode,\n\t\tdefaultRenderingMode,\n\t\tgetPostLinkProps,\n\t\tarchiveLabels.archiveTypeLabel,\n\t\tarchiveLabels.archiveNameLabel,\n\t] );\n\n\treturn defaultEditorSettings;\n}\n\nexport default function useSiteEditorSettings() {\n\tconst defaultEditorSettings = useSpecificEditorSettings();\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst usedPostType = getEditedPostType();\n\t\tconst usedPostId = getEditedPostId();\n\t\treturn {\n\t\t\tpostType: usedPostType,\n\t\t\tpostId: usedPostId,\n\t\t};\n\t}, [] );\n\treturn useBlockEditorSettings( defaultEditorSettings, postType, postId );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ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