@wordpress/editor 14.6.0 → 14.7.1-next.1f6eadc42.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 (421) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +41 -0
  3. package/build/bindings/post-meta.js +11 -8
  4. package/build/bindings/post-meta.js.map +1 -1
  5. package/build/components/block-manager/index.js +1 -0
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/block-settings-menu/content-only-settings-menu.js +5 -8
  8. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  9. package/build/components/document-bar/index.js +4 -4
  10. package/build/components/document-bar/index.js.map +1 -1
  11. package/build/components/editor/index.js +2 -2
  12. package/build/components/editor/index.js.map +1 -1
  13. package/build/components/editor-history/redo.js +1 -0
  14. package/build/components/editor-history/redo.js.map +1 -1
  15. package/build/components/editor-history/undo.js +1 -0
  16. package/build/components/editor-history/undo.js.map +1 -1
  17. package/build/components/editor-interface/index.js +2 -3
  18. package/build/components/editor-interface/index.js.map +1 -1
  19. package/build/components/error-boundary/index.js +1 -0
  20. package/build/components/error-boundary/index.js.map +1 -1
  21. package/build/components/global-styles-provider/index.js +3 -4
  22. package/build/components/global-styles-provider/index.js.map +1 -1
  23. package/build/components/header/index.js +6 -4
  24. package/build/components/header/index.js.map +1 -1
  25. package/build/components/index.js +8 -0
  26. package/build/components/index.js.map +1 -1
  27. package/build/components/inserter-sidebar/index.js +5 -10
  28. package/build/components/inserter-sidebar/index.js.map +1 -1
  29. package/build/components/local-autosave-monitor/index.js +5 -5
  30. package/build/components/local-autosave-monitor/index.js.map +1 -1
  31. package/build/components/page-attributes/parent.js +4 -1
  32. package/build/components/page-attributes/parent.js.map +1 -1
  33. package/build/components/plugin-preview-menu-item/index.js +57 -0
  34. package/build/components/plugin-preview-menu-item/index.js.map +1 -0
  35. package/build/components/post-actions/index.js +5 -8
  36. package/build/components/post-actions/index.js.map +1 -1
  37. package/build/components/post-excerpt/panel.js +1 -1
  38. package/build/components/post-excerpt/panel.js.map +1 -1
  39. package/build/components/post-featured-image/index.js +3 -0
  40. package/build/components/post-featured-image/index.js.map +1 -1
  41. package/build/components/post-format/index.js +1 -0
  42. package/build/components/post-format/index.js.map +1 -1
  43. package/build/components/post-last-revision/index.js +1 -0
  44. package/build/components/post-last-revision/index.js.map +1 -1
  45. package/build/components/post-locked-modal/index.js +6 -1
  46. package/build/components/post-locked-modal/index.js.map +1 -1
  47. package/build/components/post-publish-panel/index.js +1 -0
  48. package/build/components/post-publish-panel/index.js.map +1 -1
  49. package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  50. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  51. package/build/components/post-publish-panel/maybe-upload-media.js +156 -33
  52. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  53. package/build/components/post-publish-panel/media-util.js +79 -0
  54. package/build/components/post-publish-panel/media-util.js.map +1 -0
  55. package/build/components/post-status/index.js +4 -2
  56. package/build/components/post-status/index.js.map +1 -1
  57. package/build/components/post-taxonomies/hierarchical-term-selector.js +4 -1
  58. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  59. package/build/components/post-taxonomies/most-used-terms.js +4 -1
  60. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  61. package/build/components/post-template/block-theme.js +13 -4
  62. package/build/components/post-template/block-theme.js.map +1 -1
  63. package/build/components/post-template/classic-theme.js +4 -1
  64. package/build/components/post-template/classic-theme.js.map +1 -1
  65. package/build/components/post-title/index.js +32 -46
  66. package/build/components/post-title/index.js.map +1 -1
  67. package/build/components/post-trash/check.js +2 -1
  68. package/build/components/post-trash/check.js.map +1 -1
  69. package/build/components/post-trash/index.js +22 -8
  70. package/build/components/post-trash/index.js.map +1 -1
  71. package/build/components/post-url/index.js +4 -1
  72. package/build/components/post-url/index.js.map +1 -1
  73. package/build/components/preferences-modal/index.js +28 -1
  74. package/build/components/preferences-modal/index.js.map +1 -1
  75. package/build/components/preview-dropdown/index.js +11 -51
  76. package/build/components/preview-dropdown/index.js.map +1 -1
  77. package/build/components/provider/index.js +34 -8
  78. package/build/components/provider/index.js.map +1 -1
  79. package/build/components/provider/use-block-editor-settings.js +14 -10
  80. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  81. package/build/components/save-publish-panels/index.js +8 -2
  82. package/build/components/save-publish-panels/index.js.map +1 -1
  83. package/build/components/sidebar/post-summary.js +3 -0
  84. package/build/components/sidebar/post-summary.js.map +1 -1
  85. package/build/components/start-page-options/index.js +16 -19
  86. package/build/components/start-page-options/index.js.map +1 -1
  87. package/build/components/start-template-options/index.js +1 -0
  88. package/build/components/start-template-options/index.js.map +1 -1
  89. package/build/components/table-of-contents/index.js +1 -0
  90. package/build/components/table-of-contents/index.js.map +1 -1
  91. package/build/components/text-editor/index.js +1 -0
  92. package/build/components/text-editor/index.js.map +1 -1
  93. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -1
  94. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  95. package/build/components/visual-editor/index.js +1 -6
  96. package/build/components/visual-editor/index.js.map +1 -1
  97. package/build/components/zoom-out-toggle/index.js +38 -0
  98. package/build/components/zoom-out-toggle/index.js.map +1 -0
  99. package/build/dataviews/actions/reset-post.js +2 -0
  100. package/build/dataviews/actions/reset-post.js.map +1 -1
  101. package/build/dataviews/actions/trash-post.js +2 -0
  102. package/build/dataviews/actions/trash-post.js.map +1 -1
  103. package/build/dataviews/store/private-actions.js +4 -10
  104. package/build/dataviews/store/private-actions.js.map +1 -1
  105. package/build/private-apis.js +0 -2
  106. package/build/private-apis.js.map +1 -1
  107. package/build/store/private-actions.js +1 -1
  108. package/build/store/private-actions.js.map +1 -1
  109. package/build/store/selectors.js +7 -3
  110. package/build/store/selectors.js.map +1 -1
  111. package/build-module/bindings/post-meta.js +11 -8
  112. package/build-module/bindings/post-meta.js.map +1 -1
  113. package/build-module/components/block-manager/index.js +1 -0
  114. package/build-module/components/block-manager/index.js.map +1 -1
  115. package/build-module/components/block-settings-menu/content-only-settings-menu.js +6 -9
  116. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  117. package/build-module/components/document-bar/index.js +4 -4
  118. package/build-module/components/document-bar/index.js.map +1 -1
  119. package/build-module/components/editor/index.js +2 -2
  120. package/build-module/components/editor/index.js.map +1 -1
  121. package/build-module/components/editor-history/redo.js +1 -0
  122. package/build-module/components/editor-history/redo.js.map +1 -1
  123. package/build-module/components/editor-history/undo.js +1 -0
  124. package/build-module/components/editor-history/undo.js.map +1 -1
  125. package/build-module/components/editor-interface/index.js +2 -3
  126. package/build-module/components/editor-interface/index.js.map +1 -1
  127. package/build-module/components/error-boundary/index.js +1 -0
  128. package/build-module/components/error-boundary/index.js.map +1 -1
  129. package/build-module/components/global-styles-provider/index.js +3 -4
  130. package/build-module/components/global-styles-provider/index.js.map +1 -1
  131. package/build-module/components/header/index.js +6 -4
  132. package/build-module/components/header/index.js.map +1 -1
  133. package/build-module/components/index.js +1 -0
  134. package/build-module/components/index.js.map +1 -1
  135. package/build-module/components/inserter-sidebar/index.js +5 -10
  136. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  137. package/build-module/components/local-autosave-monitor/index.js +5 -5
  138. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  139. package/build-module/components/page-attributes/parent.js +4 -1
  140. package/build-module/components/page-attributes/parent.js.map +1 -1
  141. package/build-module/components/plugin-preview-menu-item/index.js +52 -0
  142. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -0
  143. package/build-module/components/post-actions/index.js +5 -8
  144. package/build-module/components/post-actions/index.js.map +1 -1
  145. package/build-module/components/post-excerpt/panel.js +1 -1
  146. package/build-module/components/post-excerpt/panel.js.map +1 -1
  147. package/build-module/components/post-featured-image/index.js +3 -0
  148. package/build-module/components/post-featured-image/index.js.map +1 -1
  149. package/build-module/components/post-format/index.js +1 -0
  150. package/build-module/components/post-format/index.js.map +1 -1
  151. package/build-module/components/post-last-revision/index.js +1 -0
  152. package/build-module/components/post-last-revision/index.js.map +1 -1
  153. package/build-module/components/post-locked-modal/index.js +6 -1
  154. package/build-module/components/post-locked-modal/index.js.map +1 -1
  155. package/build-module/components/post-publish-panel/index.js +1 -0
  156. package/build-module/components/post-publish-panel/index.js.map +1 -1
  157. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  158. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  159. package/build-module/components/post-publish-panel/maybe-upload-media.js +155 -32
  160. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  161. package/build-module/components/post-publish-panel/media-util.js +72 -0
  162. package/build-module/components/post-publish-panel/media-util.js.map +1 -0
  163. package/build-module/components/post-status/index.js +4 -2
  164. package/build-module/components/post-status/index.js.map +1 -1
  165. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -1
  166. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  167. package/build-module/components/post-taxonomies/most-used-terms.js +4 -1
  168. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  169. package/build-module/components/post-template/block-theme.js +13 -4
  170. package/build-module/components/post-template/block-theme.js.map +1 -1
  171. package/build-module/components/post-template/classic-theme.js +4 -1
  172. package/build-module/components/post-template/classic-theme.js.map +1 -1
  173. package/build-module/components/post-title/index.js +33 -47
  174. package/build-module/components/post-title/index.js.map +1 -1
  175. package/build-module/components/post-trash/check.js +2 -1
  176. package/build-module/components/post-trash/check.js.map +1 -1
  177. package/build-module/components/post-trash/index.js +23 -11
  178. package/build-module/components/post-trash/index.js.map +1 -1
  179. package/build-module/components/post-url/index.js +4 -1
  180. package/build-module/components/post-url/index.js.map +1 -1
  181. package/build-module/components/preferences-modal/index.js +28 -1
  182. package/build-module/components/preferences-modal/index.js.map +1 -1
  183. package/build-module/components/preview-dropdown/index.js +11 -51
  184. package/build-module/components/preview-dropdown/index.js.map +1 -1
  185. package/build-module/components/provider/index.js +35 -9
  186. package/build-module/components/provider/index.js.map +1 -1
  187. package/build-module/components/provider/use-block-editor-settings.js +15 -11
  188. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  189. package/build-module/components/save-publish-panels/index.js +8 -2
  190. package/build-module/components/save-publish-panels/index.js.map +1 -1
  191. package/build-module/components/sidebar/post-summary.js +3 -0
  192. package/build-module/components/sidebar/post-summary.js.map +1 -1
  193. package/build-module/components/start-page-options/index.js +17 -21
  194. package/build-module/components/start-page-options/index.js.map +1 -1
  195. package/build-module/components/start-template-options/index.js +1 -0
  196. package/build-module/components/start-template-options/index.js.map +1 -1
  197. package/build-module/components/table-of-contents/index.js +1 -0
  198. package/build-module/components/table-of-contents/index.js.map +1 -1
  199. package/build-module/components/text-editor/index.js +1 -0
  200. package/build-module/components/text-editor/index.js.map +1 -1
  201. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -1
  202. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  203. package/build-module/components/visual-editor/index.js +1 -6
  204. package/build-module/components/visual-editor/index.js.map +1 -1
  205. package/build-module/components/zoom-out-toggle/index.js +31 -0
  206. package/build-module/components/zoom-out-toggle/index.js.map +1 -0
  207. package/build-module/dataviews/actions/reset-post.js +2 -0
  208. package/build-module/dataviews/actions/reset-post.js.map +1 -1
  209. package/build-module/dataviews/actions/trash-post.js +2 -0
  210. package/build-module/dataviews/actions/trash-post.js.map +1 -1
  211. package/build-module/dataviews/store/private-actions.js +2 -8
  212. package/build-module/dataviews/store/private-actions.js.map +1 -1
  213. package/build-module/private-apis.js +0 -2
  214. package/build-module/private-apis.js.map +1 -1
  215. package/build-module/store/private-actions.js +1 -1
  216. package/build-module/store/private-actions.js.map +1 -1
  217. package/build-module/store/selectors.js +6 -2
  218. package/build-module/store/selectors.js.map +1 -1
  219. package/build-style/style-rtl.css +14 -13
  220. package/build-style/style.css +14 -13
  221. package/build-types/bindings/post-meta.d.ts +0 -3
  222. package/build-types/bindings/post-meta.d.ts.map +1 -1
  223. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -1
  224. package/build-types/components/editor-history/redo.d.ts.map +1 -1
  225. package/build-types/components/editor-history/undo.d.ts.map +1 -1
  226. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  227. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  228. package/build-types/components/header/back-button.d.ts.map +1 -1
  229. package/build-types/components/header/index.d.ts.map +1 -1
  230. package/build-types/components/index.d.ts +1 -0
  231. package/build-types/components/index.d.ts.map +1 -1
  232. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  233. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  234. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  235. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  236. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  237. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  238. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  239. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  240. package/build-types/components/plugin-preview-menu-item/index.d.ts +3 -0
  241. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -0
  242. package/build-types/components/post-actions/index.d.ts.map +1 -1
  243. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  244. package/build-types/components/post-format/index.d.ts.map +1 -1
  245. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  246. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  247. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  248. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
  249. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +1 -1
  250. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  251. package/build-types/components/post-publish-panel/media-util.d.ts +20 -0
  252. package/build-types/components/post-publish-panel/media-util.d.ts.map +1 -0
  253. package/build-types/components/post-status/index.d.ts.map +1 -1
  254. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  255. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
  256. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  257. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  258. package/build-types/components/post-trash/check.d.ts.map +1 -1
  259. package/build-types/components/post-trash/index.d.ts +4 -1
  260. package/build-types/components/post-trash/index.d.ts.map +1 -1
  261. package/build-types/components/post-url/index.d.ts.map +1 -1
  262. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  263. package/build-types/components/preferences-modal/index.d.ts.map +1 -1
  264. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  265. package/build-types/components/provider/index.d.ts.map +1 -1
  266. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  267. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  268. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  269. package/build-types/components/start-page-options/index.d.ts +1 -0
  270. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  271. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  272. package/build-types/components/text-editor/index.d.ts.map +1 -1
  273. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
  274. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  275. package/build-types/components/zoom-out-toggle/index.d.ts +3 -0
  276. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -0
  277. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
  278. package/build-types/dataviews/actions/trash-post.d.ts.map +1 -1
  279. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  280. package/build-types/private-apis.d.ts.map +1 -1
  281. package/build-types/store/private-actions.d.ts.map +1 -1
  282. package/build-types/store/selectors.d.ts +8 -8
  283. package/build-types/store/selectors.d.ts.map +1 -1
  284. package/package.json +37 -36
  285. package/src/bindings/post-meta.js +12 -6
  286. package/src/components/block-manager/index.js +1 -0
  287. package/src/components/block-settings-menu/content-only-settings-menu.js +5 -9
  288. package/src/components/create-template-part-modal/style.scss +1 -1
  289. package/src/components/document-bar/index.js +4 -4
  290. package/src/components/document-outline/style.scss +1 -1
  291. package/src/components/editor/index.js +1 -1
  292. package/src/components/editor-history/redo.js +1 -0
  293. package/src/components/editor-history/undo.js +1 -0
  294. package/src/components/editor-interface/index.js +2 -4
  295. package/src/components/error-boundary/index.js +1 -1
  296. package/src/components/global-styles-provider/index.js +11 -7
  297. package/src/components/header/index.js +12 -3
  298. package/src/components/header/style.scss +6 -3
  299. package/src/components/index.js +1 -0
  300. package/src/components/inserter-sidebar/index.js +6 -8
  301. package/src/components/local-autosave-monitor/index.js +6 -6
  302. package/src/components/page-attributes/parent.js +5 -4
  303. package/src/components/plugin-preview-menu-item/index.js +52 -0
  304. package/src/components/post-actions/index.js +8 -14
  305. package/src/components/post-card-panel/style.scss +1 -1
  306. package/src/components/post-excerpt/panel.js +1 -1
  307. package/src/components/post-featured-image/index.js +3 -0
  308. package/src/components/post-featured-image/style.scss +2 -7
  309. package/src/components/post-format/index.js +1 -0
  310. package/src/components/post-last-revision/index.js +1 -0
  311. package/src/components/post-locked-modal/index.js +12 -2
  312. package/src/components/post-locked-modal/style.scss +1 -1
  313. package/src/components/post-publish-panel/index.js +1 -0
  314. package/src/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  315. package/src/components/post-publish-panel/maybe-upload-media.js +144 -36
  316. package/src/components/post-publish-panel/media-util.js +87 -0
  317. package/src/components/post-publish-panel/style.scss +3 -1
  318. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  319. package/src/components/post-publish-panel/test/media-util.js +118 -0
  320. package/src/components/post-status/index.js +3 -2
  321. package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -0
  322. package/src/components/post-taxonomies/most-used-terms.js +2 -0
  323. package/src/components/post-template/block-theme.js +15 -9
  324. package/src/components/post-template/classic-theme.js +2 -0
  325. package/src/components/post-title/index.js +30 -41
  326. package/src/components/post-trash/check.js +5 -2
  327. package/src/components/post-trash/index.js +23 -12
  328. package/src/components/post-url/index.js +2 -0
  329. package/src/components/preferences-modal/index.js +227 -172
  330. package/src/components/preview-dropdown/index.js +22 -72
  331. package/src/components/provider/index.js +42 -10
  332. package/src/components/provider/use-block-editor-settings.js +16 -11
  333. package/src/components/resizable-editor/style.scss +2 -2
  334. package/src/components/save-publish-panels/index.js +4 -0
  335. package/src/components/sidebar/post-summary.js +4 -0
  336. package/src/components/start-page-options/index.js +28 -26
  337. package/src/components/start-template-options/index.js +5 -1
  338. package/src/components/table-of-contents/index.js +1 -0
  339. package/src/components/text-editor/index.js +1 -0
  340. package/src/components/text-editor/style.scss +1 -1
  341. package/src/components/visual-editor/edit-template-blocks-notification.js +4 -1
  342. package/src/components/visual-editor/index.js +2 -9
  343. package/src/components/zoom-out-toggle/index.js +34 -0
  344. package/src/dataviews/actions/reset-post.tsx +2 -0
  345. package/src/dataviews/actions/trash-post.tsx +2 -0
  346. package/src/dataviews/store/private-actions.ts +10 -8
  347. package/src/private-apis.js +0 -2
  348. package/src/store/private-actions.js +3 -1
  349. package/src/store/selectors.js +9 -3
  350. package/tsconfig.json +2 -0
  351. package/tsconfig.tsbuildinfo +1 -1
  352. package/build/dataviews/actions/duplicate-pattern.js +0 -48
  353. package/build/dataviews/actions/duplicate-pattern.js.map +0 -1
  354. package/build/dataviews/actions/duplicate-post.js +0 -146
  355. package/build/dataviews/actions/duplicate-post.js.map +0 -1
  356. package/build/dataviews/actions/duplicate-post.native.js +0 -9
  357. package/build/dataviews/actions/duplicate-post.native.js.map +0 -1
  358. package/build/dataviews/actions/export-pattern.js +0 -55
  359. package/build/dataviews/actions/export-pattern.js.map +0 -1
  360. package/build/dataviews/actions/export-pattern.native.js +0 -9
  361. package/build/dataviews/actions/export-pattern.native.js.map +0 -1
  362. package/build/dataviews/actions/permanently-delete-post.js +0 -107
  363. package/build/dataviews/actions/permanently-delete-post.js.map +0 -1
  364. package/build/dataviews/actions/reorder-page.js +0 -116
  365. package/build/dataviews/actions/reorder-page.js.map +0 -1
  366. package/build/dataviews/actions/reorder-page.native.js +0 -9
  367. package/build/dataviews/actions/reorder-page.native.js.map +0 -1
  368. package/build/dataviews/actions/view-post-revisions.js +0 -49
  369. package/build/dataviews/actions/view-post-revisions.js.map +0 -1
  370. package/build/dataviews/actions/view-post.js +0 -36
  371. package/build/dataviews/actions/view-post.js.map +0 -1
  372. package/build-module/dataviews/actions/duplicate-pattern.js +0 -39
  373. package/build-module/dataviews/actions/duplicate-pattern.js.map +0 -1
  374. package/build-module/dataviews/actions/duplicate-post.js +0 -139
  375. package/build-module/dataviews/actions/duplicate-post.js.map +0 -1
  376. package/build-module/dataviews/actions/duplicate-post.native.js +0 -3
  377. package/build-module/dataviews/actions/duplicate-post.native.js.map +0 -1
  378. package/build-module/dataviews/actions/export-pattern.js +0 -49
  379. package/build-module/dataviews/actions/export-pattern.js.map +0 -1
  380. package/build-module/dataviews/actions/export-pattern.native.js +0 -3
  381. package/build-module/dataviews/actions/export-pattern.native.js.map +0 -1
  382. package/build-module/dataviews/actions/permanently-delete-post.js +0 -99
  383. package/build-module/dataviews/actions/permanently-delete-post.js.map +0 -1
  384. package/build-module/dataviews/actions/reorder-page.js +0 -111
  385. package/build-module/dataviews/actions/reorder-page.js.map +0 -1
  386. package/build-module/dataviews/actions/reorder-page.native.js +0 -3
  387. package/build-module/dataviews/actions/reorder-page.native.js.map +0 -1
  388. package/build-module/dataviews/actions/view-post-revisions.js +0 -43
  389. package/build-module/dataviews/actions/view-post-revisions.js.map +0 -1
  390. package/build-module/dataviews/actions/view-post.js +0 -30
  391. package/build-module/dataviews/actions/view-post.js.map +0 -1
  392. package/build-types/dataviews/actions/duplicate-pattern.d.ts +0 -5
  393. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +0 -1
  394. package/build-types/dataviews/actions/duplicate-post.d.ts +0 -5
  395. package/build-types/dataviews/actions/duplicate-post.d.ts.map +0 -1
  396. package/build-types/dataviews/actions/duplicate-post.native.d.ts +0 -3
  397. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +0 -1
  398. package/build-types/dataviews/actions/export-pattern.d.ts +0 -8
  399. package/build-types/dataviews/actions/export-pattern.d.ts.map +0 -1
  400. package/build-types/dataviews/actions/export-pattern.native.d.ts +0 -3
  401. package/build-types/dataviews/actions/export-pattern.native.d.ts.map +0 -1
  402. package/build-types/dataviews/actions/permanently-delete-post.d.ts +0 -5
  403. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +0 -1
  404. package/build-types/dataviews/actions/reorder-page.d.ts +0 -8
  405. package/build-types/dataviews/actions/reorder-page.d.ts.map +0 -1
  406. package/build-types/dataviews/actions/reorder-page.native.d.ts +0 -3
  407. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +0 -1
  408. package/build-types/dataviews/actions/view-post-revisions.d.ts +0 -8
  409. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +0 -1
  410. package/build-types/dataviews/actions/view-post.d.ts +0 -8
  411. package/build-types/dataviews/actions/view-post.d.ts.map +0 -1
  412. package/src/dataviews/actions/duplicate-pattern.tsx +0 -40
  413. package/src/dataviews/actions/duplicate-post.native.tsx +0 -3
  414. package/src/dataviews/actions/duplicate-post.tsx +0 -174
  415. package/src/dataviews/actions/export-pattern.native.tsx +0 -3
  416. package/src/dataviews/actions/export-pattern.tsx +0 -74
  417. package/src/dataviews/actions/permanently-delete-post.tsx +0 -116
  418. package/src/dataviews/actions/reorder-page.native.tsx +0 -3
  419. package/src/dataviews/actions/reorder-page.tsx +0 -125
  420. package/src/dataviews/actions/view-post-revisions.tsx +0 -47
  421. package/src/dataviews/actions/view-post.tsx +0 -30
@@ -19,9 +19,8 @@ import { __ } from '@wordpress/i18n';
19
19
  import { desktop, mobile, tablet, external } from '@wordpress/icons';
20
20
  import { useSelect, useDispatch } from '@wordpress/data';
21
21
  import { store as coreStore } from '@wordpress/core-data';
22
- import { useEffect, useRef } from '@wordpress/element';
23
22
  import { store as preferencesStore } from '@wordpress/preferences';
24
- import { store as blockEditorStore } from '@wordpress/block-editor';
23
+ import { ActionItem } from '@wordpress/interface';
25
24
 
26
25
  /**
27
26
  * Internal dependencies
@@ -30,49 +29,21 @@ import { store as editorStore } from '../../store';
30
29
  import PostPreviewButton from '../post-preview-button';
31
30
 
32
31
  export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
33
- const {
34
- deviceType,
35
- editorMode,
36
- homeUrl,
37
- isTemplate,
38
- isViewable,
39
- showIconLabels,
40
- } = useSelect( ( select ) => {
41
- const { getDeviceType, getCurrentPostType } = select( editorStore );
42
- const { getUnstableBase, getPostType } = select( coreStore );
43
- const { get } = select( preferencesStore );
44
- const { __unstableGetEditorMode } = select( blockEditorStore );
45
- const _currentPostType = getCurrentPostType();
46
- return {
47
- deviceType: getDeviceType(),
48
- editorMode: __unstableGetEditorMode(),
49
- homeUrl: getUnstableBase()?.home,
50
- isTemplate: _currentPostType === 'wp_template',
51
- isViewable: getPostType( _currentPostType )?.viewable ?? false,
52
- showIconLabels: get( 'core', 'showIconLabels' ),
53
- };
54
- }, [] );
32
+ const { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =
33
+ useSelect( ( select ) => {
34
+ const { getDeviceType, getCurrentPostType } = select( editorStore );
35
+ const { getEntityRecord, getPostType } = select( coreStore );
36
+ const { get } = select( preferencesStore );
37
+ const _currentPostType = getCurrentPostType();
38
+ return {
39
+ deviceType: getDeviceType(),
40
+ homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
41
+ isTemplate: _currentPostType === 'wp_template',
42
+ isViewable: getPostType( _currentPostType )?.viewable ?? false,
43
+ showIconLabels: get( 'core', 'showIconLabels' ),
44
+ };
45
+ }, [] );
55
46
  const { setDeviceType } = useDispatch( editorStore );
56
- const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
57
-
58
- /**
59
- * Save the original editing mode in a ref to restore it when we exit zoom out.
60
- */
61
- const originalEditingMode = useRef( editorMode );
62
- useEffect( () => {
63
- if ( editorMode !== 'zoom-out' ) {
64
- originalEditingMode.current = editorMode;
65
- }
66
-
67
- return () => {
68
- if (
69
- editorMode === 'zoom-out' &&
70
- editorMode !== originalEditingMode.current
71
- ) {
72
- __unstableSetEditorMode( originalEditingMode.current );
73
- }
74
- };
75
- }, [ editorMode, __unstableSetEditorMode ] );
76
47
 
77
48
  const isMobile = useViewportMatch( 'medium', '<' );
78
49
  if ( isMobile ) {
@@ -111,11 +82,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
111
82
  label: __( 'Desktop' ),
112
83
  icon: desktop,
113
84
  },
114
- {
115
- value: 'ZoomOut',
116
- label: __( 'Desktop (50%)' ),
117
- icon: desktop,
118
- },
119
85
  {
120
86
  value: 'Tablet',
121
87
  label: __( 'Tablet' ),
@@ -128,26 +94,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
128
94
  },
129
95
  ];
130
96
 
131
- const previewValue = editorMode === 'zoom-out' ? 'ZoomOut' : deviceType;
132
-
133
- /**
134
- * Handles the selection of a device type.
135
- *
136
- * @param {string} value The device type.
137
- */
138
- const onSelect = ( value ) => {
139
- let newEditorMode = originalEditingMode.current;
140
-
141
- if ( value === 'ZoomOut' ) {
142
- newEditorMode = 'zoom-out';
143
- setDeviceType( 'Desktop' );
144
- } else {
145
- setDeviceType( value );
146
- }
147
-
148
- __unstableSetEditorMode( newEditorMode );
149
- };
150
-
151
97
  return (
152
98
  <DropdownMenu
153
99
  className={ clsx(
@@ -158,7 +104,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
158
104
  toggleProps={ toggleProps }
159
105
  menuProps={ menuProps }
160
106
  icon={ deviceIcons[ deviceType.toLowerCase() ] }
161
- text={ editorMode === 'zoom-out' ? __( '50%' ) : undefined }
162
107
  label={ __( 'View' ) }
163
108
  disableOpenOnArrowDown={ disabled }
164
109
  >
@@ -167,8 +112,8 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
167
112
  <MenuGroup>
168
113
  <MenuItemsChoice
169
114
  choices={ choices }
170
- value={ previewValue }
171
- onSelect={ onSelect }
115
+ value={ deviceType }
116
+ onSelect={ setDeviceType }
172
117
  />
173
118
  </MenuGroup>
174
119
  { isTemplate && (
@@ -206,6 +151,11 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
206
151
  />
207
152
  </MenuGroup>
208
153
  ) }
154
+ <ActionItem.Slot
155
+ name="core/plugin-preview-menu"
156
+ as={ MenuGroup }
157
+ fillProps={ { onClick: onClose } }
158
+ />
209
159
  </>
210
160
  ) }
211
161
  </DropdownMenu>
@@ -4,7 +4,11 @@
4
4
  import { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';
5
5
  import { useDispatch, useSelect } from '@wordpress/data';
6
6
  import { __ } from '@wordpress/i18n';
7
- import { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';
7
+ import {
8
+ EntityProvider,
9
+ useEntityBlockEditor,
10
+ store as coreStore,
11
+ } from '@wordpress/core-data';
8
12
  import {
9
13
  BlockEditorProvider,
10
14
  BlockContextProvider,
@@ -48,7 +52,6 @@ const noop = () => {};
48
52
  */
49
53
  const NON_CONTEXTUAL_POST_TYPES = [
50
54
  'wp_block',
51
- 'wp_template',
52
55
  'wp_navigation',
53
56
  'wp_template_part',
54
57
  ];
@@ -161,31 +164,59 @@ export const ExperimentalEditorProvider = withRegistryProvider(
161
164
  BlockEditorProviderComponent = ExperimentalBlockEditorProvider,
162
165
  __unstableTemplate: template,
163
166
  } ) => {
164
- const { editorSettings, selection, isReady, mode } = useSelect(
165
- ( select ) => {
167
+ const { editorSettings, selection, isReady, mode, postTypes } =
168
+ useSelect( ( select ) => {
166
169
  const {
167
170
  getEditorSettings,
168
171
  getEditorSelection,
169
172
  getRenderingMode,
170
173
  __unstableIsEditorReady,
171
174
  } = select( editorStore );
175
+ const { getPostTypes } = select( coreStore );
176
+
172
177
  return {
173
178
  editorSettings: getEditorSettings(),
174
179
  isReady: __unstableIsEditorReady(),
175
180
  mode: getRenderingMode(),
176
181
  selection: getEditorSelection(),
182
+ postTypes: getPostTypes( { per_page: -1 } ),
177
183
  };
178
- },
179
- []
180
- );
184
+ }, [] );
181
185
  const shouldRenderTemplate = !! template && mode !== 'post-only';
182
186
  const rootLevelPost = shouldRenderTemplate ? template : post;
183
187
  const defaultBlockContext = useMemo( () => {
184
- const postContext =
188
+ const postContext = {};
189
+ // If it is a template, try to inherit the post type from the slug.
190
+ if ( post.type === 'wp_template' ) {
191
+ if ( ! post.is_custom ) {
192
+ const [ kind ] = post.slug.split( '-' );
193
+ switch ( kind ) {
194
+ case 'page':
195
+ postContext.postType = 'page';
196
+ break;
197
+ case 'single':
198
+ // Infer the post type from the slug.
199
+ const postTypesSlugs =
200
+ postTypes?.map( ( entity ) => entity.slug ) ||
201
+ [];
202
+ const match = post.slug.match(
203
+ `^single-(${ postTypesSlugs.join(
204
+ '|'
205
+ ) })(?:-.+)?$`
206
+ );
207
+ if ( match ) {
208
+ postContext.postType = match[ 1 ];
209
+ }
210
+ break;
211
+ }
212
+ }
213
+ } else if (
185
214
  ! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||
186
215
  shouldRenderTemplate
187
- ? { postId: post.id, postType: post.type }
188
- : {};
216
+ ) {
217
+ postContext.postId = post.id;
218
+ postContext.postType = post.type;
219
+ }
189
220
 
190
221
  return {
191
222
  ...postContext,
@@ -200,6 +231,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
200
231
  post.type,
201
232
  rootLevelPost.type,
202
233
  rootLevelPost.slug,
234
+ postTypes,
203
235
  ] );
204
236
  const { id, type } = rootLevelPost;
205
237
  const blockEditorSettings = useBlockEditorSettings(
@@ -23,18 +23,23 @@ import {
23
23
  import inserterMediaCategories from '../media-categories';
24
24
  import { mediaUpload } from '../../utils';
25
25
  import { store as editorStore } from '../../store';
26
- import { lock, unlock } from '../../lock-unlock';
26
+ import { unlock } from '../../lock-unlock';
27
27
  import { useGlobalStylesContext } from '../global-styles-provider';
28
28
 
29
- const EMPTY_BLOCKS_LIST = [];
30
29
  const EMPTY_OBJECT = {};
31
30
 
32
31
  function __experimentalReusableBlocksSelect( select ) {
33
- return (
34
- select( coreStore ).getEntityRecords( 'postType', 'wp_block', {
35
- per_page: -1,
36
- } ) ?? EMPTY_BLOCKS_LIST
37
- );
32
+ const { getEntityRecords, hasFinishedResolution } = select( coreStore );
33
+ const reusableBlocks = getEntityRecords( 'postType', 'wp_block', {
34
+ per_page: -1,
35
+ } );
36
+ return hasFinishedResolution( 'getEntityRecords', [
37
+ 'postType',
38
+ 'wp_block',
39
+ { per_page: -1 },
40
+ ] )
41
+ ? reusableBlocks
42
+ : undefined;
38
43
  }
39
44
 
40
45
  const BLOCK_EDITOR_SETTINGS = [
@@ -47,6 +52,7 @@ const BLOCK_EDITOR_SETTINGS = [
47
52
  'allowedMimeTypes',
48
53
  'bodyPlaceholder',
49
54
  'canLockBlocks',
55
+ 'canUpdateBlockBindings',
50
56
  'capabilities',
51
57
  'clearBlockSelection',
52
58
  'codeEditingEnabled',
@@ -74,7 +80,6 @@ const BLOCK_EDITOR_SETTINGS = [
74
80
  'postContentAttributes',
75
81
  'postsPerPage',
76
82
  'readOnly',
77
- 'sectionRootClientId',
78
83
  'styles',
79
84
  'titlePlaceholder',
80
85
  'supportsLayout',
@@ -90,6 +95,7 @@ const {
90
95
  globalStylesLinksDataKey,
91
96
  selectBlockPatternsKey,
92
97
  reusableBlocksSelectKey,
98
+ sectionRootClientIdKey,
93
99
  } = unlock( privateApis );
94
100
 
95
101
  /**
@@ -325,10 +331,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
325
331
  ? [ [ 'core/navigation', {}, [] ] ]
326
332
  : settings.template,
327
333
  __experimentalSetIsInserterOpened: setIsInserterOpened,
334
+ [ sectionRootClientIdKey ]: sectionRootClientId,
328
335
  };
329
- lock( blockEditorSettings, {
330
- sectionRootClientId,
331
- } );
336
+
332
337
  return blockEditorSettings;
333
338
  }, [
334
339
  allowedBlockTypes,
@@ -16,7 +16,7 @@
16
16
  cursor: ew-resize;
17
17
  outline: none;
18
18
  background: none;
19
- border-radius: $radius-block-ui;
19
+ border-radius: $radius-full;
20
20
  border: 0;
21
21
  height: 100px;
22
22
 
@@ -29,7 +29,7 @@
29
29
  content: "";
30
30
  width: $grid-unit-05;
31
31
  background-color: rgba($gray-700, 0.4);
32
- border-radius: $radius-block-ui;
32
+ border-radius: $radius-full;
33
33
  }
34
34
 
35
35
  &.is-left {
@@ -71,6 +71,8 @@ export default function SavePublishPanels( {
71
71
  unmountableContent = (
72
72
  <div className="editor-layout__toggle-publish-panel">
73
73
  <Button
74
+ // TODO: Switch to `true` (40px size) if possible
75
+ __next40pxDefaultSize={ false }
74
76
  variant="secondary"
75
77
  className="editor-layout__toggle-publish-panel-button"
76
78
  onClick={ togglePublishSidebar }
@@ -84,6 +86,8 @@ export default function SavePublishPanels( {
84
86
  unmountableContent = (
85
87
  <div className="editor-layout__toggle-entities-saved-states-panel">
86
88
  <Button
89
+ // TODO: Switch to `true` (40px size) if possible
90
+ __next40pxDefaultSize={ false }
87
91
  variant="secondary"
88
92
  className="editor-layout__toggle-entities-saved-states-panel-button"
89
93
  onClick={ openEntitiesSavedStates }
@@ -28,6 +28,7 @@ import PostsPerPage from '../posts-per-page';
28
28
  import SiteDiscussion from '../site-discussion';
29
29
  import { store as editorStore } from '../../store';
30
30
  import { PrivatePostLastRevision } from '../post-last-revision';
31
+ import PostTrash from '../post-trash';
31
32
 
32
33
  /**
33
34
  * Module Constants
@@ -87,6 +88,9 @@ export default function PostSummary( { onActionPerformed } ) {
87
88
  <SiteDiscussion />
88
89
  <PostFormatPanel />
89
90
  </VStack>
91
+ <PostTrash
92
+ onActionPerformed={ onActionPerformed }
93
+ />
90
94
  { fills }
91
95
  </VStack>
92
96
  ) }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { Modal } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
- import { useState, useMemo, useEffect } from '@wordpress/element';
6
+ import { useState, useMemo } from '@wordpress/element';
7
7
  import {
8
8
  store as blockEditorStore,
9
9
  __experimentalBlockPatternsList as BlockPatternsList,
@@ -12,6 +12,8 @@ import { useSelect, useDispatch } from '@wordpress/data';
12
12
  import { useAsyncList } from '@wordpress/compose';
13
13
  import { store as coreStore } from '@wordpress/core-data';
14
14
  import { __unstableSerializeAndClean } from '@wordpress/blocks';
15
+ import { store as preferencesStore } from '@wordpress/preferences';
16
+ import { store as interfaceStore } from '@wordpress/interface';
15
17
 
16
18
  /**
17
19
  * Internal dependencies
@@ -19,7 +21,7 @@ import { __unstableSerializeAndClean } from '@wordpress/blocks';
19
21
  import { store as editorStore } from '../../store';
20
22
  import { TEMPLATE_POST_TYPE } from '../../store/constants';
21
23
 
22
- function useStartPatterns() {
24
+ export function useStartPatterns() {
23
25
  // A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
24
26
  // and it has no postTypes declared and the current post type is page or if
25
27
  // the current post type is part of the postTypes declared.
@@ -45,8 +47,14 @@ function useStartPatterns() {
45
47
  );
46
48
 
47
49
  return useMemo( () => {
48
- // filter patterns without postTypes declared if the current postType is page
49
- // or patterns that declare the current postType in its post type array.
50
+ if ( ! blockPatternsWithPostContentBlockType?.length ) {
51
+ return [];
52
+ }
53
+
54
+ /*
55
+ * Filter patterns without postTypes declared if the current postType is page
56
+ * or patterns that declare the current postType in its post type array.
57
+ */
50
58
  return blockPatternsWithPostContentBlockType.filter( ( pattern ) => {
51
59
  return (
52
60
  ( postType === 'page' && ! pattern.postTypes ) ||
@@ -110,30 +118,24 @@ function StartPageOptionsModal( { onClose } ) {
110
118
 
111
119
  export default function StartPageOptions() {
112
120
  const [ isClosed, setIsClosed ] = useState( false );
113
- const { shouldEnableModal, postType, postId } = useSelect( ( select ) => {
114
- const {
115
- isEditedPostDirty,
116
- isEditedPostEmpty,
117
- getCurrentPostType,
118
- getCurrentPostId,
119
- } = select( editorStore );
120
- const _postType = getCurrentPostType();
121
-
122
- return {
123
- shouldEnableModal:
124
- ! isEditedPostDirty() &&
125
- isEditedPostEmpty() &&
126
- TEMPLATE_POST_TYPE !== _postType,
127
- postType: _postType,
128
- postId: getCurrentPostId(),
129
- };
121
+ const shouldEnableModal = useSelect( ( select ) => {
122
+ const { isEditedPostDirty, isEditedPostEmpty, getCurrentPostType } =
123
+ select( editorStore );
124
+ const preferencesModalActive =
125
+ select( interfaceStore ).isModalActive( 'editor/preferences' );
126
+ const choosePatternModalEnabled = select( preferencesStore ).get(
127
+ 'core',
128
+ 'enableChoosePatternModal'
129
+ );
130
+ return (
131
+ choosePatternModalEnabled &&
132
+ ! preferencesModalActive &&
133
+ ! isEditedPostDirty() &&
134
+ isEditedPostEmpty() &&
135
+ TEMPLATE_POST_TYPE !== getCurrentPostType()
136
+ );
130
137
  }, [] );
131
138
 
132
- useEffect( () => {
133
- // Should reset the modal state when navigating to a new page/post.
134
- setIsClosed( false );
135
- }, [ postType, postId ] );
136
-
137
139
  if ( ! shouldEnableModal || isClosed ) {
138
140
  return null;
139
141
  }
@@ -155,7 +155,11 @@ function StartModal( { slug, isCustom, onClose, postType } ) {
155
155
  expanded={ false }
156
156
  >
157
157
  <FlexItem>
158
- <Button variant="tertiary" onClick={ onClose }>
158
+ <Button
159
+ __next40pxDefaultSize
160
+ variant="tertiary"
161
+ onClick={ onClose }
162
+ >
159
163
  { __( 'Skip' ) }
160
164
  </Button>
161
165
  </FlexItem>
@@ -30,6 +30,7 @@ function TableOfContents(
30
30
  contentClassName="table-of-contents__popover"
31
31
  renderToggle={ ( { isOpen, onToggle } ) => (
32
32
  <Button
33
+ __next40pxDefaultSize
33
34
  { ...props }
34
35
  ref={ ref }
35
36
  onClick={ hasBlocks ? onToggle : undefined }
@@ -40,6 +40,7 @@ export default function TextEditor( { autoFocus = false } ) {
40
40
  <div className="editor-text-editor__toolbar">
41
41
  <h2>{ __( 'Editing code' ) }</h2>
42
42
  <Button
43
+ __next40pxDefaultSize
43
44
  variant="tertiary"
44
45
  onClick={ () => switchEditorMode( 'visual' ) }
45
46
  shortcut={ shortcut }
@@ -63,7 +63,7 @@
63
63
  }
64
64
 
65
65
  h2 {
66
- line-height: $button-size;
66
+ line-height: $button-size-next-default-40px;
67
67
  margin: 0 auto 0 0;
68
68
  font-size: $default-font-size;
69
69
  color: $gray-900;
@@ -55,7 +55,10 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
55
55
  return;
56
56
  }
57
57
 
58
- if ( ! event.target.classList.contains( 'is-root-container' ) ) {
58
+ if (
59
+ ! event.target.classList.contains( 'is-root-container' ) ||
60
+ event.target.dataset?.type === 'core/template-part'
61
+ ) {
59
62
  return;
60
63
  }
61
64
  setIsDialogOpen( true );
@@ -128,8 +128,7 @@ function VisualEditor( {
128
128
  getRenderingMode,
129
129
  getDeviceType,
130
130
  } = select( editorStore );
131
- const { getPostType, canUser, getEditedEntityRecord } =
132
- select( coreStore );
131
+ const { getPostType, getEditedEntityRecord } = select( coreStore );
133
132
  const postTypeSlug = getCurrentPostType();
134
133
  const _renderingMode = getRenderingMode();
135
134
  let _wrapperBlockName;
@@ -143,10 +142,6 @@ function VisualEditor( {
143
142
  const editorSettings = getEditorSettings();
144
143
  const supportsTemplateMode = editorSettings.supportsTemplateMode;
145
144
  const postTypeObject = getPostType( postTypeSlug );
146
- const canEditTemplate = canUser( 'create', {
147
- kind: 'postType',
148
- name: 'wp_template',
149
- } );
150
145
  const currentTemplateId = getCurrentTemplateId();
151
146
  const template = currentTemplateId
152
147
  ? getEditedEntityRecord(
@@ -163,9 +158,7 @@ function VisualEditor( {
163
158
  // Post template fetch returns a 404 on classic themes, which
164
159
  // messes with e2e tests, so check it's a block theme first.
165
160
  editedPostTemplate:
166
- postTypeObject?.viewable &&
167
- supportsTemplateMode &&
168
- canEditTemplate
161
+ postTypeObject?.viewable && supportsTemplateMode
169
162
  ? template
170
163
  : undefined,
171
164
  wrapperBlockName: _wrapperBlockName,
@@ -0,0 +1,34 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { Button } from '@wordpress/components';
5
+ import { __ } from '@wordpress/i18n';
6
+
7
+ import { useDispatch, useSelect } from '@wordpress/data';
8
+ import { store as blockEditorStore } from '@wordpress/block-editor';
9
+ import { square as zoomOutIcon } from '@wordpress/icons';
10
+
11
+ const ZoomOutToggle = () => {
12
+ const { isZoomOutMode } = useSelect( ( select ) => ( {
13
+ isZoomOutMode:
14
+ select( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',
15
+ } ) );
16
+
17
+ const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
18
+
19
+ const handleZoomOut = () => {
20
+ __unstableSetEditorMode( isZoomOutMode ? 'edit' : 'zoom-out' );
21
+ };
22
+
23
+ return (
24
+ <Button
25
+ onClick={ handleZoomOut }
26
+ icon={ zoomOutIcon }
27
+ label={ __( 'Toggle Zoom Out' ) }
28
+ isPressed={ isZoomOutMode }
29
+ size="compact"
30
+ />
31
+ );
32
+ };
33
+
34
+ export default ZoomOutToggle;
@@ -114,6 +114,7 @@ const resetPost: Action< Post > = {
114
114
  </Text>
115
115
  <HStack justify="right">
116
116
  <Button
117
+ __next40pxDefaultSize
117
118
  variant="tertiary"
118
119
  onClick={ closeModal }
119
120
  disabled={ isBusy }
@@ -122,6 +123,7 @@ const resetPost: Action< Post > = {
122
123
  { __( 'Cancel' ) }
123
124
  </Button>
124
125
  <Button
126
+ __next40pxDefaultSize
125
127
  variant="primary"
126
128
  onClick={ async () => {
127
129
  setIsBusy( true );
@@ -67,6 +67,7 @@ const trashPost: Action< PostWithPermissions > = {
67
67
  </Text>
68
68
  <HStack justify="right">
69
69
  <Button
70
+ __next40pxDefaultSize
70
71
  variant="tertiary"
71
72
  onClick={ closeModal }
72
73
  disabled={ isBusy }
@@ -75,6 +76,7 @@ const trashPost: Action< PostWithPermissions > = {
75
76
  { __( 'Cancel' ) }
76
77
  </Button>
77
78
  <Button
79
+ __next40pxDefaultSize
78
80
  variant="primary"
79
81
  onClick={ async () => {
80
82
  setIsBusy( true );
@@ -8,22 +8,24 @@ import { doAction } from '@wordpress/hooks';
8
8
  /**
9
9
  * Internal dependencies
10
10
  */
11
- import deletePost from '../actions/delete-post';
12
- import duplicatePattern from '../actions/duplicate-pattern';
13
11
  import duplicateTemplatePart from '../actions/duplicate-template-part';
14
- import exportPattern from '../actions/export-pattern';
15
12
  import resetPost from '../actions/reset-post';
16
13
  import trashPost from '../actions/trash-post';
17
- import permanentlyDeletePost from '../actions/permanently-delete-post';
18
14
  import renamePost from '../actions/rename-post';
19
- import reorderPage from '../actions/reorder-page';
20
15
  import restorePost from '../actions/restore-post';
21
16
  import type { PostType } from '../types';
22
17
  import { store as editorStore } from '../../store';
23
18
  import { unlock } from '../../lock-unlock';
24
- import duplicatePost from '../actions/duplicate-post';
25
- import viewPostRevisions from '../actions/view-post-revisions';
26
- import viewPost from '../actions/view-post';
19
+ import {
20
+ viewPost,
21
+ viewPostRevisions,
22
+ duplicatePost,
23
+ duplicatePattern,
24
+ reorderPage,
25
+ exportPattern,
26
+ permanentlyDeletePost,
27
+ } from '@wordpress/fields';
28
+ import deletePost from '../actions/delete-post';
27
29
 
28
30
  export function registerEntityAction< Item >(
29
31
  kind: string,
@@ -9,7 +9,6 @@ import * as interfaceApis from '@wordpress/interface';
9
9
  import { lock } from './lock-unlock';
10
10
  import { EntitiesSavedStatesExtensible } from './components/entities-saved-states';
11
11
  import EditorContentSlotFill from './components/editor-interface/content-slot-fill';
12
- import useBlockEditorSettings from './components/provider/use-block-editor-settings';
13
12
  import BackButton from './components/header/back-button';
14
13
  import CreateTemplatePartModal from './components/create-template-part-modal';
15
14
  import Editor from './components/editor';
@@ -51,7 +50,6 @@ lock( privateApis, {
51
50
  bootstrapBlockBindingsSourcesFromServer,
52
51
 
53
52
  // This is a temporary private API while we're updating the site editor to use EditorProvider.
54
- useBlockEditorSettings,
55
53
  interfaceStore,
56
54
  ...remainingInterfaceApis,
57
55
  } );
@@ -137,7 +137,9 @@ export const saveDirtyEntities =
137
137
  { kind: 'postType', name: 'wp_navigation' },
138
138
  ];
139
139
  const saveNoticeId = 'site-editor-save-success';
140
- const homeUrl = registry.select( coreStore ).getUnstableBase()?.home;
140
+ const homeUrl = registry
141
+ .select( coreStore )
142
+ .getEntityRecord( 'root', '__unstableBase' )?.home;
141
143
  registry.dispatch( noticesStore ).removeNotice( saveNoticeId );
142
144
  const entitiesToSave = dirtyEntityRecords.filter(
143
145
  ( { kind, name, key, property } ) => {