@wordpress/editor 14.7.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 (301) hide show
  1. package/README.md +4 -0
  2. package/build/bindings/post-meta.js +2 -1
  3. package/build/bindings/post-meta.js.map +1 -1
  4. package/build/components/block-manager/index.js +2 -4
  5. package/build/components/block-manager/index.js.map +1 -1
  6. package/build/components/editor/index.js +2 -2
  7. package/build/components/editor/index.js.map +1 -1
  8. package/build/components/editor-history/redo.js +2 -4
  9. package/build/components/editor-history/redo.js.map +1 -1
  10. package/build/components/editor-history/undo.js +2 -4
  11. package/build/components/editor-history/undo.js.map +1 -1
  12. package/build/components/error-boundary/index.js +2 -4
  13. package/build/components/error-boundary/index.js.map +1 -1
  14. package/build/components/global-styles-provider/index.js +3 -4
  15. package/build/components/global-styles-provider/index.js.map +1 -1
  16. package/build/components/header/index.js +6 -4
  17. package/build/components/header/index.js.map +1 -1
  18. package/build/components/inserter-sidebar/index.js +2 -5
  19. package/build/components/inserter-sidebar/index.js.map +1 -1
  20. package/build/components/post-excerpt/panel.js +2 -5
  21. package/build/components/post-excerpt/panel.js.map +1 -1
  22. package/build/components/post-featured-image/index.js +6 -12
  23. package/build/components/post-featured-image/index.js.map +1 -1
  24. package/build/components/post-format/index.js +2 -4
  25. package/build/components/post-format/index.js.map +1 -1
  26. package/build/components/post-last-revision/index.js +2 -4
  27. package/build/components/post-last-revision/index.js.map +1 -1
  28. package/build/components/post-locked-modal/index.js +4 -8
  29. package/build/components/post-locked-modal/index.js.map +1 -1
  30. package/build/components/post-publish-panel/index.js +2 -4
  31. package/build/components/post-publish-panel/index.js.map +1 -1
  32. package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -4
  33. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  34. package/build/components/post-publish-panel/maybe-upload-media.js +153 -36
  35. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  36. package/build/components/post-publish-panel/media-util.js +79 -0
  37. package/build/components/post-publish-panel/media-util.js.map +1 -0
  38. package/build/components/post-trash/check.js +2 -1
  39. package/build/components/post-trash/check.js.map +1 -1
  40. package/build/components/post-trash/index.js +22 -8
  41. package/build/components/post-trash/index.js.map +1 -1
  42. package/build/components/preferences-modal/index.js +28 -1
  43. package/build/components/preferences-modal/index.js.map +1 -1
  44. package/build/components/preview-dropdown/index.js +5 -57
  45. package/build/components/preview-dropdown/index.js.map +1 -1
  46. package/build/components/provider/index.js +34 -8
  47. package/build/components/provider/index.js.map +1 -1
  48. package/build/components/provider/use-block-editor-settings.js +9 -4
  49. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  50. package/build/components/sidebar/post-summary.js +3 -0
  51. package/build/components/sidebar/post-summary.js.map +1 -1
  52. package/build/components/start-page-options/index.js +16 -19
  53. package/build/components/start-page-options/index.js.map +1 -1
  54. package/build/components/start-template-options/index.js +2 -4
  55. package/build/components/start-template-options/index.js.map +1 -1
  56. package/build/components/table-of-contents/index.js +2 -4
  57. package/build/components/table-of-contents/index.js.map +1 -1
  58. package/build/components/text-editor/index.js +2 -4
  59. package/build/components/text-editor/index.js.map +1 -1
  60. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -1
  61. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  62. package/build/components/zoom-out-toggle/index.js +38 -0
  63. package/build/components/zoom-out-toggle/index.js.map +1 -0
  64. package/build/dataviews/actions/reset-post.js +4 -8
  65. package/build/dataviews/actions/reset-post.js.map +1 -1
  66. package/build/dataviews/actions/trash-post.js +4 -8
  67. package/build/dataviews/actions/trash-post.js.map +1 -1
  68. package/build/dataviews/store/private-actions.js +4 -10
  69. package/build/dataviews/store/private-actions.js.map +1 -1
  70. package/build/store/selectors.js +7 -3
  71. package/build/store/selectors.js.map +1 -1
  72. package/build-module/bindings/post-meta.js +2 -1
  73. package/build-module/bindings/post-meta.js.map +1 -1
  74. package/build-module/components/block-manager/index.js +2 -4
  75. package/build-module/components/block-manager/index.js.map +1 -1
  76. package/build-module/components/editor/index.js +2 -2
  77. package/build-module/components/editor/index.js.map +1 -1
  78. package/build-module/components/editor-history/redo.js +2 -4
  79. package/build-module/components/editor-history/redo.js.map +1 -1
  80. package/build-module/components/editor-history/undo.js +2 -4
  81. package/build-module/components/editor-history/undo.js.map +1 -1
  82. package/build-module/components/error-boundary/index.js +2 -4
  83. package/build-module/components/error-boundary/index.js.map +1 -1
  84. package/build-module/components/global-styles-provider/index.js +3 -4
  85. package/build-module/components/global-styles-provider/index.js.map +1 -1
  86. package/build-module/components/header/index.js +6 -4
  87. package/build-module/components/header/index.js.map +1 -1
  88. package/build-module/components/inserter-sidebar/index.js +2 -5
  89. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  90. package/build-module/components/post-excerpt/panel.js +2 -5
  91. package/build-module/components/post-excerpt/panel.js.map +1 -1
  92. package/build-module/components/post-featured-image/index.js +6 -12
  93. package/build-module/components/post-featured-image/index.js.map +1 -1
  94. package/build-module/components/post-format/index.js +2 -4
  95. package/build-module/components/post-format/index.js.map +1 -1
  96. package/build-module/components/post-last-revision/index.js +2 -4
  97. package/build-module/components/post-last-revision/index.js.map +1 -1
  98. package/build-module/components/post-locked-modal/index.js +4 -8
  99. package/build-module/components/post-locked-modal/index.js.map +1 -1
  100. package/build-module/components/post-publish-panel/index.js +2 -4
  101. package/build-module/components/post-publish-panel/index.js.map +1 -1
  102. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -4
  103. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  104. package/build-module/components/post-publish-panel/maybe-upload-media.js +152 -35
  105. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  106. package/build-module/components/post-publish-panel/media-util.js +72 -0
  107. package/build-module/components/post-publish-panel/media-util.js.map +1 -0
  108. package/build-module/components/post-trash/check.js +2 -1
  109. package/build-module/components/post-trash/check.js.map +1 -1
  110. package/build-module/components/post-trash/index.js +23 -11
  111. package/build-module/components/post-trash/index.js.map +1 -1
  112. package/build-module/components/preferences-modal/index.js +28 -1
  113. package/build-module/components/preferences-modal/index.js.map +1 -1
  114. package/build-module/components/preview-dropdown/index.js +5 -57
  115. package/build-module/components/preview-dropdown/index.js.map +1 -1
  116. package/build-module/components/provider/index.js +35 -9
  117. package/build-module/components/provider/index.js.map +1 -1
  118. package/build-module/components/provider/use-block-editor-settings.js +9 -4
  119. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  120. package/build-module/components/sidebar/post-summary.js +3 -0
  121. package/build-module/components/sidebar/post-summary.js.map +1 -1
  122. package/build-module/components/start-page-options/index.js +17 -21
  123. package/build-module/components/start-page-options/index.js.map +1 -1
  124. package/build-module/components/start-template-options/index.js +2 -4
  125. package/build-module/components/start-template-options/index.js.map +1 -1
  126. package/build-module/components/table-of-contents/index.js +2 -4
  127. package/build-module/components/table-of-contents/index.js.map +1 -1
  128. package/build-module/components/text-editor/index.js +2 -4
  129. package/build-module/components/text-editor/index.js.map +1 -1
  130. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -1
  131. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  132. package/build-module/components/zoom-out-toggle/index.js +31 -0
  133. package/build-module/components/zoom-out-toggle/index.js.map +1 -0
  134. package/build-module/dataviews/actions/reset-post.js +4 -8
  135. package/build-module/dataviews/actions/reset-post.js.map +1 -1
  136. package/build-module/dataviews/actions/trash-post.js +4 -8
  137. package/build-module/dataviews/actions/trash-post.js.map +1 -1
  138. package/build-module/dataviews/store/private-actions.js +2 -8
  139. package/build-module/dataviews/store/private-actions.js.map +1 -1
  140. package/build-module/store/selectors.js +6 -2
  141. package/build-module/store/selectors.js.map +1 -1
  142. package/build-style/style-rtl.css +3 -7
  143. package/build-style/style.css +3 -7
  144. package/build-types/components/editor-history/redo.d.ts.map +1 -1
  145. package/build-types/components/editor-history/undo.d.ts.map +1 -1
  146. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  147. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  148. package/build-types/components/header/back-button.d.ts.map +1 -1
  149. package/build-types/components/header/index.d.ts.map +1 -1
  150. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  151. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  152. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  153. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  154. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  155. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  156. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  157. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  158. package/build-types/components/post-format/index.d.ts.map +1 -1
  159. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  160. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  161. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  162. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
  163. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +1 -1
  164. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  165. package/build-types/components/post-publish-panel/media-util.d.ts +20 -0
  166. package/build-types/components/post-publish-panel/media-util.d.ts.map +1 -0
  167. package/build-types/components/post-trash/check.d.ts.map +1 -1
  168. package/build-types/components/post-trash/index.d.ts +4 -1
  169. package/build-types/components/post-trash/index.d.ts.map +1 -1
  170. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  171. package/build-types/components/preferences-modal/index.d.ts.map +1 -1
  172. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  173. package/build-types/components/provider/index.d.ts.map +1 -1
  174. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  175. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  176. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  177. package/build-types/components/start-page-options/index.d.ts +1 -0
  178. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  179. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  180. package/build-types/components/text-editor/index.d.ts.map +1 -1
  181. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
  182. package/build-types/components/zoom-out-toggle/index.d.ts +3 -0
  183. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -0
  184. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
  185. package/build-types/dataviews/actions/trash-post.d.ts.map +1 -1
  186. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  187. package/build-types/store/selectors.d.ts +8 -8
  188. package/build-types/store/selectors.d.ts.map +1 -1
  189. package/package.json +37 -36
  190. package/src/bindings/post-meta.js +1 -1
  191. package/src/components/block-manager/index.js +1 -2
  192. package/src/components/editor/index.js +1 -1
  193. package/src/components/editor-history/redo.js +1 -2
  194. package/src/components/editor-history/undo.js +1 -2
  195. package/src/components/error-boundary/index.js +1 -6
  196. package/src/components/global-styles-provider/index.js +11 -7
  197. package/src/components/header/index.js +12 -3
  198. package/src/components/header/style.scss +1 -1
  199. package/src/components/inserter-sidebar/index.js +2 -5
  200. package/src/components/post-excerpt/panel.js +1 -3
  201. package/src/components/post-featured-image/index.js +3 -6
  202. package/src/components/post-featured-image/style.scss +1 -5
  203. package/src/components/post-format/index.js +1 -2
  204. package/src/components/post-last-revision/index.js +1 -2
  205. package/src/components/post-locked-modal/index.js +2 -4
  206. package/src/components/post-publish-panel/index.js +1 -2
  207. package/src/components/post-publish-panel/maybe-post-format-panel.js +1 -2
  208. package/src/components/post-publish-panel/maybe-upload-media.js +150 -50
  209. package/src/components/post-publish-panel/media-util.js +87 -0
  210. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  211. package/src/components/post-publish-panel/test/media-util.js +118 -0
  212. package/src/components/post-trash/check.js +5 -2
  213. package/src/components/post-trash/index.js +23 -12
  214. package/src/components/preferences-modal/index.js +227 -172
  215. package/src/components/preview-dropdown/index.js +26 -84
  216. package/src/components/provider/index.js +42 -10
  217. package/src/components/provider/use-block-editor-settings.js +11 -6
  218. package/src/components/sidebar/post-summary.js +4 -0
  219. package/src/components/start-page-options/index.js +28 -26
  220. package/src/components/start-template-options/index.js +1 -2
  221. package/src/components/table-of-contents/index.js +1 -2
  222. package/src/components/text-editor/index.js +1 -2
  223. package/src/components/text-editor/style.scss +1 -1
  224. package/src/components/visual-editor/edit-template-blocks-notification.js +4 -1
  225. package/src/components/zoom-out-toggle/index.js +34 -0
  226. package/src/dataviews/actions/reset-post.tsx +2 -4
  227. package/src/dataviews/actions/trash-post.tsx +2 -4
  228. package/src/dataviews/store/private-actions.ts +10 -8
  229. package/src/store/selectors.js +9 -3
  230. package/tsconfig.json +2 -0
  231. package/tsconfig.tsbuildinfo +1 -1
  232. package/build/dataviews/actions/duplicate-pattern.js +0 -48
  233. package/build/dataviews/actions/duplicate-pattern.js.map +0 -1
  234. package/build/dataviews/actions/duplicate-post.js +0 -146
  235. package/build/dataviews/actions/duplicate-post.js.map +0 -1
  236. package/build/dataviews/actions/duplicate-post.native.js +0 -9
  237. package/build/dataviews/actions/duplicate-post.native.js.map +0 -1
  238. package/build/dataviews/actions/export-pattern.js +0 -57
  239. package/build/dataviews/actions/export-pattern.js.map +0 -1
  240. package/build/dataviews/actions/export-pattern.native.js +0 -9
  241. package/build/dataviews/actions/export-pattern.native.js.map +0 -1
  242. package/build/dataviews/actions/permanently-delete-post.js +0 -109
  243. package/build/dataviews/actions/permanently-delete-post.js.map +0 -1
  244. package/build/dataviews/actions/reorder-page.js +0 -116
  245. package/build/dataviews/actions/reorder-page.js.map +0 -1
  246. package/build/dataviews/actions/reorder-page.native.js +0 -9
  247. package/build/dataviews/actions/reorder-page.native.js.map +0 -1
  248. package/build/dataviews/actions/view-post-revisions.js +0 -49
  249. package/build/dataviews/actions/view-post-revisions.js.map +0 -1
  250. package/build/dataviews/actions/view-post.js +0 -36
  251. package/build/dataviews/actions/view-post.js.map +0 -1
  252. package/build-module/dataviews/actions/duplicate-pattern.js +0 -39
  253. package/build-module/dataviews/actions/duplicate-pattern.js.map +0 -1
  254. package/build-module/dataviews/actions/duplicate-post.js +0 -139
  255. package/build-module/dataviews/actions/duplicate-post.js.map +0 -1
  256. package/build-module/dataviews/actions/duplicate-post.native.js +0 -3
  257. package/build-module/dataviews/actions/duplicate-post.native.js.map +0 -1
  258. package/build-module/dataviews/actions/export-pattern.js +0 -51
  259. package/build-module/dataviews/actions/export-pattern.js.map +0 -1
  260. package/build-module/dataviews/actions/export-pattern.native.js +0 -3
  261. package/build-module/dataviews/actions/export-pattern.native.js.map +0 -1
  262. package/build-module/dataviews/actions/permanently-delete-post.js +0 -102
  263. package/build-module/dataviews/actions/permanently-delete-post.js.map +0 -1
  264. package/build-module/dataviews/actions/reorder-page.js +0 -111
  265. package/build-module/dataviews/actions/reorder-page.js.map +0 -1
  266. package/build-module/dataviews/actions/reorder-page.native.js +0 -3
  267. package/build-module/dataviews/actions/reorder-page.native.js.map +0 -1
  268. package/build-module/dataviews/actions/view-post-revisions.js +0 -43
  269. package/build-module/dataviews/actions/view-post-revisions.js.map +0 -1
  270. package/build-module/dataviews/actions/view-post.js +0 -30
  271. package/build-module/dataviews/actions/view-post.js.map +0 -1
  272. package/build-types/dataviews/actions/duplicate-pattern.d.ts +0 -5
  273. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +0 -1
  274. package/build-types/dataviews/actions/duplicate-post.d.ts +0 -5
  275. package/build-types/dataviews/actions/duplicate-post.d.ts.map +0 -1
  276. package/build-types/dataviews/actions/duplicate-post.native.d.ts +0 -3
  277. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +0 -1
  278. package/build-types/dataviews/actions/export-pattern.d.ts +0 -8
  279. package/build-types/dataviews/actions/export-pattern.d.ts.map +0 -1
  280. package/build-types/dataviews/actions/export-pattern.native.d.ts +0 -3
  281. package/build-types/dataviews/actions/export-pattern.native.d.ts.map +0 -1
  282. package/build-types/dataviews/actions/permanently-delete-post.d.ts +0 -5
  283. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +0 -1
  284. package/build-types/dataviews/actions/reorder-page.d.ts +0 -8
  285. package/build-types/dataviews/actions/reorder-page.d.ts.map +0 -1
  286. package/build-types/dataviews/actions/reorder-page.native.d.ts +0 -3
  287. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +0 -1
  288. package/build-types/dataviews/actions/view-post-revisions.d.ts +0 -8
  289. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +0 -1
  290. package/build-types/dataviews/actions/view-post.d.ts +0 -8
  291. package/build-types/dataviews/actions/view-post.d.ts.map +0 -1
  292. package/src/dataviews/actions/duplicate-pattern.tsx +0 -40
  293. package/src/dataviews/actions/duplicate-post.native.tsx +0 -3
  294. package/src/dataviews/actions/duplicate-post.tsx +0 -174
  295. package/src/dataviews/actions/export-pattern.native.tsx +0 -3
  296. package/src/dataviews/actions/export-pattern.tsx +0 -76
  297. package/src/dataviews/actions/permanently-delete-post.tsx +0 -118
  298. package/src/dataviews/actions/reorder-page.native.tsx +0 -3
  299. package/src/dataviews/actions/reorder-page.tsx +0 -125
  300. package/src/dataviews/actions/view-post-revisions.tsx +0 -47
  301. package/src/dataviews/actions/view-post.tsx +0 -30
@@ -26,6 +26,7 @@ import PageAttributesCheck from '../page-attributes/check';
26
26
  import PostTypeSupportCheck from '../post-type-support-check';
27
27
  import { store as editorStore } from '../../store';
28
28
  import { unlock } from '../../lock-unlock';
29
+ import { useStartPatterns } from '../start-page-options';
29
30
 
30
31
  const {
31
32
  PreferencesModal,
@@ -57,214 +58,267 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
57
58
  const { setIsListViewOpened, setIsInserterOpened } =
58
59
  useDispatch( editorStore );
59
60
  const { set: setPreference } = useDispatch( preferencesStore );
61
+ const hasStarterPatterns = !! useStartPatterns().length;
60
62
 
61
63
  const sections = useMemo(
62
- () => [
63
- {
64
- name: 'general',
65
- tabLabel: __( 'General' ),
66
- content: (
67
- <>
68
- <PreferencesModalSection title={ __( 'Interface' ) }>
69
- <PreferenceToggleControl
70
- scope="core"
71
- featureName="showListViewByDefault"
72
- help={ __(
73
- 'Opens the List View sidebar by default.'
74
- ) }
75
- label={ __( 'Always open List View' ) }
76
- />
77
- { showBlockBreadcrumbsOption && (
64
+ () =>
65
+ [
66
+ {
67
+ name: 'general',
68
+ tabLabel: __( 'General' ),
69
+ content: (
70
+ <>
71
+ <PreferencesModalSection
72
+ title={ __( 'Interface' ) }
73
+ >
78
74
  <PreferenceToggleControl
79
75
  scope="core"
80
- featureName="showBlockBreadcrumbs"
76
+ featureName="showListViewByDefault"
81
77
  help={ __(
82
- 'Display the block hierarchy trail at the bottom of the editor.'
78
+ 'Opens the List View sidebar by default.'
83
79
  ) }
84
- label={ __( 'Show block breadcrumbs' ) }
80
+ label={ __( 'Always open List View' ) }
85
81
  />
86
- ) }
87
- <PreferenceToggleControl
88
- scope="core"
89
- featureName="allowRightClickOverrides"
90
- help={ __(
91
- 'Allows contextual List View menus via right-click, overriding browser defaults.'
92
- ) }
93
- label={ __(
94
- 'Allow right-click contextual menus'
95
- ) }
96
- />
97
- </PreferencesModalSection>
98
- <PreferencesModalSection
99
- title={ __( 'Document settings' ) }
100
- description={ __(
101
- 'Select what settings are shown in the document panel.'
102
- ) }
103
- >
104
- <EnablePluginDocumentSettingPanelOption.Slot />
105
- <PostTaxonomies
106
- taxonomyWrapper={ ( content, taxonomy ) => (
107
- <EnablePanelOption
108
- label={ taxonomy.labels.menu_name }
109
- panelName={ `taxonomy-panel-${ taxonomy.slug }` }
82
+ { showBlockBreadcrumbsOption && (
83
+ <PreferenceToggleControl
84
+ scope="core"
85
+ featureName="showBlockBreadcrumbs"
86
+ help={ __(
87
+ 'Display the block hierarchy trail at the bottom of the editor.'
88
+ ) }
89
+ label={ __( 'Show block breadcrumbs' ) }
110
90
  />
111
91
  ) }
112
- />
113
- <PostFeaturedImageCheck>
114
- <EnablePanelOption
115
- label={ __( 'Featured image' ) }
116
- panelName="featured-image"
117
- />
118
- </PostFeaturedImageCheck>
119
- <PostExcerptCheck>
120
- <EnablePanelOption
121
- label={ __( 'Excerpt' ) }
122
- panelName="post-excerpt"
123
- />
124
- </PostExcerptCheck>
125
- <PostTypeSupportCheck
126
- supportKeys={ [ 'comments', 'trackbacks' ] }
127
- >
128
- <EnablePanelOption
129
- label={ __( 'Discussion' ) }
130
- panelName="discussion-panel"
131
- />
132
- </PostTypeSupportCheck>
133
- <PageAttributesCheck>
134
- <EnablePanelOption
135
- label={ __( 'Page attributes' ) }
136
- panelName="page-attributes"
92
+ <PreferenceToggleControl
93
+ scope="core"
94
+ featureName="allowRightClickOverrides"
95
+ help={ __(
96
+ 'Allows contextual List View menus via right-click, overriding browser defaults.'
97
+ ) }
98
+ label={ __(
99
+ 'Allow right-click contextual menus'
100
+ ) }
137
101
  />
138
- </PageAttributesCheck>
139
- </PreferencesModalSection>
140
- { isLargeViewport && (
102
+ { hasStarterPatterns && (
103
+ <PreferenceToggleControl
104
+ scope="core"
105
+ featureName="enableChoosePatternModal"
106
+ help={ __(
107
+ 'Shows starter patterns when creating a new page.'
108
+ ) }
109
+ label={ __( 'Show starter patterns' ) }
110
+ />
111
+ ) }
112
+ </PreferencesModalSection>
141
113
  <PreferencesModalSection
142
- title={ __( 'Publishing' ) }
114
+ title={ __( 'Document settings' ) }
115
+ description={ __(
116
+ 'Select what settings are shown in the document panel.'
117
+ ) }
143
118
  >
144
- <EnablePublishSidebarOption
145
- help={ __(
146
- 'Review settings, such as visibility and tags.'
119
+ <EnablePluginDocumentSettingPanelOption.Slot />
120
+ <PostTaxonomies
121
+ taxonomyWrapper={ ( content, taxonomy ) => (
122
+ <EnablePanelOption
123
+ label={ taxonomy.labels.menu_name }
124
+ panelName={ `taxonomy-panel-${ taxonomy.slug }` }
125
+ />
147
126
  ) }
148
- label={ __( 'Enable pre-publish checks' ) }
149
127
  />
128
+ <PostFeaturedImageCheck>
129
+ <EnablePanelOption
130
+ label={ __( 'Featured image' ) }
131
+ panelName="featured-image"
132
+ />
133
+ </PostFeaturedImageCheck>
134
+ <PostExcerptCheck>
135
+ <EnablePanelOption
136
+ label={ __( 'Excerpt' ) }
137
+ panelName="post-excerpt"
138
+ />
139
+ </PostExcerptCheck>
140
+ <PostTypeSupportCheck
141
+ supportKeys={ [ 'comments', 'trackbacks' ] }
142
+ >
143
+ <EnablePanelOption
144
+ label={ __( 'Discussion' ) }
145
+ panelName="discussion-panel"
146
+ />
147
+ </PostTypeSupportCheck>
148
+ <PageAttributesCheck>
149
+ <EnablePanelOption
150
+ label={ __( 'Page attributes' ) }
151
+ panelName="page-attributes"
152
+ />
153
+ </PageAttributesCheck>
150
154
  </PreferencesModalSection>
151
- ) }
152
- { extraSections?.general }
153
- </>
154
- ),
155
- },
156
- {
157
- name: 'appearance',
158
- tabLabel: __( 'Appearance' ),
159
- content: (
160
- <PreferencesModalSection
161
- title={ __( 'Appearance' ) }
162
- description={ __(
163
- 'Customize the editor interface to suit your needs.'
164
- ) }
165
- >
166
- <PreferenceToggleControl
167
- scope="core"
168
- featureName="fixedToolbar"
169
- onToggle={ () =>
170
- setPreference(
171
- 'core',
172
- 'distractionFree',
173
- false
174
- )
175
- }
176
- help={ __(
177
- 'Access all block and document tools in a single place.'
178
- ) }
179
- label={ __( 'Top toolbar' ) }
180
- />
181
- <PreferenceToggleControl
182
- scope="core"
183
- featureName="distractionFree"
184
- onToggle={ () => {
185
- setPreference( 'core', 'fixedToolbar', true );
186
- setIsInserterOpened( false );
187
- setIsListViewOpened( false );
188
- } }
189
- help={ __(
190
- 'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'
191
- ) }
192
- label={ __( 'Distraction free' ) }
193
- />
194
- <PreferenceToggleControl
195
- scope="core"
196
- featureName="focusMode"
197
- help={ __(
198
- 'Highlights the current block and fades other content.'
155
+ { isLargeViewport && (
156
+ <PreferencesModalSection
157
+ title={ __( 'Publishing' ) }
158
+ >
159
+ <EnablePublishSidebarOption
160
+ help={ __(
161
+ 'Review settings, such as visibility and tags.'
162
+ ) }
163
+ label={ __(
164
+ 'Enable pre-publish checks'
165
+ ) }
166
+ />
167
+ </PreferencesModalSection>
199
168
  ) }
200
- label={ __( 'Spotlight mode' ) }
201
- />
202
- { extraSections?.appearance }
203
- </PreferencesModalSection>
204
- ),
205
- },
206
- {
207
- name: 'accessibility',
208
- tabLabel: __( 'Accessibility' ),
209
- content: (
210
- <>
169
+ { extraSections?.general }
170
+ </>
171
+ ),
172
+ },
173
+ {
174
+ name: 'appearance',
175
+ tabLabel: __( 'Appearance' ),
176
+ content: (
211
177
  <PreferencesModalSection
212
- title={ __( 'Navigation' ) }
178
+ title={ __( 'Appearance' ) }
213
179
  description={ __(
214
- 'Optimize the editing experience for enhanced control.'
180
+ 'Customize the editor interface to suit your needs.'
215
181
  ) }
216
182
  >
217
183
  <PreferenceToggleControl
218
184
  scope="core"
219
- featureName="keepCaretInsideBlock"
185
+ featureName="fixedToolbar"
186
+ onToggle={ () =>
187
+ setPreference(
188
+ 'core',
189
+ 'distractionFree',
190
+ false
191
+ )
192
+ }
220
193
  help={ __(
221
- 'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'
222
- ) }
223
- label={ __(
224
- 'Contain text cursor inside block'
194
+ 'Access all block and document tools in a single place.'
225
195
  ) }
196
+ label={ __( 'Top toolbar' ) }
226
197
  />
227
- </PreferencesModalSection>
228
- <PreferencesModalSection title={ __( 'Interface' ) }>
229
198
  <PreferenceToggleControl
230
199
  scope="core"
231
- featureName="showIconLabels"
232
- label={ __( 'Show button text labels' ) }
200
+ featureName="distractionFree"
201
+ onToggle={ () => {
202
+ setPreference(
203
+ 'core',
204
+ 'fixedToolbar',
205
+ true
206
+ );
207
+ setIsInserterOpened( false );
208
+ setIsListViewOpened( false );
209
+ } }
233
210
  help={ __(
234
- 'Show text instead of icons on buttons across the interface.'
211
+ 'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'
235
212
  ) }
213
+ label={ __( 'Distraction free' ) }
236
214
  />
237
- </PreferencesModalSection>
238
- </>
239
- ),
240
- },
241
- {
242
- name: 'blocks',
243
- tabLabel: __( 'Blocks' ),
244
- content: (
245
- <>
246
- <PreferencesModalSection title={ __( 'Inserter' ) }>
247
215
  <PreferenceToggleControl
248
216
  scope="core"
249
- featureName="mostUsedBlocks"
217
+ featureName="focusMode"
250
218
  help={ __(
251
- 'Adds a category with the most frequently used blocks in the inserter.'
219
+ 'Highlights the current block and fades other content.'
252
220
  ) }
253
- label={ __( 'Show most used blocks' ) }
221
+ label={ __( 'Spotlight mode' ) }
254
222
  />
223
+ { extraSections?.appearance }
255
224
  </PreferencesModalSection>
256
- <PreferencesModalSection
257
- title={ __( 'Manage block visibility' ) }
258
- description={ __(
259
- "Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."
260
- ) }
261
- >
262
- <BlockManager />
263
- </PreferencesModalSection>
264
- </>
265
- ),
266
- },
267
- ],
225
+ ),
226
+ },
227
+ {
228
+ name: 'accessibility',
229
+ tabLabel: __( 'Accessibility' ),
230
+ content: (
231
+ <>
232
+ <PreferencesModalSection
233
+ title={ __( 'Navigation' ) }
234
+ description={ __(
235
+ 'Optimize the editing experience for enhanced control.'
236
+ ) }
237
+ >
238
+ <PreferenceToggleControl
239
+ scope="core"
240
+ featureName="keepCaretInsideBlock"
241
+ help={ __(
242
+ 'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'
243
+ ) }
244
+ label={ __(
245
+ 'Contain text cursor inside block'
246
+ ) }
247
+ />
248
+ </PreferencesModalSection>
249
+ <PreferencesModalSection
250
+ title={ __( 'Interface' ) }
251
+ >
252
+ <PreferenceToggleControl
253
+ scope="core"
254
+ featureName="showIconLabels"
255
+ label={ __( 'Show button text labels' ) }
256
+ help={ __(
257
+ 'Show text instead of icons on buttons across the interface.'
258
+ ) }
259
+ />
260
+ </PreferencesModalSection>
261
+ </>
262
+ ),
263
+ },
264
+ {
265
+ name: 'blocks',
266
+ tabLabel: __( 'Blocks' ),
267
+ content: (
268
+ <>
269
+ <PreferencesModalSection title={ __( 'Inserter' ) }>
270
+ <PreferenceToggleControl
271
+ scope="core"
272
+ featureName="mostUsedBlocks"
273
+ help={ __(
274
+ 'Adds a category with the most frequently used blocks in the inserter.'
275
+ ) }
276
+ label={ __( 'Show most used blocks' ) }
277
+ />
278
+ </PreferencesModalSection>
279
+ <PreferencesModalSection
280
+ title={ __( 'Manage block visibility' ) }
281
+ description={ __(
282
+ "Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."
283
+ ) }
284
+ >
285
+ <BlockManager />
286
+ </PreferencesModalSection>
287
+ </>
288
+ ),
289
+ },
290
+ window.__experimentalMediaProcessing && {
291
+ name: 'media',
292
+ tabLabel: __( 'Media' ),
293
+ content: (
294
+ <>
295
+ <PreferencesModalSection
296
+ title={ __( 'General' ) }
297
+ description={ __(
298
+ 'Customize options related to the media upload flow.'
299
+ ) }
300
+ >
301
+ <PreferenceToggleControl
302
+ scope="core/media"
303
+ featureName="optimizeOnUpload"
304
+ help={ __(
305
+ 'Compress media items before uploading to the server.'
306
+ ) }
307
+ label={ __( 'Pre-upload compression' ) }
308
+ />
309
+ <PreferenceToggleControl
310
+ scope="core/media"
311
+ featureName="requireApproval"
312
+ help={ __(
313
+ 'Require approval step when optimizing existing media.'
314
+ ) }
315
+ label={ __( 'Approval step' ) }
316
+ />
317
+ </PreferencesModalSection>
318
+ </>
319
+ ),
320
+ },
321
+ ].filter( Boolean ),
268
322
  [
269
323
  showBlockBreadcrumbsOption,
270
324
  extraSections,
@@ -272,6 +326,7 @@ export default function EditorPreferencesModal( { extraSections = {} } ) {
272
326
  setIsListViewOpened,
273
327
  setPreference,
274
328
  isLargeViewport,
329
+ hasStarterPatterns,
275
330
  ]
276
331
  );
277
332
 
@@ -19,9 +19,7 @@ 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';
25
23
  import { ActionItem } from '@wordpress/interface';
26
24
 
27
25
  /**
@@ -31,49 +29,21 @@ import { store as editorStore } from '../../store';
31
29
  import PostPreviewButton from '../post-preview-button';
32
30
 
33
31
  export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
34
- const {
35
- deviceType,
36
- editorMode,
37
- homeUrl,
38
- isTemplate,
39
- isViewable,
40
- showIconLabels,
41
- } = useSelect( ( select ) => {
42
- const { getDeviceType, getCurrentPostType } = select( editorStore );
43
- const { getEntityRecord, getPostType } = select( coreStore );
44
- const { get } = select( preferencesStore );
45
- const { __unstableGetEditorMode } = select( blockEditorStore );
46
- const _currentPostType = getCurrentPostType();
47
- return {
48
- deviceType: getDeviceType(),
49
- editorMode: __unstableGetEditorMode(),
50
- homeUrl: getEntityRecord( 'root', '__unstableBase' )?.home,
51
- isTemplate: _currentPostType === 'wp_template',
52
- isViewable: getPostType( _currentPostType )?.viewable ?? false,
53
- showIconLabels: get( 'core', 'showIconLabels' ),
54
- };
55
- }, [] );
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
+ }, [] );
56
46
  const { setDeviceType } = useDispatch( editorStore );
57
- const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
58
-
59
- /**
60
- * Save the original editing mode in a ref to restore it when we exit zoom out.
61
- */
62
- const originalEditingModeRef = useRef( editorMode );
63
- useEffect( () => {
64
- if ( editorMode !== 'zoom-out' ) {
65
- originalEditingModeRef.current = editorMode;
66
- }
67
-
68
- return () => {
69
- if (
70
- editorMode === 'zoom-out' &&
71
- editorMode !== originalEditingModeRef.current
72
- ) {
73
- __unstableSetEditorMode( originalEditingModeRef.current );
74
- }
75
- };
76
- }, [ editorMode, __unstableSetEditorMode ] );
77
47
 
78
48
  const isMobile = useViewportMatch( 'medium', '<' );
79
49
  if ( isMobile ) {
@@ -112,44 +82,17 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
112
82
  label: __( 'Desktop' ),
113
83
  icon: desktop,
114
84
  },
85
+ {
86
+ value: 'Tablet',
87
+ label: __( 'Tablet' ),
88
+ icon: tablet,
89
+ },
90
+ {
91
+ value: 'Mobile',
92
+ label: __( 'Mobile' ),
93
+ icon: mobile,
94
+ },
115
95
  ];
116
- if ( window.__experimentalEnableZoomOutExperiment ) {
117
- choices.push( {
118
- value: 'ZoomOut',
119
- label: __( 'Desktop (50%)' ),
120
- icon: desktop,
121
- } );
122
- }
123
- choices.push( {
124
- value: 'Tablet',
125
- label: __( 'Tablet' ),
126
- icon: tablet,
127
- } );
128
- choices.push( {
129
- value: 'Mobile',
130
- label: __( 'Mobile' ),
131
- icon: mobile,
132
- } );
133
-
134
- const previewValue = editorMode === 'zoom-out' ? 'ZoomOut' : deviceType;
135
-
136
- /**
137
- * Handles the selection of a device type.
138
- *
139
- * @param {string} value The device type.
140
- */
141
- const onSelect = ( value ) => {
142
- let newEditorMode = originalEditingModeRef.current;
143
-
144
- if ( value === 'ZoomOut' ) {
145
- newEditorMode = 'zoom-out';
146
- setDeviceType( 'Desktop' );
147
- } else {
148
- setDeviceType( value );
149
- }
150
-
151
- __unstableSetEditorMode( newEditorMode );
152
- };
153
96
 
154
97
  return (
155
98
  <DropdownMenu
@@ -161,7 +104,6 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
161
104
  toggleProps={ toggleProps }
162
105
  menuProps={ menuProps }
163
106
  icon={ deviceIcons[ deviceType.toLowerCase() ] }
164
- text={ editorMode === 'zoom-out' ? __( '50%' ) : undefined }
165
107
  label={ __( 'View' ) }
166
108
  disableOpenOnArrowDown={ disabled }
167
109
  >
@@ -170,8 +112,8 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
170
112
  <MenuGroup>
171
113
  <MenuItemsChoice
172
114
  choices={ choices }
173
- value={ previewValue }
174
- onSelect={ onSelect }
115
+ value={ deviceType }
116
+ onSelect={ setDeviceType }
175
117
  />
176
118
  </MenuGroup>
177
119
  { isTemplate && (