@wordpress/editor 14.3.0 → 14.4.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 (400) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -1
  3. package/build/bindings/api.js +65 -0
  4. package/build/bindings/api.js.map +1 -0
  5. package/build/bindings/pattern-overrides.js +23 -13
  6. package/build/bindings/pattern-overrides.js.map +1 -1
  7. package/build/bindings/post-meta.js +23 -12
  8. package/build/bindings/post-meta.js.map +1 -1
  9. package/build/components/block-settings-menu/content-only-settings-menu.js +4 -1
  10. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  11. package/build/components/blog-title/index.js +6 -2
  12. package/build/components/blog-title/index.js.map +1 -1
  13. package/build/components/collapsible-block-toolbar/index.js +2 -3
  14. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  15. package/build/components/global-styles-provider/index.js +15 -3
  16. package/build/components/global-styles-provider/index.js.map +1 -1
  17. package/build/components/header/back-button.js +7 -8
  18. package/build/components/header/back-button.js.map +1 -1
  19. package/build/components/header/index.js +19 -17
  20. package/build/components/header/index.js.map +1 -1
  21. package/build/components/page-attributes/order.js +1 -67
  22. package/build/components/page-attributes/order.js.map +1 -1
  23. package/build/components/page-attributes/panel.js +1 -4
  24. package/build/components/page-attributes/panel.js.map +1 -1
  25. package/build/components/post-actions/actions.js +126 -33
  26. package/build/components/post-actions/actions.js.map +1 -1
  27. package/build/components/post-card-panel/index.js +8 -2
  28. package/build/components/post-card-panel/index.js.map +1 -1
  29. package/build/components/post-comments/index.js +1 -1
  30. package/build/components/post-comments/index.js.map +1 -1
  31. package/build/components/post-content-information/index.js +7 -1
  32. package/build/components/post-content-information/index.js.map +1 -1
  33. package/build/components/post-discussion/panel.js +2 -2
  34. package/build/components/post-discussion/panel.js.map +1 -1
  35. package/build/components/post-excerpt/panel.js +1 -1
  36. package/build/components/post-excerpt/panel.js.map +1 -1
  37. package/build/components/post-featured-image/index.js +3 -1
  38. package/build/components/post-featured-image/index.js.map +1 -1
  39. package/build/components/post-last-revision/index.js +2 -1
  40. package/build/components/post-last-revision/index.js.map +1 -1
  41. package/build/components/post-publish-button/index.js +4 -11
  42. package/build/components/post-publish-button/index.js.map +1 -1
  43. package/build/components/post-publish-panel/maybe-category-panel.js +4 -1
  44. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  45. package/build/components/post-publish-panel/maybe-tags-panel.js +2 -1
  46. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  47. package/build/components/post-status/index.js +30 -10
  48. package/build/components/post-status/index.js.map +1 -1
  49. package/build/components/post-taxonomies/flat-term-selector.js +17 -6
  50. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  51. package/build/components/post-taxonomies/index.js +7 -1
  52. package/build/components/post-taxonomies/index.js.map +1 -1
  53. package/build/components/post-template/block-theme.js +4 -4
  54. package/build/components/post-template/block-theme.js.map +1 -1
  55. package/build/components/post-template/classic-theme.js +8 -2
  56. package/build/components/post-template/classic-theme.js.map +1 -1
  57. package/build/components/post-template/create-new-template.js +4 -1
  58. package/build/components/post-template/create-new-template.js.map +1 -1
  59. package/build/components/post-template/hooks.js +5 -1
  60. package/build/components/post-template/hooks.js.map +1 -1
  61. package/build/components/post-template/panel.js +8 -2
  62. package/build/components/post-template/panel.js.map +1 -1
  63. package/build/components/post-trash/check.js +6 -4
  64. package/build/components/post-trash/check.js.map +1 -1
  65. package/build/components/post-url/panel.js +6 -2
  66. package/build/components/post-url/panel.js.map +1 -1
  67. package/build/components/posts-per-page/index.js +6 -2
  68. package/build/components/posts-per-page/index.js.map +1 -1
  69. package/build/components/provider/use-block-editor-settings.js +15 -6
  70. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  71. package/build/components/save-publish-panels/index.js +1 -2
  72. package/build/components/save-publish-panels/index.js.map +1 -1
  73. package/build/components/sidebar/index.js +3 -9
  74. package/build/components/sidebar/index.js.map +1 -1
  75. package/build/components/site-discussion/index.js +7 -3
  76. package/build/components/site-discussion/index.js.map +1 -1
  77. package/build/components/template-content-panel/index.js +5 -5
  78. package/build/components/template-content-panel/index.js.map +1 -1
  79. package/build/components/visual-editor/edit-template-blocks-notification.js +4 -4
  80. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  81. package/build/components/visual-editor/index.js +5 -2
  82. package/build/components/visual-editor/index.js.map +1 -1
  83. package/build/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  84. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
  85. package/build/dataviews/actions/delete-post.js +2 -0
  86. package/build/dataviews/actions/delete-post.js.map +1 -1
  87. package/build/hooks/pattern-overrides.js +1 -1
  88. package/build/hooks/pattern-overrides.js.map +1 -1
  89. package/build/index.js +0 -1
  90. package/build/index.js.map +1 -1
  91. package/build/private-apis.js +3 -0
  92. package/build/private-apis.js.map +1 -1
  93. package/build/utils/media-upload/index.js +35 -2
  94. package/build/utils/media-upload/index.js.map +1 -1
  95. package/build-module/bindings/api.js +57 -0
  96. package/build-module/bindings/api.js.map +1 -0
  97. package/build-module/bindings/pattern-overrides.js +23 -13
  98. package/build-module/bindings/pattern-overrides.js.map +1 -1
  99. package/build-module/bindings/post-meta.js +23 -12
  100. package/build-module/bindings/post-meta.js.map +1 -1
  101. package/build-module/components/block-settings-menu/content-only-settings-menu.js +4 -1
  102. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  103. package/build-module/components/blog-title/index.js +6 -2
  104. package/build-module/components/blog-title/index.js.map +1 -1
  105. package/build-module/components/collapsible-block-toolbar/index.js +1 -2
  106. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  107. package/build-module/components/global-styles-provider/index.js +15 -3
  108. package/build-module/components/global-styles-provider/index.js.map +1 -1
  109. package/build-module/components/header/back-button.js +5 -7
  110. package/build-module/components/header/back-button.js.map +1 -1
  111. package/build-module/components/header/index.js +19 -19
  112. package/build-module/components/header/index.js.map +1 -1
  113. package/build-module/components/page-attributes/order.js +4 -70
  114. package/build-module/components/page-attributes/order.js.map +1 -1
  115. package/build-module/components/page-attributes/panel.js +1 -6
  116. package/build-module/components/page-attributes/panel.js.map +1 -1
  117. package/build-module/components/post-actions/actions.js +127 -34
  118. package/build-module/components/post-actions/actions.js.map +1 -1
  119. package/build-module/components/post-card-panel/index.js +8 -2
  120. package/build-module/components/post-card-panel/index.js.map +1 -1
  121. package/build-module/components/post-comments/index.js +2 -2
  122. package/build-module/components/post-comments/index.js.map +1 -1
  123. package/build-module/components/post-content-information/index.js +7 -1
  124. package/build-module/components/post-content-information/index.js.map +1 -1
  125. package/build-module/components/post-discussion/panel.js +3 -3
  126. package/build-module/components/post-discussion/panel.js.map +1 -1
  127. package/build-module/components/post-excerpt/panel.js +1 -1
  128. package/build-module/components/post-excerpt/panel.js.map +1 -1
  129. package/build-module/components/post-featured-image/index.js +3 -1
  130. package/build-module/components/post-featured-image/index.js.map +1 -1
  131. package/build-module/components/post-last-revision/index.js +2 -1
  132. package/build-module/components/post-last-revision/index.js.map +1 -1
  133. package/build-module/components/post-publish-button/index.js +4 -11
  134. package/build-module/components/post-publish-button/index.js.map +1 -1
  135. package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -1
  136. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  137. package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -1
  138. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  139. package/build-module/components/post-status/index.js +30 -10
  140. package/build-module/components/post-status/index.js.map +1 -1
  141. package/build-module/components/post-taxonomies/flat-term-selector.js +17 -6
  142. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  143. package/build-module/components/post-taxonomies/index.js +7 -1
  144. package/build-module/components/post-taxonomies/index.js.map +1 -1
  145. package/build-module/components/post-template/block-theme.js +4 -4
  146. package/build-module/components/post-template/block-theme.js.map +1 -1
  147. package/build-module/components/post-template/classic-theme.js +8 -2
  148. package/build-module/components/post-template/classic-theme.js.map +1 -1
  149. package/build-module/components/post-template/create-new-template.js +4 -1
  150. package/build-module/components/post-template/create-new-template.js.map +1 -1
  151. package/build-module/components/post-template/hooks.js +5 -1
  152. package/build-module/components/post-template/hooks.js.map +1 -1
  153. package/build-module/components/post-template/panel.js +8 -2
  154. package/build-module/components/post-template/panel.js.map +1 -1
  155. package/build-module/components/post-trash/check.js +6 -4
  156. package/build-module/components/post-trash/check.js.map +1 -1
  157. package/build-module/components/post-url/panel.js +6 -2
  158. package/build-module/components/post-url/panel.js.map +1 -1
  159. package/build-module/components/posts-per-page/index.js +6 -2
  160. package/build-module/components/posts-per-page/index.js.map +1 -1
  161. package/build-module/components/provider/use-block-editor-settings.js +15 -6
  162. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  163. package/build-module/components/save-publish-panels/index.js +1 -2
  164. package/build-module/components/save-publish-panels/index.js.map +1 -1
  165. package/build-module/components/sidebar/index.js +3 -9
  166. package/build-module/components/sidebar/index.js.map +1 -1
  167. package/build-module/components/site-discussion/index.js +8 -4
  168. package/build-module/components/site-discussion/index.js.map +1 -1
  169. package/build-module/components/template-content-panel/index.js +5 -5
  170. package/build-module/components/template-content-panel/index.js.map +1 -1
  171. package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -4
  172. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  173. package/build-module/components/visual-editor/index.js +5 -2
  174. package/build-module/components/visual-editor/index.js.map +1 -1
  175. package/build-module/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  176. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
  177. package/build-module/dataviews/actions/delete-post.js +2 -0
  178. package/build-module/dataviews/actions/delete-post.js.map +1 -1
  179. package/build-module/hooks/pattern-overrides.js +1 -1
  180. package/build-module/hooks/pattern-overrides.js.map +1 -1
  181. package/build-module/index.js +0 -1
  182. package/build-module/index.js.map +1 -1
  183. package/build-module/private-apis.js +3 -0
  184. package/build-module/private-apis.js.map +1 -1
  185. package/build-module/utils/media-upload/index.js +36 -3
  186. package/build-module/utils/media-upload/index.js.map +1 -1
  187. package/build-style/style-rtl.css +78 -42
  188. package/build-style/style.css +78 -42
  189. package/build-types/bindings/api.d.ts +25 -0
  190. package/build-types/bindings/api.d.ts.map +1 -0
  191. package/build-types/bindings/pattern-overrides.d.ts +5 -6
  192. package/build-types/bindings/pattern-overrides.d.ts.map +1 -1
  193. package/build-types/bindings/post-meta.d.ts +5 -7
  194. package/build-types/bindings/post-meta.d.ts.map +1 -1
  195. package/build-types/components/autocompleters/user.d.ts +2 -2
  196. package/build-types/components/autocompleters/user.d.ts.map +1 -1
  197. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
  198. package/build-types/components/blog-title/index.d.ts.map +1 -1
  199. package/build-types/components/collapsible-block-toolbar/index.d.ts +1 -2
  200. package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -1
  201. package/build-types/components/document-bar/index.d.ts.map +1 -1
  202. package/build-types/components/document-outline/check.d.ts.map +1 -1
  203. package/build-types/components/document-outline/index.d.ts.map +1 -1
  204. package/build-types/components/editor-history/redo.d.ts +1 -1
  205. package/build-types/components/editor-history/undo.d.ts +1 -1
  206. package/build-types/components/editor-notices/index.d.ts.map +1 -1
  207. package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
  208. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  209. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  210. package/build-types/components/header/back-button.d.ts +1 -0
  211. package/build-types/components/header/back-button.d.ts.map +1 -1
  212. package/build-types/components/header/index.d.ts.map +1 -1
  213. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
  214. package/build-types/components/media-categories/index.d.ts.map +1 -1
  215. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  216. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  217. package/build-types/components/page-attributes/check.d.ts.map +1 -1
  218. package/build-types/components/page-attributes/order.d.ts +1 -1
  219. package/build-types/components/page-attributes/order.d.ts.map +1 -1
  220. package/build-types/components/page-attributes/panel.d.ts.map +1 -1
  221. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  222. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  223. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  224. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  225. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  226. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  227. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
  228. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  229. package/build-types/components/post-author/check.d.ts.map +1 -1
  230. package/build-types/components/post-author/index.d.ts.map +1 -1
  231. package/build-types/components/post-author/panel.d.ts.map +1 -1
  232. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  233. package/build-types/components/post-content-information/index.d.ts.map +1 -1
  234. package/build-types/components/post-discussion/panel.d.ts.map +1 -1
  235. package/build-types/components/post-excerpt/check.d.ts.map +1 -1
  236. package/build-types/components/post-excerpt/index.d.ts.map +1 -1
  237. package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
  238. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  239. package/build-types/components/post-featured-image/check.d.ts.map +1 -1
  240. package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
  241. package/build-types/components/post-format/index.d.ts.map +1 -1
  242. package/build-types/components/post-format/panel.d.ts.map +1 -1
  243. package/build-types/components/post-last-revision/check.d.ts.map +1 -1
  244. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  245. package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
  246. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  247. package/build-types/components/post-pending-status/check.d.ts.map +1 -1
  248. package/build-types/components/post-pending-status/index.d.ts.map +1 -1
  249. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  250. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  251. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
  252. package/build-types/components/post-saved-state/index.d.ts +1 -1
  253. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  254. package/build-types/components/post-schedule/check.d.ts.map +1 -1
  255. package/build-types/components/post-schedule/index.d.ts.map +1 -1
  256. package/build-types/components/post-schedule/label.d.ts.map +1 -1
  257. package/build-types/components/post-schedule/panel.d.ts.map +1 -1
  258. package/build-types/components/post-slug/check.d.ts.map +1 -1
  259. package/build-types/components/post-slug/index.d.ts.map +1 -1
  260. package/build-types/components/post-status/index.d.ts.map +1 -1
  261. package/build-types/components/post-sticky/check.d.ts.map +1 -1
  262. package/build-types/components/post-sticky/index.d.ts.map +1 -1
  263. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
  264. package/build-types/components/post-sync-status/index.d.ts.map +1 -1
  265. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  266. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +9 -7
  267. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  268. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +13 -11
  269. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  270. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  271. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  272. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  273. package/build-types/components/post-template/create-new-template.d.ts.map +1 -1
  274. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  275. package/build-types/components/post-template/panel.d.ts.map +1 -1
  276. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  277. package/build-types/components/post-trash/check.d.ts.map +1 -1
  278. package/build-types/components/post-trash/index.d.ts.map +1 -1
  279. package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
  280. package/build-types/components/post-url/check.d.ts.map +1 -1
  281. package/build-types/components/post-url/index.d.ts.map +1 -1
  282. package/build-types/components/post-url/label.d.ts.map +1 -1
  283. package/build-types/components/post-url/panel.d.ts.map +1 -1
  284. package/build-types/components/post-visibility/check.d.ts.map +1 -1
  285. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  286. package/build-types/components/posts-per-page/index.d.ts.map +1 -1
  287. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  288. package/build-types/components/provider/index.d.ts.map +1 -1
  289. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  290. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  291. package/build-types/components/sidebar/index.d.ts.map +1 -1
  292. package/build-types/components/site-discussion/index.d.ts.map +1 -1
  293. package/build-types/components/template-content-panel/index.d.ts +1 -3
  294. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  295. package/build-types/components/theme-support-check/index.d.ts.map +1 -1
  296. package/build-types/components/time-to-read/index.d.ts.map +1 -1
  297. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
  298. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +1 -1
  299. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
  300. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  301. package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts.map +1 -0
  302. package/build-types/components/word-count/index.d.ts.map +1 -1
  303. package/build-types/dataviews/actions/delete-post.d.ts.map +1 -1
  304. package/build-types/dataviews/api.d.ts +1 -1
  305. package/build-types/dataviews/api.d.ts.map +1 -1
  306. package/build-types/dataviews/store/private-selectors.d.ts +0 -1
  307. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  308. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +1 -1
  309. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
  310. package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
  311. package/build-types/private-apis.d.ts.map +1 -1
  312. package/build-types/store/actions.d.ts.map +1 -1
  313. package/build-types/store/private-actions.d.ts.map +1 -1
  314. package/build-types/store/reducer.d.ts.map +1 -1
  315. package/build-types/store/selectors.d.ts +0 -1
  316. package/build-types/store/selectors.d.ts.map +1 -1
  317. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  318. package/package.json +38 -37
  319. package/src/bindings/api.js +57 -0
  320. package/src/bindings/pattern-overrides.js +28 -17
  321. package/src/bindings/post-meta.js +19 -14
  322. package/src/components/block-settings-menu/content-only-settings-menu.js +4 -4
  323. package/src/components/blog-title/index.js +7 -2
  324. package/src/components/collapsible-block-toolbar/index.js +1 -3
  325. package/src/components/collapsible-block-toolbar/style.scss +0 -3
  326. package/src/components/document-bar/style.scss +1 -5
  327. package/src/components/document-tools/style.scss +4 -4
  328. package/src/components/editor-interface/style.scss +4 -0
  329. package/src/components/global-styles-provider/index.js +22 -11
  330. package/src/components/header/back-button.js +6 -6
  331. package/src/components/header/index.js +26 -25
  332. package/src/components/header/style.scss +64 -21
  333. package/src/components/inserter-sidebar/style.scss +1 -6
  334. package/src/components/page-attributes/order.js +3 -77
  335. package/src/components/page-attributes/panel.js +1 -7
  336. package/src/components/post-actions/actions.js +150 -32
  337. package/src/components/post-card-panel/index.js +8 -2
  338. package/src/components/post-comments/index.js +2 -2
  339. package/src/components/post-content-information/index.js +7 -1
  340. package/src/components/post-discussion/panel.js +5 -3
  341. package/src/components/post-excerpt/panel.js +2 -1
  342. package/src/components/post-featured-image/index.js +5 -1
  343. package/src/components/post-last-revision/index.js +1 -0
  344. package/src/components/post-panel-row/style.scss +0 -1
  345. package/src/components/post-publish-button/index.js +4 -17
  346. package/src/components/post-publish-panel/maybe-category-panel.js +4 -1
  347. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  348. package/src/components/post-status/index.js +18 -10
  349. package/src/components/post-taxonomies/flat-term-selector.js +19 -5
  350. package/src/components/post-taxonomies/index.js +8 -1
  351. package/src/components/post-template/block-theme.js +5 -1
  352. package/src/components/post-template/classic-theme.js +8 -3
  353. package/src/components/post-template/create-new-template.js +4 -1
  354. package/src/components/post-template/hooks.js +8 -2
  355. package/src/components/post-template/panel.js +10 -2
  356. package/src/components/post-trash/check.js +9 -5
  357. package/src/components/post-url/panel.js +7 -2
  358. package/src/components/posts-per-page/index.js +7 -2
  359. package/src/components/provider/use-block-editor-settings.js +15 -6
  360. package/src/components/save-publish-panels/index.js +1 -4
  361. package/src/components/sidebar/index.js +2 -5
  362. package/src/components/site-discussion/index.js +9 -4
  363. package/src/components/template-content-panel/index.js +3 -2
  364. package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
  365. package/src/components/visual-editor/index.js +5 -2
  366. package/src/components/visual-editor/style.scss +0 -1
  367. package/src/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  368. package/src/dataviews/actions/delete-post.tsx +2 -0
  369. package/src/hooks/pattern-overrides.js +1 -1
  370. package/src/index.js +0 -1
  371. package/src/private-apis.js +6 -0
  372. package/src/store/test/actions.js +9 -3
  373. package/src/utils/media-upload/index.js +38 -3
  374. package/tsconfig.tsbuildinfo +1 -1
  375. package/build/bindings/index.js +0 -22
  376. package/build/bindings/index.js.map +0 -1
  377. package/build/hooks/use-select-nearest-editable-block.js.map +0 -1
  378. package/build/store/utils/get-filtered-template-parts.js +0 -71
  379. package/build/store/utils/get-filtered-template-parts.js.map +0 -1
  380. package/build/utils/set-nested-value.js +0 -44
  381. package/build/utils/set-nested-value.js.map +0 -1
  382. package/build-module/bindings/index.js +0 -17
  383. package/build-module/bindings/index.js.map +0 -1
  384. package/build-module/hooks/use-select-nearest-editable-block.js.map +0 -1
  385. package/build-module/store/utils/get-filtered-template-parts.js +0 -64
  386. package/build-module/store/utils/get-filtered-template-parts.js.map +0 -1
  387. package/build-module/utils/set-nested-value.js +0 -38
  388. package/build-module/utils/set-nested-value.js.map +0 -1
  389. package/build-types/bindings/index.d.ts +0 -2
  390. package/build-types/bindings/index.d.ts.map +0 -1
  391. package/build-types/hooks/use-select-nearest-editable-block.d.ts.map +0 -1
  392. package/build-types/store/utils/get-filtered-template-parts.d.ts +0 -3
  393. package/build-types/store/utils/get-filtered-template-parts.d.ts.map +0 -1
  394. package/build-types/utils/set-nested-value.d.ts +0 -20
  395. package/build-types/utils/set-nested-value.d.ts.map +0 -1
  396. package/src/bindings/index.js +0 -15
  397. package/src/store/utils/get-filtered-template-parts.js +0 -69
  398. package/src/store/utils/test/get-filtered-template-parts.js +0 -189
  399. package/src/utils/set-nested-value.js +0 -39
  400. /package/build-types/{hooks → components/visual-editor}/use-select-nearest-editable-block.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_i18n","_coreData","_store","_classicTheme","_interopRequireDefault","_blockTheme","_postPanelRow","_jsxRuntime","PostTemplatePanel","templateId","isBlockTheme","useSelect","select","getCurrentTemplateId","getEditorSettings","editorStore","__unstableIsBlockBasedTheme","isVisible","_select$canUser","postTypeSlug","getCurrentPostType","postType","coreStore","getPostType","viewable","settings","hasTemplates","availableTemplates","Object","keys","length","supportsTemplateMode","canCreateTemplates","canUser","canViewTemplates","_select$canUser2","jsx","default","label","__","children","id"],"sources":["@wordpress/editor/src/components/post-template/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport ClassicThemeControl from './classic-theme';\nimport BlockThemeControl from './block-theme';\nimport PostPanelRow from '../post-panel-row';\n\n/**\n * Displays the template controls based on the current editor settings and user permissions.\n *\n * @return {JSX.Element|null} The rendered PostTemplatePanel component.\n */\nexport default function PostTemplatePanel() {\n\tconst { templateId, isBlockTheme } = useSelect( ( select ) => {\n\t\tconst { getCurrentTemplateId, getEditorSettings } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\tisBlockTheme: getEditorSettings().__unstableIsBlockBasedTheme,\n\t\t};\n\t}, [] );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst settings = select( editorStore ).getEditorSettings();\n\t\tconst hasTemplates =\n\t\t\t!! settings.availableTemplates &&\n\t\t\tObject.keys( settings.availableTemplates ).length > 0;\n\t\tif ( hasTemplates ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! settings.supportsTemplateMode ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst canCreateTemplates =\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) ?? false;\n\t\treturn canCreateTemplates;\n\t}, [] );\n\n\tconst canViewTemplates = useSelect( ( select ) => {\n\t\treturn select( coreStore ).canUser( 'read', 'templates' ) ?? false;\n\t}, [] );\n\n\tif ( ( ! isBlockTheme || ! canViewTemplates ) && isVisible ) {\n\t\treturn (\n\t\t\t<PostPanelRow label={ __( 'Template' ) }>\n\t\t\t\t<ClassicThemeControl />\n\t\t\t</PostPanelRow>\n\t\t);\n\t}\n\n\tif ( isBlockTheme && !! templateId ) {\n\t\treturn (\n\t\t\t<PostPanelRow label={ __( 'Template' ) }>\n\t\t\t\t<BlockThemeControl id={ templateId } />\n\t\t\t</PostPanelRow>\n\t\t);\n\t}\n\treturn null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,WAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,aAAA,GAAAF,sBAAA,CAAAL,OAAA;AAA6C,IAAAQ,WAAA,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c,kBAAkB;EAC1B,CAAC,EAAE,EAAG,CAAC;EAEP,MAAME,gBAAgB,GAAG,IAAAvB,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAuB,gBAAA;IACjD,QAAAA,gBAAA,GAAOvB,MAAM,CAAEU,eAAU,CAAC,CAACW,OAAO,CAAE,MAAM,EAAE,WAAY,CAAC,cAAAE,gBAAA,cAAAA,gBAAA,GAAI,KAAK;EACnE,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAE,CAAEzB,YAAY,IAAI,CAAEwB,gBAAgB,KAAMjB,SAAS,EAAG;IAC5D,oBACC,IAAAV,WAAA,CAAA6B,GAAA,EAAC9B,aAAA,CAAA+B,OAAY;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;MAAAC,QAAA,eACvC,IAAAjC,WAAA,CAAA6B,GAAA,EAACjC,aAAA,CAAAkC,OAAmB,IAAE;IAAC,CACV,CAAC;EAEjB;EAEA,IAAK3B,YAAY,IAAI,CAAC,CAAED,UAAU,EAAG;IACpC,oBACC,IAAAF,WAAA,CAAA6B,GAAA,EAAC9B,aAAA,CAAA+B,OAAY;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;MAAAC,QAAA,eACvC,IAAAjC,WAAA,CAAA6B,GAAA,EAAC/B,WAAA,CAAAgC,OAAiB;QAACI,EAAE,EAAGhC;MAAY,CAAE;IAAC,CAC1B,CAAC;EAEjB;EACA,OAAO,IAAI;AACZ","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_i18n","_coreData","_store","_classicTheme","_interopRequireDefault","_blockTheme","_postPanelRow","_jsxRuntime","PostTemplatePanel","templateId","isBlockTheme","useSelect","select","getCurrentTemplateId","getEditorSettings","editorStore","__unstableIsBlockBasedTheme","isVisible","_select$canUser","postTypeSlug","getCurrentPostType","postType","coreStore","getPostType","viewable","settings","hasTemplates","availableTemplates","Object","keys","length","supportsTemplateMode","canCreateTemplates","canUser","kind","name","canViewTemplates","_select$canUser2","jsx","default","label","__","children","id"],"sources":["@wordpress/editor/src/components/post-template/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport ClassicThemeControl from './classic-theme';\nimport BlockThemeControl from './block-theme';\nimport PostPanelRow from '../post-panel-row';\n\n/**\n * Displays the template controls based on the current editor settings and user permissions.\n *\n * @return {JSX.Element|null} The rendered PostTemplatePanel component.\n */\nexport default function PostTemplatePanel() {\n\tconst { templateId, isBlockTheme } = useSelect( ( select ) => {\n\t\tconst { getCurrentTemplateId, getEditorSettings } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\tisBlockTheme: getEditorSettings().__unstableIsBlockBasedTheme,\n\t\t};\n\t}, [] );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst settings = select( editorStore ).getEditorSettings();\n\t\tconst hasTemplates =\n\t\t\t!! settings.availableTemplates &&\n\t\t\tObject.keys( settings.availableTemplates ).length > 0;\n\t\tif ( hasTemplates ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! settings.supportsTemplateMode ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst canCreateTemplates =\n\t\t\tselect( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ) ?? false;\n\t\treturn canCreateTemplates;\n\t}, [] );\n\n\tconst canViewTemplates = useSelect( ( select ) => {\n\t\treturn (\n\t\t\tselect( coreStore ).canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ) ?? false\n\t\t);\n\t}, [] );\n\n\tif ( ( ! isBlockTheme || ! canViewTemplates ) && isVisible ) {\n\t\treturn (\n\t\t\t<PostPanelRow label={ __( 'Template' ) }>\n\t\t\t\t<ClassicThemeControl />\n\t\t\t</PostPanelRow>\n\t\t);\n\t}\n\n\tif ( isBlockTheme && !! templateId ) {\n\t\treturn (\n\t\t\t<PostPanelRow label={ __( 'Template' ) }>\n\t\t\t\t<BlockThemeControl id={ templateId } />\n\t\t\t</PostPanelRow>\n\t\t);\n\t}\n\treturn null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,WAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,aAAA,GAAAF,sBAAA,CAAAL,OAAA;AAA6C,IAAAQ,WAAA,GAAAR,OAAA;AAb7C;AACA;AACA;;AAKA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,GACe,SAASS,iBAAiBA,CAAA,EAAG;EAC3C,MAAM;IAAEC,UAAU;IAAEC;EAAa,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC7D,MAAM;MAAEC,oBAAoB;MAAEC;IAAkB,CAAC,GAChDF,MAAM,CAAEG,YAAY,CAAC;IACtB,OAAO;MACNN,UAAU,EAAEI,oBAAoB,CAAC,CAAC;MAClCH,YAAY,EAAEI,iBAAiB,CAAC,CAAC,CAACE;IACnC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,SAAS,GAAG,IAAAN,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAM,eAAA;IAC1C,MAAMC,YAAY,GAAGP,MAAM,CAAEG,YAAY,CAAC,CAACK,kBAAkB,CAAC,CAAC;IAC/D,MA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AAG;MAAAC,QAAA,eACvC,IAAAnC,WAAA,CAAA+B,GAAA,EAACnC,aAAA,CAAAoC,OAAmB,IAAE;IAAC,CACV,CAAC;EAEjB;EAEA,IAAK7B,YAAY,IAAI,CAAC,CAAED,UAAU,EAAG;IACpC,oBACC,IAAAF,WAAA,CAAA+B,GAAA,EAAChC,aAAA,CAAAiC,OAAY;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;MAAAC,QAAA,eACvC,IAAAnC,WAAA,CAAA+B,GAAA,EAACjC,WAAA,CAAAkC,OAAiB;QAACI,EAAE,EAAGlC;MAAY,CAAE;IAAC,CAC1B,CAAC;EAEjB;EACA,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -35,14 +35,16 @@ function PostTrashCheck({
35
35
  getCurrentPostType
36
36
  } = select(_store.store);
37
37
  const {
38
- getPostType,
39
38
  canUser
40
39
  } = select(_coreData.store);
41
- const postType = getPostType(getCurrentPostType());
40
+ const postType = getCurrentPostType();
42
41
  const postId = getCurrentPostId();
43
42
  const isNew = isEditedPostNew();
44
- const resource = postType?.rest_base || ''; // eslint-disable-line camelcase
45
- const canUserDelete = postId && resource ? canUser('delete', resource, postId) : false;
43
+ const canUserDelete = !!postId ? canUser('delete', {
44
+ kind: 'postType',
45
+ name: postType,
46
+ id: postId
47
+ }) : false;
46
48
  return {
47
49
  canTrashPost: (!isNew || postId) && canUserDelete
48
50
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_coreData","_store","PostTrashCheck","children","canTrashPost","useSelect","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","editorStore","getPostType","canUser","coreStore","postType","postId","isNew","resource","rest_base","canUserDelete"],"sources":["@wordpress/editor/src/components/post-trash/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if the post can trashed.\n *\n * @param {Object} props - The component props.\n * @param {Element} props.children - The child components to render.\n *\n * @return {Component|null} The rendered child components or null if the post can not trashed.\n */\nexport default function PostTrashCheck( { children } ) {\n\tconst { canTrashPost } = useSelect( ( select ) => {\n\t\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst { getPostType, canUser } = select( coreStore );\n\t\tconst postType = getPostType( getCurrentPostType() );\n\t\tconst postId = getCurrentPostId();\n\t\tconst isNew = isEditedPostNew();\n\t\tconst resource = postType?.rest_base || ''; // eslint-disable-line camelcase\n\t\tconst canUserDelete =\n\t\t\tpostId && resource ? canUser( 'delete', resource, postId ) : false;\n\n\t\treturn {\n\t\t\tcanTrashPost: ( ! isNew || postId ) && canUserDelete,\n\t\t};\n\t}, [] );\n\n\tif ( ! canTrashPost ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,cAAcA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACjD,MAAM;MAAEC,eAAe;MAAEC,gBAAgB;MAAEC;IAAmB,CAAC,GAC9DH,MAAM,CAAEI,YAAY,CAAC;IACtB,MAAM;MAAEC,WAAW;MAAEC;IAAQ,CAAC,GAAGN,MAAM,CAAEO,eAAU,CAAC;IACpD,MAAMC,QAAQ,GAAGH,WAAW,CAAEF,kBAAkB,CAAC,CAAE,CAAC;IACpD,MAAMM,MAAM,GAAGP,gBAAgB,CAAC,CAAC;IACjC,MAAMQ,KAAK,GAAGT,eAAe,CAAC,CAAC;IAC/B,MAAMU,QAAQ,GAAGH,QAAQ,EAAEI,SAAS,IAAI,EAAE,CAAC,CAAC;IAC5C,MAAMC,aAAa,GAClBJ,MAAM,IAAIE,QAAQ,GAAGL,OAAO,CAAE,QAAQ,EAAEK,QAAQ,EAAEF,MAAO,CAAC,GAAG,KAAK;IAEnE,OAAO;MACNX,YAAY,EAAE,CAAE,CAAEY,KAAK,IAAID,MAAM,KAAMI;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEf,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_coreData","_store","PostTrashCheck","children","canTrashPost","useSelect","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","editorStore","canUser","coreStore","postType","postId","isNew","canUserDelete","kind","name","id"],"sources":["@wordpress/editor/src/components/post-trash/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children only if the post can trashed.\n *\n * @param {Object} props - The component props.\n * @param {Element} props.children - The child components to render.\n *\n * @return {Component|null} The rendered child components or null if the post can not trashed.\n */\nexport default function PostTrashCheck( { children } ) {\n\tconst { canTrashPost } = useSelect( ( select ) => {\n\t\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst { canUser } = select( coreStore );\n\t\tconst postType = getCurrentPostType();\n\t\tconst postId = getCurrentPostId();\n\t\tconst isNew = isEditedPostNew();\n\t\tconst canUserDelete = !! postId\n\t\t\t? canUser( 'delete', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t\tid: postId,\n\t\t\t } )\n\t\t\t: false;\n\n\t\treturn {\n\t\t\tcanTrashPost: ( ! isNew || postId ) && canUserDelete,\n\t\t};\n\t}, [] );\n\n\tif ( ! canTrashPost ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,cAAcA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACjD,MAAM;MAAEC,eAAe;MAAEC,gBAAgB;MAAEC;IAAmB,CAAC,GAC9DH,MAAM,CAAEI,YAAY,CAAC;IACtB,MAAM;MAAEC;IAAQ,CAAC,GAAGL,MAAM,CAAEM,eAAU,CAAC;IACvC,MAAMC,QAAQ,GAAGJ,kBAAkB,CAAC,CAAC;IACrC,MAAMK,MAAM,GAAGN,gBAAgB,CAAC,CAAC;IACjC,MAAMO,KAAK,GAAGR,eAAe,CAAC,CAAC;IAC/B,MAAMS,aAAa,GAAG,CAAC,CAAEF,MAAM,GAC5BH,OAAO,CAAE,QAAQ,EAAE;MACnBM,IAAI,EAAE,UAAU;MAChBC,IAAI,EAAEL,QAAQ;MACdM,EAAE,EAAEL;IACJ,CAAE,CAAC,GACH,KAAK;IAER,OAAO;MACNV,YAAY,EAAE,CAAE,CAAEW,KAAK,IAAID,MAAM,KAAME;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEZ,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
@@ -80,9 +80,13 @@ function PostURLToggle({
80
80
  getCurrentPost
81
81
  } = select(_store.store);
82
82
  const {
83
- getEditedEntityRecord
83
+ getEditedEntityRecord,
84
+ canUser
84
85
  } = select(_coreData.store);
85
- const siteSettings = getEditedEntityRecord('root', 'site');
86
+ const siteSettings = canUser('read', {
87
+ kind: 'root',
88
+ name: 'site'
89
+ }) ? getEditedEntityRecord('root', 'site') : undefined;
86
90
  const _id = getCurrentPostId();
87
91
  return {
88
92
  slug: select(_store.store).getEditedPostSlug(),
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_components","_i18n","_url","_coreData","_check","_interopRequireDefault","_index","_postPanelRow","_store","_jsxRuntime","PostURLPanel","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","offset","shift","jsx","default","children","label","__","ref","Dropdown","className","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostURLToggle","onClick","renderContent","onClose","slug","isFrontPage","postLink","useSelect","select","getCurrentPostId","getCurrentPost","editorStore","getEditedEntityRecord","coreStore","siteSettings","_id","getEditedPostSlug","page_on_front","link","decodedSlug","safeDecodeURIComponent","Button","size","variant","sprintf","jsxs","Fragment"],"sources":["@wordpress/editor/src/components/post-url/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { safeDecodeURIComponent } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostURLCheck from './check';\nimport PostURL from './index';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the `PostURLPanel` component.\n *\n * @return {JSX.Element} The rendered PostURLPanel component.\n */\nexport default function PostURLPanel() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PostPanelRow label={ __( 'Link' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"editor-post-url__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-url__panel-dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostURLToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostURL onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst { slug, isFrontPage, postLink } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPost } = select( editorStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst siteSettings = getEditedEntityRecord( 'root', 'site' );\n\t\tconst _id = getCurrentPostId();\n\t\treturn {\n\t\t\tslug: select( editorStore ).getEditedPostSlug(),\n\t\t\tisFrontPage: siteSettings?.page_on_front === _id,\n\t\t\tpostLink: getCurrentPost()?.link,\n\t\t};\n\t}, [] );\n\tconst decodedSlug = safeDecodeURIComponent( slug );\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-url__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post link.\n\t\t\taria-label={ sprintf( __( 'Change link: %s' ), decodedSlug ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ isFrontPage ? postLink : <>/{ decodedSlug }</> }\n\t\t</Button>\n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aAAO,EAAE,IAAAjC,QAAE,EAAE,iBAAkB,CAAC,EAAE4B,WAAY,CAAG;IAC9DlB,OAAO,EAAGA,OAAS;IAAAZ,QAAA,EAEjBgB,WAAW,GAAGC,QAAQ,gBAAG,IAAA9B,WAAA,CAAAiD,IAAA,EAAAjD,WAAA,CAAAkD,QAAA;MAAArC,QAAA,GAAE,GAAC,EAAE8B,WAAW;IAAA,CAAI;EAAC,CACzC,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_components","_i18n","_url","_coreData","_check","_interopRequireDefault","_index","_postPanelRow","_store","_jsxRuntime","PostURLPanel","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","offset","shift","jsx","default","children","label","__","ref","Dropdown","className","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostURLToggle","onClick","renderContent","onClose","slug","isFrontPage","postLink","useSelect","select","getCurrentPostId","getCurrentPost","editorStore","getEditedEntityRecord","canUser","coreStore","siteSettings","kind","name","undefined","_id","getEditedPostSlug","page_on_front","link","decodedSlug","safeDecodeURIComponent","Button","size","variant","sprintf","jsxs","Fragment"],"sources":["@wordpress/editor/src/components/post-url/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { safeDecodeURIComponent } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostURLCheck from './check';\nimport PostURL from './index';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the `PostURLPanel` component.\n *\n * @return {JSX.Element} The rendered PostURLPanel component.\n */\nexport default function PostURLPanel() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PostPanelRow label={ __( 'Link' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"editor-post-url__panel-dropdown\"\n\t\t\t\t\tcontentClassName=\"editor-post-url__panel-dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostURLToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostURL onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst { slug, isFrontPage, postLink } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPost } = select( editorStore );\n\t\tconst { getEditedEntityRecord, canUser } = select( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEditedEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst _id = getCurrentPostId();\n\t\treturn {\n\t\t\tslug: select( editorStore ).getEditedPostSlug(),\n\t\t\tisFrontPage: siteSettings?.page_on_front === _id,\n\t\t\tpostLink: getCurrentPost()?.link,\n\t\t};\n\t}, [] );\n\tconst decodedSlug = safeDecodeURIComponent( slug );\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-url__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post link.\n\t\t\taria-label={ sprintf( __( 'Change link: %s' ), decodedSlug ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ isFrontPage ? postLink : <>/{ decodedSlug }</> }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,aAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAAmD,IAAAW,WAAA,GAAAX,OAAA;AAhBnD;AACA;AACA;;AAQA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA,GACe,SAASY,YAAYA,CAAA,EAAG;EACtC;EACA;EACA,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAC5D;EACA,MAAMC,YAAY,GAAG,IAAAC,gBAAO,EAC3B,OAAQ;IACP;IACA;IACAC,MAAM,EAAEL,aAAa;IACrBM,SAAS,EAAE,YAAY;IACvBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE;EACR,CAAC,CAAE,EACH,CAAER,aAAa,CAChB,CAAC;EAED,oBACC,IAAAF,WAAA,CAAAW,GAAA,EAAChB,MAAA,CAAAiB,OAAY;IAAAC,QAAA,eACZ,IAAAb,WAAA,CAAAW,GAAA,EAACb,aAAA,CAAAc,OAAY;MAACE,KAAK,EAAG,IAAAC,QAAE,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EM,aAAa,KAAKF,GAAG;MAChDb,QAAQ,EAAEI,cAAc,CAAC,CAAC,EAAEY;IAC7B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAMC,WAAW,GAAG,IAAAC,2BAAsB,EAAEpB,IAAK,CAAC;EAClD,oBACC,IAAA5B,WAAA,CAAAW,GAAA,EAACpB,WAAA,CAAA0D,MAAM;IACNC,IAAI,EAAC,SAAS;IACdhC,SAAS,EAAC,+BAA+B;IACzCiC,OAAO,EAAC,UAAU;IAClB,iBAAgB7B;IAChB;IAAA;IACA,cAAa,IAAA8B,aAAO,EAAE,IAAArC,QAAE,EAAE,iBAAkB,CAAC,EAAEgC,WAAY,CAAG;IAC9DtB,OAAO,EAAGA,OAAS;IAAAZ,QAAA,EAEjBgB,WAAW,GAAGC,QAAQ,gBAAG,IAAA9B,WAAA,CAAAqD,IAAA,EAAArD,WAAA,CAAAsD,QAAA;MAAAzC,QAAA,GAAE,GAAC,EAAEkC,WAAW;IAAA,CAAI;EAAC,CACzC,CAAC;AAEX","ignoreList":[]}
@@ -37,9 +37,13 @@ function PostsPerPage() {
37
37
  getCurrentPostType
38
38
  } = select(_store.store);
39
39
  const {
40
- getEditedEntityRecord
40
+ getEditedEntityRecord,
41
+ canUser
41
42
  } = select(_coreData.store);
42
- const siteSettings = getEditedEntityRecord('root', 'site');
43
+ const siteSettings = canUser('read', {
44
+ kind: 'root',
45
+ name: 'site'
46
+ }) ? getEditedEntityRecord('root', 'site') : undefined;
43
47
  return {
44
48
  isTemplate: getCurrentPostType() === _constants.TEMPLATE_POST_TYPE,
45
49
  postSlug: getEditedPostAttribute('slug'),
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_data","_coreData","_components","_element","_blockEditor","_constants","_store","_postPanelRow","_interopRequireDefault","_jsxRuntime","PostsPerPage","editEntityRecord","useDispatch","coreStore","postsPerPage","isTemplate","postSlug","useSelect","select","getEditedPostAttribute","getCurrentPostType","editorStore","getEditedEntityRecord","siteSettings","TEMPLATE_POST_TYPE","posts_per_page","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","offset","shift","includes","setPostsPerPage","newValue","undefined","jsx","default","label","__","ref","children","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","Button","size","variant","onClick","renderContent","onClose","jsxs","Fragment","__experimentalInspectorPopoverHeader","title","__experimentalNumberControl","placeholder","value","spinControls","step","min","onChange","help","hideLabelFromVision"],"sources":["@wordpress/editor/src/components/posts-per-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tButton,\n\tDropdown,\n\t__experimentalNumberControl as NumberControl,\n} from '@wordpress/components';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport PostPanelRow from '../post-panel-row';\n\nexport default function PostsPerPage() {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postsPerPage, isTemplate, postSlug } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst siteSettings = getEditedEntityRecord( 'root', 'site' );\n\t\treturn {\n\t\t\tisTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,\n\t\t\tpostSlug: getEditedPostAttribute( 'slug' ),\n\t\t\tpostsPerPage: siteSettings?.posts_per_page || 1,\n\t\t};\n\t}, [] );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tif ( ! isTemplate || ! [ 'home', 'index' ].includes( postSlug ) ) {\n\t\treturn null;\n\t}\n\tconst setPostsPerPage = ( newValue ) => {\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tposts_per_page: newValue,\n\t\t} );\n\t};\n\treturn (\n\t\t<PostPanelRow label={ __( 'Posts per page' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tcontentClassName=\"editor-posts-per-page-dropdown__content\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\taria-label={ __( 'Change posts per page' ) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ postsPerPage }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Posts per page' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tplaceholder={ 0 }\n\t\t\t\t\t\t\tvalue={ postsPerPage }\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tspinControls=\"custom\"\n\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tonChange={ setPostsPerPage }\n\t\t\t\t\t\t\tlabel={ __( 'Posts per page' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAC,sBAAA,CAAAT,OAAA;AAA6C,IAAAU,WAAA,GAAAV,OAAA;AAnB7C;AACA;AACA;;AAYA;AACA;AACA;;AAKe,SAASW,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EACrD,MAAM;IAAEC,YAAY;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACvE,MAAM;MAAEC,sBAAsB;MAAEC;IAAmB,CAAC,GACnDF,MAAM,CAAEG,YAAY,CAAC;IACtB,MAAM;MAAEC;IAAsB,CAAC,GAAGJ,MAAM,CAAEL,eAAU,CAAC;IACrD,MAAMU,YAAY,GAAGD,qBAAqB,CAAE,MAAM,EAAE,MAAO,CAAC;IAC5D,OAAO;MACNP,UAAU,EAAEK,kBAAkB,CAAC,CAAC,KAAKI,6BAAkB;MACvDR,QAAQ,EAAEG,sBAAsB,CAAE,MAAO,CAAC;MAC1CL,YAAY,EAAES,YAAY,EAAEE,cAAc,IAA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P,CACN;MACHyC,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,kBAC5B,IAAA/C,WAAA,CAAAgD,IAAA,EAAAhD,WAAA,CAAAiD,QAAA;QAAAd,QAAA,gBACC,IAAAnC,WAAA,CAAA8B,GAAA,EAACnC,YAAA,CAAAuD,oCAAsB;UACtBC,KAAK,EAAG,IAAAlB,QAAE,EAAE,gBAAiB,CAAG;UAChCc,OAAO,EAAGA;QAAS,CACnB,CAAC,eACF,IAAA/C,WAAA,CAAA8B,GAAA,EAACrC,WAAA,CAAA2D,2BAAa;UACbC,WAAW,EAAG,CAAG;UACjBC,KAAK,EAAGjD,YAAc;UACtBsC,IAAI,EAAC,kBAAkB;UACvBY,YAAY,EAAC,QAAQ;UACrBC,IAAI,EAAC,GAAG;UACRC,GAAG,EAAC,GAAG;UACPC,QAAQ,EAAG/B,eAAiB;UAC5BK,KAAK,EAAG,IAAAC,QAAE,EAAE,gBAAiB,CAAG;UAChC0B,IAAI,EAAG,IAAA1B,QAAE,EACR,oIACD,CAAG;UACH2B,mBAAmB;QAAA,CACnB,CAAC;MAAA,CACD;IACA,CACH;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_data","_coreData","_components","_element","_blockEditor","_constants","_store","_postPanelRow","_interopRequireDefault","_jsxRuntime","PostsPerPage","editEntityRecord","useDispatch","coreStore","postsPerPage","isTemplate","postSlug","useSelect","select","getEditedPostAttribute","getCurrentPostType","editorStore","getEditedEntityRecord","canUser","siteSettings","kind","name","undefined","TEMPLATE_POST_TYPE","posts_per_page","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","offset","shift","includes","setPostsPerPage","newValue","jsx","default","label","__","ref","children","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","Button","size","variant","onClick","renderContent","onClose","jsxs","Fragment","__experimentalInspectorPopoverHeader","title","__experimentalNumberControl","placeholder","value","spinControls","step","min","onChange","help","hideLabelFromVision"],"sources":["@wordpress/editor/src/components/posts-per-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tButton,\n\tDropdown,\n\t__experimentalNumberControl as NumberControl,\n} from '@wordpress/components';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport PostPanelRow from '../post-panel-row';\n\nexport default function PostsPerPage() {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postsPerPage, isTemplate, postSlug } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst { getEditedEntityRecord, canUser } = select( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEditedEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tisTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,\n\t\t\tpostSlug: getEditedPostAttribute( 'slug' ),\n\t\t\tpostsPerPage: siteSettings?.posts_per_page || 1,\n\t\t};\n\t}, [] );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tif ( ! isTemplate || ! [ 'home', 'index' ].includes( postSlug ) ) {\n\t\treturn null;\n\t}\n\tconst setPostsPerPage = ( newValue ) => {\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tposts_per_page: newValue,\n\t\t} );\n\t};\n\treturn (\n\t\t<PostPanelRow label={ __( 'Posts per page' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tcontentClassName=\"editor-posts-per-page-dropdown__content\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\taria-label={ __( 'Change posts per page' ) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ postsPerPage }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Posts per page' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tplaceholder={ 0 }\n\t\t\t\t\t\t\tvalue={ postsPerPage }\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tspinControls=\"custom\"\n\t\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\t\tonChange={ setPostsPerPage }\n\t\t\t\t\t\t\tlabel={ __( 'Posts per page' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\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A,CAAAmD,IAAA,EAAAnD,WAAA,CAAAoD,QAAA;QAAAd,QAAA,gBACC,IAAAtC,WAAA,CAAAiC,GAAA,EAACtC,YAAA,CAAA0D,oCAAsB;UACtBC,KAAK,EAAG,IAAAlB,QAAE,EAAE,gBAAiB,CAAG;UAChCc,OAAO,EAAGA;QAAS,CACnB,CAAC,eACF,IAAAlD,WAAA,CAAAiC,GAAA,EAACxC,WAAA,CAAA8D,2BAAa;UACbC,WAAW,EAAG,CAAG;UACjBC,KAAK,EAAGpD,YAAc;UACtByC,IAAI,EAAC,kBAAkB;UACvBY,YAAY,EAAC,QAAQ;UACrBC,IAAI,EAAC,GAAG;UACRC,GAAG,EAAC,GAAG;UACPC,QAAQ,EAAG9B,eAAiB;UAC5BI,KAAK,EAAG,IAAAC,QAAE,EAAE,gBAAiB,CAAG;UAChC0B,IAAI,EAAG,IAAA1B,QAAE,EACR,oIACD,CAAG;UACH2B,mBAAmB;QAAA,CACnB,CAAC;MAAA,CACD;IACA,CACH;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}
@@ -34,7 +34,7 @@ function __experimentalReusableBlocksSelect(select) {
34
34
  per_page: -1
35
35
  })) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : EMPTY_BLOCKS_LIST;
36
36
  }
37
- const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'sectionRootClientId', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel'];
37
+ const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'sectionRootClientId', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme'];
38
38
  const {
39
39
  globalStylesDataKey,
40
40
  globalStylesLinksDataKey,
@@ -90,7 +90,10 @@ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
90
90
  getBlocksByName,
91
91
  getBlockAttributes
92
92
  } = select(_blockEditor.store);
93
- const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined;
93
+ const siteSettings = canUser('read', {
94
+ kind: 'root',
95
+ name: 'site'
96
+ }) ? getEntityRecord('root', 'site') : undefined;
94
97
  function getSectionRootBlock() {
95
98
  var _getBlocksByName$find;
96
99
  if (renderingMode === 'template-locked') {
@@ -108,8 +111,14 @@ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
108
111
  hiddenBlockTypes: get('core', 'hiddenBlockTypes'),
109
112
  isDistractionFree: get('core', 'distractionFree'),
110
113
  keepCaretInsideBlock: get('core', 'keepCaretInsideBlock'),
111
- hasUploadPermissions: (_canUser = canUser('create', 'media')) !== null && _canUser !== void 0 ? _canUser : true,
112
- userCanCreatePages: canUser('create', 'pages'),
114
+ hasUploadPermissions: (_canUser = canUser('create', {
115
+ kind: 'root',
116
+ name: 'media'
117
+ })) !== null && _canUser !== void 0 ? _canUser : true,
118
+ userCanCreatePages: canUser('create', {
119
+ kind: 'postType',
120
+ name: 'page'
121
+ }),
113
122
  pageOnFront: siteSettings?.page_on_front,
114
123
  pageForPosts: siteSettings?.page_for_posts,
115
124
  userPatternCategories: getUserPatternCategories(),
@@ -206,7 +215,7 @@ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
206
215
  __experimentalUndo: undo,
207
216
  // Check whether we want all site editor frames to have outlines
208
217
  // including the navigation / pattern / parts editors.
209
- outlineMode: postType === 'wp_template',
218
+ outlineMode: !isDistractionFree && postType === 'wp_template',
210
219
  // Check these two properties: they were not present in the site editor.
211
220
  __experimentalCreatePageEntity: createPageEntity,
212
221
  __experimentalUserCanCreatePages: userCanCreatePages,
@@ -221,7 +230,7 @@ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
221
230
  sectionRootClientId
222
231
  });
223
232
  return blockEditorSettings;
224
- }, [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened, sectionRootClientId, globalStylesData]);
233
+ }, [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened, sectionRootClientId, globalStylesData, globalStylesLinksData]);
225
234
  }
226
235
  var _default = exports.default = useBlockEditorSettings;
227
236
  //# sourceMappingURL=use-block-editor-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_coreData","_i18n","_preferences","_compose","_blocks","_blockEditor","_mediaCategories","_interopRequireDefault","_utils","_store","_lockUnlock","_globalStylesProvider","EMPTY_BLOCKS_LIST","EMPTY_OBJECT","__experimentalReusableBlocksSelect","select","_select$getEntityReco","coreStore","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","globalStylesDataKey","globalStylesLinksDataKey","selectBlockPatternsKey","reusableBlocksSelectKey","unlock","privateApis","useBlockEditorSettings","settings","postType","postId","renderingMode","_mergedGlobalStyles$s","_mergedGlobalStyles$_","_settings$__experimen","_settings$__experimen2","isLargeViewport","useViewportMatch","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","useSelect","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","preferencesStore","getBlockTypes","blocksStore","getBlocksByName","getBlockAttributes","blockEditorStore","siteSettings","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","merged","mergedGlobalStyles","useGlobalStylesContext","globalStylesData","styles","globalStylesLinksData","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","useMemo","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","name","undo","setIsInserterOpened","useDispatch","editorStore","saveEntityRecord","createPageEntity","useCallback","options","Promise","reject","message","__","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","mediaUpload","hasFinishedResolution","getBlockPatternsForPostType","patterns","__experimentalUserPatternCategories","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","lock","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\nimport { lock, unlock } from '../../lock-unlock';\nimport { useGlobalStylesContext } from '../global-styles-provider';\n\nconst EMPTY_BLOCKS_LIST = [];\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\treturn (\n\t\tselect( coreStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\tper_page: -1,\n\t\t} ) ?? EMPTY_BLOCKS_LIST\n\t);\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'sectionRootClientId',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n} = unlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStylesContext();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t};\n\t\tlock( blockEditorSettings, {\n\t\t\tsectionRootClientId,\n\t\t} );\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAA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xD6G,uBAAuB,EAAvBA,wBAAuB;MACvBC,8BAA8B,EAAEC,oCAAY;MAC5C;MACA;MACAC,sCAAsC,EAAE9F,oBAAoB;MAC5D;MACA+F,kBAAkB,EAAEpC,IAAI;MACxB;MACA;MACAqC,WAAW,EAAEjH,QAAQ,KAAK,aAAa;MACvC;MACAkH,8BAA8B,EAAEjC,gBAAgB;MAChDkC,gCAAgC,EAAEjG,kBAAkB;MACpDC,WAAW;MACXC,YAAY;MACZgG,kCAAkC,EAAEpH,QAAQ,KAAK,aAAa;MAC9DqH,YAAY,EACXrH,QAAQ,KAAK,eAAe,GAAG,QAAQ,GAAGD,QAAQ,CAACsH,YAAY;MAChEC,QAAQ,EACPtH,QAAQ,KAAK,eAAe,GACzB,CAAE,CAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAAE,GACjCD,QAAQ,CAACuH,QAAQ;MACrBC,iCAAiC,EAAE1C;IACpC,CAAC;IACD,IAAA2C,gBAAI,EAAE1B,mBAAmB,EAAE;MAC1BvE;IACD,CAAE,CAAC;IACH,OAAOuE,mBAAmB;EAC3B,CAAC,EAAE,CACFN,iBAAiB,EACjB/E,wBAAwB,EACxBE,SAAS,EACTkF,qBAAqB,EACrBjF,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBf,QAAQ,EACRgB,oBAAoB,EACpBM,qBAAqB,EACrByC,aAAa,EACbO,sBAAsB,EACtBpD,oBAAoB,EACpB2D,IAAI,EACJK,gBAAgB,EAChB/D,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZpB,QAAQ,EACR6E,mBAAmB,EACnBtD,mBAAmB,EACnB8B,gBAAgB,CACf,CAAC;AACJ;AAAC,IAAAoE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc7H,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_coreData","_i18n","_preferences","_compose","_blocks","_blockEditor","_mediaCategories","_interopRequireDefault","_utils","_store","_lockUnlock","_globalStylesProvider","EMPTY_BLOCKS_LIST","EMPTY_OBJECT","__experimentalReusableBlocksSelect","select","_select$getEntityReco","coreStore","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","globalStylesDataKey","globalStylesLinksDataKey","selectBlockPatternsKey","reusableBlocksSelectKey","unlock","privateApis","useBlockEditorSettings","settings","postType","postId","renderingMode","_mergedGlobalStyles$s","_mergedGlobalStyles$_","_settings$__experimen","_settings$__experimen2","isLargeViewport","useViewportMatch","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","useSelect","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","preferencesStore","getBlockTypes","blocksStore","getBlocksByName","getBlockAttributes","blockEditorStore","siteSettings","kind","name","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","merged","mergedGlobalStyles","useGlobalStylesContext","globalStylesData","styles","globalStylesLinksData","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","useMemo","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","undo","setIsInserterOpened","useDispatch","editorStore","saveEntityRecord","createPageEntity","useCallback","options","Promise","reject","message","__","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","mediaUpload","hasFinishedResolution","getBlockPatternsForPostType","patterns","__experimentalUserPatternCategories","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","lock","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\nimport { lock, unlock } from '../../lock-unlock';\nimport { useGlobalStylesContext } from '../global-styles-provider';\n\nconst EMPTY_BLOCKS_LIST = [];\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\treturn (\n\t\tselect( coreStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\tper_page: -1,\n\t\t} ) ?? EMPTY_BLOCKS_LIST\n\t);\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'sectionRootClientId',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n} = unlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'root',\n\t\t\t\t\t\tname: 'media',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStylesContext();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: ! isDistractionFree && postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t};\n\t\tlock( blockEditorSettings, {\n\t\t\tsectionRootClientId,\n\t\t} );\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAQA,IAAAQ,gBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,qBAAA,GAAAb,OAAA;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MACAC,sCAAsC,EAAE/F,oBAAoB;MAC5D;MACAgG,kBAAkB,EAAEpC,IAAI;MACxB;MACA;MACAqC,WAAW,EAAE,CAAErG,iBAAiB,IAAIb,QAAQ,KAAK,aAAa;MAC9D;MACAmH,8BAA8B,EAAEjC,gBAAgB;MAChDkC,gCAAgC,EAAElG,kBAAkB;MACpDC,WAAW;MACXC,YAAY;MACZiG,kCAAkC,EAAErH,QAAQ,KAAK,aAAa;MAC9DsH,YAAY,EACXtH,QAAQ,KAAK,eAAe,GAAG,QAAQ,GAAGD,QAAQ,CAACuH,YAAY;MAChEC,QAAQ,EACPvH,QAAQ,KAAK,eAAe,GACzB,CAAE,CAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAAE,GACjCD,QAAQ,CAACwH,QAAQ;MACrBC,iCAAiC,EAAE1C;IACpC,CAAC;IACD,IAAA2C,gBAAI,EAAE1B,mBAAmB,EAAE;MAC1BxE;IACD,CAAE,CAAC;IACH,OAAOwE,mBAAmB;EAC3B,CAAC,EAAE,CACFN,iBAAiB,EACjBhF,wBAAwB,EACxBE,SAAS,EACTmF,qBAAqB,EACrBlF,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBf,QAAQ,EACRgB,oBAAoB,EACpBM,qBAAqB,EACrB2C,aAAa,EACbO,sBAAsB,EACtBtD,oBAAoB,EACpB4D,IAAI,EACJK,gBAAgB,EAChBhE,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZpB,QAAQ,EACR8E,mBAAmB,EACnBvD,mBAAmB,EACnBgC,gBAAgB,EAChBE,qBAAqB,CACpB,CAAC;AACJ;AAAC,IAAAiE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc9H,sBAAsB","ignoreList":[]}
@@ -15,7 +15,6 @@ var _postPublishPanel = _interopRequireDefault(require("../post-publish-panel"))
15
15
  var _pluginPrePublishPanel = _interopRequireDefault(require("../plugin-pre-publish-panel"));
16
16
  var _pluginPostPublishPanel = _interopRequireDefault(require("../plugin-post-publish-panel"));
17
17
  var _store = require("../../store");
18
- var _lockUnlock = require("../../lock-unlock");
19
18
  var _jsxRuntime = require("react/jsx-runtime");
20
19
  /**
21
20
  * WordPress dependencies
@@ -53,7 +52,7 @@ function SavePublishPanels({
53
52
  isEditedPostDirty,
54
53
  hasNonPostEntityChanges
55
54
  } = select(_store.store);
56
- const _hasOtherEntitiesChanges = hasNonPostEntityChanges() || (0, _lockUnlock.unlock)(select(_store.store)).hasPostMetaChanges();
55
+ const _hasOtherEntitiesChanges = hasNonPostEntityChanges();
57
56
  return {
58
57
  publishSidebarOpened: isPublishSidebarOpened(),
59
58
  isPublishable: !isCurrentPostPublished() && isEditedPostPublishable(),
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_element","_entitiesSavedStates","_interopRequireDefault","_postPublishPanel","_pluginPrePublishPanel","_pluginPostPublishPanel","_store","_lockUnlock","_jsxRuntime","Fill","Slot","createSlotFill","ActionsPanelFill","exports","SavePublishPanels","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","closePublishSidebar","togglePublishSidebar","useDispatch","editorStore","publishSidebarOpened","isPublishable","isDirty","hasOtherEntitiesChanges","useSelect","select","isPublishSidebarOpened","isEditedPostPublishable","isCurrentPostPublished","isEditedPostDirty","hasNonPostEntityChanges","_hasOtherEntitiesChanges","unlock","hasPostMetaChanges","openEntitiesSavedStates","useCallback","unmountableContent","jsx","default","onClose","forceIsDirty","PrePublishExtension","PluginPrePublishPanel","PostPublishExtension","PluginPostPublishPanel","className","children","Button","variant","onClick","__","disabled","accessibleWhenDisabled","jsxs","Fragment","close","bubblesVirtually"],"sources":["@wordpress/editor/src/components/save-publish-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EntitiesSavedStates from '../entities-saved-states';\nimport PostPublishPanel from '../post-publish-panel';\nimport PluginPrePublishPanel from '../plugin-pre-publish-panel';\nimport PluginPostPublishPanel from '../plugin-post-publish-panel';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function SavePublishPanels( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n\tforceIsDirtyPublishPanel,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\tisPublishable,\n\t\tisDirty,\n\t\thasOtherEntitiesChanges,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPublishSidebarOpened,\n\t\t\tisEditedPostPublishable,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostDirty,\n\t\t\thasNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst _hasOtherEntitiesChanges =\n\t\t\thasNonPostEntityChanges() ||\n\t\t\tunlock( select( editorStore ) ).hasPostMetaChanges();\n\t\treturn {\n\t\t\tpublishSidebarOpened: isPublishSidebarOpened(),\n\t\t\tisPublishable:\n\t\t\t\t! isCurrentPostPublished() && isEditedPostPublishable(),\n\t\t\tisDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),\n\t\t\thasOtherEntitiesChanges: _hasOtherEntitiesChanges,\n\t\t};\n\t}, [] );\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ forceIsDirtyPublishPanel }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( isPublishable && ! hasOtherEntitiesChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"editor-layout__toggle-publish-panel-button\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"editor-layout__toggle-entities-saved-states-panel-button\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA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AAAI,QAAE,EAAE,iBAAkB;MAAC,CAClB;IAAC,CACL,CACL;EACF;;EAEA;EACA;EACA,oBACC,IAAA7C,WAAA,CAAAgD,IAAA,EAAAhD,WAAA,CAAAiD,QAAA;IAAAR,QAAA,GACGhC,yBAAyB,iBAC1B,IAAAT,WAAA,CAAAgC,GAAA,EAACvC,oBAAA,CAAAwC,OAAmB;MAACiB,KAAK,EAAG1C;IAA0B,CAAE,CACzD,eACD,IAAAR,WAAA,CAAAgC,GAAA,EAAC9B,IAAI;MAACiD,gBAAgB;IAAA,CAAE,CAAC,EACvB,CAAE1C,yBAAyB,IAAIsB,kBAAkB;EAAA,CAClD,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_components","_i18n","_element","_entitiesSavedStates","_interopRequireDefault","_postPublishPanel","_pluginPrePublishPanel","_pluginPostPublishPanel","_store","_jsxRuntime","Fill","Slot","createSlotFill","ActionsPanelFill","exports","SavePublishPanels","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","closePublishSidebar","togglePublishSidebar","useDispatch","editorStore","publishSidebarOpened","isPublishable","isDirty","hasOtherEntitiesChanges","useSelect","select","isPublishSidebarOpened","isEditedPostPublishable","isCurrentPostPublished","isEditedPostDirty","hasNonPostEntityChanges","_hasOtherEntitiesChanges","openEntitiesSavedStates","useCallback","unmountableContent","jsx","default","onClose","forceIsDirty","PrePublishExtension","PluginPrePublishPanel","PostPublishExtension","PluginPostPublishPanel","className","children","Button","variant","onClick","__","disabled","accessibleWhenDisabled","jsxs","Fragment","close","bubblesVirtually"],"sources":["@wordpress/editor/src/components/save-publish-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EntitiesSavedStates from '../entities-saved-states';\nimport PostPublishPanel from '../post-publish-panel';\nimport PluginPrePublishPanel from '../plugin-pre-publish-panel';\nimport PluginPostPublishPanel from '../plugin-post-publish-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function SavePublishPanels( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n\tforceIsDirtyPublishPanel,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\tisPublishable,\n\t\tisDirty,\n\t\thasOtherEntitiesChanges,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPublishSidebarOpened,\n\t\t\tisEditedPostPublishable,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostDirty,\n\t\t\thasNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst _hasOtherEntitiesChanges = hasNonPostEntityChanges();\n\t\treturn {\n\t\t\tpublishSidebarOpened: isPublishSidebarOpened(),\n\t\t\tisPublishable:\n\t\t\t\t! isCurrentPostPublished() && isEditedPostPublishable(),\n\t\t\tisDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),\n\t\t\thasOtherEntitiesChanges: _hasOtherEntitiesChanges,\n\t\t};\n\t}, [] );\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ forceIsDirtyPublishPanel }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( isPublishable && ! hasOtherEntitiesChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"editor-layout__toggle-publish-panel-button\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"editor-layout__toggle-entities-saved-states-panel-button\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,oBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAD,sBAAA,CAAAL,OAA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,EAAGxC;IAA0B,CAAE,CACzD,eACD,IAAAR,WAAA,CAAA8B,GAAA,EAAC5B,IAAI;MAAC+C,gBAAgB;IAAA,CAAE,CAAC,EACvB,CAAExC,yBAAyB,IAAIoB,kBAAkB;EAAA,CAClD,CAAC;AAEL","ignoreList":[]}
@@ -46,7 +46,6 @@ const SIDEBAR_ACTIVE_BY_DEFAULT = _element.Platform.select({
46
46
  const SidebarContent = ({
47
47
  tabName,
48
48
  keyboardShortcut,
49
- renderingMode,
50
49
  onActionPerformed,
51
50
  extraPanels
52
51
  }) => {
@@ -102,9 +101,7 @@ const SidebarContent = ({
102
101
  focusable: false,
103
102
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_postSummary.default, {
104
103
  onActionPerformed: onActionPerformed
105
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_pluginDocumentSettingPanel.default.Slot, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_templateContentPanel.default, {
106
- renderingMode: renderingMode
107
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_templatePartContentPanel.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_postTransformPanel.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternOverridesPanel.default, {}), extraPanels]
104
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_pluginDocumentSettingPanel.default.Slot, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_templateContentPanel.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_templatePartContentPanel.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_postTransformPanel.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_patternOverridesPanel.default, {}), extraPanels]
108
105
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Tabs.TabPanel, {
109
106
  tabId: _constants.sidebars.block,
110
107
  focusable: false,
@@ -121,8 +118,7 @@ const Sidebar = ({
121
118
  const {
122
119
  tabName,
123
120
  keyboardShortcut,
124
- showSummary,
125
- renderingMode
121
+ showSummary
126
122
  } = (0, _data.useSelect)(select => {
127
123
  const shortcut = select(_keyboardShortcuts.store).getShortcutRepresentation('core/editor/toggle-sidebar');
128
124
  const sidebar = select(_interface.store).getActiveComplementaryArea('core');
@@ -134,8 +130,7 @@ const Sidebar = ({
134
130
  return {
135
131
  tabName: _tabName,
136
132
  keyboardShortcut: shortcut,
137
- showSummary: ![_constants2.TEMPLATE_POST_TYPE, _constants2.TEMPLATE_PART_POST_TYPE, _constants2.NAVIGATION_POST_TYPE].includes(select(_store.store).getCurrentPostType()),
138
- renderingMode: select(_store.store).getRenderingMode()
133
+ showSummary: ![_constants2.TEMPLATE_POST_TYPE, _constants2.TEMPLATE_PART_POST_TYPE, _constants2.NAVIGATION_POST_TYPE].includes(select(_store.store).getCurrentPostType())
139
134
  };
140
135
  }, []);
141
136
  const {
@@ -154,7 +149,6 @@ const Sidebar = ({
154
149
  tabName: tabName,
155
150
  keyboardShortcut: keyboardShortcut,
156
151
  showSummary: showSummary,
157
- renderingMode: renderingMode,
158
152
  onActionPerformed: onActionPerformed,
159
153
  extraPanels: extraPanels
160
154
  })
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_data","_element","_i18n","_icons","_keyboardShortcuts","_components","_interface","_patternOverridesPanel","_interopRequireDefault","_pluginDocumentSettingPanel","_pluginSidebar","_postSummary","_panel","_postTransformPanel","_header","_templateContentPanel","_templatePartContentPanel","_useAutoSwitchEditorSidebars","_constants","_lockUnlock","_store","_constants2","_jsxRuntime","Tabs","unlock","componentsPrivateApis","SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","SidebarContent","tabName","keyboardShortcut","renderingMode","onActionPerformed","extraPanels","tabListRef","useRef","tabsContextValue","useContext","Context","useEffect","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","jsx","default","identifier","header","Provider","value","children","ref","closeLabel","__","className","headerClassName","title","toggleShortcut","icon","isRTL","drawerLeft","drawerRight","isActiveByDefault","jsxs","TabPanel","tabId","sidebars","document","focusable","Slot","block","BlockInspector","Sidebar","useAutoSwitchEditorSidebars","showSummary","useSelect","shortcut","keyboardShortcutsStore","getShortcutRepresentation","sidebar","interfaceStore","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","blockEditorStore","getBlockSelectionStart","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","editorStore","getCurrentPostType","getRenderingMode","enableComplementaryArea","useDispatch","onTabSelect","useCallback","newSelectedTabId","selectedTabId","onSelect","selectOnMove","_default","exports"],"sources":["@wordpress/editor/src/components/sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PatternOverridesPanel from '../pattern-overrides-panel';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebar from '../plugin-sidebar';\nimport PostSummary from './post-summary';\nimport PostTaxonomiesPanel from '../post-taxonomies/panel';\nimport PostTransformPanel from '../post-transform-panel';\nimport SidebarHeader from './header';\nimport TemplateContentPanel from '../template-content-panel';\nimport TemplatePartContentPanel from '../template-part-content-panel';\nimport useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';\nimport { sidebars } from './constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst SidebarContent = ( {\n\ttabName,\n\tkeyboardShortcut,\n\trenderingMode,\n\tonActionPerformed,\n\textraPanels,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"editor-sidebar__panel\"\n\t\t\theaderClassName=\"editor-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<PostSummary onActionPerformed={ onActionPerformed } />\n\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t<TemplateContentPanel renderingMode={ renderingMode } />\n\t\t\t\t\t<TemplatePartContentPanel />\n\t\t\t\t\t<PostTransformPanel />\n\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t{ extraPanels }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst Sidebar = ( { extraPanels, onActionPerformed } ) => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, showSummary, renderingMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tshowSummary: ! [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\t].includes( select( editorStore ).getCurrentPostType() ),\n\t\t\t\trenderingMode: select( editorStore ).getRenderingMode(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tshowSummary={ showSummary }\n\t\t\t\trenderingMode={ renderingMode }\n\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\textraPanels={ extraPanels }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default Sidebar;\n"],"mappings":";;;;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aAAa,EAAEN,MAAM,CAAE4E,YAAY,CAAC,CAACE,gBAAgB,CAAC;IACvD,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,MAAM;IAAEC;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEd,gBAAe,CAAC;EAEjE,MAAMe,WAAW,GAAG,IAAAC,oBAAW,EAC5BC,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BJ,uBAAuB,CAAE,MAAM,EAAEI,gBAAiB,CAAC;IACpD;EACD,CAAC,EACD,CAAEJ,uBAAuB,CAC1B,CAAC;EAED,oBACC,IAAArF,WAAA,CAAAoC,GAAA,EAACnC,IAAI;IACJyF,aAAa,EAAGhF,OAAS;IACzBiF,QAAQ,EAAGJ,WAAa;IACxBK,YAAY,EAAG,KAAO;IAAAlD,QAAA,eAEtB,IAAA1C,WAAA,CAAAoC,GAAA,EAAC3B,cAAc;MACdC,OAAO,EAAGA,OAAS;MACnBC,gBAAgB,EAAGA,gBAAkB;MACrCuD,WAAW,EAAGA,WAAa;MAC3BtD,aAAa,EAAGA,aAAe;MAC/BC,iBAAiB,EAAGA,iBAAmB;MACvCC,WAAW,EAAGA;IAAa,CAC3B;EAAC,CACG,CAAC;AAET,CAAC;AAAC,IAAA+E,QAAA,GAAAC,OAAA,CAAAzD,OAAA,GAEa2B,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_data","_element","_i18n","_icons","_keyboardShortcuts","_components","_interface","_patternOverridesPanel","_interopRequireDefault","_pluginDocumentSettingPanel","_pluginSidebar","_postSummary","_panel","_postTransformPanel","_header","_templateContentPanel","_templatePartContentPanel","_useAutoSwitchEditorSidebars","_constants","_lockUnlock","_store","_constants2","_jsxRuntime","Tabs","unlock","componentsPrivateApis","SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","SidebarContent","tabName","keyboardShortcut","onActionPerformed","extraPanels","tabListRef","useRef","tabsContextValue","useContext","Context","useEffect","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","jsx","default","identifier","header","Provider","value","children","ref","closeLabel","__","className","headerClassName","title","toggleShortcut","icon","isRTL","drawerLeft","drawerRight","isActiveByDefault","jsxs","TabPanel","tabId","sidebars","document","focusable","Slot","block","BlockInspector","Sidebar","useAutoSwitchEditorSidebars","showSummary","useSelect","shortcut","keyboardShortcutsStore","getShortcutRepresentation","sidebar","interfaceStore","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","blockEditorStore","getBlockSelectionStart","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","editorStore","getCurrentPostType","enableComplementaryArea","useDispatch","onTabSelect","useCallback","newSelectedTabId","selectedTabId","onSelect","selectOnMove","_default","exports"],"sources":["@wordpress/editor/src/components/sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PatternOverridesPanel from '../pattern-overrides-panel';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebar from '../plugin-sidebar';\nimport PostSummary from './post-summary';\nimport PostTaxonomiesPanel from '../post-taxonomies/panel';\nimport PostTransformPanel from '../post-transform-panel';\nimport SidebarHeader from './header';\nimport TemplateContentPanel from '../template-content-panel';\nimport TemplatePartContentPanel from '../template-part-content-panel';\nimport useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';\nimport { sidebars } from './constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst SidebarContent = ( {\n\ttabName,\n\tkeyboardShortcut,\n\tonActionPerformed,\n\textraPanels,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"editor-sidebar__panel\"\n\t\t\theaderClassName=\"editor-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<PostSummary onActionPerformed={ onActionPerformed } />\n\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t<TemplateContentPanel />\n\t\t\t\t\t<TemplatePartContentPanel />\n\t\t\t\t\t<PostTransformPanel />\n\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t{ extraPanels }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst Sidebar = ( { extraPanels, onActionPerformed } ) => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, showSummary } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tshowSummary: ! [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\t].includes( select( editorStore ).getCurrentPostType() ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tshowSummary={ showSummary }\n\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\textraPanels={ extraPanels }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default Sidebar;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,O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AG,IAAAC,oBAAW,EAC5BC,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BJ,uBAAuB,CAAE,MAAM,EAAEI,gBAAiB,CAAC;IACpD;EACD,CAAC,EACD,CAAEJ,uBAAuB,CAC1B,CAAC;EAED,oBACC,IAAAnF,WAAA,CAAAmC,GAAA,EAAClC,IAAI;IACJuF,aAAa,EAAG9E,OAAS;IACzB+E,QAAQ,EAAGJ,WAAa;IACxBK,YAAY,EAAG,KAAO;IAAAjD,QAAA,eAEtB,IAAAzC,WAAA,CAAAmC,GAAA,EAAC1B,cAAc;MACdC,OAAO,EAAGA,OAAS;MACnBC,gBAAgB,EAAGA,gBAAkB;MACrCsD,WAAW,EAAGA,WAAa;MAC3BrD,iBAAiB,EAAGA,iBAAmB;MACvCC,WAAW,EAAGA;IAAa,CAC3B;EAAC,CACG,CAAC;AAET,CAAC;AAAC,IAAA8E,QAAA,GAAAC,OAAA,CAAAxD,OAAA,GAEa2B,OAAO","ignoreList":[]}
@@ -25,7 +25,7 @@ var _jsxRuntime = require("react/jsx-runtime");
25
25
 
26
26
  const COMMENT_OPTIONS = [{
27
27
  label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
28
- children: [(0, _i18n.__)('Open'), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
28
+ children: [(0, _i18n._x)('Open', 'Adjective: e.g. "Comments are open"'), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
29
29
  variant: "muted",
30
30
  size: 12,
31
31
  children: (0, _i18n.__)('Visitors can add new comments and replies.')
@@ -60,9 +60,13 @@ function SiteDiscussion() {
60
60
  getCurrentPostType
61
61
  } = select(_store.store);
62
62
  const {
63
- getEditedEntityRecord
63
+ getEditedEntityRecord,
64
+ canUser
64
65
  } = select(_coreData.store);
65
- const siteSettings = getEditedEntityRecord('root', 'site');
66
+ const siteSettings = canUser('read', {
67
+ kind: 'root',
68
+ name: 'site'
69
+ }) ? getEditedEntityRecord('root', 'site') : undefined;
66
70
  return {
67
71
  isTemplate: getCurrentPostType() === _constants.TEMPLATE_POST_TYPE,
68
72
  postSlug: getEditedPostAttribute('slug'),