@wordpress/edit-site 5.27.2 → 5.28.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 (334) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/actions/index.js +3 -6
  3. package/build/components/actions/index.js.map +1 -1
  4. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +1 -2
  5. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
  6. package/build/components/add-new-template/add-custom-template-modal-content.js +1 -2
  7. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  8. package/build/components/block-editor/editor-canvas.js +1 -2
  9. package/build/components/block-editor/editor-canvas.js.map +1 -1
  10. package/build/components/block-editor/inserter-media-categories.js +1 -2
  11. package/build/components/block-editor/inserter-media-categories.js.map +1 -1
  12. package/build/components/block-editor/resizable-editor.js +1 -2
  13. package/build/components/block-editor/resizable-editor.js.map +1 -1
  14. package/build/components/block-editor/site-editor-canvas.js +4 -3
  15. package/build/components/block-editor/site-editor-canvas.js.map +1 -1
  16. package/build/components/block-editor/{use-post-link-props.js → use-navigate-to-entity-record.js} +9 -8
  17. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -0
  18. package/build/components/block-editor/use-site-editor-settings.js +30 -4
  19. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  20. package/build/components/editor/index.js +6 -3
  21. package/build/components/editor/index.js.map +1 -1
  22. package/build/components/editor-canvas-container/index.js +1 -2
  23. package/build/components/editor-canvas-container/index.js.map +1 -1
  24. package/build/components/global-styles/block-preview-panel.js +1 -2
  25. package/build/components/global-styles/block-preview-panel.js.map +1 -1
  26. package/build/components/global-styles/color-indicator-wrapper.js +1 -2
  27. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
  28. package/build/components/global-styles/font-families.js +9 -5
  29. package/build/components/global-styles/font-families.js.map +1 -1
  30. package/build/components/global-styles/font-family-item.js +1 -2
  31. package/build/components/global-styles/font-family-item.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/collection-font-details.js +1 -2
  33. package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/collection-font-variant.js +13 -13
  35. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  36. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +1 -2
  37. package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
  38. package/build/components/global-styles/font-library-modal/context.js +2 -4
  39. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  40. package/build/components/global-styles/font-library-modal/font-card.js +3 -3
  41. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  42. package/build/components/global-styles/font-library-modal/font-collection.js +9 -7
  43. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  44. package/build/components/global-styles/font-library-modal/font-demo.js +5 -11
  45. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  46. package/build/components/global-styles/font-library-modal/fonts-grid.js +1 -2
  47. package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
  48. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +2 -3
  49. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  50. package/build/components/global-styles/font-library-modal/index.js +1 -2
  51. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  52. package/build/components/global-styles/font-library-modal/installed-fonts.js +6 -5
  53. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  54. package/build/components/global-styles/font-library-modal/library-font-card.js +2 -3
  55. package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  56. package/build/components/global-styles/font-library-modal/library-font-details.js +1 -2
  57. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  58. package/build/components/global-styles/font-library-modal/library-font-variant.js +13 -13
  59. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  60. package/build/components/global-styles/font-library-modal/tab-panel-layout.js +4 -3
  61. package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -1
  62. package/build/components/global-styles/font-library-modal/upload-fonts.js +3 -8
  63. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  64. package/build/components/global-styles/font-library-modal/utils/constants.js +3 -6
  65. package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
  66. package/build/components/global-styles/font-library-modal/utils/index.js +4 -1
  67. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  68. package/build/components/global-styles/header.js +1 -2
  69. package/build/components/global-styles/header.js.map +1 -1
  70. package/build/components/global-styles/palette.js +1 -2
  71. package/build/components/global-styles/palette.js.map +1 -1
  72. package/build/components/global-styles/preview.js +1 -2
  73. package/build/components/global-styles/preview.js.map +1 -1
  74. package/build/components/global-styles/root-menu.js +1 -2
  75. package/build/components/global-styles/root-menu.js.map +1 -1
  76. package/build/components/global-styles/screen-block-list.js +1 -2
  77. package/build/components/global-styles/screen-block-list.js.map +1 -1
  78. package/build/components/global-styles/screen-block.js +1 -11
  79. package/build/components/global-styles/screen-block.js.map +1 -1
  80. package/build/components/global-styles/screen-color-palette.js +1 -2
  81. package/build/components/global-styles/screen-color-palette.js.map +1 -1
  82. package/build/components/global-styles/screen-colors.js +1 -2
  83. package/build/components/global-styles/screen-colors.js.map +1 -1
  84. package/build/components/global-styles/screen-css.js +1 -2
  85. package/build/components/global-styles/screen-css.js.map +1 -1
  86. package/build/components/global-styles/screen-layout.js +1 -2
  87. package/build/components/global-styles/screen-layout.js.map +1 -1
  88. package/build/components/global-styles/screen-revisions/index.js +1 -2
  89. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  90. package/build/components/global-styles/screen-revisions/revisions-buttons.js +2 -3
  91. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  92. package/build/components/global-styles/screen-root.js +1 -2
  93. package/build/components/global-styles/screen-root.js.map +1 -1
  94. package/build/components/global-styles/screen-style-variations.js +1 -2
  95. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  96. package/build/components/global-styles/screen-typography-element.js +3 -6
  97. package/build/components/global-styles/screen-typography-element.js.map +1 -1
  98. package/build/components/global-styles/screen-typography.js +1 -2
  99. package/build/components/global-styles/screen-typography.js.map +1 -1
  100. package/build/components/global-styles/subtitle.js +1 -2
  101. package/build/components/global-styles/subtitle.js.map +1 -1
  102. package/build/components/global-styles/typogrphy-elements.js +1 -2
  103. package/build/components/global-styles/typogrphy-elements.js.map +1 -1
  104. package/build/components/global-styles/ui.js +3 -4
  105. package/build/components/global-styles/ui.js.map +1 -1
  106. package/build/components/header-edit-mode/mode-switcher/index.js +1 -2
  107. package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
  108. package/build/components/header-edit-mode/more-menu/index.js +12 -21
  109. package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
  110. package/build/components/header-edit-mode/plugin-more-menu-item/index.js +1 -2
  111. package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +1 -1
  112. package/build/components/header-edit-mode/tools-more-menu-group/index.js +1 -2
  113. package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
  114. package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
  115. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  116. package/build/components/keyboard-shortcut-help-modal/index.js +1 -3
  117. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  118. package/build/components/keyboard-shortcuts/edit-mode.js +1 -2
  119. package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
  120. package/build/components/keyboard-shortcuts/global.js +1 -2
  121. package/build/components/keyboard-shortcuts/global.js.map +1 -1
  122. package/build/components/keyboard-shortcuts/register.js +1 -2
  123. package/build/components/keyboard-shortcuts/register.js.map +1 -1
  124. package/build/components/layout/index.js +0 -2
  125. package/build/components/layout/index.js.map +1 -1
  126. package/build/components/media/index.js +1 -2
  127. package/build/components/media/index.js.map +1 -1
  128. package/build/components/page-pages/index.js +27 -15
  129. package/build/components/page-pages/index.js.map +1 -1
  130. package/build/components/page-patterns/dataviews-pattern-actions.js +87 -32
  131. package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  132. package/build/components/page-patterns/grid-item.js +2 -6
  133. package/build/components/page-patterns/grid-item.js.map +1 -1
  134. package/build/components/page-patterns/index.js +2 -1
  135. package/build/components/page-patterns/index.js.map +1 -1
  136. package/build/components/page-patterns/search-items.js +0 -1
  137. package/build/components/page-patterns/search-items.js.map +1 -1
  138. package/build/components/page-patterns/use-patterns.js +1 -2
  139. package/build/components/page-patterns/use-patterns.js.map +1 -1
  140. package/build/components/page-templates-template-parts/actions.js +2 -4
  141. package/build/components/page-templates-template-parts/actions.js.map +1 -1
  142. package/build/components/page-templates-template-parts/index.js +8 -5
  143. package/build/components/page-templates-template-parts/index.js.map +1 -1
  144. package/build/components/pattern-modal/index.js +1 -2
  145. package/build/components/pattern-modal/index.js.map +1 -1
  146. package/build/components/plugin-template-setting-panel/index.js +1 -2
  147. package/build/components/plugin-template-setting-panel/index.js.map +1 -1
  148. package/build/components/preferences-modal/index.js +1 -2
  149. package/build/components/preferences-modal/index.js.map +1 -1
  150. package/build/components/resizable-frame/index.js +1 -2
  151. package/build/components/resizable-frame/index.js.map +1 -1
  152. package/build/components/revisions/index.js +1 -2
  153. package/build/components/revisions/index.js.map +1 -1
  154. package/build/components/routes/link.js +2 -6
  155. package/build/components/routes/link.js.map +1 -1
  156. package/build/components/sidebar/index.js +3 -4
  157. package/build/components/sidebar/index.js.map +1 -1
  158. package/build/components/sidebar-dataviews/default-views.js +4 -6
  159. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  160. package/build/components/sidebar-edit-mode/constants.js +2 -4
  161. package/build/components/sidebar-edit-mode/constants.js.map +1 -1
  162. package/build/components/sidebar-edit-mode/index.js +97 -18
  163. package/build/components/sidebar-edit-mode/index.js.map +1 -1
  164. package/build/components/sidebar-edit-mode/settings-header/index.js +21 -43
  165. package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  166. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +1 -2
  167. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
  168. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +1 -2
  169. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
  170. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
  171. package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  172. package/build/components/site-hub/index.js +1 -2
  173. package/build/components/site-hub/index.js.map +1 -1
  174. package/build/components/site-icon/index.js +3 -4
  175. package/build/components/site-icon/index.js.map +1 -1
  176. package/build/components/style-book/index.js +1 -2
  177. package/build/components/style-book/index.js.map +1 -1
  178. package/build/components/template-part-converter/convert-to-template-part.js +0 -1
  179. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  180. package/build/hooks/navigation-menu-edit.js +1 -2
  181. package/build/hooks/navigation-menu-edit.js.map +1 -1
  182. package/build/hooks/template-part-edit.js +1 -2
  183. package/build/hooks/template-part-edit.js.map +1 -1
  184. package/build/store/actions.js +7 -2
  185. package/build/store/actions.js.map +1 -1
  186. package/build/store/constants.js +1 -2
  187. package/build/store/constants.js.map +1 -1
  188. package/build/store/index.js +4 -6
  189. package/build/store/index.js.map +1 -1
  190. package/build/store/reducer.js +1 -2
  191. package/build/store/reducer.js.map +1 -1
  192. package/build/store/selectors.js +9 -18
  193. package/build/store/selectors.js.map +1 -1
  194. package/build/store/utils.js +1 -2
  195. package/build/store/utils.js.map +1 -1
  196. package/build/utils/constants.js +13 -26
  197. package/build/utils/constants.js.map +1 -1
  198. package/build-module/components/block-editor/site-editor-canvas.js +5 -4
  199. package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
  200. package/build-module/components/block-editor/{use-post-link-props.js → use-navigate-to-entity-record.js} +8 -7
  201. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -0
  202. package/build-module/components/block-editor/use-site-editor-settings.js +29 -4
  203. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  204. package/build-module/components/editor/index.js +6 -3
  205. package/build-module/components/editor/index.js.map +1 -1
  206. package/build-module/components/global-styles/font-families.js +8 -4
  207. package/build-module/components/global-styles/font-families.js.map +1 -1
  208. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +12 -11
  209. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
  210. package/build-module/components/global-styles/font-library-modal/font-card.js +3 -2
  211. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  212. package/build-module/components/global-styles/font-library-modal/font-collection.js +9 -6
  213. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  214. package/build-module/components/global-styles/font-library-modal/font-demo.js +4 -9
  215. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  216. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  217. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
  218. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +5 -3
  219. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  220. package/build-module/components/global-styles/font-library-modal/library-font-card.js +1 -1
  221. package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
  222. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +12 -11
  223. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
  224. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js +3 -1
  225. package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -1
  226. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +3 -7
  227. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  228. package/build-module/components/global-styles/font-library-modal/utils/index.js +4 -1
  229. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  230. package/build-module/components/global-styles/screen-block.js +0 -9
  231. package/build-module/components/global-styles/screen-block.js.map +1 -1
  232. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  233. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  234. package/build-module/components/global-styles/screen-typography-element.js +3 -5
  235. package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
  236. package/build-module/components/header-edit-mode/more-menu/index.js +12 -21
  237. package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
  238. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
  239. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  240. package/build-module/components/layout/index.js +0 -2
  241. package/build-module/components/layout/index.js.map +1 -1
  242. package/build-module/components/page-pages/index.js +25 -13
  243. package/build-module/components/page-pages/index.js.map +1 -1
  244. package/build-module/components/page-patterns/dataviews-pattern-actions.js +81 -20
  245. package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
  246. package/build-module/components/page-patterns/grid-item.js +1 -4
  247. package/build-module/components/page-patterns/grid-item.js.map +1 -1
  248. package/build-module/components/page-patterns/index.js +2 -1
  249. package/build-module/components/page-patterns/index.js.map +1 -1
  250. package/build-module/components/page-patterns/search-items.js +0 -1
  251. package/build-module/components/page-patterns/search-items.js.map +1 -1
  252. package/build-module/components/page-templates-template-parts/index.js +6 -3
  253. package/build-module/components/page-templates-template-parts/index.js.map +1 -1
  254. package/build-module/components/routes/link.js +2 -5
  255. package/build-module/components/routes/link.js.map +1 -1
  256. package/build-module/components/sidebar-dataviews/default-views.js +3 -3
  257. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  258. package/build-module/components/sidebar-edit-mode/index.js +98 -18
  259. package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
  260. package/build-module/components/sidebar-edit-mode/settings-header/index.js +23 -43
  261. package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
  262. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +2 -2
  263. package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
  264. package/build-module/components/site-icon/index.js +2 -2
  265. package/build-module/components/site-icon/index.js.map +1 -1
  266. package/build-module/components/template-part-converter/convert-to-template-part.js +0 -1
  267. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  268. package/build-module/store/actions.js +7 -2
  269. package/build-module/store/actions.js.map +1 -1
  270. package/build-style/style-rtl.css +394 -218
  271. package/build-style/style.css +394 -218
  272. package/package.json +42 -42
  273. package/src/components/add-new-template/style.scss +0 -12
  274. package/src/components/block-editor/site-editor-canvas.js +4 -3
  275. package/src/components/block-editor/style.scss +2 -20
  276. package/src/components/block-editor/use-navigate-to-entity-record.js +25 -0
  277. package/src/components/block-editor/use-site-editor-settings.js +35 -4
  278. package/src/components/editor/index.js +7 -1
  279. package/src/components/global-styles/font-families.js +13 -4
  280. package/src/components/global-styles/font-library-modal/collection-font-variant.js +10 -8
  281. package/src/components/global-styles/font-library-modal/font-card.js +10 -4
  282. package/src/components/global-styles/font-library-modal/font-collection.js +9 -7
  283. package/src/components/global-styles/font-library-modal/font-demo.js +8 -9
  284. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
  285. package/src/components/global-styles/font-library-modal/installed-fonts.js +8 -3
  286. package/src/components/global-styles/font-library-modal/library-font-card.js +1 -1
  287. package/src/components/global-styles/font-library-modal/library-font-variant.js +10 -8
  288. package/src/components/global-styles/font-library-modal/style.scss +13 -17
  289. package/src/components/global-styles/font-library-modal/tab-panel-layout.js +2 -0
  290. package/src/components/global-styles/font-library-modal/upload-fonts.js +4 -13
  291. package/src/components/global-styles/font-library-modal/utils/index.js +2 -1
  292. package/src/components/global-styles/screen-block.js +0 -12
  293. package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
  294. package/src/components/global-styles/screen-revisions/style.scss +21 -15
  295. package/src/components/global-styles/screen-typography-element.js +2 -4
  296. package/src/components/global-styles/style.scss +4 -0
  297. package/src/components/header-edit-mode/more-menu/index.js +10 -18
  298. package/src/components/header-edit-mode/style.scss +54 -6
  299. package/src/components/layout/style.scss +2 -7
  300. package/src/components/page/style.scss +0 -1
  301. package/src/components/page-pages/index.js +32 -23
  302. package/src/components/page-pages/style.scss +28 -27
  303. package/src/components/page-patterns/dataviews-pattern-actions.js +106 -30
  304. package/src/components/page-patterns/grid-item.js +0 -2
  305. package/src/components/page-patterns/index.js +1 -0
  306. package/src/components/page-patterns/style.scss +4 -9
  307. package/src/components/page-templates-template-parts/index.js +23 -16
  308. package/src/components/page-templates-template-parts/style.scss +16 -0
  309. package/src/components/routes/link.js +2 -11
  310. package/src/components/sidebar-dataviews/default-views.js +3 -3
  311. package/src/components/sidebar-edit-mode/index.js +121 -25
  312. package/src/components/sidebar-edit-mode/settings-header/index.js +25 -63
  313. package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -87
  314. package/src/components/sidebar-edit-mode/sidebar-card/style.scss +3 -0
  315. package/src/components/sidebar-edit-mode/style.scss +4 -0
  316. package/src/components/sidebar-navigation-screen/style.scss +2 -1
  317. package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +9 -3
  318. package/src/components/site-hub/style.scss +0 -1
  319. package/src/components/site-icon/index.js +1 -1
  320. package/src/components/site-icon/style.scss +9 -1
  321. package/src/store/actions.js +20 -3
  322. package/build/components/block-editor/back-button.js +0 -46
  323. package/build/components/block-editor/back-button.js.map +0 -1
  324. package/build/components/block-editor/use-post-link-props.js.map +0 -1
  325. package/build/components/global-styles/font-library-modal/font-variant.js +0 -51
  326. package/build/components/global-styles/font-library-modal/font-variant.js.map +0 -1
  327. package/build-module/components/block-editor/back-button.js +0 -38
  328. package/build-module/components/block-editor/back-button.js.map +0 -1
  329. package/build-module/components/block-editor/use-post-link-props.js.map +0 -1
  330. package/build-module/components/global-styles/font-library-modal/font-variant.js +0 -42
  331. package/build-module/components/global-styles/font-library-modal/font-variant.js.map +0 -1
  332. package/src/components/block-editor/back-button.js +0 -51
  333. package/src/components/block-editor/use-post-link-props.js +0 -24
  334. package/src/components/global-styles/font-library-modal/font-variant.js +0 -53
@@ -52,7 +52,7 @@ var _lockUnlock = require("../lock-unlock");
52
52
  *
53
53
  * @return {boolean} Is active.
54
54
  */
55
- const isFeatureActive = (0, _data.createRegistrySelector)(select => (_, featureName) => {
55
+ const isFeatureActive = exports.isFeatureActive = (0, _data.createRegistrySelector)(select => (_, featureName) => {
56
56
  (0, _deprecated.default)(`select( 'core/edit-site' ).isFeatureActive`, {
57
57
  since: '6.0',
58
58
  alternative: `select( 'core/preferences' ).get`
@@ -69,8 +69,7 @@ const isFeatureActive = (0, _data.createRegistrySelector)(select => (_, featureN
69
69
  *
70
70
  * @return {string} Device type.
71
71
  */
72
- exports.isFeatureActive = isFeatureActive;
73
- const __experimentalGetPreviewDeviceType = (0, _data.createRegistrySelector)(select => () => {
72
+ const __experimentalGetPreviewDeviceType = exports.__experimentalGetPreviewDeviceType = (0, _data.createRegistrySelector)(select => () => {
74
73
  (0, _deprecated.default)(`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`, {
75
74
  since: '6.5',
76
75
  version: '6.7',
@@ -86,8 +85,7 @@ const __experimentalGetPreviewDeviceType = (0, _data.createRegistrySelector)(sel
86
85
  *
87
86
  * @return {Object} Whether the current user can create media or not.
88
87
  */
89
- exports.__experimentalGetPreviewDeviceType = __experimentalGetPreviewDeviceType;
90
- const getCanUserCreateMedia = (0, _data.createRegistrySelector)(select => () => select(_coreData.store).canUser('create', 'media'));
88
+ const getCanUserCreateMedia = exports.getCanUserCreateMedia = (0, _data.createRegistrySelector)(select => () => select(_coreData.store).canUser('create', 'media'));
91
89
 
92
90
  /**
93
91
  * Returns any available Reusable blocks.
@@ -96,8 +94,7 @@ const getCanUserCreateMedia = (0, _data.createRegistrySelector)(select => () =>
96
94
  *
97
95
  * @return {Array} The available reusable blocks.
98
96
  */
99
- exports.getCanUserCreateMedia = getCanUserCreateMedia;
100
- const getReusableBlocks = (0, _data.createRegistrySelector)(select => () => {
97
+ const getReusableBlocks = exports.getReusableBlocks = (0, _data.createRegistrySelector)(select => () => {
101
98
  (0, _deprecated.default)("select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )", {
102
99
  since: '6.5',
103
100
  version: '6.8'
@@ -115,7 +112,6 @@ const getReusableBlocks = (0, _data.createRegistrySelector)(select => () => {
115
112
  *
116
113
  * @return {Object} Settings.
117
114
  */
118
- exports.getReusableBlocks = getReusableBlocks;
119
115
  function getSettings(state) {
120
116
  // It is important that we don't inject anything into these settings locally.
121
117
  // The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings.
@@ -190,7 +186,7 @@ function getPage(state) {
190
186
  *
191
187
  * @return {boolean} Whether the inserter is opened.
192
188
  */
193
- const isInserterOpened = (0, _data.createRegistrySelector)(select => () => {
189
+ const isInserterOpened = exports.isInserterOpened = (0, _data.createRegistrySelector)(select => () => {
194
190
  (0, _deprecated.default)(`select( 'core/edit-site' ).isInserterOpened`, {
195
191
  since: '6.5',
196
192
  alternative: `select( 'core/editor' ).isInserterOpened`
@@ -207,8 +203,7 @@ const isInserterOpened = (0, _data.createRegistrySelector)(select => () => {
207
203
  *
208
204
  * @return {Object} The root client ID, index to insert at and starting filter value.
209
205
  */
210
- exports.isInserterOpened = isInserterOpened;
211
- const __experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select => () => {
206
+ const __experimentalGetInsertionPoint = exports.__experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select => () => {
212
207
  (0, _deprecated.default)(`select( 'core/edit-site' ).__experimentalGetInsertionPoint`, {
213
208
  since: '6.5',
214
209
  version: '6.7'
@@ -223,8 +218,7 @@ const __experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select
223
218
  *
224
219
  * @return {boolean} Whether the list view is opened.
225
220
  */
226
- exports.__experimentalGetInsertionPoint = __experimentalGetInsertionPoint;
227
- const isListViewOpened = (0, _data.createRegistrySelector)(select => () => {
221
+ const isListViewOpened = exports.isListViewOpened = (0, _data.createRegistrySelector)(select => () => {
228
222
  (0, _deprecated.default)(`select( 'core/edit-site' ).isListViewOpened`, {
229
223
  since: '6.5',
230
224
  alternative: `select( 'core/editor' ).isListViewOpened`
@@ -239,7 +233,6 @@ const isListViewOpened = (0, _data.createRegistrySelector)(select => () => {
239
233
  *
240
234
  * @return {boolean} True if the save panel should be open; false if closed.
241
235
  */
242
- exports.isListViewOpened = isListViewOpened;
243
236
  function isSaveViewOpened(state) {
244
237
  return state.saveViewPanel;
245
238
  }
@@ -250,7 +243,7 @@ function isSaveViewOpened(state) {
250
243
  * @param {Object} state Global application state.
251
244
  * @return {Array} Template parts and their blocks in an array.
252
245
  */
253
- const getCurrentTemplateTemplateParts = (0, _data.createRegistrySelector)(select => () => {
246
+ const getCurrentTemplateTemplateParts = exports.getCurrentTemplateTemplateParts = (0, _data.createRegistrySelector)(select => () => {
254
247
  const templateParts = select(_coreData.store).getEntityRecords('postType', _constants.TEMPLATE_PART_POST_TYPE, {
255
248
  per_page: -1
256
249
  });
@@ -266,15 +259,13 @@ const getCurrentTemplateTemplateParts = (0, _data.createRegistrySelector)(select
266
259
  *
267
260
  * @return {string} Editing mode.
268
261
  */
269
- exports.getCurrentTemplateTemplateParts = getCurrentTemplateTemplateParts;
270
- const getEditorMode = (0, _data.createRegistrySelector)(select => () => {
262
+ const getEditorMode = exports.getEditorMode = (0, _data.createRegistrySelector)(select => () => {
271
263
  return select(_preferences.store).get('core', 'editorMode');
272
264
  });
273
265
 
274
266
  /**
275
267
  * @deprecated
276
268
  */
277
- exports.getEditorMode = getEditorMode;
278
269
  function getCurrentTemplateNavigationPanelSubMenu() {
279
270
  (0, _deprecated.default)("dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu", {
280
271
  since: '6.2',
@@ -1 +1 @@
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","getBlocksByName","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 ).getBlocksByName( 'core/template-part' );\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', '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;AACA;AACA;AACA;AARAM,OAAA,CAAAV,eAAA,GAAAA,eAAA;AASO,MAAMW,kCAAkC,GAAG,IAA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AC9D,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"}
1
+ {"version":3,"names":["_coreData","require","_data","_deprecated","_interopRequireDefault","_element","_preferences","_blockEditor","_editor","_utils","_constants","_lockUnlock","isFeatureActive","exports","createRegistrySelector","select","_","featureName","deprecated","since","alternative","preferencesStore","get","__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","getBlocksByName","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 ).getBlocksByName( 'core/template-part' );\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', '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,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,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;AACA;AACA;AACA;AACO,MAAMM,kCAAkC,GAAAV,OAAA,CAAAU,kCAAA,GAAG,IAAAT,4BAAsB,EACrEC,MAAM,IAAM,MAAM;EACnB,IAAAG,mBAAU,EACR,+DAA8D,EAC/D;IACCC,KAAK,EAAE,KAAK;IACZK,OAAO,EAAE,KAAK;IACdJ,WAAW,EAAG;EACf,CACD,CAAC;EACD,OAAOL,MAAM,CAAEU,aAAY,CAAC,CAACC,aAAa,C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E;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAAS2C,kBAAkBA,CAAA,EAAG;EACpC,IAAAjD,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,KAAK,EAAE,KAAK;IACZK,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,IAAApD,mBAAU,EAAG,gDAA+C,EAAE;IAC7DC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAO,KAAK;AACb"}
@@ -67,6 +67,5 @@ function getFilteredTemplatePartBlocks(blocks = EMPTY_ARRAY, templateParts) {
67
67
  }
68
68
  return result;
69
69
  }
70
- const memoizedGetFilteredTemplatePartBlocks = (0, _memize.default)(getFilteredTemplatePartBlocks);
71
- exports.getFilteredTemplatePartBlocks = memoizedGetFilteredTemplatePartBlocks;
70
+ const memoizedGetFilteredTemplatePartBlocks = exports.getFilteredTemplatePartBlocks = (0, _memize.default)(getFilteredTemplatePartBlocks);
72
71
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_memize","_interopRequireDefault","require","_blocks","EMPTY_ARRAY","getFilteredTemplatePartBlocks","blocks","templateParts","templatePartsById","reduce","newTemplateParts","part","id","result","stack","length","innerBlocks","block","shift","unshift","isTemplatePart","attributes","theme","slug","templatePartId","templatePart","push","memoizedGetFilteredTemplatePartBlocks","memoize","exports"],"sources":["@wordpress/edit-site/src/store/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { isTemplatePart } from '@wordpress/blocks';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Get a flattened and filtered list of template parts and the matching block for that template part.\n *\n * Takes a list of blocks defined within a template, and a list of template parts, and returns a\n * flattened list of template parts and the matching block for that template part.\n *\n * @param {Array} blocks Blocks to flatten.\n * @param {?Array} templateParts Available template parts.\n * @return {Array} An array of template parts and their blocks.\n */\nfunction getFilteredTemplatePartBlocks( blocks = EMPTY_ARRAY, templateParts ) {\n\tconst templatePartsById = templateParts\n\t\t? // Key template parts by their ID.\n\t\t templateParts.reduce(\n\t\t\t\t( newTemplateParts, part ) => ( {\n\t\t\t\t\t...newTemplateParts,\n\t\t\t\t\t[ part.id ]: part,\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t )\n\t\t: {};\n\n\tconst result = [];\n\n\t// Iterate over all blocks, recursing into inner blocks.\n\t// Output will be based on a depth-first traversal.\n\tconst stack = [ ...blocks ];\n\twhile ( stack.length ) {\n\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t// Place inner blocks at the beginning of the stack to preserve order.\n\t\tstack.unshift( ...innerBlocks );\n\n\t\tif ( isTemplatePart( block ) ) {\n\t\t\tconst {\n\t\t\t\tattributes: { theme, slug },\n\t\t\t} = block;\n\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t// Only add to output if the found template part block is in the list of available template parts.\n\t\t\tif ( templatePart ) {\n\t\t\t\tresult.push( {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst memoizedGetFilteredTemplatePartBlocks = memoize(\n\tgetFilteredTemplatePartBlocks\n);\n\nexport { memoizedGetFilteredTemplatePartBlocks as getFilteredTemplatePartBlocks };\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAME,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,6BAA6BA,CAAEC,MAAM,GAAGF,WAAW,EAAEG,aAAa,EAAG;EAC7E,MAAMC,iBAAiB,GAAGD,aAAa;EACpC;EACAA,aAAa,CAACE,MAAM,CACpB,CAAEC,gBAAgB,EAAEC,IAAI,MAAQ;IAC/B,GAAGD,gBAAgB;IACnB,CAAEC,IAAI,CAACC,EAAE,GAAID;EACd,CAAC,CAAE,EACH,CAAC,CACD,CAAC,GACD,CAAC,CAAC;EAEL,MAAME,MAAM,GAAG,EAAE;;EAEjB;EACA;EACA,MAAMC,KAAK,GAAG,CAAE,GAAGR,MAAM,CAAE;EAC3B,OAAQQ,KAAK,CAACC,MAAM,EAAG;IACtB,MAAM;MAAEC,WAAW;MAAE,GAAGC;IAAM,CAAC,GAAGH,KAAK,CAACI,KAAK,CAAC,CAAC;IAC/C;IACAJ,KAAK,CAACK,OAAO,CAAE,GAAGH,WAAY,CAAC;IAE/B,IAAK,IAAAI,sBAAc,EAAEH,KAAM,CAAC,EAAG;MAC9B,MAAM;QACLI,UAAU,EAAE;UAAEC,KAAK;UAAEC;QAAK;MAC3B,CAAC,GAAGN,KAAK;MACT,MAAMO,cAAc,GAAI,GAAGF,KAAO,KAAKC,IAAM,EAAC;MAC9C,MAAME,YAAY,GAAGjB,iBAAiB,CAAEgB,cAAc,CAAE;;MAExD;MACA,IAAKC,YAAY,EAAG;QACnBZ,MAAM,CAACa,IAAI,CAAE;UACZD,YAAY;UACZR;QACD,CAAE,CAAC;MACJ;IACD;EACD;EAEA,OAAOJ,MAAM;AACd;AAEA,MAAMc,qCAAqC,GAAG,IAAAC,eAAO,EACpDvB,6BACD,CAAC;AAACwB,OAAA,CAAAxB,6BAAA,GAAAsB,qCAAA"}
1
+ {"version":3,"names":["_memize","_interopRequireDefault","require","_blocks","EMPTY_ARRAY","getFilteredTemplatePartBlocks","blocks","templateParts","templatePartsById","reduce","newTemplateParts","part","id","result","stack","length","innerBlocks","block","shift","unshift","isTemplatePart","attributes","theme","slug","templatePartId","templatePart","push","memoizedGetFilteredTemplatePartBlocks","exports","memoize"],"sources":["@wordpress/edit-site/src/store/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { isTemplatePart } from '@wordpress/blocks';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Get a flattened and filtered list of template parts and the matching block for that template part.\n *\n * Takes a list of blocks defined within a template, and a list of template parts, and returns a\n * flattened list of template parts and the matching block for that template part.\n *\n * @param {Array} blocks Blocks to flatten.\n * @param {?Array} templateParts Available template parts.\n * @return {Array} An array of template parts and their blocks.\n */\nfunction getFilteredTemplatePartBlocks( blocks = EMPTY_ARRAY, templateParts ) {\n\tconst templatePartsById = templateParts\n\t\t? // Key template parts by their ID.\n\t\t templateParts.reduce(\n\t\t\t\t( newTemplateParts, part ) => ( {\n\t\t\t\t\t...newTemplateParts,\n\t\t\t\t\t[ part.id ]: part,\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t )\n\t\t: {};\n\n\tconst result = [];\n\n\t// Iterate over all blocks, recursing into inner blocks.\n\t// Output will be based on a depth-first traversal.\n\tconst stack = [ ...blocks ];\n\twhile ( stack.length ) {\n\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t// Place inner blocks at the beginning of the stack to preserve order.\n\t\tstack.unshift( ...innerBlocks );\n\n\t\tif ( isTemplatePart( block ) ) {\n\t\t\tconst {\n\t\t\t\tattributes: { theme, slug },\n\t\t\t} = block;\n\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t// Only add to output if the found template part block is in the list of available template parts.\n\t\t\tif ( templatePart ) {\n\t\t\t\tresult.push( {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst memoizedGetFilteredTemplatePartBlocks = memoize(\n\tgetFilteredTemplatePartBlocks\n);\n\nexport { memoizedGetFilteredTemplatePartBlocks as getFilteredTemplatePartBlocks };\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAME,WAAW,GAAG,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,6BAA6BA,CAAEC,MAAM,GAAGF,WAAW,EAAEG,aAAa,EAAG;EAC7E,MAAMC,iBAAiB,GAAGD,aAAa;EACpC;EACAA,aAAa,CAACE,MAAM,CACpB,CAAEC,gBAAgB,EAAEC,IAAI,MAAQ;IAC/B,GAAGD,gBAAgB;IACnB,CAAEC,IAAI,CAACC,EAAE,GAAID;EACd,CAAC,CAAE,EACH,CAAC,CACD,CAAC,GACD,CAAC,CAAC;EAEL,MAAME,MAAM,GAAG,EAAE;;EAEjB;EACA;EACA,MAAMC,KAAK,GAAG,CAAE,GAAGR,MAAM,CAAE;EAC3B,OAAQQ,KAAK,CAACC,MAAM,EAAG;IACtB,MAAM;MAAEC,WAAW;MAAE,GAAGC;IAAM,CAAC,GAAGH,KAAK,CAACI,KAAK,CAAC,CAAC;IAC/C;IACAJ,KAAK,CAACK,OAAO,CAAE,GAAGH,WAAY,CAAC;IAE/B,IAAK,IAAAI,sBAAc,EAAEH,KAAM,CAAC,EAAG;MAC9B,MAAM;QACLI,UAAU,EAAE;UAAEC,KAAK;UAAEC;QAAK;MAC3B,CAAC,GAAGN,KAAK;MACT,MAAMO,cAAc,GAAI,GAAGF,KAAO,KAAKC,IAAM,EAAC;MAC9C,MAAME,YAAY,GAAGjB,iBAAiB,CAAEgB,cAAc,CAAE;;MAExD;MACA,IAAKC,YAAY,EAAG;QACnBZ,MAAM,CAACa,IAAI,CAAE;UACZD,YAAY;UACZR;QACD,CAAE,CAAC;MACJ;IACD;EACD;EAEA,OAAOJ,MAAM;AACd;AAEA,MAAMc,qCAAqC,GAAAC,OAAA,CAAAvB,6BAAA,GAAG,IAAAwB,eAAO,EACpDxB,6BACD,CAAC"}
@@ -16,24 +16,19 @@ var _lockUnlock = require("../lock-unlock");
16
16
  */
17
17
 
18
18
  // Navigation
19
- const NAVIGATION_POST_TYPE = 'wp_navigation';
19
+ const NAVIGATION_POST_TYPE = exports.NAVIGATION_POST_TYPE = 'wp_navigation';
20
20
 
21
21
  // Templates.
22
- exports.NAVIGATION_POST_TYPE = NAVIGATION_POST_TYPE;
23
- const TEMPLATE_POST_TYPE = 'wp_template';
24
- exports.TEMPLATE_POST_TYPE = TEMPLATE_POST_TYPE;
25
- const TEMPLATE_PART_POST_TYPE = 'wp_template_part';
26
- exports.TEMPLATE_PART_POST_TYPE = TEMPLATE_PART_POST_TYPE;
27
- const TEMPLATE_ORIGINS = {
22
+ const TEMPLATE_POST_TYPE = exports.TEMPLATE_POST_TYPE = 'wp_template';
23
+ const TEMPLATE_PART_POST_TYPE = exports.TEMPLATE_PART_POST_TYPE = 'wp_template_part';
24
+ const TEMPLATE_ORIGINS = exports.TEMPLATE_ORIGINS = {
28
25
  custom: 'custom',
29
26
  theme: 'theme',
30
27
  plugin: 'plugin'
31
28
  };
32
- exports.TEMPLATE_ORIGINS = TEMPLATE_ORIGINS;
33
- const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';
29
+ const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';
34
30
 
35
31
  // Patterns.
36
- exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = TEMPLATE_PART_AREA_DEFAULT_CATEGORY;
37
32
  const {
38
33
  PATTERN_TYPES,
39
34
  PATTERN_DEFAULT_CATEGORY,
@@ -48,9 +43,8 @@ exports.EXCLUDED_PATTERN_SOURCES = EXCLUDED_PATTERN_SOURCES;
48
43
  exports.PATTERN_USER_CATEGORY = PATTERN_USER_CATEGORY;
49
44
  exports.PATTERN_DEFAULT_CATEGORY = PATTERN_DEFAULT_CATEGORY;
50
45
  exports.PATTERN_TYPES = PATTERN_TYPES;
51
- const FOCUSABLE_ENTITIES = [TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user];
52
- exports.FOCUSABLE_ENTITIES = FOCUSABLE_ENTITIES;
53
- const POST_TYPE_LABELS = {
46
+ const FOCUSABLE_ENTITIES = exports.FOCUSABLE_ENTITIES = [TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user];
47
+ const POST_TYPE_LABELS = exports.POST_TYPE_LABELS = {
54
48
  [TEMPLATE_POST_TYPE]: (0, _i18n.__)('Template'),
55
49
  [TEMPLATE_PART_POST_TYPE]: (0, _i18n.__)('Template part'),
56
50
  [PATTERN_TYPES.user]: (0, _i18n.__)('Pattern'),
@@ -58,17 +52,10 @@ const POST_TYPE_LABELS = {
58
52
  };
59
53
 
60
54
  // DataViews constants
61
- exports.POST_TYPE_LABELS = POST_TYPE_LABELS;
62
- const LAYOUT_GRID = 'grid';
63
- exports.LAYOUT_GRID = LAYOUT_GRID;
64
- const LAYOUT_TABLE = 'table';
65
- exports.LAYOUT_TABLE = LAYOUT_TABLE;
66
- const LAYOUT_LIST = 'list';
67
- exports.LAYOUT_LIST = LAYOUT_LIST;
68
- const ENUMERATION_TYPE = 'enumeration';
69
- exports.ENUMERATION_TYPE = ENUMERATION_TYPE;
70
- const OPERATOR_IN = 'in';
71
- exports.OPERATOR_IN = OPERATOR_IN;
72
- const OPERATOR_NOT_IN = 'notIn';
73
- exports.OPERATOR_NOT_IN = OPERATOR_NOT_IN;
55
+ const LAYOUT_GRID = exports.LAYOUT_GRID = 'grid';
56
+ const LAYOUT_TABLE = exports.LAYOUT_TABLE = 'table';
57
+ const LAYOUT_LIST = exports.LAYOUT_LIST = 'list';
58
+ const ENUMERATION_TYPE = exports.ENUMERATION_TYPE = 'enumeration';
59
+ const OPERATOR_IN = exports.OPERATOR_IN = 'in';
60
+ const OPERATOR_NOT_IN = exports.OPERATOR_NOT_IN = 'notIn';
74
61
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_patterns","_lockUnlock","NAVIGATION_POST_TYPE","exports","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","EXCLUDED_PATTERN_SOURCES","PATTERN_SYNC_TYPES","unlock","patternPrivateApis","FOCUSABLE_ENTITIES","user","POST_TYPE_LABELS","__","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","ENUMERATION_TYPE","OPERATOR_IN","OPERATOR_NOT_IN"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n// Navigation\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\n\n// Templates.\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tEXCLUDED_PATTERN_SOURCES,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternPrivateApis );\n\n// Entities that are editable in focus mode.\nexport const FOCUSABLE_ENTITIES = [\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nexport const POST_TYPE_LABELS = {\n\t[ TEMPLATE_POST_TYPE ]: __( 'Template' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Template part' ),\n\t[ PATTERN_TYPES.user ]: __( 'Pattern' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Navigation' ),\n};\n\n// DataViews constants\nexport const LAYOUT_GRID = 'grid';\nexport const LAYOUT_TABLE = 'table';\nexport const LAYOUT_LIST = 'list';\nexport const ENUMERATION_TYPE = 'enumeration';\nexport const OPERATOR_IN = 'in';\nexport const OPERATOR_NOT_IN = 'notIn';\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACO,MAAMG,oBAAoB,GAAG,eAAe;;AAEnD;AAAAC,OAAA,CAAAD,oBAAA,GAAAA,oBAAA;AACO,MAAME,kBAAkB,GAAG,aAAa;AAACD,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AACzC,MAAMC,uBAAuB,GAAG,kBAAkB;AAACF,OAAA,CAAAE,uBAAA,GAAAA,uBAAA;AACnD,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AAACN,OAAA,CAAAG,gBAAA,GAAAA,gBAAA;AACK,MAAMI,mCAAmC,GAAG,eAAe;;AAElE;AAAAP,OAAA,CAAAO,mCAAA,GAAAA,mCAAA;AACO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,qBAAqB;EACrBC,wBAAwB;EACxBC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAmB,CAAC;;AAEhC;AAAAd,OAAA,CAAAY,kBAAA,GAAAA,kBAAA;AAAAZ,OAAA,CAAAW,wBAAA,GAAAA,wBAAA;AAAAX,OAAA,CAAAU,qBAAA,GAAAA,qBAAA;AAAAV,OAAA,CAAAS,wBAAA,GAAAA,wBAAA;AAAAT,OAAA,CAAAQ,aAAA,GAAAA,aAAA;AACO,MAAMO,kBAAkB,GAAG,CACjCb,uBAAuB,EACvBH,oBAAoB,EACpBS,aAAa,CAACQ,IAAI,CAClB;AAAChB,OAAA,CAAAe,kBAAA,GAAAA,kBAAA;AAEK,MAAME,gBAAgB,GAAG;EAC/B,CAAEhB,kBAAkB,GAAI,IAAAiB,QAAE,EAAE,UAAW,CAAC;EACxC,CAAEhB,uBAAuB,GAAI,IAAAgB,QAAE,EAAE,eAAgB,CAAC;EAClD,CAAEV,aAAa,CAACQ,IAAI,GAAI,IAAAE,QAAE,EAAE,SAAU,CAAC;EACvC,CAAEnB,oBAAoB,GAAI,IAAAmB,QAAE,EAAE,YAAa;AAC5C,CAAC;;AAED;AAAAlB,OAAA,CAAAiB,gBAAA,GAAAA,gBAAA;AACO,MAAME,WAAW,GAAG,MAAM;AAACnB,OAAA,CAAAmB,WAAA,GAAAA,WAAA;AAC3B,MAAMC,YAAY,GAAG,OAAO;AAACpB,OAAA,CAAAoB,YAAA,GAAAA,YAAA;AAC7B,MAAMC,WAAW,GAAG,MAAM;AAACrB,OAAA,CAAAqB,WAAA,GAAAA,WAAA;AAC3B,MAAMC,gBAAgB,GAAG,aAAa;AAACtB,OAAA,CAAAsB,gBAAA,GAAAA,gBAAA;AACvC,MAAMC,WAAW,GAAG,IAAI;AAACvB,OAAA,CAAAuB,WAAA,GAAAA,WAAA;AACzB,MAAMC,eAAe,GAAG,OAAO;AAACxB,OAAA,CAAAwB,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["_i18n","require","_patterns","_lockUnlock","NAVIGATION_POST_TYPE","exports","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","EXCLUDED_PATTERN_SOURCES","PATTERN_SYNC_TYPES","unlock","patternPrivateApis","FOCUSABLE_ENTITIES","user","POST_TYPE_LABELS","__","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","ENUMERATION_TYPE","OPERATOR_IN","OPERATOR_NOT_IN"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n// Navigation\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\n\n// Templates.\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tEXCLUDED_PATTERN_SOURCES,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternPrivateApis );\n\n// Entities that are editable in focus mode.\nexport const FOCUSABLE_ENTITIES = [\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nexport const POST_TYPE_LABELS = {\n\t[ TEMPLATE_POST_TYPE ]: __( 'Template' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Template part' ),\n\t[ PATTERN_TYPES.user ]: __( 'Pattern' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Navigation' ),\n};\n\n// DataViews constants\nexport const LAYOUT_GRID = 'grid';\nexport const LAYOUT_TABLE = 'table';\nexport const LAYOUT_LIST = 'list';\nexport const ENUMERATION_TYPE = 'enumeration';\nexport const OPERATOR_IN = 'in';\nexport const OPERATOR_NOT_IN = 'notIn';\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACO,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,eAAe;;AAEnD;AACO,MAAME,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,aAAa;AACxC,MAAMC,uBAAuB,GAAAF,OAAA,CAAAE,uBAAA,GAAG,kBAAkB;AAClD,MAAMC,gBAAgB,GAAAH,OAAA,CAAAG,gBAAA,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AACM,MAAMC,mCAAmC,GAAAP,OAAA,CAAAO,mCAAA,GAAG,eAAe;;AAElE;AACO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,qBAAqB;EACrBC,wBAAwB;EACxBC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAmB,CAAC;;AAEhC;AAAAd,OAAA,CAAAY,kBAAA,GAAAA,kBAAA;AAAAZ,OAAA,CAAAW,wBAAA,GAAAA,wBAAA;AAAAX,OAAA,CAAAU,qBAAA,GAAAA,qBAAA;AAAAV,OAAA,CAAAS,wBAAA,GAAAA,wBAAA;AAAAT,OAAA,CAAAQ,aAAA,GAAAA,aAAA;AACO,MAAMO,kBAAkB,GAAAf,OAAA,CAAAe,kBAAA,GAAG,CACjCb,uBAAuB,EACvBH,oBAAoB,EACpBS,aAAa,CAACQ,IAAI,CAClB;AAEM,MAAMC,gBAAgB,GAAAjB,OAAA,CAAAiB,gBAAA,GAAG;EAC/B,CAAEhB,kBAAkB,GAAI,IAAAiB,QAAE,EAAE,UAAW,CAAC;EACxC,CAAEhB,uBAAuB,GAAI,IAAAgB,QAAE,EAAE,eAAgB,CAAC;EAClD,CAAEV,aAAa,CAACQ,IAAI,GAAI,IAAAE,QAAE,EAAE,SAAU,CAAC;EACvC,CAAEnB,oBAAoB,GAAI,IAAAmB,QAAE,EAAE,YAAa;AAC5C,CAAC;;AAED;AACO,MAAMC,WAAW,GAAAnB,OAAA,CAAAmB,WAAA,GAAG,MAAM;AAC1B,MAAMC,YAAY,GAAApB,OAAA,CAAAoB,YAAA,GAAG,OAAO;AAC5B,MAAMC,WAAW,GAAArB,OAAA,CAAAqB,WAAA,GAAG,MAAM;AAC1B,MAAMC,gBAAgB,GAAAtB,OAAA,CAAAsB,gBAAA,GAAG,aAAa;AACtC,MAAMC,WAAW,GAAAvB,OAAA,CAAAuB,WAAA,GAAG,IAAI;AACxB,MAAMC,eAAe,GAAAxB,OAAA,CAAAwB,eAAA,GAAG,OAAO"}
@@ -12,13 +12,12 @@ import { useViewportMatch, useResizeObserver } from '@wordpress/compose';
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
- import BackButton from './back-button';
16
15
  import ResizableEditor from './resizable-editor';
17
16
  import EditorCanvas from './editor-canvas';
18
17
  import EditorCanvasContainer from '../editor-canvas-container';
19
18
  import useSiteEditorSettings from './use-site-editor-settings';
20
19
  import { store as editSiteStore } from '../../store';
21
- import { FOCUSABLE_ENTITIES, NAVIGATION_POST_TYPE } from '../../utils/constants';
20
+ import { FOCUSABLE_ENTITIES, NAVIGATION_POST_TYPE, TEMPLATE_POST_TYPE } from '../../utils/constants';
22
21
  import { unlock } from '../../lock-unlock';
23
22
  import { privateApis as routerPrivateApis } from '@wordpress/router';
24
23
  const {
@@ -48,7 +47,9 @@ export default function SiteEditorCanvas() {
48
47
  const isMobileViewport = useViewportMatch('small', '<');
49
48
  const enableResizing = isFocusMode && !isViewMode &&
50
49
  // Disable resizing in mobile viewport.
51
- !isMobileViewport;
50
+ !isMobileViewport &&
51
+ // Disable resizing when editing a template in focus mode.
52
+ templateType !== TEMPLATE_POST_TYPE;
52
53
  const isTemplateTypeNavigation = templateType === NAVIGATION_POST_TYPE;
53
54
  const isNavigationFocusMode = isTemplateTypeNavigation && isFocusMode;
54
55
  const forceFullHeight = isNavigationFocusMode;
@@ -59,7 +60,7 @@ export default function SiteEditorCanvas() {
59
60
  'is-focus-mode': isFocusMode || !!editorCanvasView,
60
61
  'is-view-mode': isViewMode
61
62
  })
62
- }, createElement(BackButton, null), createElement(ResizableEditor, {
63
+ }, createElement(ResizableEditor, {
63
64
  enableResizing: enableResizing,
64
65
  height: sizes.height && !forceFullHeight ? sizes.height : '100%'
65
66
  }, createElement(EditorCanvas, {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useSelect","useViewportMatch","useResizeObserver","BackButton","ResizableEditor","EditorCanvas","EditorCanvasContainer","useSiteEditorSettings","store","editSiteStore","FOCUSABLE_ENTITIES","NAVIGATION_POST_TYPE","unlock","privateApis","routerPrivateApis","useLocation","SiteEditorCanvas","location","templateType","isFocusableEntity","isViewMode","select","getEditedPostType","getCanvasMode","_templateType","includes","isFocusMode","params","focusMode","resizeObserver","sizes","settings","isMobileViewport","enableResizing","isTemplateTypeNavigation","isNavigationFocusMode","forceFullHeight","createElement","Slot","editorCanvasView","className","height"],"sources":["@wordpress/edit-site/src/components/block-editor/site-editor-canvas.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch, useResizeObserver } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BackButton from './back-button';\nimport ResizableEditor from './resizable-editor';\nimport EditorCanvas from './editor-canvas';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport useSiteEditorSettings from './use-site-editor-settings';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tFOCUSABLE_ENTITIES,\n\tNAVIGATION_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SiteEditorCanvas() {\n\tconst location = useLocation();\n\tconst { templateType, isFocusableEntity, isViewMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\tconst _templateType = getEditedPostType();\n\n\t\t\treturn {\n\t\t\t\ttemplateType: _templateType,\n\t\t\t\tisFocusableEntity: FOCUSABLE_ENTITIES.includes( _templateType ),\n\t\t\t\tisViewMode: getCanvasMode() === 'view',\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst isFocusMode = location.params.focusMode || isFocusableEntity;\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\n\tconst settings = useSiteEditorSettings();\n\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst enableResizing =\n\t\tisFocusMode &&\n\t\t! isViewMode &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport;\n\n\tconst isTemplateTypeNavigation = templateType === NAVIGATION_POST_TYPE;\n\tconst isNavigationFocusMode = isTemplateTypeNavigation && isFocusMode;\n\tconst forceFullHeight = isNavigationFocusMode;\n\n\treturn (\n\t\t<EditorCanvasContainer.Slot>\n\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t<div className=\"edit-site-visual-editor is-focus-mode\">\n\t\t\t\t\t\t{ editorCanvasView }\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames( 'edit-site-visual-editor', {\n\t\t\t\t\t\t\t'is-focus-mode': isFocusMode || !! editorCanvasView,\n\t\t\t\t\t\t\t'is-view-mode': isViewMode,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BackButton />\n\t\t\t\t\t\t<ResizableEditor\n\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\theight={\n\t\t\t\t\t\t\t\tsizes.height && ! forceFullHeight\n\t\t\t\t\t\t\t\t\t? sizes.height\n\t\t\t\t\t\t\t\t\t: '100%'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EditorCanvas\n\t\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ resizeObserver }\n\t\t\t\t\t\t\t</EditorCanvas>\n\t\t\t\t\t\t</ResizableEditor>\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t</EditorCanvasContainer.Slot>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AACnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,oBAAoB;;AAExE;AACA;AACA;AACA,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SACCC,kBAAkB,EAClBC,oBAAoB,QACd,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AAEpE,MAAM;EAAEC;AAAY,CAAC,GAAGH,MAAM,CAAEE,iBAAkB,CAAC;AAEnD,eAAe,SAASE,gBAAgBA,CAAA,EAAG;EAC1C,MAAMC,QAAQ,GAAGF,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEG,YAAY;IAAEC,iBAAiB;IAAEC;EAAW,CAAC,GAAGpB,S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A,cAAgB;IACjCQ,MAAM,EACLX,KAAK,CAACW,MAAM,IAAI,CAAEL,eAAe,GAC9BN,KAAK,CAACW,MAAM,GACZ;EACH,GAEDJ,aAAA,CAAChC,YAAY;IACZ4B,cAAc,EAAGA,cAAgB;IACjCF,QAAQ,EAAGA;EAAU,GAEnBF,cACW,CACE,CACb,CAGoB,CAAC;AAE/B"}
1
+ {"version":3,"names":["classnames","useSelect","useViewportMatch","useResizeObserver","ResizableEditor","EditorCanvas","EditorCanvasContainer","useSiteEditorSettings","store","editSiteStore","FOCUSABLE_ENTITIES","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","unlock","privateApis","routerPrivateApis","useLocation","SiteEditorCanvas","location","templateType","isFocusableEntity","isViewMode","select","getEditedPostType","getCanvasMode","_templateType","includes","isFocusMode","params","focusMode","resizeObserver","sizes","settings","isMobileViewport","enableResizing","isTemplateTypeNavigation","isNavigationFocusMode","forceFullHeight","createElement","Slot","editorCanvasView","className","height"],"sources":["@wordpress/edit-site/src/components/block-editor/site-editor-canvas.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useViewportMatch, useResizeObserver } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport ResizableEditor from './resizable-editor';\nimport EditorCanvas from './editor-canvas';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport useSiteEditorSettings from './use-site-editor-settings';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tFOCUSABLE_ENTITIES,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SiteEditorCanvas() {\n\tconst location = useLocation();\n\tconst { templateType, isFocusableEntity, isViewMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\tconst _templateType = getEditedPostType();\n\n\t\t\treturn {\n\t\t\t\ttemplateType: _templateType,\n\t\t\t\tisFocusableEntity: FOCUSABLE_ENTITIES.includes( _templateType ),\n\t\t\t\tisViewMode: getCanvasMode() === 'view',\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst isFocusMode = location.params.focusMode || isFocusableEntity;\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\n\tconst settings = useSiteEditorSettings();\n\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst enableResizing =\n\t\tisFocusMode &&\n\t\t! isViewMode &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Disable resizing when editing a template in focus mode.\n\t\ttemplateType !== TEMPLATE_POST_TYPE;\n\n\tconst isTemplateTypeNavigation = templateType === NAVIGATION_POST_TYPE;\n\tconst isNavigationFocusMode = isTemplateTypeNavigation && isFocusMode;\n\tconst forceFullHeight = isNavigationFocusMode;\n\n\treturn (\n\t\t<EditorCanvasContainer.Slot>\n\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t<div className=\"edit-site-visual-editor is-focus-mode\">\n\t\t\t\t\t\t{ editorCanvasView }\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames( 'edit-site-visual-editor', {\n\t\t\t\t\t\t\t'is-focus-mode': isFocusMode || !! editorCanvasView,\n\t\t\t\t\t\t\t'is-view-mode': isViewMode,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ResizableEditor\n\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\theight={\n\t\t\t\t\t\t\t\tsizes.height && ! forceFullHeight\n\t\t\t\t\t\t\t\t\t? sizes.height\n\t\t\t\t\t\t\t\t\t: '100%'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EditorCanvas\n\t\t\t\t\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ resizeObserver }\n\t\t\t\t\t\t\t</EditorCanvas>\n\t\t\t\t\t\t</ResizableEditor>\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t</EditorCanvasContainer.Slot>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AACnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,oBAAoB;;AAExE;AACA;AACA;AACA,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SACCC,kBAAkB,EAClBC,oBAAoB,EACpBC,kBAAkB,QACZ,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AAEpE,MAAM;EAAEC;AAAY,CAAC,GAAGH,MAAM,CAAEE,iBAAkB,CAAC;AAEnD,eAAe,SAASE,gBAAgBA,CAAA,EAAG;EAC1C,MAAMC,QAAQ,GAAGF,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEG,YAAY;IAAEC,iBAAiB;IAAEC;EAAW,CAAC,GAAGpB,SAAS,CAC9DqB,MAAM,IAAM;IACb,MAAM;MAAEC,iBAAiB;MAAEC;IAAc,CAAC,GAAGX,MAAM,CAClDS,MAAM,CAAEb,aAAc,CACvB,CAAC;IAED,MAAMgB,aAAa,GAAGF,iBAAiB,CAA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jCF,QAAQ,EAAGA;EAAU,GAEnBF,cACW,CACE,CACb,CAGoB,CAAC;AAE/B"}
@@ -2,23 +2,24 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { privateApis as routerPrivateApis } from '@wordpress/router';
5
+ import { useCallback } from '@wordpress/element';
5
6
 
6
7
  /**
7
8
  * Internal dependencies
8
9
  */
9
10
  import { unlock } from '../../lock-unlock';
10
- import { getPostLinkProps } from '../routes/link';
11
11
  const {
12
12
  useHistory
13
13
  } = unlock(routerPrivateApis);
14
- export function usePostLinkProps() {
14
+ export default function useNavigateToEntityRecord() {
15
15
  const history = useHistory();
16
- return (params, state) => {
17
- return getPostLinkProps(history, {
16
+ const onNavigateToEntityRecord = useCallback(params => {
17
+ history.push({
18
18
  ...params,
19
19
  focusMode: true,
20
20
  canvas: 'edit'
21
- }, state);
22
- };
21
+ });
22
+ }, [history]);
23
+ return onNavigateToEntityRecord;
23
24
  }
24
- //# sourceMappingURL=use-post-link-props.js.map
25
+ //# sourceMappingURL=use-navigate-to-entity-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["privateApis","routerPrivateApis","useCallback","unlock","useHistory","useNavigateToEntityRecord","history","onNavigateToEntityRecord","params","push","focusMode","canvas"],"sources":["@wordpress/edit-site/src/components/block-editor/use-navigate-to-entity-record.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function useNavigateToEntityRecord() {\n\tconst history = useHistory();\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params ) => {\n\t\t\thistory.push( { ...params, focusMode: true, canvas: 'edit' } );\n\t\t},\n\t\t[ history ]\n\t);\n\n\treturn onNavigateToEntityRecord;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAW,CAAC,GAAGD,MAAM,CAAEF,iBAAkB,CAAC;AAElD,eAAe,SAASI,yBAAyBA,CAAA,EAAG;EACnD,MAAMC,OAAO,GAAGF,UAAU,CAAC,CAAC;EAE5B,MAAMG,wBAAwB,GAAGL,WAAW,CACzCM,MAAM,IAAM;IACbF,OAAO,CAACG,IAAI,CAAE;MAAE,GAAGD,MAAM;MAAEE,SAAS,EAAE,IAAI;MAAEC,MAAM,EAAE;IAAO,CAAE,CAAC;EAC/D,CAAC,EACD,CAAEL,OAAO,CACV,CAAC;EAED,OAAOC,wBAAwB;AAChC"}
@@ -5,16 +5,23 @@ import { useSelect } from '@wordpress/data';
5
5
  import { useMemo } from '@wordpress/element';
6
6
  import { store as coreStore } from '@wordpress/core-data';
7
7
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
8
+ import { privateApis as routerPrivateApis } from '@wordpress/router';
9
+ import { usePrevious } from '@wordpress/compose';
8
10
 
9
11
  /**
10
12
  * Internal dependencies
11
13
  */
12
14
  import { store as editSiteStore } from '../../store';
13
15
  import { unlock } from '../../lock-unlock';
14
- import { usePostLinkProps } from './use-post-link-props';
16
+ import useNavigateToEntityRecord from './use-navigate-to-entity-record';
17
+ import { FOCUSABLE_ENTITIES } from '../../utils/constants';
15
18
  const {
16
19
  useBlockEditorSettings
17
20
  } = unlock(editorPrivateApis);
21
+ const {
22
+ useLocation,
23
+ useHistory
24
+ } = unlock(routerPrivateApis);
18
25
  function useArchiveLabel(templateSlug) {
19
26
  const taxonomyMatches = templateSlug?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/);
20
27
  let taxonomy;
@@ -81,8 +88,24 @@ function useArchiveLabel(templateSlug) {
81
88
  };
82
89
  }, [authorSlug, isAuthor, taxonomy, term]);
83
90
  }
91
+ function useNavigateToPreviousEntityRecord() {
92
+ const location = useLocation();
93
+ const previousLocation = usePrevious(location);
94
+ const history = useHistory();
95
+ const goBack = useMemo(() => {
96
+ const isFocusMode = location.params.focusMode || location.params.postId && FOCUSABLE_ENTITIES.includes(location.params.postType);
97
+ const didComeFromEditorCanvas = previousLocation?.params.postId && previousLocation?.params.postType && previousLocation?.params.canvas === 'edit';
98
+ const showBackButton = isFocusMode && didComeFromEditorCanvas;
99
+ return showBackButton ? () => history.back() : undefined;
100
+ // Disable reason: previousLocation changes when the component updates for any reason, not
101
+ // just when location changes. Until this is fixed we can't add it to deps. See
102
+ // https://github.com/WordPress/gutenberg/pull/58710#discussion_r1479219465.
103
+ // eslint-disable-next-line react-hooks/exhaustive-deps
104
+ }, [location, history]);
105
+ return goBack;
106
+ }
84
107
  export function useSpecificEditorSettings() {
85
- const getPostLinkProps = usePostLinkProps();
108
+ const onNavigateToEntityRecord = useNavigateToEntityRecord();
86
109
  const {
87
110
  templateSlug,
88
111
  canvasMode,
@@ -112,6 +135,7 @@ export function useSpecificEditorSettings() {
112
135
  }, []);
113
136
  const archiveLabels = useArchiveLabel(templateSlug);
114
137
  const defaultRenderingMode = postWithTemplate ? 'template-locked' : 'all';
138
+ const onNavigateToPreviousEntityRecord = useNavigateToPreviousEntityRecord();
115
139
  const defaultEditorSettings = useMemo(() => {
116
140
  return {
117
141
  ...settings,
@@ -119,12 +143,13 @@ export function useSpecificEditorSettings() {
119
143
  supportsTemplateMode: true,
120
144
  focusMode: canvasMode !== 'view',
121
145
  defaultRenderingMode,
122
- getPostLinkProps,
146
+ onNavigateToEntityRecord,
147
+ onNavigateToPreviousEntityRecord,
123
148
  // I wonder if they should be set in the post editor too
124
149
  __experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,
125
150
  __experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel
126
151
  };
127
- }, [settings, canvasMode, defaultRenderingMode, getPostLinkProps, archiveLabels.archiveTypeLabel, archiveLabels.archiveNameLabel]);
152
+ }, [settings, canvasMode, defaultRenderingMode, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, archiveLabels.archiveTypeLabel, archiveLabels.archiveNameLabel]);
128
153
  return defaultEditorSettings;
129
154
  }
130
155
  export default function useSiteEditorSettings() {
@@ -1 +1 @@
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,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,MAAM;EAAEC;AAAuB,CAAC,GAAGF,MAAM,CAAEF,iBAAkB,CAAC;AAE9D,SAASK,eAAeA,CAAEC,YAAY,EAAG;EACxC,MAAMC,eAAe,GAAGD,YAAY,EAAEE,KAAK,CAC1C,8EACD,CAAC;EACD,IAAIC,QAAQ;EACZ,IAAIC,IAAI;EACR,IAAIC,QAAQ,GAAG,KAAK;EACpB,IAAIC,UAAU;EACd,IAAKL,eAAe,EAAG;IACtB;IACA,IAAKA,eAAe,CAAE,CAAC,CAAE,E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ACD,MAAMC,aAAa,GAAGtC,eAAe,CAAEC,YAAa,CAAC;EACrD,MAAMsC,oBAAoB,GAAGb,gBAAgB,GAAG,iBAAiB,GAAG,KAAK;EACzE,MAAMc,qBAAqB,GAAGjD,OAAO,CAAE,MAAM;IAC5C,OAAO;MACN,GAAGkC,QAAQ;MAEXgB,kBAAkB,EAAE,IAAI;MACxBC,oBAAoB,EAAE,IAAI;MAC1BC,SAAS,EAAEnB,UAAU,KAAK,MAAM;MAChCe,oBAAoB;MACpBhB,gBAAgB;MAChB;MACAqB,mCAAmC,EAAEN,aAAa,CAACzB,gBAAgB;MACnEgC,mCAAmC,EAAEP,aAAa,CAACxB;IACpD,CAAC;EACF,CAAC,EAAE,CACFW,QAAQ,EACRD,UAAU,EACVe,oBAAoB,EACpBhB,gBAAgB,EAChBe,aAAa,CAACzB,gBAAgB,EAC9ByB,aAAa,CAACxB,gBAAgB,CAC7B,CAAC;EAEH,OAAO0B,qBAAqB;AAC7B;AAEA,eAAe,SAASM,qBAAqBA,CAAA,EAAG;EAC/C,MAAMN,qBAAqB,GAAGlB,yBAAyB,CAAC,CAAC;EACzD,MAAM;IAAEyB,QAAQ;IAAEV;EAAO,CAAC,GAAG/C,SAAS,CAAImB,MAAM,IAAM;IACrD,MAAM;MAAEkB,iBAAiB;MAAEC;IAAgB,CAAC,GAAG/B,MAAM,CACpDY,MAAM,CAAEb,aAAc,CACvB,CAAC;IACD,MAAMqC,YAAY,GAAGN,iBAAiB,CAAC,CAAC;IACxC,MAAMO,UAAU,GAAGN,eAAe,CAAC,CAAC;IACpC,OAAO;MACNmB,QAAQ,EAAEd,YAAY;MACtBI,MAAM,EAAEH;IACT,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OAAOnC,sBAAsB,CAAEyC,qBAAqB,EAAEO,QAAQ,EAAEV,MAAO,CAAC;AACzE"}
1
+ {"version":3,"names":["useSelect","useMemo","store","coreStore","privateApis","editorPrivateApis","routerPrivateApis","usePrevious","editSiteStore","unlock","useNavigateToEntityRecord","FOCUSABLE_ENTITIES","useBlockEditorSettings","useLocation","useHistory","useArchiveLabel","templateSlug","taxonomyMatches","match","taxonomy","term","isAuthor","authorSlug","authorMatches","select","getEntityRecords","getTaxonomy","getAuthors","archiveTypeLabel","archiveNameLabel","labels","singular_name","records","slug","per_page","name","authorRecords","useNavigateToPreviousEntityRecord","location","previousLocation","history","goBack","isFocusMode","params","focusMode","postId","includes","postType","didComeFromEditorCanvas","canvas","showBackButton","back","undefined","useSpecificEditorSettings","onNavigateToEntityRecord","canvasMode","settings","postWithTemplate","getEditedPostType","getEditedPostId","getEditedPostContext","getCanvasMode","getSettings","getEditedEntityRecord","usedPostType","usedPostId","_record","_context","archiveLabels","defaultRenderingMode","onNavigateToPreviousEntityRecord","defaultEditorSettings","richEditingEnabled","supportsTemplateMode","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel","useSiteEditorSettings"],"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';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useNavigateToEntityRecord from './use-navigate-to-entity-record';\nimport { FOCUSABLE_ENTITIES } from '../../utils/constants';\n\nconst { useBlockEditorSettings } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\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\nfunction useNavigateToPreviousEntityRecord() {\n\tconst location = useLocation();\n\tconst previousLocation = usePrevious( location );\n\tconst history = useHistory();\n\tconst goBack = useMemo( () => {\n\t\tconst isFocusMode =\n\t\t\tlocation.params.focusMode ||\n\t\t\t( location.params.postId &&\n\t\t\t\tFOCUSABLE_ENTITIES.includes( location.params.postType ) );\n\t\tconst didComeFromEditorCanvas =\n\t\t\tpreviousLocation?.params.postId &&\n\t\t\tpreviousLocation?.params.postType &&\n\t\t\tpreviousLocation?.params.canvas === 'edit';\n\t\tconst showBackButton = isFocusMode && didComeFromEditorCanvas;\n\t\treturn showBackButton ? () => history.back() : undefined;\n\t\t// Disable reason: previousLocation changes when the component updates for any reason, not\n\t\t// just when location changes. Until this is fixed we can't add it to deps. See\n\t\t// https://github.com/WordPress/gutenberg/pull/58710#discussion_r1479219465.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ location, history ] );\n\treturn goBack;\n}\n\nexport function useSpecificEditorSettings() {\n\tconst onNavigateToEntityRecord = useNavigateToEntityRecord();\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 onNavigateToPreviousEntityRecord =\n\t\tuseNavigateToPreviousEntityRecord();\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\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\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\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\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\tp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BA,CAAA,EAAG;EAC/C,MAAML,qBAAqB,GAAGlB,yBAAyB,CAAC,CAAC;EACzD,MAAM;IAAEN,QAAQ;IAAEF;EAAO,CAAC,GAAG7C,SAAS,CAAIwB,MAAM,IAAM;IACrD,MAAM;MAAEkC,iBAAiB;MAAEC;IAAgB,CAAC,GAAGlD,MAAM,CACpDe,MAAM,CAAEhB,aAAc,CACvB,CAAC;IACD,MAAMwD,YAAY,GAAGN,iBAAiB,CAAC,CAAC;IACxC,MAAMO,UAAU,GAAGN,eAAe,CAAC,CAAC;IACpC,OAAO;MACNZ,QAAQ,EAAEiB,YAAY;MACtBnB,MAAM,EAAEoB;IACT,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OAAOrD,sBAAsB,CAAE2D,qBAAqB,EAAExB,QAAQ,EAAEF,MAAO,CAAC;AACzE"}
@@ -60,7 +60,8 @@ const interfaceLabels = {
60
60
  const blockRemovalRules = {
61
61
  'core/query': __('Query Loop displays a list of posts or pages.'),
62
62
  'core/post-content': __('Post Content displays the content of a post or page.'),
63
- 'core/post-template': __('Post Template displays each post or page in a Query Loop.')
63
+ 'core/post-template': __('Post Template displays each post or page in a Query Loop.'),
64
+ 'bindings/core/pattern-overrides': __('Blocks from synced patterns that can have overriden content.')
64
65
  };
65
66
  export default function Editor({
66
67
  isLoading
@@ -83,6 +84,7 @@ export default function Editor({
83
84
  isRightSidebarOpen,
84
85
  isInserterOpen,
85
86
  isListViewOpen,
87
+ isDistractionFree,
86
88
  showIconLabels,
87
89
  showBlockBreadcrumbs,
88
90
  postTypeLabel
@@ -122,6 +124,7 @@ export default function Editor({
122
124
  isInserterOpen: isInserterOpened(),
123
125
  isListViewOpen: isListViewOpened(),
124
126
  isRightSidebarOpen: getActiveComplementaryArea(editSiteStore.name),
127
+ isDistractionFree: get('core', 'distractionFree'),
125
128
  showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
126
129
  showIconLabels: get('core', 'showIconLabels'),
127
130
  postTypeLabel: getPostTypeLabel()
@@ -130,7 +133,7 @@ export default function Editor({
130
133
  const isViewMode = canvasMode === 'view';
131
134
  const isEditMode = canvasMode === 'edit';
132
135
  const showVisualEditor = isViewMode || editorMode === 'visual';
133
- const shouldShowBlockBreadcrumbs = showBlockBreadcrumbs && isEditMode && showVisualEditor && blockEditorMode !== 'zoom-out';
136
+ const shouldShowBlockBreadcrumbs = !isDistractionFree && showBlockBreadcrumbs && isEditMode && showVisualEditor && blockEditorMode !== 'zoom-out';
134
137
  const shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;
135
138
  const shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;
136
139
  const secondarySidebarLabel = isListViewOpen ? __('List View') : __('Block Library');
@@ -160,7 +163,7 @@ export default function Editor({
160
163
  settings: settings,
161
164
  useSubRegistry: false
162
165
  }, createElement(SidebarComplementaryAreaFills, null), isEditMode && createElement(StartTemplateOptions, null), createElement(InterfaceSkeleton, {
163
- isDistractionFree: true,
166
+ isDistractionFree: isDistractionFree,
164
167
  enableRegionNavigation: false,
165
168
  className: classnames('edit-site-editor__interface-skeleton', {
166
169
  'show-icon-labels': showIconLabels