@wordpress/editor 14.3.0 → 14.5.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 (537) hide show
  1. package/CHANGELOG.md +8 -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 +35 -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 +7 -3
  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/commands/index.js +8 -2
  16. package/build/components/commands/index.js.map +1 -1
  17. package/build/components/document-bar/index.js +1 -1
  18. package/build/components/document-bar/index.js.map +1 -1
  19. package/build/components/global-styles-provider/index.js +15 -3
  20. package/build/components/global-styles-provider/index.js.map +1 -1
  21. package/build/components/header/back-button.js +7 -8
  22. package/build/components/header/back-button.js.map +1 -1
  23. package/build/components/header/index.js +21 -20
  24. package/build/components/header/index.js.map +1 -1
  25. package/build/components/page-attributes/order.js +1 -67
  26. package/build/components/page-attributes/order.js.map +1 -1
  27. package/build/components/page-attributes/panel.js +1 -4
  28. package/build/components/page-attributes/panel.js.map +1 -1
  29. package/build/components/page-attributes/parent.js +6 -2
  30. package/build/components/page-attributes/parent.js.map +1 -1
  31. package/build/components/post-actions/actions.js +131 -344
  32. package/build/components/post-actions/actions.js.map +1 -1
  33. package/build/components/post-actions/index.js +16 -6
  34. package/build/components/post-actions/index.js.map +1 -1
  35. package/build/components/post-author/hook.js +10 -3
  36. package/build/components/post-author/hook.js.map +1 -1
  37. package/build/components/post-author/panel.js +2 -1
  38. package/build/components/post-author/panel.js.map +1 -1
  39. package/build/components/post-card-panel/index.js +9 -3
  40. package/build/components/post-card-panel/index.js.map +1 -1
  41. package/build/components/post-comments/index.js +6 -20
  42. package/build/components/post-comments/index.js.map +1 -1
  43. package/build/components/post-content-information/index.js +7 -1
  44. package/build/components/post-content-information/index.js.map +1 -1
  45. package/build/components/post-discussion/panel.js +2 -2
  46. package/build/components/post-discussion/panel.js.map +1 -1
  47. package/build/components/post-excerpt/panel.js +1 -1
  48. package/build/components/post-excerpt/panel.js.map +1 -1
  49. package/build/components/post-featured-image/index.js +3 -1
  50. package/build/components/post-featured-image/index.js.map +1 -1
  51. package/build/components/post-last-revision/index.js +2 -1
  52. package/build/components/post-last-revision/index.js.map +1 -1
  53. package/build/components/post-publish-button/index.js +4 -11
  54. package/build/components/post-publish-button/index.js.map +1 -1
  55. package/build/components/post-publish-panel/maybe-category-panel.js +4 -1
  56. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  57. package/build/components/post-publish-panel/maybe-tags-panel.js +2 -1
  58. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  59. package/build/components/post-status/index.js +47 -51
  60. package/build/components/post-status/index.js.map +1 -1
  61. package/build/components/post-taxonomies/flat-term-selector.js +17 -6
  62. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  63. package/build/components/post-taxonomies/index.js +7 -1
  64. package/build/components/post-taxonomies/index.js.map +1 -1
  65. package/build/components/post-template/block-theme.js +4 -4
  66. package/build/components/post-template/block-theme.js.map +1 -1
  67. package/build/components/post-template/classic-theme.js +8 -2
  68. package/build/components/post-template/classic-theme.js.map +1 -1
  69. package/build/components/post-template/create-new-template-modal.js +3 -0
  70. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  71. package/build/components/post-template/create-new-template.js +4 -1
  72. package/build/components/post-template/create-new-template.js.map +1 -1
  73. package/build/components/post-template/hooks.js +5 -1
  74. package/build/components/post-template/hooks.js.map +1 -1
  75. package/build/components/post-template/panel.js +8 -2
  76. package/build/components/post-template/panel.js.map +1 -1
  77. package/build/components/post-trash/check.js +6 -4
  78. package/build/components/post-trash/check.js.map +1 -1
  79. package/build/components/post-url/panel.js +9 -4
  80. package/build/components/post-url/panel.js.map +1 -1
  81. package/build/components/posts-per-page/index.js +6 -2
  82. package/build/components/posts-per-page/index.js.map +1 -1
  83. package/build/components/preview-dropdown/index.js +82 -17
  84. package/build/components/preview-dropdown/index.js.map +1 -1
  85. package/build/components/provider/disable-non-page-content-blocks.js +14 -18
  86. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  87. package/build/components/provider/use-block-editor-settings.js +15 -6
  88. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  89. package/build/components/save-publish-panels/index.js +1 -2
  90. package/build/components/save-publish-panels/index.js.map +1 -1
  91. package/build/components/sidebar/index.js +3 -9
  92. package/build/components/sidebar/index.js.map +1 -1
  93. package/build/components/site-discussion/index.js +12 -22
  94. package/build/components/site-discussion/index.js.map +1 -1
  95. package/build/components/template-content-panel/index.js +17 -15
  96. package/build/components/template-content-panel/index.js.map +1 -1
  97. package/build/components/visual-editor/edit-template-blocks-notification.js +4 -4
  98. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  99. package/build/components/visual-editor/index.js +7 -3
  100. package/build/components/visual-editor/index.js.map +1 -1
  101. package/build/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  102. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
  103. package/build/dataviews/actions/delete-post.js +2 -0
  104. package/build/dataviews/actions/delete-post.js.map +1 -1
  105. package/build/dataviews/actions/export-pattern.native.js +9 -0
  106. package/build/dataviews/actions/export-pattern.native.js.map +1 -0
  107. package/build/dataviews/actions/permanently-delete-post.js +107 -0
  108. package/build/dataviews/actions/permanently-delete-post.js.map +1 -0
  109. package/build/dataviews/actions/restore-post.js +112 -0
  110. package/build/dataviews/actions/restore-post.js.map +1 -0
  111. package/build/dataviews/actions/trash-post.js +142 -0
  112. package/build/dataviews/actions/trash-post.js.map +1 -0
  113. package/build/dataviews/store/private-actions.js +45 -0
  114. package/build/dataviews/store/private-actions.js.map +1 -1
  115. package/build/dataviews/store/private-selectors.js +10 -10
  116. package/build/dataviews/store/private-selectors.js.map +1 -1
  117. package/build/dataviews/store/reducer.js +15 -1
  118. package/build/dataviews/store/reducer.js.map +1 -1
  119. package/build/dataviews/types.js.map +1 -1
  120. package/build/hooks/pattern-overrides.js +1 -1
  121. package/build/hooks/pattern-overrides.js.map +1 -1
  122. package/build/index.js +0 -1
  123. package/build/index.js.map +1 -1
  124. package/build/private-apis.js +3 -2
  125. package/build/private-apis.js.map +1 -1
  126. package/build/store/actions.js +16 -2
  127. package/build/store/actions.js.map +1 -1
  128. package/build/store/private-actions.js +8 -1
  129. package/build/store/private-actions.js.map +1 -1
  130. package/build/store/private-selectors.js +33 -2
  131. package/build/store/private-selectors.js.map +1 -1
  132. package/build/utils/media-upload/index.js +35 -2
  133. package/build/utils/media-upload/index.js.map +1 -1
  134. package/build-module/bindings/api.js +57 -0
  135. package/build-module/bindings/api.js.map +1 -0
  136. package/build-module/bindings/pattern-overrides.js +23 -13
  137. package/build-module/bindings/pattern-overrides.js.map +1 -1
  138. package/build-module/bindings/post-meta.js +35 -12
  139. package/build-module/bindings/post-meta.js.map +1 -1
  140. package/build-module/components/block-settings-menu/content-only-settings-menu.js +4 -1
  141. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  142. package/build-module/components/blog-title/index.js +7 -3
  143. package/build-module/components/blog-title/index.js.map +1 -1
  144. package/build-module/components/collapsible-block-toolbar/index.js +1 -2
  145. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  146. package/build-module/components/commands/index.js +8 -2
  147. package/build-module/components/commands/index.js.map +1 -1
  148. package/build-module/components/document-bar/index.js +1 -1
  149. package/build-module/components/document-bar/index.js.map +1 -1
  150. package/build-module/components/global-styles-provider/index.js +15 -3
  151. package/build-module/components/global-styles-provider/index.js.map +1 -1
  152. package/build-module/components/header/back-button.js +5 -7
  153. package/build-module/components/header/back-button.js.map +1 -1
  154. package/build-module/components/header/index.js +21 -22
  155. package/build-module/components/header/index.js.map +1 -1
  156. package/build-module/components/page-attributes/order.js +4 -70
  157. package/build-module/components/page-attributes/order.js.map +1 -1
  158. package/build-module/components/page-attributes/panel.js +1 -6
  159. package/build-module/components/page-attributes/panel.js.map +1 -1
  160. package/build-module/components/page-attributes/parent.js +7 -3
  161. package/build-module/components/page-attributes/parent.js.map +1 -1
  162. package/build-module/components/post-actions/actions.js +137 -350
  163. package/build-module/components/post-actions/actions.js.map +1 -1
  164. package/build-module/components/post-actions/index.js +16 -6
  165. package/build-module/components/post-actions/index.js.map +1 -1
  166. package/build-module/components/post-author/hook.js +10 -3
  167. package/build-module/components/post-author/hook.js.map +1 -1
  168. package/build-module/components/post-author/panel.js +2 -1
  169. package/build-module/components/post-author/panel.js.map +1 -1
  170. package/build-module/components/post-card-panel/index.js +9 -3
  171. package/build-module/components/post-card-panel/index.js.map +1 -1
  172. package/build-module/components/post-comments/index.js +8 -24
  173. package/build-module/components/post-comments/index.js.map +1 -1
  174. package/build-module/components/post-content-information/index.js +7 -1
  175. package/build-module/components/post-content-information/index.js.map +1 -1
  176. package/build-module/components/post-discussion/panel.js +3 -3
  177. package/build-module/components/post-discussion/panel.js.map +1 -1
  178. package/build-module/components/post-excerpt/panel.js +1 -1
  179. package/build-module/components/post-excerpt/panel.js.map +1 -1
  180. package/build-module/components/post-featured-image/index.js +3 -1
  181. package/build-module/components/post-featured-image/index.js.map +1 -1
  182. package/build-module/components/post-last-revision/index.js +2 -1
  183. package/build-module/components/post-last-revision/index.js.map +1 -1
  184. package/build-module/components/post-publish-button/index.js +4 -11
  185. package/build-module/components/post-publish-button/index.js.map +1 -1
  186. package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -1
  187. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  188. package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -1
  189. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  190. package/build-module/components/post-status/index.js +49 -53
  191. package/build-module/components/post-status/index.js.map +1 -1
  192. package/build-module/components/post-taxonomies/flat-term-selector.js +17 -6
  193. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  194. package/build-module/components/post-taxonomies/index.js +7 -1
  195. package/build-module/components/post-taxonomies/index.js.map +1 -1
  196. package/build-module/components/post-template/block-theme.js +4 -4
  197. package/build-module/components/post-template/block-theme.js.map +1 -1
  198. package/build-module/components/post-template/classic-theme.js +8 -2
  199. package/build-module/components/post-template/classic-theme.js.map +1 -1
  200. package/build-module/components/post-template/create-new-template-modal.js +3 -0
  201. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  202. package/build-module/components/post-template/create-new-template.js +4 -1
  203. package/build-module/components/post-template/create-new-template.js.map +1 -1
  204. package/build-module/components/post-template/hooks.js +5 -1
  205. package/build-module/components/post-template/hooks.js.map +1 -1
  206. package/build-module/components/post-template/panel.js +8 -2
  207. package/build-module/components/post-template/panel.js.map +1 -1
  208. package/build-module/components/post-trash/check.js +6 -4
  209. package/build-module/components/post-trash/check.js.map +1 -1
  210. package/build-module/components/post-url/panel.js +10 -7
  211. package/build-module/components/post-url/panel.js.map +1 -1
  212. package/build-module/components/posts-per-page/index.js +6 -2
  213. package/build-module/components/posts-per-page/index.js.map +1 -1
  214. package/build-module/components/preview-dropdown/index.js +84 -19
  215. package/build-module/components/preview-dropdown/index.js.map +1 -1
  216. package/build-module/components/provider/disable-non-page-content-blocks.js +15 -19
  217. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  218. package/build-module/components/provider/use-block-editor-settings.js +15 -6
  219. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  220. package/build-module/components/save-publish-panels/index.js +1 -2
  221. package/build-module/components/save-publish-panels/index.js.map +1 -1
  222. package/build-module/components/sidebar/index.js +3 -9
  223. package/build-module/components/sidebar/index.js.map +1 -1
  224. package/build-module/components/site-discussion/index.js +14 -24
  225. package/build-module/components/site-discussion/index.js.map +1 -1
  226. package/build-module/components/template-content-panel/index.js +18 -16
  227. package/build-module/components/template-content-panel/index.js.map +1 -1
  228. package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -4
  229. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  230. package/build-module/components/visual-editor/index.js +7 -3
  231. package/build-module/components/visual-editor/index.js.map +1 -1
  232. package/build-module/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  233. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
  234. package/build-module/dataviews/actions/delete-post.js +2 -0
  235. package/build-module/dataviews/actions/delete-post.js.map +1 -1
  236. package/build-module/dataviews/actions/export-pattern.native.js +3 -0
  237. package/build-module/dataviews/actions/export-pattern.native.js.map +1 -0
  238. package/build-module/dataviews/actions/permanently-delete-post.js +99 -0
  239. package/build-module/dataviews/actions/permanently-delete-post.js.map +1 -0
  240. package/build-module/dataviews/actions/restore-post.js +104 -0
  241. package/build-module/dataviews/actions/restore-post.js.map +1 -0
  242. package/build-module/dataviews/actions/trash-post.js +135 -0
  243. package/build-module/dataviews/actions/trash-post.js.map +1 -0
  244. package/build-module/dataviews/store/private-actions.js +40 -0
  245. package/build-module/dataviews/store/private-actions.js.map +1 -1
  246. package/build-module/dataviews/store/private-selectors.js +8 -9
  247. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  248. package/build-module/dataviews/store/reducer.js +15 -1
  249. package/build-module/dataviews/store/reducer.js.map +1 -1
  250. package/build-module/dataviews/types.js.map +1 -1
  251. package/build-module/hooks/pattern-overrides.js +1 -1
  252. package/build-module/hooks/pattern-overrides.js.map +1 -1
  253. package/build-module/index.js +0 -1
  254. package/build-module/index.js.map +1 -1
  255. package/build-module/private-apis.js +3 -2
  256. package/build-module/private-apis.js.map +1 -1
  257. package/build-module/store/actions.js +16 -2
  258. package/build-module/store/actions.js.map +1 -1
  259. package/build-module/store/private-actions.js +8 -1
  260. package/build-module/store/private-actions.js.map +1 -1
  261. package/build-module/store/private-selectors.js +32 -2
  262. package/build-module/store/private-selectors.js.map +1 -1
  263. package/build-module/utils/media-upload/index.js +36 -3
  264. package/build-module/utils/media-upload/index.js.map +1 -1
  265. package/build-style/style-rtl.css +97 -45
  266. package/build-style/style.css +97 -45
  267. package/build-types/bindings/api.d.ts +25 -0
  268. package/build-types/bindings/api.d.ts.map +1 -0
  269. package/build-types/bindings/pattern-overrides.d.ts +5 -6
  270. package/build-types/bindings/pattern-overrides.d.ts.map +1 -1
  271. package/build-types/bindings/post-meta.d.ts +11 -7
  272. package/build-types/bindings/post-meta.d.ts.map +1 -1
  273. package/build-types/components/autocompleters/user.d.ts +2 -2
  274. package/build-types/components/autocompleters/user.d.ts.map +1 -1
  275. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
  276. package/build-types/components/blog-title/index.d.ts.map +1 -1
  277. package/build-types/components/collapsible-block-toolbar/index.d.ts +1 -2
  278. package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -1
  279. package/build-types/components/commands/index.d.ts.map +1 -1
  280. package/build-types/components/document-bar/index.d.ts.map +1 -1
  281. package/build-types/components/document-outline/check.d.ts.map +1 -1
  282. package/build-types/components/document-outline/index.d.ts.map +1 -1
  283. package/build-types/components/editor-history/redo.d.ts +1 -1
  284. package/build-types/components/editor-history/undo.d.ts +1 -1
  285. package/build-types/components/editor-notices/index.d.ts.map +1 -1
  286. package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
  287. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  288. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  289. package/build-types/components/header/back-button.d.ts +1 -0
  290. package/build-types/components/header/back-button.d.ts.map +1 -1
  291. package/build-types/components/header/index.d.ts.map +1 -1
  292. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -1
  293. package/build-types/components/media-categories/index.d.ts.map +1 -1
  294. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  295. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  296. package/build-types/components/page-attributes/check.d.ts.map +1 -1
  297. package/build-types/components/page-attributes/order.d.ts +1 -1
  298. package/build-types/components/page-attributes/order.d.ts.map +1 -1
  299. package/build-types/components/page-attributes/panel.d.ts.map +1 -1
  300. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  301. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  302. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  303. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  304. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  305. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  306. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
  307. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  308. package/build-types/components/post-actions/index.d.ts.map +1 -1
  309. package/build-types/components/post-author/check.d.ts.map +1 -1
  310. package/build-types/components/post-author/hook.d.ts +1 -1
  311. package/build-types/components/post-author/hook.d.ts.map +1 -1
  312. package/build-types/components/post-author/index.d.ts.map +1 -1
  313. package/build-types/components/post-author/panel.d.ts.map +1 -1
  314. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  315. package/build-types/components/post-comments/index.d.ts.map +1 -1
  316. package/build-types/components/post-content-information/index.d.ts.map +1 -1
  317. package/build-types/components/post-discussion/panel.d.ts.map +1 -1
  318. package/build-types/components/post-excerpt/check.d.ts.map +1 -1
  319. package/build-types/components/post-excerpt/index.d.ts.map +1 -1
  320. package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
  321. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  322. package/build-types/components/post-featured-image/check.d.ts.map +1 -1
  323. package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
  324. package/build-types/components/post-format/index.d.ts.map +1 -1
  325. package/build-types/components/post-format/panel.d.ts.map +1 -1
  326. package/build-types/components/post-last-revision/check.d.ts.map +1 -1
  327. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  328. package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
  329. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  330. package/build-types/components/post-pending-status/check.d.ts.map +1 -1
  331. package/build-types/components/post-pending-status/index.d.ts.map +1 -1
  332. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  333. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  334. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
  335. package/build-types/components/post-saved-state/index.d.ts +1 -1
  336. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  337. package/build-types/components/post-schedule/check.d.ts.map +1 -1
  338. package/build-types/components/post-schedule/index.d.ts.map +1 -1
  339. package/build-types/components/post-schedule/label.d.ts.map +1 -1
  340. package/build-types/components/post-schedule/panel.d.ts.map +1 -1
  341. package/build-types/components/post-slug/check.d.ts.map +1 -1
  342. package/build-types/components/post-slug/index.d.ts.map +1 -1
  343. package/build-types/components/post-status/index.d.ts +2 -1
  344. package/build-types/components/post-status/index.d.ts.map +1 -1
  345. package/build-types/components/post-sticky/check.d.ts.map +1 -1
  346. package/build-types/components/post-sticky/index.d.ts.map +1 -1
  347. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
  348. package/build-types/components/post-sync-status/index.d.ts.map +1 -1
  349. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  350. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +9 -7
  351. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  352. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +13 -11
  353. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  354. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  355. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  356. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  357. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
  358. package/build-types/components/post-template/create-new-template.d.ts.map +1 -1
  359. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  360. package/build-types/components/post-template/panel.d.ts.map +1 -1
  361. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  362. package/build-types/components/post-trash/check.d.ts.map +1 -1
  363. package/build-types/components/post-trash/index.d.ts.map +1 -1
  364. package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
  365. package/build-types/components/post-url/check.d.ts.map +1 -1
  366. package/build-types/components/post-url/index.d.ts.map +1 -1
  367. package/build-types/components/post-url/label.d.ts.map +1 -1
  368. package/build-types/components/post-url/panel.d.ts.map +1 -1
  369. package/build-types/components/post-visibility/check.d.ts.map +1 -1
  370. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  371. package/build-types/components/posts-per-page/index.d.ts.map +1 -1
  372. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  373. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  374. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  375. package/build-types/components/provider/index.d.ts.map +1 -1
  376. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  377. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  378. package/build-types/components/sidebar/index.d.ts.map +1 -1
  379. package/build-types/components/site-discussion/index.d.ts.map +1 -1
  380. package/build-types/components/template-content-panel/index.d.ts +1 -3
  381. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  382. package/build-types/components/theme-support-check/index.d.ts.map +1 -1
  383. package/build-types/components/time-to-read/index.d.ts.map +1 -1
  384. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
  385. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +1 -1
  386. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
  387. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  388. package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts.map +1 -0
  389. package/build-types/components/word-count/index.d.ts.map +1 -1
  390. package/build-types/dataviews/actions/delete-post.d.ts.map +1 -1
  391. package/build-types/dataviews/actions/export-pattern.native.d.ts +3 -0
  392. package/build-types/dataviews/actions/export-pattern.native.d.ts.map +1 -0
  393. package/build-types/dataviews/actions/permanently-delete-post.d.ts +5 -0
  394. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +1 -0
  395. package/build-types/dataviews/actions/restore-post.d.ts +5 -0
  396. package/build-types/dataviews/actions/restore-post.d.ts.map +1 -0
  397. package/build-types/dataviews/actions/trash-post.d.ts +5 -0
  398. package/build-types/dataviews/actions/trash-post.d.ts.map +1 -0
  399. package/build-types/dataviews/api.d.ts +1 -1
  400. package/build-types/dataviews/api.d.ts.map +1 -1
  401. package/build-types/dataviews/store/private-actions.d.ts +8 -3
  402. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  403. package/build-types/dataviews/store/private-selectors.d.ts +2 -2
  404. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  405. package/build-types/dataviews/store/reducer.d.ts +4 -1
  406. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  407. package/build-types/dataviews/types.d.ts +9 -0
  408. package/build-types/dataviews/types.d.ts.map +1 -1
  409. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +1 -1
  410. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
  411. package/build-types/hooks/pattern-overrides.d.ts.map +1 -1
  412. package/build-types/private-apis.d.ts.map +1 -1
  413. package/build-types/store/actions.d.ts.map +1 -1
  414. package/build-types/store/private-actions.d.ts.map +1 -1
  415. package/build-types/store/private-selectors.d.ts +11 -0
  416. package/build-types/store/private-selectors.d.ts.map +1 -1
  417. package/build-types/store/reducer.d.ts +1 -0
  418. package/build-types/store/reducer.d.ts.map +1 -1
  419. package/build-types/store/selectors.d.ts +0 -1
  420. package/build-types/store/selectors.d.ts.map +1 -1
  421. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  422. package/package.json +38 -37
  423. package/src/bindings/api.js +57 -0
  424. package/src/bindings/pattern-overrides.js +28 -17
  425. package/src/bindings/post-meta.js +39 -14
  426. package/src/components/block-settings-menu/content-only-settings-menu.js +4 -4
  427. package/src/components/blog-title/index.js +8 -3
  428. package/src/components/collapsible-block-toolbar/index.js +1 -3
  429. package/src/components/collapsible-block-toolbar/style.scss +0 -3
  430. package/src/components/commands/index.js +4 -2
  431. package/src/components/document-bar/index.js +1 -1
  432. package/src/components/document-bar/style.scss +2 -6
  433. package/src/components/document-tools/style.scss +4 -4
  434. package/src/components/editor-interface/style.scss +9 -0
  435. package/src/components/global-styles-provider/index.js +22 -11
  436. package/src/components/header/back-button.js +6 -6
  437. package/src/components/header/index.js +27 -27
  438. package/src/components/header/style.scss +64 -21
  439. package/src/components/inserter-sidebar/style.scss +1 -6
  440. package/src/components/list-view-sidebar/style.scss +4 -0
  441. package/src/components/page-attributes/order.js +3 -77
  442. package/src/components/page-attributes/panel.js +1 -7
  443. package/src/components/page-attributes/parent.js +25 -7
  444. package/src/components/post-actions/actions.js +158 -463
  445. package/src/components/post-actions/index.js +19 -7
  446. package/src/components/post-author/hook.js +11 -3
  447. package/src/components/post-author/panel.js +3 -1
  448. package/src/components/post-card-panel/index.js +9 -3
  449. package/src/components/post-comments/index.js +8 -21
  450. package/src/components/post-content-information/index.js +7 -1
  451. package/src/components/post-discussion/panel.js +5 -3
  452. package/src/components/post-excerpt/panel.js +2 -1
  453. package/src/components/post-featured-image/index.js +5 -1
  454. package/src/components/post-last-revision/index.js +1 -0
  455. package/src/components/post-panel-row/style.scss +0 -1
  456. package/src/components/post-publish-button/index.js +4 -17
  457. package/src/components/post-publish-panel/maybe-category-panel.js +4 -1
  458. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  459. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  460. package/src/components/post-status/index.js +29 -51
  461. package/src/components/post-taxonomies/flat-term-selector.js +19 -5
  462. package/src/components/post-taxonomies/index.js +8 -1
  463. package/src/components/post-template/block-theme.js +5 -1
  464. package/src/components/post-template/classic-theme.js +8 -3
  465. package/src/components/post-template/create-new-template-modal.js +7 -1
  466. package/src/components/post-template/create-new-template.js +4 -1
  467. package/src/components/post-template/hooks.js +8 -2
  468. package/src/components/post-template/panel.js +10 -2
  469. package/src/components/post-trash/check.js +9 -5
  470. package/src/components/post-url/panel.js +15 -4
  471. package/src/components/posts-per-page/index.js +7 -2
  472. package/src/components/preview-dropdown/index.js +113 -35
  473. package/src/components/preview-dropdown/style.scss +5 -0
  474. package/src/components/provider/disable-non-page-content-blocks.js +27 -24
  475. package/src/components/provider/use-block-editor-settings.js +15 -6
  476. package/src/components/save-publish-panels/index.js +1 -4
  477. package/src/components/sidebar/index.js +2 -5
  478. package/src/components/site-discussion/index.js +15 -22
  479. package/src/components/template-content-panel/index.js +37 -21
  480. package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
  481. package/src/components/visual-editor/index.js +13 -8
  482. package/src/components/visual-editor/style.scss +1 -4
  483. package/src/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  484. package/src/dataviews/actions/delete-post.tsx +2 -0
  485. package/src/dataviews/actions/export-pattern.native.tsx +3 -0
  486. package/src/dataviews/actions/permanently-delete-post.tsx +116 -0
  487. package/src/dataviews/actions/restore-post.tsx +134 -0
  488. package/src/dataviews/actions/trash-post.tsx +196 -0
  489. package/src/dataviews/store/private-actions.ts +68 -0
  490. package/src/dataviews/store/private-selectors.ts +9 -17
  491. package/src/dataviews/store/reducer.ts +20 -1
  492. package/src/dataviews/types.ts +11 -0
  493. package/src/hooks/pattern-overrides.js +1 -1
  494. package/src/index.js +0 -1
  495. package/src/private-apis.js +6 -2
  496. package/src/store/actions.js +36 -13
  497. package/src/store/private-actions.js +8 -4
  498. package/src/store/private-selectors.js +45 -2
  499. package/src/store/test/actions.js +9 -3
  500. package/src/store/test/private-selectors.js +78 -0
  501. package/src/utils/media-upload/index.js +38 -3
  502. package/tsconfig.tsbuildinfo +1 -1
  503. package/build/bindings/index.js +0 -22
  504. package/build/bindings/index.js.map +0 -1
  505. package/build/dataviews/actions/index.js +0 -32
  506. package/build/dataviews/actions/index.js.map +0 -1
  507. package/build/hooks/use-select-nearest-editable-block.js.map +0 -1
  508. package/build/store/utils/get-filtered-template-parts.js +0 -71
  509. package/build/store/utils/get-filtered-template-parts.js.map +0 -1
  510. package/build/utils/set-nested-value.js +0 -44
  511. package/build/utils/set-nested-value.js.map +0 -1
  512. package/build-module/bindings/index.js +0 -17
  513. package/build-module/bindings/index.js.map +0 -1
  514. package/build-module/dataviews/actions/index.js +0 -24
  515. package/build-module/dataviews/actions/index.js.map +0 -1
  516. package/build-module/hooks/use-select-nearest-editable-block.js.map +0 -1
  517. package/build-module/store/utils/get-filtered-template-parts.js +0 -64
  518. package/build-module/store/utils/get-filtered-template-parts.js.map +0 -1
  519. package/build-module/utils/set-nested-value.js +0 -38
  520. package/build-module/utils/set-nested-value.js.map +0 -1
  521. package/build-types/bindings/index.d.ts +0 -2
  522. package/build-types/bindings/index.d.ts.map +0 -1
  523. package/build-types/dataviews/actions/index.d.ts +0 -2
  524. package/build-types/dataviews/actions/index.d.ts.map +0 -1
  525. package/build-types/hooks/use-select-nearest-editable-block.d.ts.map +0 -1
  526. package/build-types/store/utils/get-filtered-template-parts.d.ts +0 -3
  527. package/build-types/store/utils/get-filtered-template-parts.d.ts.map +0 -1
  528. package/build-types/utils/set-nested-value.d.ts +0 -20
  529. package/build-types/utils/set-nested-value.d.ts.map +0 -1
  530. package/src/bindings/index.js +0 -15
  531. package/src/components/document-outline/test/__snapshots__/index.js.snap +0 -111
  532. package/src/components/document-outline/test/index.js +0 -185
  533. package/src/dataviews/actions/index.ts +0 -25
  534. package/src/store/utils/get-filtered-template-parts.js +0 -69
  535. package/src/store/utils/test/get-filtered-template-parts.js +0 -189
  536. package/src/utils/set-nested-value.js +0 -39
  537. /package/build-types/{hooks → components/visual-editor}/use-select-nearest-editable-block.d.ts +0 -0
@@ -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":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAKA,IAAAQ,sBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,2BAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,cAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,YAAA,GAAAH,sBAAA,CAAAT,OAAA;AACA,IAAAa,MAAA,GAAAJ,sBAAA,CAAAT,OAAA;AACA,IAAAc,mBAAA,GAAAL,sBAAA,CAAAT,OAAA;AACA,IAAAe,OAAA,GAAAN,sBAAA,CAAAT,OAAA;AACA,IAAAgB,qBAAA,GAAAP,sBAAA,CAAAT,OAAA;AACA,IAAAiB,yBAAA,GAAAR,sBAAA,CAAAT,OAAA;AACA,IAAAkB,4BAAA,GAAAT,sBAAA,CAAAT,OAAA;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AAW,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,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAKA,IAAAQ,sBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,2BAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,cAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,YAAA,GAAAH,sBAAA,CAAAT,OAAA;AACA,IAAAa,MAAA,GAAAJ,sBAAA,CAAAT,OAAA;AACA,IAAAc,mBAAA,GAAAL,sBAAA,CAAAT,OAAA;AACA,IAAAe,OAAA,GAAAN,sBAAA,CAAAT,OAAA;AACA,IAAAgB,qBAAA,GAAAP,sBAAA,CAAAT,OAAA;AACA,IAAAiB,yBAAA,GAAAR,sBAAA,CAAAT,OAAA;AACA,IAAAkB,4BAAA,GAAAT,sBAAA,CAAAT,OAAA;AACA,IAAAmB,UAAA,GAAAnB,OAAA;AACA,IAAAoB,WAAA,GAAApB,OAA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label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
28
- children: [(0, _i18n.__)('Open'), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
29
- variant: "muted",
30
- size: 12,
31
- children: (0, _i18n.__)('Visitors can add new comments and replies.')
32
- })]
33
- }),
34
- value: 'open'
27
+ label: (0, _i18n._x)('Open', 'Adjective: e.g. "Comments are open"'),
28
+ value: 'open',
29
+ description: (0, _i18n.__)('Visitors can add new comments and replies.')
35
30
  }, {
36
- label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
37
- children: [(0, _i18n.__)('Closed'), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
38
- variant: "muted",
39
- size: 12,
40
- children: (0, _i18n.__)('Visitors cannot add new comments or replies.')
41
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
42
- variant: "muted",
43
- size: 12,
44
- children: (0, _i18n.__)('Existing comments remain visible.')
45
- })]
46
- }),
47
- value: ''
31
+ label: (0, _i18n.__)('Closed'),
32
+ value: '',
33
+ description: [(0, _i18n.__)('Visitors cannot add new comments or replies.'), (0, _i18n.__)('Existing comments remain visible.')].join(' ')
48
34
  }];
49
35
  function SiteDiscussion() {
50
36
  const {
@@ -60,9 +46,13 @@ function SiteDiscussion() {
60
46
  getCurrentPostType
61
47
  } = select(_store.store);
62
48
  const {
63
- getEditedEntityRecord
49
+ getEditedEntityRecord,
50
+ canUser
64
51
  } = select(_coreData.store);
65
- const siteSettings = getEditedEntityRecord('root', 'site');
52
+ const siteSettings = canUser('read', {
53
+ kind: 'root',
54
+ name: 'site'
55
+ }) ? getEditedEntityRecord('root', 'site') : undefined;
66
56
  return {
67
57
  isTemplate: getCurrentPostType() === _constants.TEMPLATE_POST_TYPE,
68
58
  postSlug: getEditedPostAttribute('slug'),
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_data","_coreData","_components","_element","_blockEditor","_constants","_postPanelRow","_interopRequireDefault","_store","_jsxRuntime","COMMENT_OPTIONS","label","jsxs","Fragment","children","__","jsx","__experimentalText","variant","size","value","SiteDiscussion","editEntityRecord","useDispatch","coreStore","allowCommentsOnNewPosts","isTemplate","postSlug","useSelect","select","getEditedPostAttribute","getCurrentPostType","editorStore","getEditedEntityRecord","siteSettings","TEMPLATE_POST_TYPE","default_comment_status","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","offset","shift","includes","setAllowCommentsOnNewPosts","newValue","undefined","default","ref","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","Button","onClick","renderContent","onClose","__experimentalInspectorPopoverHeader","title","__experimentalVStack","spacing","RadioControl","className","hideLabelFromVision","options","onChange","selected"],"sources":["@wordpress/editor/src/components/site-discussion/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\tRadioControl,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\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 PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\nconst COMMENT_OPTIONS = [\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Open' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Visitors can add new comments and replies.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'open',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Closed' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Visitors cannot add new comments or replies.' ) }\n\t\t\t\t</Text>\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Existing comments remain visible.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: '',\n\t},\n];\n\nexport default function SiteDiscussion() {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { allowCommentsOnNewPosts, isTemplate, postSlug } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostAttribute, getCurrentPostType } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = getEditedEntityRecord( 'root', 'site' );\n\t\t\treturn {\n\t\t\t\tisTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,\n\t\t\t\tpostSlug: getEditedPostAttribute( 'slug' ),\n\t\t\t\tallowCommentsOnNewPosts:\n\t\t\t\t\tsiteSettings?.default_comment_status || '',\n\t\t\t};\n\t\t},\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 setAllowCommentsOnNewPosts = ( newValue ) => {\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tdefault_comment_status: newValue ? 'open' : null,\n\t\t} );\n\t};\n\treturn (\n\t\t<PostPanelRow label={ __( 'Discussion' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tcontentClassName=\"editor-site-discussion-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 discussion settings' ) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ allowCommentsOnNewPosts\n\t\t\t\t\t\t\t? __( 'Comments open' )\n\t\t\t\t\t\t\t: __( 'Comments closed' ) }\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={ __( 'Discussion' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Changes will apply to new posts only. Individual posts may override these settings.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\tclassName=\"editor-site-discussion__options\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tlabel={ __( 'Comment status' ) }\n\t\t\t\t\t\t\t\toptions={ COMMENT_OPTIONS }\n\t\t\t\t\t\t\t\tonChange={ setAllowCommentsOnNewPosts }\n\t\t\t\t\t\t\t\tselected={ allowCommentsOnNewPosts }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n"],"mappings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AA,CAAAO,GAAA,EAACd,WAAA,CAAAgE,YAAY;YACZC,SAAS,EAAC,iCAAiC;YAC3CC,mBAAmB;YACnBzD,KAAK,EAAG,IAAAI,QAAE,EAAE,gBAAiB,CAAG;YAChCsD,OAAO,EAAG3D,eAAiB;YAC3B4D,QAAQ,EAAGvB,0BAA4B;YACvCwB,QAAQ,EAAG9C;UAAyB,CACpC,CAAC;QAAA,CACK,CAAC;MAAA,CACR;IACA,CACH;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_data","_coreData","_components","_element","_blockEditor","_constants","_postPanelRow","_interopRequireDefault","_store","_jsxRuntime","COMMENT_OPTIONS","label","_x","value","description","__","join","SiteDiscussion","editEntityRecord","useDispatch","coreStore","allowCommentsOnNewPosts","isTemplate","postSlug","useSelect","select","getEditedPostAttribute","getCurrentPostType","editorStore","getEditedEntityRecord","canUser","siteSettings","kind","name","undefined","TEMPLATE_POST_TYPE","default_comment_status","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","offset","shift","includes","setAllowCommentsOnNewPosts","newValue","jsx","default","ref","children","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","Button","size","variant","onClick","renderContent","onClose","jsxs","Fragment","__experimentalInspectorPopoverHeader","title","__experimentalVStack","spacing","__experimentalText","RadioControl","className","hideLabelFromVision","options","onChange","selected"],"sources":["@wordpress/editor/src/components/site-discussion/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tButton,\n\tDropdown,\n\tRadioControl,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\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 PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\nconst COMMENT_OPTIONS = [\n\t{\n\t\tlabel: _x( 'Open', 'Adjective: e.g. \"Comments are open\"' ),\n\t\tvalue: 'open',\n\t\tdescription: __( 'Visitors can add new comments and replies.' ),\n\t},\n\t{\n\t\tlabel: __( 'Closed' ),\n\t\tvalue: '',\n\t\tdescription: [\n\t\t\t__( 'Visitors cannot add new comments or replies.' ),\n\t\t\t__( 'Existing comments remain visible.' ),\n\t\t].join( ' ' ),\n\t},\n];\n\nexport default function SiteDiscussion() {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { allowCommentsOnNewPosts, isTemplate, postSlug } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostAttribute, getCurrentPostType } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { getEditedEntityRecord, canUser } = select( coreStore );\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? getEditedEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\t\t\treturn {\n\t\t\t\tisTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,\n\t\t\t\tpostSlug: getEditedPostAttribute( 'slug' ),\n\t\t\t\tallowCommentsOnNewPosts:\n\t\t\t\t\tsiteSettings?.default_comment_status || '',\n\t\t\t};\n\t\t},\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 setAllowCommentsOnNewPosts = ( newValue ) => {\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tdefault_comment_status: newValue ? 'open' : null,\n\t\t} );\n\t};\n\treturn (\n\t\t<PostPanelRow label={ __( 'Discussion' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tcontentClassName=\"editor-site-discussion-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 discussion settings' ) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ allowCommentsOnNewPosts\n\t\t\t\t\t\t\t? __( 'Comments open' )\n\t\t\t\t\t\t\t: __( 'Comments closed' ) }\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={ __( 'Discussion' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Changes will apply to new posts only. Individual posts may override these settings.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\tclassName=\"editor-site-discussion__options\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tlabel={ __( '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AAiC;YAC3CC,mBAAmB;YACnB/D,KAAK,EAAG,IAAAI,QAAE,EAAE,gBAAiB,CAAG;YAChC4D,OAAO,EAAGjE,eAAiB;YAC3BkE,QAAQ,EAAG7B,0BAA4B;YACvC8B,QAAQ,EAAGxD;UAAyB,CACpC,CAAC;QAAA,CACK,CAAC;MAAA,CACR;IACA,CACH;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}
@@ -9,6 +9,8 @@ var _blockEditor = require("@wordpress/block-editor");
9
9
  var _components = require("@wordpress/components");
10
10
  var _i18n = require("@wordpress/i18n");
11
11
  var _interface = require("@wordpress/interface");
12
+ var _hooks = require("@wordpress/hooks");
13
+ var _element = require("@wordpress/element");
12
14
  var _lockUnlock = require("../../lock-unlock");
13
15
  var _constants = require("../../store/constants");
14
16
  var _store = require("../../store");
@@ -24,30 +26,30 @@ var _jsxRuntime = require("react/jsx-runtime");
24
26
  const {
25
27
  BlockQuickNavigation
26
28
  } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
27
- const PAGE_CONTENT_BLOCKS = ['core/post-content', 'core/post-featured-image', 'core/post-title'];
29
+ const POST_CONTENT_BLOCK_TYPES = ['core/post-title', 'core/post-featured-image', 'core/post-content'];
28
30
  const TEMPLATE_PART_BLOCK = 'core/template-part';
29
- function TemplateContentPanel({
30
- renderingMode
31
- }) {
32
- const {
33
- enableComplementaryArea
34
- } = (0, _data.useDispatch)(_interface.store);
31
+ function TemplateContentPanel() {
32
+ const postContentBlockTypes = (0, _element.useMemo)(() => (0, _hooks.applyFilters)('editor.postContentBlockTypes', POST_CONTENT_BLOCK_TYPES), []);
35
33
  const {
36
34
  clientIds,
37
- postType
35
+ postType,
36
+ renderingMode
38
37
  } = (0, _data.useSelect)(select => {
39
38
  const {
40
- getBlocksByName
41
- } = select(_blockEditor.store);
42
- const {
43
- getCurrentPostType
44
- } = select(_store.store);
39
+ getCurrentPostType,
40
+ getPostBlocksByName,
41
+ getRenderingMode
42
+ } = (0, _lockUnlock.unlock)(select(_store.store));
45
43
  const _postType = getCurrentPostType();
46
44
  return {
47
45
  postType: _postType,
48
- clientIds: getBlocksByName(_constants.TEMPLATE_POST_TYPE === _postType ? TEMPLATE_PART_BLOCK : PAGE_CONTENT_BLOCKS)
46
+ clientIds: getPostBlocksByName(_constants.TEMPLATE_POST_TYPE === _postType ? TEMPLATE_PART_BLOCK : postContentBlockTypes),
47
+ renderingMode: getRenderingMode()
49
48
  };
50
- }, []);
49
+ }, [postContentBlockTypes]);
50
+ const {
51
+ enableComplementaryArea
52
+ } = (0, _data.useDispatch)(_interface.store);
51
53
  if (renderingMode === 'post-only' && postType !== _constants.TEMPLATE_POST_TYPE) {
52
54
  return null;
53
55
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_blockEditor","_components","_i18n","_interface","_lockUnlock","_constants","_store","_jsxRuntime","BlockQuickNavigation","unlock","blockEditorPrivateApis","PAGE_CONTENT_BLOCKS","TEMPLATE_PART_BLOCK","TemplateContentPanel","renderingMode","enableComplementaryArea","useDispatch","interfaceStore","clientIds","postType","useSelect","select","getBlocksByName","blockEditorStore","getCurrentPostType","editorStore","_postType","TEMPLATE_POST_TYPE","jsx","PanelBody","title","__","children","onSelect"],"sources":["@wordpress/editor/src/components/template-content-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport { store as editorStore } from '../../store';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nconst PAGE_CONTENT_BLOCKS = [\n\t'core/post-content',\n\t'core/post-featured-image',\n\t'core/post-title',\n];\n\nconst TEMPLATE_PART_BLOCK = 'core/template-part';\n\nexport default function TemplateContentPanel( { renderingMode } ) {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst { clientIds, postType } = useSelect( ( select ) => {\n\t\tconst { getBlocksByName } = select( blockEditorStore );\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\n\t\treturn {\n\t\t\tpostType: _postType,\n\t\t\tclientIds: getBlocksByName(\n\t\t\t\tTEMPLATE_POST_TYPE === _postType\n\t\t\t\t\t? TEMPLATE_PART_BLOCK\n\t\t\t\t\t: PAGE_CONTENT_BLOCKS\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tif ( renderingMode === 'post-only' && postType !== TEMPLATE_POST_TYPE ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t<BlockQuickNavigation\n\t\t\t\tclientIds={ clientIds }\n\t\t\t\tonSelect={ () => {\n\t\t\t\t\tenableComplementaryArea( 'core', 'edit-post/document' );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAmD,IAAAQ,WAAA,GAAAR,OAAA;AAjBnD;AACA;AACA;;AAUA;AACA;AACA;;AAKA,MAAM;EAAES;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,MAAMC,mBAAmB,GAAG,CAC3B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,CACjB;AAED,MAAMC,mBAAmB,GAAG,oBAAoB;AAEjC,SAASC,oBAAoBA,CAAE;EAAEC;AAAc,CAAC,EAAG;EACjE,MAAM;IAAEC;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,gBAAe,CAAC;EACjE,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxD,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IACtD,MAAM;MAAEC;IAAmB,CAAC,GAAGH,MAAM,CAAEI,YAAY,CAAC;IACpD,MAAMC,SAAS,GAAGF,kBAAkB,CAAC,CAAC;IACtC,OAAO;MACNL,QAAQ,EAAEO,SAAS;MACnBR,SAAS,EAAEI,eAAe,CACzBK,6BAAkB,KAAKD,SAAS,GAC7Bd,mBAAmB,GACnBD,mBACJ;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKG,aAAa,KAAK,WAAW,IAAIK,QAAQ,KAAKQ,6BAAkB,EAAG;IACvE,OAAO,IAAI;EACZ;EAEA,oBACC,IAAApB,WAAA,CAAAqB,GAAA,EAAC3B,WAAA,CAAA4B,SAAS;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IAAAC,QAAA,eACnC,IAAAzB,WAAA,CAAAqB,GAAA,EAACpB,oBAAoB;MACpBU,SAAS,EAAGA,SAAW;MACvBe,QAAQ,EAAGA,CAAA,KAAM;QAChBlB,uBAAuB,CAAE,MAAM,EAAE,oBAAqB,CAAC;MACxD;IAAG,CACH;EAAC,CACQ,CAAC;AAEd","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_blockEditor","_components","_i18n","_interface","_hooks","_element","_lockUnlock","_constants","_store","_jsxRuntime","BlockQuickNavigation","unlock","blockEditorPrivateApis","POST_CONTENT_BLOCK_TYPES","TEMPLATE_PART_BLOCK","TemplateContentPanel","postContentBlockTypes","useMemo","applyFilters","clientIds","postType","renderingMode","useSelect","select","getCurrentPostType","getPostBlocksByName","getRenderingMode","editorStore","_postType","TEMPLATE_POST_TYPE","enableComplementaryArea","useDispatch","interfaceStore","jsx","PanelBody","title","__","children","onSelect"],"sources":["@wordpress/editor/src/components/template-content-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { applyFilters } from '@wordpress/hooks';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport { store as editorStore } from '../../store';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nconst POST_CONTENT_BLOCK_TYPES = [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n];\n\nconst TEMPLATE_PART_BLOCK = 'core/template-part';\n\nexport default function TemplateContentPanel() {\n\tconst postContentBlockTypes = useMemo(\n\t\t() =>\n\t\t\tapplyFilters(\n\t\t\t\t'editor.postContentBlockTypes',\n\t\t\t\tPOST_CONTENT_BLOCK_TYPES\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst { clientIds, postType, renderingMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetPostBlocksByName,\n\t\t\t\tgetRenderingMode,\n\t\t\t} = unlock( select( editorStore ) );\n\t\t\tconst _postType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tpostType: _postType,\n\t\t\t\tclientIds: getPostBlocksByName(\n\t\t\t\t\tTEMPLATE_POST_TYPE === _postType\n\t\t\t\t\t\t? TEMPLATE_PART_BLOCK\n\t\t\t\t\t\t: postContentBlockTypes\n\t\t\t\t),\n\t\t\t\trenderingMode: getRenderingMode(),\n\t\t\t};\n\t\t},\n\t\t[ postContentBlockTypes ]\n\t);\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tif ( renderingMode === 'post-only' && postType !== TEMPLATE_POST_TYPE ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t<BlockQuickNavigation\n\t\t\t\tclientIds={ clientIds }\n\t\t\t\tonSelect={ () => {\n\t\t\t\t\tenableComplementaryArea( 'core', 'edit-post/document' );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAAmD,IAAAU,WAAA,GAAAV,OAAA;AAhBnD;AACA;AACA;;AASA;AACA;AACA;;AAKA,MAAM;EAAEW;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,MAAMC,wBAAwB,GAAG,CAChC,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,CACnB;AAED,MAAMC,mBAAmB,GAAG,oBAAoB;AAEjC,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,qBAAqB,GAAG,IAAAC,gBAAO,EACpC,MACC,IAAAC,mBAAY,EACX,8BAA8B,EAC9BL,wBACD,CAAC,EACF,EACD,CAAC;EAED,MAAM;IAAEM,SAAS;IAAEC,QAAQ;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EACrDC,MAAM,IAAM;IACb,MAAM;MACLC,kBAAkB;MAClBC,mBAAmB;MACnBC;IACD,CAAC,GAAG,IAAAf,kBAAM,EAAEY,MAAM,CAAEI,YAAY,CAAE,CAAC;IACnC,MAAMC,SAAS,GAAGJ,kBAAkB,CAAC,CAAC;IACtC,OAAO;MACNJ,QAAQ,EAAEQ,SAAS;MACnBT,SAAS,EAAEM,mBAAmB,CAC7BI,6BAAkB,KAAKD,SAAS,GAC7Bd,mBAAmB,GACnBE,qBACJ,CAAC;MACDK,aAAa,EAAEK,gBAAgB,CAAC;IACjC,CAAC;EACF,CAAC,EACD,CAAEV,qBAAqB,CACxB,CAAC;EAED,MAAM;IAAEc;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,gBAAe,CAAC;EAEjE,IAAKX,aAAa,KAAK,WAAW,IAAID,QAAQ,KAAKS,6BAAkB,EAAG;IACvE,OAAO,IAAI;EACZ;EAEA,oBACC,IAAApB,WAAA,CAAAwB,GAAA,EAAChC,WAAA,CAAAiC,SAAS;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IAAAC,QAAA,eACnC,IAAA5B,WAAA,CAAAwB,GAAA,EAACvB,oBAAoB;MACpBS,SAAS,EAAGA,SAAW;MACvBmB,QAAQ,EAAGA,CAAA,KAAM;QAChBR,uBAAuB,CAAE,MAAM,EAAE,oBAAqB,CAAC;MACxD;IAAG,CACH;EAAC,CACQ,CAAC;AAEd","ignoreList":[]}
@@ -48,10 +48,10 @@ var _jsxRuntime = require("react/jsx-runtime");
48
48
  templateId: getCurrentTemplateId()
49
49
  };
50
50
  }, []);
51
- const canEditTemplate = (0, _data.useSelect)(select => {
52
- var _select$canUser;
53
- return (_select$canUser = select(_coreData.store).canUser('create', 'templates')) !== null && _select$canUser !== void 0 ? _select$canUser : false;
54
- });
51
+ const canEditTemplate = (0, _data.useSelect)(select => !!select(_coreData.store).canUser('create', {
52
+ kind: 'postType',
53
+ name: 'wp_template'
54
+ }), []);
55
55
  const [isDialogOpen, setIsDialogOpen] = (0, _element.useState)(false);
56
56
  (0, _element.useEffect)(() => {
57
57
  const handleDblClick = event => {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_coreData","_element","_i18n","_components","_store","_jsxRuntime","EditTemplateBlocksNotification","contentRef","onNavigateToEntityRecord","templateId","useSelect","select","getEditorSettings","getCurrentTemplateId","editorStore","canEditTemplate","_select$canUser","coreStore","canUser","isDialogOpen","setIsDialogOpen","useState","useEffect","handleDblClick","event","target","classList","contains","canvas","current","addEventListener","removeEventListener","jsx","__experimentalConfirmDialog","isOpen","confirmButtonText","__","onConfirm","postId","postType","onCancel","size","children"],"sources":["@wordpress/editor/src/components/visual-editor/edit-template-blocks-notification.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component that:\n *\n * - Displays a 'Edit your template to edit this block' notification when the\n * user is focusing on editing page content and clicks on a disabled template\n * block.\n * - Displays a 'Edit your template to edit this block' dialog when the user\n * is focusing on editing page conetnt and double clicks on a disabled\n * template block.\n *\n * @param {Object} props\n * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block\n * editor iframe canvas.\n */\nexport default function EditTemplateBlocksNotification( { contentRef } ) {\n\tconst { onNavigateToEntityRecord, templateId } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentTemplateId } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tonNavigateToEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToEntityRecord,\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t};\n\t}, [] );\n\n\tconst canEditTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) ?? false\n\t);\n\n\tconst [ isDialogOpen, setIsDialogOpen ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst handleDblClick = ( event ) => {\n\t\t\tif ( ! canEditTemplate ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! event.target.classList.contains( 'is-root-container' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsDialogOpen( true );\n\t\t};\n\n\t\tconst canvas = contentRef.current;\n\t\tcanvas?.addEventListener( 'dblclick', handleDblClick );\n\t\treturn () => {\n\t\t\tcanvas?.removeEventListener( 'dblclick', handleDblClick );\n\t\t};\n\t}, [ contentRef, canEditTemplate ] );\n\n\tif ( ! canEditTemplate ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isDialogOpen }\n\t\t\tconfirmButtonText={ __( 'Edit template' ) }\n\t\t\tonConfirm={ () => {\n\t\t\t\tsetIsDialogOpen( false );\n\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\tpostId: templateId,\n\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonCancel={ () => setIsDialogOpen( false ) }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?'\n\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAAmD,IAAAM,WAAA,GAAAN,OAAA;AAZnD;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACe,SAASO,8BAA8BA,CAAE;EAAEC;AAAW,CAAC,EAAG;E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WAAA,CAAA8B,2BAAa;IACbC,MAAM,EAAGf,YAAc;IACvBgB,iBAAiB,EAAG,IAAAC,QAAE,EAAE,eAAgB,CAAG;IAC3CC,SAAS,EAAGA,CAAA,KAAM;MACjBjB,eAAe,CAAE,KAAM,CAAC;MACxBZ,wBAAwB,CAAE;QACzB8B,MAAM,EAAE7B,UAAU;QAClB8B,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ,CAAG;IACHC,QAAQ,EAAGA,CAAA,KAAMpB,eAAe,CAAE,KAAM,CAAG;IAC3CqB,IAAI,EAAC,QAAQ;IAAAC,QAAA,EAEX,IAAAN,QAAE,EACH,6IACD;EAAC,CACa,CAAC;AAElB","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_coreData","_element","_i18n","_components","_store","_jsxRuntime","EditTemplateBlocksNotification","contentRef","onNavigateToEntityRecord","templateId","useSelect","select","getEditorSettings","getCurrentTemplateId","editorStore","canEditTemplate","coreStore","canUser","kind","name","isDialogOpen","setIsDialogOpen","useState","useEffect","handleDblClick","event","target","classList","contains","canvas","current","addEventListener","removeEventListener","jsx","__experimentalConfirmDialog","isOpen","confirmButtonText","__","onConfirm","postId","postType","onCancel","size","children"],"sources":["@wordpress/editor/src/components/visual-editor/edit-template-blocks-notification.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component that:\n *\n * - Displays a 'Edit your template to edit this block' notification when the\n * user is focusing on editing page content and clicks on a disabled template\n * block.\n * - Displays a 'Edit your template to edit this block' dialog when the user\n * is focusing on editing page conetnt and double clicks on a disabled\n * template block.\n *\n * @param {Object} props\n * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block\n * editor iframe canvas.\n */\nexport default function EditTemplateBlocksNotification( { contentRef } ) {\n\tconst { onNavigateToEntityRecord, templateId } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentTemplateId } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tonNavigateToEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToEntityRecord,\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t};\n\t}, [] );\n\n\tconst canEditTemplate = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t[]\n\t);\n\n\tconst [ isDialogOpen, setIsDialogOpen ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst handleDblClick = ( event ) => {\n\t\t\tif ( ! canEditTemplate ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! event.target.classList.contains( 'is-root-container' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsDialogOpen( true );\n\t\t};\n\n\t\tconst canvas = contentRef.current;\n\t\tcanvas?.addEventListener( 'dblclick', handleDblClick );\n\t\treturn () => {\n\t\t\tcanvas?.removeEventListener( 'dblclick', handleDblClick );\n\t\t};\n\t}, [ contentRef, canEditTemplate ] );\n\n\tif ( ! canEditTemplate ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isDialogOpen }\n\t\t\tconfirmButtonText={ __( 'Edit template' ) }\n\t\t\tonConfirm={ () => {\n\t\t\t\tsetIsDialogOpen( false );\n\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\tpostId: templateId,\n\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonCancel={ () => setIsDialogOpen( false ) }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'You’ve tried to select a block that is part of a template, which may be used on other posts and p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,CAAE,mBAAoB,CAAC,EAAG;QAC/D;MACD;MACAP,eAAe,CAAE,IAAK,CAAC;IACxB,CAAC;IAED,MAAMQ,MAAM,GAAGtB,UAAU,CAACuB,OAAO;IACjCD,MAAM,EAAEE,gBAAgB,CAAE,UAAU,EAAEP,cAAe,CAAC;IACtD,OAAO,MAAM;MACZK,MAAM,EAAEG,mBAAmB,CAAE,UAAU,EAAER,cAAe,CAAC;IAC1D,CAAC;EACF,CAAC,EAAE,CAAEjB,UAAU,EAAEQ,eAAe,CAAG,CAAC;EAEpC,IAAK,CAAEA,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAV,WAAA,CAAA4B,GAAA,EAAC9B,WAAA,CAAA+B,2BAAa;IACbC,MAAM,EAAGf,YAAc;IACvBgB,iBAAiB,EAAG,IAAAC,QAAE,EAAE,eAAgB,CAAG;IAC3CC,SAAS,EAAGA,CAAA,KAAM;MACjBjB,eAAe,CAAE,KAAM,CAAC;MACxBb,wBAAwB,CAAE;QACzB+B,MAAM,EAAE9B,UAAU;QAClB+B,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ,CAAG;IACHC,QAAQ,EAAGA,CAAA,KAAMpB,eAAe,CAAE,KAAM,CAAG;IAC3CqB,IAAI,EAAC,QAAQ;IAAAC,QAAA,EAEX,IAAAN,QAAE,EACH,6IACD;EAAC,CACa,CAAC;AAElB","ignoreList":[]}
@@ -17,7 +17,7 @@ var _store = require("../../store");
17
17
  var _lockUnlock = require("../../lock-unlock");
18
18
  var _editTemplateBlocksNotification = _interopRequireDefault(require("./edit-template-blocks-notification"));
19
19
  var _resizableEditor = _interopRequireDefault(require("../resizable-editor"));
20
- var _useSelectNearestEditableBlock = _interopRequireDefault(require("../../hooks/use-select-nearest-editable-block"));
20
+ var _useSelectNearestEditableBlock = _interopRequireDefault(require("./use-select-nearest-editable-block"));
21
21
  var _constants = require("../../store/constants");
22
22
  var _jsxRuntime = require("react/jsx-runtime");
23
23
  /**
@@ -87,6 +87,7 @@ function VisualEditor({
87
87
  }) {
88
88
  const [resizeObserver, sizes] = (0, _compose.useResizeObserver)();
89
89
  const isMobileViewport = (0, _compose.useViewportMatch)('small', '<');
90
+ const isTabletViewport = (0, _compose.useViewportMatch)('medium', '<');
90
91
  const {
91
92
  renderingMode,
92
93
  postContentAttributes,
@@ -123,7 +124,10 @@ function VisualEditor({
123
124
  const editorSettings = getEditorSettings();
124
125
  const supportsTemplateMode = editorSettings.supportsTemplateMode;
125
126
  const postTypeObject = getPostType(postTypeSlug);
126
- const canEditTemplate = canUser('create', 'templates');
127
+ const canEditTemplate = canUser('create', {
128
+ kind: 'postType',
129
+ name: 'wp_template'
130
+ });
127
131
  const currentTemplateId = getCurrentTemplateId();
128
132
  const template = currentTemplateId ? getEditedEntityRecord('postType', _constants.TEMPLATE_POST_TYPE, currentTemplateId) : undefined;
129
133
  return {
@@ -260,7 +264,7 @@ function VisualEditor({
260
264
  }), (0, _useSelectNearestEditableBlock.default)({
261
265
  isEnabled: renderingMode === 'template-locked'
262
266
  })]);
263
- const zoomOutProps = isZoomOutMode ? {
267
+ const zoomOutProps = isZoomOutMode && !isTabletViewport ? {
264
268
  scale: 'default',
265
269
  frameSize: '48px'
266
270
  } : {};
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_element","_data","_blocks","_coreData","_compose","_postTitle","_store","_lockUnlock","_editTemplateBlocksNotification","_resizableEditor","_useSelectNearestEditableBlock","_constants","_jsxRuntime","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","useFlashEditableBlocks","unlock","blockEditorPrivateApis","DESIGN_POST_TYPES","PATTERN_POST_TYPE","TEMPLATE_POST_TYPE","NAVIGATION_POST_TYPE","TEMPLATE_PART_POST_TYPE","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","VisualEditor","autoFocus","styles","disableIframe","iframeProps","contentRef","className","resizeObserver","sizes","useResizeObserver","isMobileViewport","useViewportMatch","renderingMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","deviceType","isFocusedEntity","isDesignPostType","postType","isPreview","useSelect","select","getCurrentPostId","getCurrentPostType","getCurrentTemplateId","getEditorSettings","getRenderingMode","getDeviceType","editorStore","getPostType","canUser","getEditedEntityRecord","coreStore","postTypeSlug","_renderingMode","_wrapperBlockName","editorSettings","supportsTemplateMode","postTypeObject","canEditTemplate","currentTemplateId","template","undefined","includes","viewable","onNavigateToPreviousEntityRecord","__unstableIsPreviewMode","isCleanNewPost","hasRootPaddingAwareAlignments","themeHasDisabledLayoutStyles","themeSupportsLayout","isZoomOutMode","getSettings","__unstableGetEditorMode","blockEditorStore","_settings","disableLayoutStyles","supportsLayout","__experimentalFeatures","useRootPaddingAwareAlignments","deviceStyles","useResizeCanvas","globalLayoutSettings","useSettings","fallbackLayout","useMemo","type","newestPostContentAttributes","content","parseableContent","parse","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","clsx","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","useTypingObserver","titleRef","useRef","useEffect","current","focus","alignCSS","localRef","typewriterRef","useTypewriter","useMergeRefs","isEnabled","useSelectNearestEditableBlock","zoomOutProps","scale","frameSize","forceFullHeight","enableResizing","shouldIframe","iframeStyles","css","jsx","children","default","height","jsxs","style","Fragment","selector","contentEditable","ref","marginTop","RecursionProvider","blockName","uniqueId","BlockList","toLowerCase","dropZoneElement","parentNode","__unstableDisableDropZone","_default","exports"],"sources":["@wordpress/editor/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tuseMergeRefs,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\nimport ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from '../../hooks/use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\nconst DESIGN_POST_TYPES = [\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n];\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tstyles,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t} = select( editorStore );\n\t\tconst { getPostType, canUser, getEditedEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postTypeObject = getPostType( postTypeSlug );\n\t\tconst canEditTemplate = canUser( 'create', 'templates' );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostTypeObject?.viewable &&\n\t\t\t\tsupportsTemplateMode &&\n\t\t\t\tcanEditTemplate\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomOutMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, __unstableGetEditorMode } =\n\t\t\tselect( blockEditorStore );\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = clsx(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst localRef = useRef();\n\tconst typewriterRef = useTypewriter();\n\tcontentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\tcontentRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : null,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseSelectNearestEditableBlock( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t] );\n\n\tconst zoomOutProps = isZoomOutMode\n\t\t? {\n\t\t\t\tscale: 'default',\n\t\t\t\tframeSize: '48px',\n\t\t }\n\t\t: {};\n\n\tconst forceFullHeight = postType === NAVIGATION_POST_TYPE;\n\tconst enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Dsiable resizing in zoomed-out mode.\n\t\t! isZoomOutMode;\n\tconst shouldIframe =\n\t\t! disableIframe || [ 'Tablet', 'Mobile' ].includes( deviceType );\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\tcss: `.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing ? 'min-height:0!important;' : ''\n\t\t\t\t}}`,\n\t\t\t},\n\t\t];\n\t}, [ styles, enableResizing ] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': shouldIframe,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<ResizableEditor\n\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\theight={\n\t\t\t\t\tsizes.height && ! forceFullHeight ? sizes.height : '100%'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ shouldIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\t...zoomOutProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward comapatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\t\t\t\t\tcontentRef={ localRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RecursionProvider>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Avoid resize listeners when not needed,\n\t\t\t\t\t\t// these will trigger unnecessary re-renders\n\t\t\t\t\t\t// when animating the iframe width.\n\t\t\t\t\t\tenableResizing && resizeObserver\n\t\t\t\t\t}\n\t\t\t\t</BlockCanvas>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,IAAI,GACJ;UACH,CACD,CAAC,EACAA,aAAa,KAAK,iBAAiB,iBACpC,IAAAnC,WAAA,CAAAmI,GAAA,EAACvI,+BAAA,CAAAyI,OAA8B;YAC9BzG,UAAU,EAAGyF;UAAU,CACvB,CACD;QAAA,CACiB,CAAC;QAEnB;QACA;QACA;QACAU,cAAc,IAAIjG,cAAc;MAAA,CAErB;IAAC,CACE;EAAC,CACd,CAAC;AAER;AAAC,IAAAwH,QAAA,GAAAC,OAAA,CAAAlB,OAAA,GAEc9G,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_element","_data","_blocks","_coreData","_compose","_postTitle","_store","_lockUnlock","_editTemplateBlocksNotification","_resizableEditor","_useSelectNearestEditableBlock","_constants","_jsxRuntime","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","useFlashEditableBlocks","unlock","blockEditorPrivateApis","DESIGN_POST_TYPES","PATTERN_POST_TYPE","TEMPLATE_POST_TYPE","NAVIGATION_POST_TYPE","TEMPLATE_PART_POST_TYPE","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","VisualEditor","autoFocus","styles","disableIframe","iframeProps","contentRef","className","resizeObserver","sizes","useResizeObserver","isMobileViewport","useViewportMatch","isTabletViewport","renderingMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","deviceType","isFocusedEntity","isDesignPostType","postType","isPreview","useSelect","select","getCurrentPostId","getCurrentPostType","getCurrentTemplateId","getEditorSettings","getRenderingMode","getDeviceType","editorStore","getPostType","canUser","getEditedEntityRecord","coreStore","postTypeSlug","_renderingMode","_wrapperBlockName","editorSettings","supportsTemplateMode","postTypeObject","canEditTemplate","kind","currentTemplateId","template","undefined","includes","viewable","onNavigateToPreviousEntityRecord","__unstableIsPreviewMode","isCleanNewPost","hasRootPaddingAwareAlignments","themeHasDisabledLayoutStyles","themeSupportsLayout","isZoomOutMode","getSettings","__unstableGetEditorMode","blockEditorStore","_settings","disableLayoutStyles","supportsLayout","__experimentalFeatures","useRootPaddingAwareAlignments","deviceStyles","useResizeCanvas","globalLayoutSettings","useSettings","fallbackLayout","useMemo","type","newestPostContentAttributes","content","parseableContent","parse","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","clsx","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","useTypingObserver","titleRef","useRef","useEffect","current","focus","alignCSS","localRef","typewriterRef","useTypewriter","useMergeRefs","isEnabled","useSelectNearestEditableBlock","zoomOutProps","scale","frameSize","forceFullHeight","enableResizing","shouldIframe","iframeStyles","css","jsx","children","default","height","jsxs","style","Fragment","selector","contentEditable","ref","marginTop","RecursionProvider","blockName","uniqueId","BlockList","toLowerCase","dropZoneElement","parentNode","__unstableDisableDropZone","_default","exports"],"sources":["@wordpress/editor/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tuseMergeRefs,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\nimport ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from './use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\nconst DESIGN_POST_TYPES = [\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n];\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tstyles,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst isTabletViewport = useViewportMatch( 'medium', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t} = select( editorStore );\n\t\tconst { getPostType, canUser, getEditedEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postTypeObject = getPostType( postTypeSlug );\n\t\tconst canEditTemplate = canUser( 'create', {\n\t\t\tkind: 'postType',\n\t\t\tname: 'wp_template',\n\t\t} );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostTypeObject?.viewable &&\n\t\t\t\tsupportsTemplateMode &&\n\t\t\t\tcanEditTemplate\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomOutMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, __unstableGetEditorMode } =\n\t\t\tselect( blockEditorStore );\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = clsx(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst localRef = useRef();\n\tconst typewriterRef = useTypewriter();\n\tcontentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\tcontentRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : null,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseSelectNearestEditableBlock( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t] );\n\n\tconst zoomOutProps =\n\t\tisZoomOutMode && ! isTabletViewport\n\t\t\t? {\n\t\t\t\t\tscale: 'default',\n\t\t\t\t\tframeSize: '48px',\n\t\t\t }\n\t\t\t: {};\n\n\tconst forceFullHeight = postType === NAVIGATION_POST_TYPE;\n\tconst enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Dsiable resizing in zoomed-out mode.\n\t\t! isZoomOutMode;\n\tconst shouldIframe =\n\t\t! disableIframe || [ 'Tablet', 'Mobile' ].includes( deviceType );\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\tcss: `.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing ? 'min-height:0!important;' : ''\n\t\t\t\t}}`,\n\t\t\t},\n\t\t];\n\t}, [ styles, enableResizing ] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': shouldIframe,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<ResizableEditor\n\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\theight={\n\t\t\t\t\tsizes.height && ! forceFullHeight ? sizes.height : '100%'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ shouldIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\t...zoomOutProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward comapatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\t\t\t\t\tcontentRef={ localRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RecursionProvider>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Avoid resize listeners when not needed,\n\t\t\t\t\t\t// these will trigger unnecessary re-renders\n\t\t\t\t\t\t// when animating the iframe width.\n\t\t\t\t\t\tenableResizing && resizeObserver\n\t\t\t\t\t}\n\t\t\t\t</BlockCanvas>\n\t\t\t</ResizableEditor>\n\t\t</div>\n\t);\n}\n\nexport default VisualEditor;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AASA,I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AAA,CACiB,CAAC;QAEnB;QACA;QACA;QACAU,cAAc,IAAInG,cAAc;MAAA,CAErB;IAAC,CACE;EAAC,CACd,CAAC;AAER;AAAC,IAAA0H,QAAA,GAAAC,OAAA,CAAAlB,OAAA,GAEchH,YAAY","ignoreList":[]}
@@ -7,7 +7,7 @@ exports.default = useSelectNearestEditableBlock;
7
7
  var _compose = require("@wordpress/compose");
8
8
  var _data = require("@wordpress/data");
9
9
  var _blockEditor = require("@wordpress/block-editor");
10
- var _lockUnlock = require("../lock-unlock");
10
+ var _lockUnlock = require("../../lock-unlock");
11
11
  /**
12
12
  * WordPress dependencies
13
13
  */
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_compose","require","_data","_blockEditor","_lockUnlock","DISTANCE_THRESHOLD","clamp","value","min","max","Math","distanceFromRect","x","y","rect","dx","left","right","dy","top","bottom","sqrt","useSelectNearestEditableBlock","isEnabled","getEnabledClientIdsTree","getBlockName","getBlockOrder","unlock","useSelect","blockEditorStore","selectBlock","useDispatch","useRefEffect","element","selectNearestEditableBlock","editableBlockClientIds","flatMap","clientId","blockName","innerBlocks","length","nearestDistance","Infinity","nearestClientId","block","querySelector","getBoundingClientRect","distance","handleClick","event","shouldSelect","target","classList","contains","clientX","clientY","addEventListener","removeEventListener"],"sources":["@wordpress/editor/src/components/visual-editor/use-select-nearest-editable-block.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst DISTANCE_THRESHOLD = 500;\n\nfunction clamp( value, min, max ) {\n\treturn Math.min( Math.max( value, min ), max );\n}\n\nfunction distanceFromRect( x, y, rect ) {\n\tconst dx = x - clamp( x, rect.left, rect.right );\n\tconst dy = y - clamp( y, rect.top, rect.bottom );\n\treturn Math.sqrt( dx * dx + dy * dy );\n}\n\nexport default function useSelectNearestEditableBlock( {\n\tisEnabled = true,\n} = {} ) {\n\tconst { getEnabledClientIdsTree, getBlockName, getBlockOrder } = unlock(\n\t\tuseSelect( blockEditorStore )\n\t);\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( element ) => {\n\t\t\tif ( ! isEnabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst selectNearestEditableBlock = ( x, y ) => {\n\t\t\t\tconst editableBlockClientIds =\n\t\t\t\t\tgetEnabledClientIdsTree().flatMap( ( { clientId } ) => {\n\t\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\t\tif ( blockName === 'core/template-part' ) {\n\t\t\t\t\t\t\treturn [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( blockName === 'core/post-content' ) {\n\t\t\t\t\t\t\tconst innerBlocks = getBlockOrder( clientId );\n\t\t\t\t\t\t\tif ( innerBlocks.length ) {\n\t\t\t\t\t\t\t\treturn innerBlocks;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn [ clientId ];\n\t\t\t\t\t} );\n\n\t\t\t\tlet nearestDistance = Infinity,\n\t\t\t\t\tnearestClientId = null;\n\n\t\t\t\tfor ( const clientId of editableBlockClientIds ) {\n\t\t\t\t\tconst block = element.querySelector(\n\t\t\t\t\t\t`[data-block=\"${ clientId }\"]`\n\t\t\t\t\t);\n\t\t\t\t\tif ( ! block ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tconst rect = block.getBoundingClientRect();\n\t\t\t\t\tconst distance = distanceFromRect( x, y, rect );\n\t\t\t\t\tif (\n\t\t\t\t\t\tdistance < nearestDistance &&\n\t\t\t\t\t\tdistance < DISTANCE_THRESHOLD\n\t\t\t\t\t) {\n\t\t\t\t\t\tnearestDistance = distance;\n\t\t\t\t\t\tnearestClientId = clientId;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( nearestClientId ) {\n\t\t\t\t\tselectBlock( nearestClientId );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst handleClick = ( event ) => {\n\t\t\t\tconst shouldSelect =\n\t\t\t\t\tevent.target === element ||\n\t\t\t\t\tevent.target.classList.contains( 'is-root-container' );\n\t\t\t\tif ( shouldSelect ) {\n\t\t\t\t\tselectNearestEditableBlock( event.clientX, event.clientY );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\telement.addEventListener( 'click', handleClick );\n\t\t\treturn () => element.removeEventListener( 'click', handleClick );\n\t\t},\n\t\t[ isEnabled ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAMI,kBAAkB,GAAG,GAAG;AAE9B,SAASC,KAAKA,CAAEC,KAAK,EAAEC,GAAG,EAAEC,GAAG,EAAG;EACjC,OAAOC,IAAI,CAACF,GAAG,CAAEE,IAAI,CAACD,GAAG,CAAEF,KAAK,EAAEC,GAAI,CAAC,EAAEC,GAAI,CAAC;AAC/C;AAEA,SAASE,gBAAgBA,CAAEC,CAAC,EAAEC,CAAC,EAAEC,IAAI,EAAG;EACvC,MAAMC,EAAE,GAAGH,CAAC,GAAGN,KAAK,CAAEM,CAAC,EAAEE,IAAI,CAACE,IAAI,EAAEF,IAAI,CAACG,KAAM,CAAC;EAChD,MAAMC,EAAE,GAAGL,CAAC,GAAGP,KAAK,CAAEO,CAAC,EAAEC,IAAI,CAACK,GAAG,EAAEL,IAAI,CAACM,MAAO,CAAC;EAChD,OAAOV,IAAI,CAACW,IAAI,CAAEN,EAAE,GAAGA,EAAE,GAAGG,EAAE,GAAGA,EAAG,CAAC;AACtC;AAEe,SAASI,6BAA6BA,CAAE;EACtDC,SAAS,GAAG;AACb,CAAC,GAAG,C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,EAC5B;UACDoC,eAAe,GAAGM,QAAQ;UAC1BJ,eAAe,GAAGN,QAAQ;QAC3B;MACD;MAEA,IAAKM,eAAe,EAAG;QACtBb,WAAW,CAAEa,eAAgB,CAAC;MAC/B;IACD,CAAC;IAED,MAAMK,WAAW,GAAKC,KAAK,IAAM;MAChC,MAAMC,YAAY,GACjBD,KAAK,CAACE,MAAM,KAAKlB,OAAO,IACxBgB,KAAK,CAACE,MAAM,CAACC,SAAS,CAACC,QAAQ,CAAE,mBAAoB,CAAC;MACvD,IAAKH,YAAY,EAAG;QACnBhB,0BAA0B,CAAEe,KAAK,CAACK,OAAO,EAAEL,KAAK,CAACM,OAAQ,CAAC;MAC3D;IACD,CAAC;IAEDtB,OAAO,CAACuB,gBAAgB,CAAE,OAAO,EAAER,WAAY,CAAC;IAChD,OAAO,MAAMf,OAAO,CAACwB,mBAAmB,CAAE,OAAO,EAAET,WAAY,CAAC;EACjE,CAAC,EACD,CAAEzB,SAAS,CACZ,CAAC;AACF","ignoreList":[]}
@@ -71,6 +71,7 @@ const deletePostAction = {
71
71
  onClick: closeModal,
72
72
  disabled: isBusy,
73
73
  accessibleWhenDisabled: true,
74
+ __next40pxDefaultSize: true,
74
75
  children: (0, _i18n.__)('Cancel')
75
76
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
76
77
  variant: "primary",
@@ -86,6 +87,7 @@ const deletePostAction = {
86
87
  isBusy: isBusy,
87
88
  disabled: isBusy,
88
89
  accessibleWhenDisabled: true,
90
+ __next40pxDefaultSize: true,
89
91
  children: (0, _i18n.__)('Delete')
90
92
  })]
91
93
  })]
@@ -1 +1 @@
1
- {"version":3,"names":["_icons","require","_data","_i18n","_element","_components","_patterns","_utils","_store","_lockUnlock","_jsxRuntime","PATTERN_TYPES","unlock","patternsPrivateApis","deletePostAction","id","label","__","isPrimary","icon","trash","isEligible","post","isTemplateOrTemplatePart","isTemplateRemovable","type","user","supportsBulk","hideModalHeader","RenderModal","items","closeModal","onActionPerformed","isBusy","setIsBusy","useState","removeTemplates","useDispatch","editorStore","jsxs","__experimentalVStack","spacing","children","jsx","__experimentalText","length","sprintf","_n","getItemTitle","__experimentalHStack","justify","Button","variant","onClick","disabled","accessibleWhenDisabled","allowUndo","_default","exports","default"],"sources":["@wordpress/editor/src/dataviews/actions/delete-post.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { trash } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n// @ts-ignore\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport type { Action } from '@wordpress/dataviews';\nimport type { StoreDescriptor } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tisTemplateRemovable,\n\tgetItemTitle,\n\tisTemplateOrTemplatePart,\n} from './utils';\n// @ts-ignore\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport type { Post } from '../types';\n\nconst { PATTERN_TYPES } = unlock( patternsPrivateApis );\n\n// This action is used for templates, patterns and template parts.\n// Every other post type uses the similar `trashPostAction` which\n// moves the post to trash.\nconst deletePostAction: Action< Post > = {\n\tid: 'delete-post',\n\tlabel: __( 'Delete' ),\n\tisPrimary: true,\n\ticon: trash,\n\tisEligible( post ) {\n\t\tif ( isTemplateOrTemplatePart( post ) ) {\n\t\t\treturn isTemplateRemovable( post );\n\t\t}\n\t\t// We can only remove user patterns.\n\t\treturn post.type === PATTERN_TYPES.user;\n\t},\n\tsupportsBulk: true,\n\thideModalHeader: true,\n\tRenderModal: ( { items, closeModal, onActionPerformed } ) => {\n\t\tconst [ isBusy, setIsBusy ] = useState( false );\n\t\tconst { removeTemplates } = unlock(\n\t\t\tuseDispatch( editorStore as StoreDescriptor )\n\t\t);\n\t\treturn (\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<Text>\n\t\t\t\t\t{ items.length > 1\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %d: number of items to delete.\n\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t'Delete %d item?',\n\t\t\t\t\t\t\t\t\t'Delete %d items?',\n\t\t\t\t\t\t\t\t\titems.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\titems.length\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The template or template part's titles\n\t\t\t\t\t\t\t\t__( 'Delete \"%s\"?' ),\n\t\t\t\t\t\t\t\tgetItemTitle( items[ 0 ] )\n\t\t\t\t\t\t ) }\n\t\t\t\t</Text>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ closeModal }\n\t\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ async () => {\n\t\t\t\t\t\t\tsetIsBusy( true );\n\t\t\t\t\t\t\tawait removeTemplates( items, {\n\t\t\t\t\t\t\t\tallowUndo: false,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tonActionPerformed?.( items );\n\t\t\t\t\t\t\tsetIsBusy( false );\n\t\t\t\t\t\t\tcloseModal?.();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t);\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CACT,CAAC;MAAA,CACF,CAAC;IAAA,CACF,CAAC;EAEX;AACD,CAAC;AAAC,IAAAwC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa7C,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_icons","require","_data","_i18n","_element","_components","_patterns","_utils","_store","_lockUnlock","_jsxRuntime","PATTERN_TYPES","unlock","patternsPrivateApis","deletePostAction","id","label","__","isPrimary","icon","trash","isEligible","post","isTemplateOrTemplatePart","isTemplateRemovable","type","user","supportsBulk","hideModalHeader","RenderModal","items","closeModal","onActionPerformed","isBusy","setIsBusy","useState","removeTemplates","useDispatch","editorStore","jsxs","__experimentalVStack","spacing","children","jsx","__experimentalText","length","sprintf","_n","getItemTitle","__experimentalHStack","justify","Button","variant","onClick","disabled","accessibleWhenDisabled","__next40pxDefaultSize","allowUndo","_default","exports","default"],"sources":["@wordpress/editor/src/dataviews/actions/delete-post.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { trash } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n// @ts-ignore\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\nimport type { Action } from '@wordpress/dataviews';\nimport type { StoreDescriptor } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tisTemplateRemovable,\n\tgetItemTitle,\n\tisTemplateOrTemplatePart,\n} from './utils';\n// @ts-ignore\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport type { Post } from '../types';\n\nconst { PATTERN_TYPES } = unlock( patternsPrivateApis );\n\n// This action is used for templates, patterns and template parts.\n// Every other post type uses the similar `trashPostAction` which\n// moves the post to trash.\nconst deletePostAction: Action< Post > = {\n\tid: 'delete-post',\n\tlabel: __( 'Delete' ),\n\tisPrimary: true,\n\ticon: trash,\n\tisEligible( post ) {\n\t\tif ( isTemplateOrTemplatePart( post ) ) {\n\t\t\treturn isTemplateRemovable( post );\n\t\t}\n\t\t// We can only remove user patterns.\n\t\treturn post.type === PATTERN_TYPES.user;\n\t},\n\tsupportsBulk: true,\n\thideModalHeader: true,\n\tRenderModal: ( { items, closeModal, onActionPerformed } ) => {\n\t\tconst [ isBusy, setIsBusy ] = useState( false );\n\t\tconst { removeTemplates } = unlock(\n\t\t\tuseDispatch( editorStore as StoreDescriptor )\n\t\t);\n\t\treturn (\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<Text>\n\t\t\t\t\t{ items.length > 1\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %d: number of items to delete.\n\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t'Delete %d item?',\n\t\t\t\t\t\t\t\t\t'Delete %d items?',\n\t\t\t\t\t\t\t\t\titems.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\titems.length\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The template or template part's titles\n\t\t\t\t\t\t\t\t__( 'Delete \"%s\"?' ),\n\t\t\t\t\t\t\t\tgetItemTitle( items[ 0 ] )\n\t\t\t\t\t\t ) }\n\t\t\t\t</Text>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ closeModal }\n\t\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ async () => {\n\t\t\t\t\t\t\tsetIsBusy( true );\n\t\t\t\t\t\t\tawait removeTemplates( items, {\n\t\t\t\t\t\t\t\tallowUndo: false,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tonActionPerformed?.( items );\n\t\t\t\t\t\t\tsetIsBusy( false );\n\t\t\t\t\t\t\tcloseModal?.();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t);\n\t},\n};\n\nexport default deletePostAction;\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAOA,IAAAK,SAAA,GAAAL,OAAA;AAOA,IAAAM,MAAA,GAAAN,OAAA;AAMA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA2C,IAAAS,WAAA,GAAAT,OAAA;AA5B3C;AACA;AACA;;AAWA;;AAKA;AACA;AACA;;AAMA;;AAKA,MAAM;EAAEU;AAAc,CAAC,GAAG,IAAAC,kBAAM,EAAEC,qBAAoB,CAAC;;AAEvD;AACA;AACA;AACA,MAAMC,gBAAgC,GAAG;EACxCC,EAAE,EAAE,aAAa;EACjBC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EACrBC,SAAS,EAAE,IAAI;EACfC,IAAI,EAAEC,YAAK;EACXC,UAAUA,CAAEC,IAAI,EAAG;IAClB,IAAK,IAAAC,+BAAwB,EAAED,IAAK,CAAC,EAAG;MACvC,OAAO,IAAAE,0BAAmB,EAAEF,IAAK,CAAC;IACnC;IACA;IACA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AiC,GAAA,EAACtC,WAAA,CAAA8C,MAAM;UACNC,OAAO,EAAC,SAAS;UACjBC,OAAO,EAAG,MAAAA,CAAA,KAAY;YACrBnB,SAAS,CAAE,IAAK,CAAC;YACjB,MAAME,eAAe,CAAEN,KAAK,EAAE;cAC7B2B,SAAS,EAAE;YACZ,CAAE,CAAC;YACHzB,iBAAiB,GAAIF,KAAM,CAAC;YAC5BI,SAAS,CAAE,KAAM,CAAC;YAClBH,UAAU,GAAG,CAAC;UACf,CAAG;UACHE,MAAM,EAAGA,MAAQ;UACjBqB,QAAQ,EAAGrB,MAAQ;UACnBsB,sBAAsB;UACtBC,qBAAqB;UAAAd,QAAA,EAEnB,IAAAzB,QAAE,EAAE,QAAS;QAAC,CACT,CAAC;MAAA,CACF,CAAC;IAAA,CACF,CAAC;EAEX;AACD,CAAC;AAAC,IAAAyC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa9C,gBAAgB","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ const exportPattern = undefined;
8
+ var _default = exports.default = exportPattern;
9
+ //# sourceMappingURL=export-pattern.native.js.map