@wordpress/editor 14.46.0 → 14.47.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 (326) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/components/collab-sidebar/add-note.cjs +6 -0
  3. package/build/components/collab-sidebar/add-note.cjs.map +2 -2
  4. package/build/components/collab-sidebar/hooks.cjs +36 -24
  5. package/build/components/collab-sidebar/hooks.cjs.map +2 -2
  6. package/build/components/collab-sidebar/index.cjs +19 -10
  7. package/build/components/collab-sidebar/index.cjs.map +2 -2
  8. package/build/components/collab-sidebar/note-byline.cjs +16 -9
  9. package/build/components/collab-sidebar/note-byline.cjs.map +2 -2
  10. package/build/components/collab-sidebar/notes.cjs +20 -11
  11. package/build/components/collab-sidebar/notes.cjs.map +2 -2
  12. package/build/components/collab-sidebar/utils.cjs +42 -2
  13. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  14. package/build/components/collaborators-overlay/compute-selection.cjs +39 -15
  15. package/build/components/collaborators-overlay/compute-selection.cjs.map +3 -3
  16. package/build/components/collaborators-overlay/use-block-highlighting.cjs +10 -2
  17. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +3 -3
  18. package/build/components/collaborators-overlay/use-render-cursors.cjs +15 -7
  19. package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
  20. package/build/components/collaborators-presence/avatar/component.cjs +5 -1
  21. package/build/components/collaborators-presence/avatar/component.cjs.map +3 -3
  22. package/build/components/collaborators-presence/use-collaborator-notifications.cjs +6 -3
  23. package/build/components/collaborators-presence/use-collaborator-notifications.cjs.map +2 -2
  24. package/build/components/editor-interface/index.cjs +17 -16
  25. package/build/components/editor-interface/index.cjs.map +3 -3
  26. package/build/components/editor-notices/index.cjs +6 -1
  27. package/build/components/editor-notices/index.cjs.map +3 -3
  28. package/build/components/global-styles/hooks.cjs +12 -1
  29. package/build/components/global-styles/hooks.cjs.map +2 -2
  30. package/build/components/header/index.cjs +11 -6
  31. package/build/components/header/index.cjs.map +2 -2
  32. package/build/components/media/media-editor-modal.cjs +14 -1
  33. package/build/components/media/media-editor-modal.cjs.map +2 -2
  34. package/build/components/post-card-panel/index.cjs +7 -1
  35. package/build/components/post-card-panel/index.cjs.map +3 -3
  36. package/build/components/post-last-revision/index.cjs +28 -8
  37. package/build/components/post-last-revision/index.cjs.map +2 -2
  38. package/build/components/post-locked-modal/index.cjs +9 -6
  39. package/build/components/post-locked-modal/index.cjs.map +2 -2
  40. package/build/components/post-publish-button/label.cjs +0 -7
  41. package/build/components/post-publish-button/label.cjs.map +2 -2
  42. package/build/components/post-publish-panel/prepublish.cjs +8 -1
  43. package/build/components/post-publish-panel/prepublish.cjs.map +3 -3
  44. package/build/components/post-revisions-panel/index.cjs +7 -0
  45. package/build/components/post-revisions-panel/index.cjs.map +2 -2
  46. package/build/components/post-revisions-preview/diff-markers.cjs +21 -13
  47. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  48. package/build/components/post-revisions-preview/revisions-canvas.cjs +7 -1
  49. package/build/components/post-revisions-preview/revisions-canvas.cjs.map +2 -2
  50. package/build/components/post-taxonomies/check.cjs +1 -2
  51. package/build/components/post-taxonomies/check.cjs.map +2 -2
  52. package/build/components/post-taxonomies/index.cjs +1 -2
  53. package/build/components/post-taxonomies/index.cjs.map +2 -2
  54. package/build/components/preferences-modal/index.cjs +1 -1
  55. package/build/components/preferences-modal/index.cjs.map +2 -2
  56. package/build/components/preview-dropdown/index.cjs.map +3 -3
  57. package/build/components/provider/index.cjs +5 -21
  58. package/build/components/provider/index.cjs.map +3 -3
  59. package/build/components/provider/use-block-editor-settings.cjs +16 -9
  60. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  61. package/build/components/resizable-editor/resize-handle.cjs +24 -16
  62. package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
  63. package/build/components/sidebar/header.cjs +16 -21
  64. package/build/components/sidebar/header.cjs.map +3 -3
  65. package/build/components/sidebar/index.cjs +2 -6
  66. package/build/components/sidebar/index.cjs.map +2 -2
  67. package/build/components/start-page-options/index.cjs +14 -4
  68. package/build/components/start-page-options/index.cjs.map +2 -2
  69. package/build/components/start-template-options/index.cjs +8 -6
  70. package/build/components/start-template-options/index.cjs.map +2 -2
  71. package/build/components/styles-canvas/style-book.cjs +59 -2
  72. package/build/components/styles-canvas/style-book.cjs.map +2 -2
  73. package/build/components/sync-connection-error-modal/index.cjs +10 -7
  74. package/build/components/sync-connection-error-modal/index.cjs.map +3 -3
  75. package/build/components/template-actions-panel/block-theme-content.cjs +21 -12
  76. package/build/components/template-actions-panel/block-theme-content.cjs.map +2 -2
  77. package/build/dataviews/store/private-actions.cjs.map +2 -2
  78. package/build/store/private-actions.cjs +17 -1
  79. package/build/store/private-actions.cjs.map +3 -3
  80. package/build/store/private-selectors.cjs +18 -0
  81. package/build/store/private-selectors.cjs.map +2 -2
  82. package/build/store/selectors.cjs +0 -17
  83. package/build/store/selectors.cjs.map +2 -2
  84. package/build/{components/media → utils/media-delete}/index.cjs +12 -13
  85. package/build/utils/media-delete/index.cjs.map +7 -0
  86. package/build/utils/media-finalize/index.cjs +3 -1
  87. package/build/utils/media-finalize/index.cjs.map +2 -2
  88. package/build/utils/sync-error-messages.cjs +9 -0
  89. package/build/utils/sync-error-messages.cjs.map +2 -2
  90. package/build-module/components/collab-sidebar/add-note.mjs +6 -0
  91. package/build-module/components/collab-sidebar/add-note.mjs.map +2 -2
  92. package/build-module/components/collab-sidebar/hooks.mjs +42 -25
  93. package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
  94. package/build-module/components/collab-sidebar/index.mjs +19 -10
  95. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  96. package/build-module/components/collab-sidebar/note-byline.mjs +17 -10
  97. package/build-module/components/collab-sidebar/note-byline.mjs.map +2 -2
  98. package/build-module/components/collab-sidebar/notes.mjs +26 -13
  99. package/build-module/components/collab-sidebar/notes.mjs.map +2 -2
  100. package/build-module/components/collab-sidebar/utils.mjs +38 -2
  101. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  102. package/build-module/components/collaborators-overlay/compute-selection.mjs +36 -12
  103. package/build-module/components/collaborators-overlay/compute-selection.mjs.map +2 -2
  104. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +10 -3
  105. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
  106. package/build-module/components/collaborators-overlay/use-render-cursors.mjs +11 -6
  107. package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
  108. package/build-module/components/collaborators-presence/avatar/component.mjs +7 -3
  109. package/build-module/components/collaborators-presence/avatar/component.mjs.map +2 -2
  110. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs +6 -3
  111. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs.map +2 -2
  112. package/build-module/components/editor-interface/index.mjs +22 -17
  113. package/build-module/components/editor-interface/index.mjs.map +2 -2
  114. package/build-module/components/editor-notices/index.mjs +6 -1
  115. package/build-module/components/editor-notices/index.mjs.map +2 -2
  116. package/build-module/components/global-styles/hooks.mjs +12 -1
  117. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  118. package/build-module/components/header/index.mjs +11 -6
  119. package/build-module/components/header/index.mjs.map +2 -2
  120. package/build-module/components/media/media-editor-modal.mjs +14 -1
  121. package/build-module/components/media/media-editor-modal.mjs.map +2 -2
  122. package/build-module/components/post-card-panel/index.mjs +8 -2
  123. package/build-module/components/post-card-panel/index.mjs.map +2 -2
  124. package/build-module/components/post-last-revision/index.mjs +29 -9
  125. package/build-module/components/post-last-revision/index.mjs.map +2 -2
  126. package/build-module/components/post-locked-modal/index.mjs +9 -6
  127. package/build-module/components/post-locked-modal/index.mjs.map +2 -2
  128. package/build-module/components/post-publish-button/label.mjs +0 -7
  129. package/build-module/components/post-publish-button/label.mjs.map +2 -2
  130. package/build-module/components/post-publish-panel/prepublish.mjs +9 -2
  131. package/build-module/components/post-publish-panel/prepublish.mjs.map +2 -2
  132. package/build-module/components/post-revisions-panel/index.mjs +7 -0
  133. package/build-module/components/post-revisions-panel/index.mjs.map +2 -2
  134. package/build-module/components/post-revisions-preview/diff-markers.mjs +22 -14
  135. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  136. package/build-module/components/post-revisions-preview/revisions-canvas.mjs +7 -1
  137. package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +2 -2
  138. package/build-module/components/post-taxonomies/check.mjs +1 -2
  139. package/build-module/components/post-taxonomies/check.mjs.map +2 -2
  140. package/build-module/components/post-taxonomies/index.mjs +1 -2
  141. package/build-module/components/post-taxonomies/index.mjs.map +2 -2
  142. package/build-module/components/preferences-modal/index.mjs +1 -1
  143. package/build-module/components/preferences-modal/index.mjs.map +2 -2
  144. package/build-module/components/preview-dropdown/index.mjs +2 -2
  145. package/build-module/components/preview-dropdown/index.mjs.map +2 -2
  146. package/build-module/components/provider/index.mjs +6 -22
  147. package/build-module/components/provider/index.mjs.map +2 -2
  148. package/build-module/components/provider/use-block-editor-settings.mjs +16 -9
  149. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  150. package/build-module/components/resizable-editor/resize-handle.mjs +26 -18
  151. package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
  152. package/build-module/components/sidebar/header.mjs +11 -16
  153. package/build-module/components/sidebar/header.mjs.map +2 -2
  154. package/build-module/components/sidebar/index.mjs +2 -7
  155. package/build-module/components/sidebar/index.mjs.map +2 -2
  156. package/build-module/components/start-page-options/index.mjs +14 -4
  157. package/build-module/components/start-page-options/index.mjs.map +2 -2
  158. package/build-module/components/start-template-options/index.mjs +8 -6
  159. package/build-module/components/start-template-options/index.mjs.map +2 -2
  160. package/build-module/components/styles-canvas/style-book.mjs +60 -3
  161. package/build-module/components/styles-canvas/style-book.mjs.map +2 -2
  162. package/build-module/components/sync-connection-error-modal/index.mjs +14 -8
  163. package/build-module/components/sync-connection-error-modal/index.mjs.map +2 -2
  164. package/build-module/components/template-actions-panel/block-theme-content.mjs +21 -13
  165. package/build-module/components/template-actions-panel/block-theme-content.mjs.map +2 -2
  166. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  167. package/build-module/store/private-actions.mjs +16 -1
  168. package/build-module/store/private-actions.mjs.map +2 -2
  169. package/build-module/store/private-selectors.mjs +18 -0
  170. package/build-module/store/private-selectors.mjs.map +2 -2
  171. package/build-module/store/selectors.mjs +0 -16
  172. package/build-module/store/selectors.mjs.map +2 -2
  173. package/build-module/utils/media-delete/index.mjs +12 -0
  174. package/build-module/utils/media-delete/index.mjs.map +7 -0
  175. package/build-module/utils/media-finalize/index.mjs +3 -1
  176. package/build-module/utils/media-finalize/index.mjs.map +2 -2
  177. package/build-module/utils/sync-error-messages.mjs +8 -0
  178. package/build-module/utils/sync-error-messages.mjs.map +2 -2
  179. package/build-style/style-rtl.css +462 -408
  180. package/build-style/style.css +462 -408
  181. package/build-types/components/collab-sidebar/add-note.d.ts.map +1 -1
  182. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  183. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  184. package/build-types/components/collab-sidebar/note-byline.d.ts +3 -0
  185. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -1
  186. package/build-types/components/collab-sidebar/notes.d.ts.map +1 -1
  187. package/build-types/components/collab-sidebar/utils.d.ts +33 -0
  188. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  189. package/build-types/components/collaborators-overlay/compute-selection.d.ts.map +1 -1
  190. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +3 -0
  191. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
  192. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
  193. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -1
  194. package/build-types/components/collaborators-presence/use-collaborator-notifications.d.ts.map +1 -1
  195. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  196. package/build-types/components/editor-notices/index.d.ts.map +1 -1
  197. package/build-types/components/global-styles/hooks.d.ts.map +1 -1
  198. package/build-types/components/media/media-editor-modal.d.ts +6 -2
  199. package/build-types/components/media/media-editor-modal.d.ts.map +1 -1
  200. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  201. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  202. package/build-types/components/post-locked-modal/index.d.ts +1 -6
  203. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  204. package/build-types/components/post-publish-button/label.d.ts.map +1 -1
  205. package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -1
  206. package/build-types/components/post-revisions-panel/index.d.ts +1 -1
  207. package/build-types/components/post-revisions-panel/index.d.ts.map +1 -1
  208. package/build-types/components/post-revisions-preview/diff-markers.d.ts.map +1 -1
  209. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -1
  210. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  211. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +1 -6
  212. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +1 -6
  213. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  214. package/build-types/components/provider/index.d.ts.map +1 -1
  215. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  216. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  217. package/build-types/components/sidebar/index.d.ts.map +1 -1
  218. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  219. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  220. package/build-types/components/styles-canvas/style-book.d.ts.map +1 -1
  221. package/build-types/components/sync-connection-error-modal/index.d.ts.map +1 -1
  222. package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -1
  223. package/build-types/dataviews/store/private-actions.d.ts +0 -1
  224. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  225. package/build-types/store/private-actions.d.ts +15 -0
  226. package/build-types/store/private-actions.d.ts.map +1 -1
  227. package/build-types/store/private-selectors.d.ts +10 -0
  228. package/build-types/store/private-selectors.d.ts.map +1 -1
  229. package/build-types/store/selectors.d.ts +0 -10
  230. package/build-types/store/selectors.d.ts.map +1 -1
  231. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  232. package/build-types/utils/media-delete/index.d.ts +2 -0
  233. package/build-types/utils/media-delete/index.d.ts.map +1 -0
  234. package/build-types/utils/media-finalize/index.d.ts +1 -1
  235. package/build-types/utils/media-finalize/index.d.ts.map +1 -1
  236. package/build-types/utils/sync-error-messages.d.ts +1 -0
  237. package/build-types/utils/sync-error-messages.d.ts.map +1 -1
  238. package/package.json +48 -48
  239. package/src/components/collab-sidebar/add-note.js +9 -0
  240. package/src/components/collab-sidebar/hooks.js +53 -29
  241. package/src/components/collab-sidebar/index.js +28 -14
  242. package/src/components/collab-sidebar/note-byline.js +15 -10
  243. package/src/components/collab-sidebar/notes.js +36 -14
  244. package/src/components/collab-sidebar/test/utils.js +375 -1
  245. package/src/components/collab-sidebar/utils.js +70 -1
  246. package/src/components/collaborators-overlay/compute-selection.ts +67 -19
  247. package/src/components/collaborators-overlay/use-block-highlighting.ts +14 -1
  248. package/src/components/collaborators-overlay/use-render-cursors.ts +15 -4
  249. package/src/components/collaborators-presence/avatar/component.tsx +10 -3
  250. package/src/components/collaborators-presence/avatar/test/index.tsx +50 -18
  251. package/src/components/collaborators-presence/styles/collaborators-presence.scss +4 -1
  252. package/src/components/collaborators-presence/test/use-collaborator-notifications.ts +2 -1
  253. package/src/components/collaborators-presence/use-collaborator-notifications.ts +6 -4
  254. package/src/components/editor-help/help-topic-row.native.js +2 -2
  255. package/src/components/editor-interface/index.js +22 -23
  256. package/src/components/editor-interface/style.scss +4 -0
  257. package/src/components/editor-notices/index.js +7 -1
  258. package/src/components/error-boundary/index.native.js +2 -2
  259. package/src/components/global-styles/hooks.js +26 -0
  260. package/src/components/global-styles-sidebar/style.scss +0 -9
  261. package/src/components/header/index.js +12 -12
  262. package/src/components/media/media-editor-modal.js +20 -2
  263. package/src/components/offline-status/index.native.js +2 -2
  264. package/src/components/post-card-panel/index.js +5 -2
  265. package/src/components/post-last-revision/index.js +37 -9
  266. package/src/components/post-last-revision/style.scss +0 -3
  267. package/src/components/post-locked-modal/index.js +8 -5
  268. package/src/components/post-panel-row/style.scss +1 -0
  269. package/src/components/post-publish-button/label.js +0 -11
  270. package/src/components/post-publish-panel/prepublish.js +6 -2
  271. package/src/components/post-revisions-panel/index.js +8 -0
  272. package/src/components/post-revisions-preview/diff-markers.js +17 -11
  273. package/src/components/post-revisions-preview/revisions-canvas.js +7 -1
  274. package/src/components/post-revisions-preview/style.scss +4 -4
  275. package/src/components/post-taxonomies/check.js +1 -2
  276. package/src/components/post-taxonomies/index.js +1 -2
  277. package/src/components/preferences-modal/index.js +1 -1
  278. package/src/components/preview-dropdown/index.js +2 -2
  279. package/src/components/provider/index.js +10 -31
  280. package/src/components/provider/use-block-editor-settings.js +19 -12
  281. package/src/components/resizable-editor/resize-handle.js +22 -16
  282. package/src/components/sidebar/header.js +18 -28
  283. package/src/components/sidebar/index.js +5 -14
  284. package/src/components/start-page-options/index.js +19 -4
  285. package/src/components/start-template-options/index.js +13 -6
  286. package/src/components/styles-canvas/style-book.js +75 -13
  287. package/src/components/sync-connection-error-modal/index.tsx +25 -11
  288. package/src/components/template-actions-panel/block-theme-content.js +19 -13
  289. package/src/components/text-editor/style.scss +2 -2
  290. package/src/dataviews/store/private-actions.ts +0 -1
  291. package/src/store/private-actions.js +27 -0
  292. package/src/store/private-selectors.js +26 -0
  293. package/src/store/selectors.js +0 -24
  294. package/src/store/test/actions.js +34 -0
  295. package/src/utils/media-delete/index.js +11 -0
  296. package/src/utils/media-finalize/index.js +6 -1
  297. package/src/utils/media-finalize/test/index.js +32 -2
  298. package/src/utils/sync-error-messages.ts +8 -0
  299. package/src/utils/test/sync-error-messages.js +1 -0
  300. package/build/components/global-styles-provider/index.cjs +0 -181
  301. package/build/components/global-styles-provider/index.cjs.map +0 -7
  302. package/build/components/media/index.cjs.map +0 -7
  303. package/build/components/media/metadata-panel.cjs +0 -96
  304. package/build/components/media/metadata-panel.cjs.map +0 -7
  305. package/build/components/media/preview.cjs +0 -39
  306. package/build/components/media/preview.cjs.map +0 -7
  307. package/build-module/components/global-styles-provider/index.mjs +0 -156
  308. package/build-module/components/global-styles-provider/index.mjs.map +0 -7
  309. package/build-module/components/media/index.mjs +0 -8
  310. package/build-module/components/media/index.mjs.map +0 -7
  311. package/build-module/components/media/metadata-panel.mjs +0 -65
  312. package/build-module/components/media/metadata-panel.mjs.map +0 -7
  313. package/build-module/components/media/preview.mjs +0 -21
  314. package/build-module/components/media/preview.mjs.map +0 -7
  315. package/build-types/components/global-styles-provider/index.d.ts +0 -16
  316. package/build-types/components/global-styles-provider/index.d.ts.map +0 -1
  317. package/build-types/components/media/index.d.ts +0 -3
  318. package/build-types/components/media/index.d.ts.map +0 -1
  319. package/build-types/components/media/metadata-panel.d.ts +0 -12
  320. package/build-types/components/media/metadata-panel.d.ts.map +0 -1
  321. package/build-types/components/media/preview.d.ts +0 -9
  322. package/build-types/components/media/preview.d.ts.map +0 -1
  323. package/src/components/global-styles-provider/index.js +0 -207
  324. package/src/components/media/index.js +0 -2
  325. package/src/components/media/metadata-panel.js +0 -77
  326. package/src/components/media/preview.js +0 -35
@@ -32,6 +32,3 @@
32
32
  }
33
33
  }
34
34
 
35
- .editor-private-post-last-revision__button {
36
- display: inline-block;
37
- }
@@ -26,10 +26,13 @@ import { store as editorStore } from '../../store';
26
26
  function CollaborationContext() {
27
27
  const { isCollaborationSupported, syncConnectionStatus } = useSelect(
28
28
  ( select ) => {
29
- const selectors = unlock( select( coreStore ) );
29
+ const {
30
+ isCollaborationSupported: isSupported,
31
+ getSyncConnectionStatus,
32
+ } = unlock( select( coreStore ) );
30
33
  return {
31
- isCollaborationSupported: selectors.isCollaborationSupported(),
32
- syncConnectionStatus: selectors.getSyncConnectionStatus(),
34
+ isCollaborationSupported: isSupported(),
35
+ syncConnectionStatus: getSyncConnectionStatus(),
33
36
  };
34
37
  },
35
38
  []
@@ -74,7 +77,6 @@ function PostLockedModal() {
74
77
  previewLink,
75
78
  } = useSelect( ( select ) => {
76
79
  const {
77
- isCollaborationEnabledForCurrentPost,
78
80
  isPostLocked,
79
81
  isPostLockTakeover,
80
82
  getPostLockUser,
@@ -83,7 +85,8 @@ function PostLockedModal() {
83
85
  getEditedPostAttribute,
84
86
  getEditedPostPreviewLink,
85
87
  getEditorSettings,
86
- } = select( editorStore );
88
+ isCollaborationEnabledForCurrentPost,
89
+ } = unlock( select( editorStore ) );
87
90
  const { getPostType } = select( coreStore );
88
91
  return {
89
92
  isCollaborationEnabled: isCollaborationEnabledForCurrentPost(),
@@ -16,6 +16,7 @@
16
16
  padding: 6px 0; // Matches button to ensure alignment
17
17
  line-height: $grid-unit-05 * 5;
18
18
  hyphens: auto;
19
+ word-break: break-word;
19
20
  }
20
21
 
21
22
  .editor-post-panel__row-control {
@@ -9,7 +9,6 @@ import { useViewportMatch } from '@wordpress/compose';
9
9
  * Internal dependencies
10
10
  */
11
11
  import { store as editorStore } from '../../store';
12
- import { ATTACHMENT_POST_TYPE } from '../../store/constants';
13
12
 
14
13
  /**
15
14
  * Renders the label for the publish button.
@@ -28,7 +27,6 @@ export default function PublishButtonLabel() {
28
27
  hasNonPostEntityChanges,
29
28
  postStatusHasChanged,
30
29
  postStatus,
31
- postType,
32
30
  isPostSavingLocked,
33
31
  } = useSelect( ( select ) => {
34
32
  const {
@@ -37,7 +35,6 @@ export default function PublishButtonLabel() {
37
35
  isSavingPost,
38
36
  isPublishingPost,
39
37
  getCurrentPost,
40
- getCurrentPostType,
41
38
  isAutosavingPost,
42
39
  getPostEdits,
43
40
  getEditedPostAttribute,
@@ -49,7 +46,6 @@ export default function PublishButtonLabel() {
49
46
  isPublishing: isPublishingPost(),
50
47
  hasPublishAction:
51
48
  getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
52
- postType: getCurrentPostType(),
53
49
  isAutosaving: isAutosavingPost(),
54
50
  hasNonPostEntityChanges:
55
51
  select( editorStore ).hasNonPostEntityChanges(),
@@ -70,13 +66,6 @@ export default function PublishButtonLabel() {
70
66
  return __( 'Saving…' );
71
67
  }
72
68
  if ( ! hasPublishAction ) {
73
- // For attachments, always show "Save" since they don't have a publish workflow
74
- if (
75
- postType === ATTACHMENT_POST_TYPE &&
76
- window?.__experimentalMediaEditor
77
- ) {
78
- return __( 'Save' );
79
- }
80
69
  // TODO: this is because "Submit for review" string is too long in some languages.
81
70
  // @see https://github.com/WordPress/gutenberg/issues/10475
82
71
  return isSmallerThanMediumViewport
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { Icon, PanelBody } from '@wordpress/components';
5
+ import { Icon as WCIcon, PanelBody } from '@wordpress/components';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { wordpress } from '@wordpress/icons';
8
8
  import { filterURLForDisplay } from '@wordpress/url';
@@ -53,7 +53,11 @@ function PostPublishPanelPrepublish( { children } ) {
53
53
  }, [] );
54
54
 
55
55
  let siteIcon = (
56
- <Icon className="components-site-icon" size="36px" icon={ wordpress } />
56
+ <WCIcon
57
+ className="components-site-icon"
58
+ size="36px"
59
+ icon={ wordpress }
60
+ />
57
61
  );
58
62
 
59
63
  if ( siteIconUrl ) {
@@ -145,6 +145,14 @@ function PostRevisionsPanelContent() {
145
145
  }
146
146
 
147
147
  export default function PostRevisionsPanel() {
148
+ const disableVisualRevisions = useSelect(
149
+ ( select ) =>
150
+ !! select( editorStore ).getEditorSettings().disableVisualRevisions,
151
+ []
152
+ );
153
+ if ( disableVisualRevisions ) {
154
+ return null;
155
+ }
148
156
  return (
149
157
  <PostLastRevisionCheck>
150
158
  <PostRevisionsPanelContent />
@@ -15,7 +15,8 @@ import {
15
15
  store as blockEditorStore,
16
16
  } from '@wordpress/block-editor';
17
17
  import { __ } from '@wordpress/i18n';
18
- import { Tooltip } from '@wordpress/components';
18
+ // eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
19
+ import { Tooltip } from '@wordpress/ui';
19
20
 
20
21
  /**
21
22
  * Internal dependencies
@@ -98,17 +99,22 @@ function DiffMarkerButton( { clientId, status, subscribe } ) {
98
99
  }
99
100
 
100
101
  return (
101
- <Tooltip text={ STATUS_LABELS[ status ] }>
102
- <button
103
- className={ `revision-diff-marker is-${ status }` }
104
- style={ {
105
- top: `${ position.top }%`,
106
- height: `${ Math.max( position.height, 0.5 ) }%`,
107
- } }
108
- onClick={ () => blockRef.current?.focus() }
109
- aria-label={ STATUS_LABELS[ status ] }
102
+ <Tooltip.Root>
103
+ <Tooltip.Trigger
104
+ render={
105
+ <button
106
+ className={ `revision-diff-marker is-${ status }` }
107
+ style={ {
108
+ top: `${ position.top }%`,
109
+ height: `${ Math.max( position.height, 0.5 ) }%`,
110
+ } }
111
+ onClick={ () => blockRef.current?.focus() }
112
+ aria-label={ STATUS_LABELS[ status ] }
113
+ />
114
+ }
110
115
  />
111
- </Tooltip>
116
+ <Tooltip.Popup>{ STATUS_LABELS[ status ] }</Tooltip.Popup>
117
+ </Tooltip.Root>
112
118
  );
113
119
  }
114
120
 
@@ -58,14 +58,20 @@ const REVISION_REMOVED_FILTER_SVG = `
58
58
  const REVISION_DIFF_STYLES = `
59
59
  .is-revision-added {
60
60
  box-shadow: inset 0 0 0 9999px color-mix(in srgb, currentColor 5%, #00a32a 15%), 0 0 0 4px color-mix(in srgb, currentColor 5%, #00a32a 15%);
61
+ outline: 3px solid #00a32a;
62
+ outline-offset: 2px;
61
63
  }
62
64
  .is-revision-removed,
63
65
  .revision-diff-removed {
64
66
  text-decoration: line-through;
65
67
  filter: url(#revision-removed-filter);
66
68
  }
69
+ .is-revision-removed {
70
+ outline: 3px dashed #d63638;
71
+ outline-offset: 2px;
72
+ }
67
73
  .is-revision-modified {
68
- outline: 2px solid color-mix(in srgb, currentColor 30%, #dba617 70%) !important;
74
+ outline: 3px dotted #9a7000 !important;
69
75
  outline-offset: 2px;
70
76
  }
71
77
  .revision-diff-added {
@@ -35,7 +35,7 @@
35
35
  .revision-diff-markers {
36
36
  position: relative;
37
37
  flex-shrink: 0;
38
- width: 24px;
38
+ width: max(16px, 1rem);
39
39
  background: rgba(0, 0, 0, 0.05);
40
40
 
41
41
  .revision-diff-marker {
@@ -48,15 +48,15 @@
48
48
  transition: opacity 0.1s ease;
49
49
 
50
50
  &.is-added {
51
- background: #00a32a;
51
+ background: #008a20;
52
52
  }
53
53
 
54
54
  &.is-removed {
55
- background: repeating-linear-gradient(45deg, #d63638, #d63638 3px, rgba(#d63638, 0.45) 3px, rgba(#d63638, 0.45) 6px);
55
+ background: repeating-linear-gradient(45deg, #d63638, #d63638 6px, rgba(#d63638, 0.45) 6px, rgba(#d63638, 0.45) 8px);
56
56
  }
57
57
 
58
58
  &.is-modified {
59
- background: repeating-linear-gradient(-45deg, #dba617, #dba617 3px, rgba(#dba617, 0.45) 3px, rgba(#dba617, 0.45) 6px);
59
+ background: repeating-linear-gradient(-45deg, #9a7000, #9a7000 6px, rgba(#9a7000, 0.45) 6px, rgba(#9a7000, 0.45) 8px);
60
60
  }
61
61
 
62
62
  &:hover {
@@ -22,8 +22,7 @@ export default function PostTaxonomiesCheck( { children } ) {
22
22
  const postType = select( editorStore ).getCurrentPostType();
23
23
  const taxonomies = select( coreStore ).getEntityRecords(
24
24
  'root',
25
- 'taxonomy',
26
- { per_page: -1 }
25
+ 'taxonomy'
27
26
  );
28
27
  return taxonomies?.some( ( taxonomy ) =>
29
28
  taxonomy.types.includes( postType )
@@ -20,8 +20,7 @@ export function PostTaxonomies( { taxonomyWrapper = identity } ) {
20
20
  postType: select( editorStore ).getCurrentPostType(),
21
21
  taxonomies: select( coreStore ).getEntityRecords(
22
22
  'root',
23
- 'taxonomy',
24
- { per_page: -1 }
23
+ 'taxonomy'
25
24
  ),
26
25
  };
27
26
  }, [] );
@@ -58,7 +58,7 @@ function PreferencesModalContents( { extraSections = {} } ) {
58
58
  const { showBlockBreadcrumbsOption, showCollaborationOptions } = useSelect(
59
59
  ( select ) => {
60
60
  const { getEditorSettings, isCollaborationEnabledForCurrentPost } =
61
- select( editorStore );
61
+ unlock( select( editorStore ) );
62
62
  const { get } = select( preferencesStore );
63
63
  const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
64
64
  const isDistractionFreeEnabled = get( 'core', 'distractionFree' );
@@ -12,7 +12,7 @@ import {
12
12
  MenuGroup,
13
13
  MenuItem,
14
14
  MenuItemsChoice,
15
- Icon,
15
+ Icon as WCIcon,
16
16
  } from '@wordpress/components';
17
17
  import { __ } from '@wordpress/i18n';
18
18
  import { desktop, mobile, tablet, external, check } from '@wordpress/icons';
@@ -189,7 +189,7 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
189
189
  textContent={
190
190
  <>
191
191
  { __( 'Preview in new tab' ) }
192
- <Icon icon={ external } />
192
+ <WCIcon icon={ external } />
193
193
  </>
194
194
  }
195
195
  onPreview={ onClose }
@@ -7,7 +7,7 @@ import {
7
7
  useLayoutEffect,
8
8
  useMemo,
9
9
  } from '@wordpress/element';
10
- import { useDispatch, useSelect } from '@wordpress/data';
10
+ import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
11
11
  import { __ } from '@wordpress/i18n';
12
12
  import {
13
13
  EntityProvider,
@@ -28,7 +28,6 @@ import { createBlock } from '@wordpress/blocks';
28
28
  */
29
29
  import withRegistryProvider from './with-registry-provider';
30
30
  import { store as editorStore } from '../../store';
31
- import { ATTACHMENT_POST_TYPE } from '../../store/constants';
32
31
  import useBlockEditorSettings from './use-block-editor-settings';
33
32
  import { unlock } from '../../lock-unlock';
34
33
  import DisableNonPageContentBlocks from './disable-non-page-content-blocks';
@@ -311,6 +310,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
311
310
  setRenderingMode,
312
311
  } = unlock( useDispatch( editorStore ) );
313
312
  const { editEntityRecord } = useDispatch( coreStore );
313
+ const registry = useRegistry();
314
314
 
315
315
  const onChangeSelection = useCallback(
316
316
  ( newSelection ) => {
@@ -335,7 +335,13 @@ export const ExperimentalEditorProvider = withRegistryProvider(
335
335
  }
336
336
 
337
337
  updatePostLock( settings.postLock );
338
- setupEditor( post, initialEdits, settings.template );
338
+ // `setupEditor` may already have been dispatched by the
339
+ // editor's pre-mount kickoff (see edit-post's
340
+ // `initializeEditor`). Skip the redundant dispatch — it
341
+ // would otherwise re-parse + reset blocks for new posts.
342
+ if ( ! registry.select( editorStore ).__unstableIsEditorReady() ) {
343
+ setupEditor( post, initialEdits, settings.template );
344
+ }
339
345
  if ( settings.autosave ) {
340
346
  createWarningNotice(
341
347
  __(
@@ -401,31 +407,6 @@ export const ExperimentalEditorProvider = withRegistryProvider(
401
407
  return null;
402
408
  }
403
409
 
404
- const isAttachment =
405
- post.type === ATTACHMENT_POST_TYPE &&
406
- window?.__experimentalMediaEditor;
407
-
408
- // Early return for attachments - no block editor needed
409
- if ( isAttachment ) {
410
- return (
411
- <EntityProvider kind="root" type="site">
412
- <EntityProvider
413
- kind="postType"
414
- type={ post.type }
415
- id={ post.id }
416
- >
417
- { children }
418
- { ! settings.isPreviewMode && (
419
- <>
420
- <EditorKeyboardShortcuts />
421
- <KeyboardShortcutHelpModal />
422
- </>
423
- ) }
424
- </EntityProvider>
425
- </EntityProvider>
426
- );
427
- }
428
-
429
410
  return (
430
411
  <EntityProvider kind="root" type="site">
431
412
  <EntityProvider
@@ -466,9 +447,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
466
447
  <StartTemplateOptions />
467
448
  <PatternRenameModal />
468
449
  <PatternDuplicateModal />
469
- { window?.__experimentalMediaEditorModal && (
470
- <MediaEditorModalMount />
471
- ) }
450
+ <MediaEditorModalMount />
472
451
  </>
473
452
  ) }
474
453
  </BlockEditorProviderComponent>
@@ -27,9 +27,10 @@ import { mediaUpload } from '../../utils';
27
27
  import mediaUploadOnSuccess from '../../utils/media-upload/on-success';
28
28
  import { default as mediaSideload } from '../../utils/media-sideload';
29
29
  import { default as mediaFinalize } from '../../utils/media-finalize';
30
+ import { default as mediaDelete } from '../../utils/media-delete';
30
31
  import { store as editorStore } from '../../store';
31
32
  import { unlock } from '../../lock-unlock';
32
- import { useGlobalStylesContext } from '../global-styles-provider';
33
+ import { useGlobalStyles } from '../global-styles';
33
34
 
34
35
  const { store: mediaEditorStore } = unlock( mediaEditorPrivateApis );
35
36
 
@@ -44,6 +45,10 @@ function __experimentalReusableBlocksSelect( select ) {
44
45
  } );
45
46
  }
46
47
 
48
+ function __experimentalUserPatternCategoriesSelect( select ) {
49
+ return select( coreStore ).getUserPatternCategories();
50
+ }
51
+
47
52
  const BLOCK_EDITOR_SETTINGS = [
48
53
  '__experimentalBlockBindingsSupportedAttributes',
49
54
  '__experimentalBlockDirectory',
@@ -102,11 +107,13 @@ const {
102
107
  globalStylesLinksDataKey,
103
108
  selectBlockPatternsKey,
104
109
  reusableBlocksSelectKey,
110
+ userPatternCategoriesSelectKey,
105
111
  sectionRootClientIdKey,
106
112
  mediaEditKey,
107
113
  getMediaSelectKey,
108
114
  isIsolatedEditorKey,
109
115
  deviceTypeKey,
116
+ onViewportStateChangeKey,
110
117
  isNavigationOverlayContextKey,
111
118
  isNavigationPostEditorKey,
112
119
  mediaUploadOnSuccessKey,
@@ -140,7 +147,6 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
140
147
  userCanCreatePages,
141
148
  pageOnFront,
142
149
  pageForPosts,
143
- userPatternCategories,
144
150
  restBlockPatternCategories,
145
151
  sectionRootClientId,
146
152
  deviceType,
@@ -152,7 +158,6 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
152
158
  canUser,
153
159
  getRawEntityRecord,
154
160
  getEntityRecord,
155
- getUserPatternCategories,
156
161
  getBlockPatternCategories,
157
162
  } = select( coreStore );
158
163
  const { get } = select( preferencesStore );
@@ -215,7 +220,6 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
215
220
  } ),
216
221
  pageOnFront: siteSettings?.page_on_front,
217
222
  pageForPosts: siteSettings?.page_for_posts,
218
- userPatternCategories: getUserPatternCategories(),
219
223
  restBlockPatternCategories: getBlockPatternCategories(),
220
224
  sectionRootClientId: getSectionRootBlock(),
221
225
  deviceType: getDeviceType(),
@@ -233,7 +237,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
233
237
  [ postType, postId, isLargeViewport, renderingMode ]
234
238
  );
235
239
 
236
- const { merged: mergedGlobalStyles } = useGlobalStylesContext();
240
+ const { merged: mergedGlobalStyles } = useGlobalStyles();
237
241
  const globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;
238
242
  const globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;
239
243
 
@@ -271,6 +275,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
271
275
  );
272
276
 
273
277
  const { undo, setIsInserterOpened } = useDispatch( editorStore );
278
+ const { updateDeviceTypeForViewportState } = unlock(
279
+ useDispatch( editorStore )
280
+ );
274
281
  const { editMediaEntity } = unlock( useDispatch( coreStore ) );
275
282
  const { saveEntityRecord } = useDispatch( coreStore );
276
283
  const { openMediaEditorModal } = useDispatch( mediaEditorStore );
@@ -344,16 +351,15 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
344
351
  [ mediaEditKey ]: hasUploadPermissions
345
352
  ? editMediaEntity
346
353
  : undefined,
347
- [ openMediaEditorModalKey ]: window?.__experimentalMediaEditorModal
348
- ? ( { id, onUpdate } ) =>
349
- openMediaEditorModal( { id, onUpdate } )
350
- : undefined,
354
+ [ openMediaEditorModalKey ]: ( { id, onUpdate } ) =>
355
+ openMediaEditorModal( { id, onUpdate } ),
351
356
  mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
352
357
  [ mediaUploadOnSuccessKey ]: hasUploadPermissions
353
358
  ? mediaUploadOnSuccess
354
359
  : undefined,
355
360
  mediaSideload: hasUploadPermissions ? mediaSideload : undefined,
356
361
  mediaFinalize: hasUploadPermissions ? mediaFinalize : undefined,
362
+ mediaDelete: hasUploadPermissions ? mediaDelete : undefined,
357
363
  __experimentalBlockPatterns: blockPatterns,
358
364
  [ selectBlockPatternsKey ]: ( select ) => {
359
365
  const { hasFinishedResolution, getBlockPatternsForPostType } =
@@ -364,8 +370,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
364
370
  : undefined;
365
371
  },
366
372
  [ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,
373
+ [ userPatternCategoriesSelectKey ]:
374
+ __experimentalUserPatternCategoriesSelect,
367
375
  __experimentalBlockPatternCategories: blockPatternCategories,
368
- __experimentalUserPatternCategories: userPatternCategories,
369
376
  __experimentalFetchLinkSuggestions: ( search, searchOptions ) =>
370
377
  fetchLinkSuggestions( search, searchOptions, settings ),
371
378
  inserterMediaCategories,
@@ -409,6 +416,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
409
416
  disableContentOnlyForTemplateParts:
410
417
  renderingMode === 'template-locked',
411
418
  ...( deviceType ? { [ deviceTypeKey ]: deviceType } : {} ),
419
+ [ onViewportStateChangeKey ]: updateDeviceTypeForViewportState,
412
420
  [ isNavigationOverlayContextKey ]: isNavigationOverlayContext,
413
421
  };
414
422
 
@@ -428,7 +436,6 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
428
436
  keepCaretInsideBlock,
429
437
  settings,
430
438
  hasUploadPermissions,
431
- userPatternCategories,
432
439
  blockPatterns,
433
440
  blockPatternCategories,
434
441
  canUseUnfilteredHTML,
@@ -445,7 +452,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
445
452
  renderingMode,
446
453
  editMediaEntity,
447
454
  openMediaEditorModal,
448
- settings.onNavigateToEntityRecord,
455
+ updateDeviceTypeForViewportState,
449
456
  deviceType,
450
457
  allImageSizes,
451
458
  bigImageSizeThreshold,
@@ -3,8 +3,9 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { LEFT, RIGHT } from '@wordpress/keycodes';
6
- import { Tooltip, __unstableMotion as motion } from '@wordpress/components';
7
- import { VisuallyHidden } from '@wordpress/ui';
6
+ import { __unstableMotion as motion } from '@wordpress/components';
7
+ // eslint-disable-next-line @wordpress/use-recommended-components -- `Tooltip` is not yet on the recommended `@wordpress/ui` allow-list; landing as a migration step ahead of the wider rollout.
8
+ import { Tooltip, VisuallyHidden } from '@wordpress/ui';
8
9
 
9
10
  const DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels.
10
11
 
@@ -41,21 +42,26 @@ export default function ResizeHandle( { direction, resizeWidthBy } ) {
41
42
 
42
43
  return (
43
44
  <>
44
- <Tooltip text={ __( 'Drag to resize' ) }>
45
- <motion.button
46
- className={ `editor-resizable-editor__resize-handle is-${ direction }` }
47
- aria-label={ __( 'Drag to resize' ) }
48
- aria-describedby={ resizableHandleHelpId }
49
- onKeyDown={ handleKeyDown }
50
- variants={ resizeHandleVariants }
51
- whileFocus="active"
52
- whileHover="active"
53
- whileTap="active"
54
- key="handle"
55
- role="separator"
56
- aria-orientation="vertical"
45
+ <Tooltip.Root>
46
+ <Tooltip.Trigger
47
+ render={
48
+ <motion.button
49
+ className={ `editor-resizable-editor__resize-handle is-${ direction }` }
50
+ aria-label={ __( 'Drag to resize' ) }
51
+ aria-describedby={ resizableHandleHelpId }
52
+ onKeyDown={ handleKeyDown }
53
+ variants={ resizeHandleVariants }
54
+ whileFocus="active"
55
+ whileHover="active"
56
+ whileTap="active"
57
+ key="handle"
58
+ role="separator"
59
+ aria-orientation="vertical"
60
+ />
61
+ }
57
62
  />
58
- </Tooltip>
63
+ <Tooltip.Popup>{ __( 'Drag to resize' ) }</Tooltip.Popup>
64
+ </Tooltip.Root>
59
65
  <VisuallyHidden id={ resizableHandleHelpId }>
60
66
  { __( 'Use left and right arrow keys to resize the canvas.' ) }
61
67
  </VisuallyHidden>
@@ -11,30 +11,22 @@ import { decodeEntities } from '@wordpress/html-entities';
11
11
  * Internal dependencies
12
12
  */
13
13
  import { store as editorStore } from '../../store';
14
- import { ATTACHMENT_POST_TYPE } from '../../store/constants';
15
14
  import { unlock } from '../../lock-unlock';
16
15
  import { sidebars } from './constants';
17
16
 
18
17
  const { Tabs } = unlock( componentsPrivateApis );
19
18
 
20
19
  const SidebarHeader = ( _, ref ) => {
21
- const { postTypeLabel, isAttachment, isRevisionsMode } = useSelect(
22
- ( select ) => {
23
- const { getPostTypeLabel, getCurrentPostType } =
24
- select( editorStore );
25
- const { isRevisionsMode: _isRevisionsMode } = unlock(
26
- select( editorStore )
27
- );
28
- return {
29
- postTypeLabel: getPostTypeLabel(),
30
- isAttachment:
31
- getCurrentPostType() === ATTACHMENT_POST_TYPE &&
32
- window?.__experimentalMediaEditor,
33
- isRevisionsMode: _isRevisionsMode(),
34
- };
35
- },
36
- []
37
- );
20
+ const { postTypeLabel, isRevisionsMode } = useSelect( ( select ) => {
21
+ const { getPostTypeLabel } = select( editorStore );
22
+ const { isRevisionsMode: _isRevisionsMode } = unlock(
23
+ select( editorStore )
24
+ );
25
+ return {
26
+ postTypeLabel: getPostTypeLabel(),
27
+ isRevisionsMode: _isRevisionsMode(),
28
+ };
29
+ }, [] );
38
30
 
39
31
  let documentLabel;
40
32
  if ( isRevisionsMode ) {
@@ -55,16 +47,14 @@ const SidebarHeader = ( _, ref ) => {
55
47
  >
56
48
  { documentLabel }
57
49
  </Tabs.Tab>
58
- { ! isAttachment && (
59
- <Tabs.Tab
60
- tabId={ sidebars.block }
61
- // Used for focus management in the SettingsSidebar component.
62
- data-tab-id={ sidebars.block }
63
- >
64
- { /* translators: Text label for the Block Settings Sidebar tab. */ }
65
- { __( 'Block' ) }
66
- </Tabs.Tab>
67
- ) }
50
+ <Tabs.Tab
51
+ tabId={ sidebars.block }
52
+ // Used for focus management in the SettingsSidebar component.
53
+ data-tab-id={ sidebars.block }
54
+ >
55
+ { /* translators: Text label for the Block Settings Sidebar tab. */ }
56
+ { __( 'Block' ) }
57
+ </Tabs.Tab>
68
58
  </Tabs.TabList>
69
59
  );
70
60
  };
@@ -33,7 +33,6 @@ import SidebarHeader from './header';
33
33
  import TemplateActionsPanel from '../template-actions-panel';
34
34
  import TemplateContentPanel from '../template-content-panel';
35
35
  import TemplatePartContentPanel from '../template-part-content-panel';
36
- import { MediaMetadataPanel } from '../media';
37
36
  import PostRevisionsPanel from '../post-revisions-panel';
38
37
  import RevisionBlockDiffPanel from '../revision-block-diff';
39
38
  import useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';
@@ -41,7 +40,6 @@ import { sidebars } from './constants';
41
40
  import { unlock } from '../../lock-unlock';
42
41
  import { store as editorStore } from '../../store';
43
42
  import {
44
- ATTACHMENT_POST_TYPE,
45
43
  NAVIGATION_POST_TYPE,
46
44
  TEMPLATE_PART_POST_TYPE,
47
45
  TEMPLATE_POST_TYPE,
@@ -66,7 +64,6 @@ const SidebarContent = ( {
66
64
  // need to forward the `Tabs` context so it can be passed through the
67
65
  // underlying slot/fill.
68
66
  const tabsContextValue = useContext( Tabs.Context );
69
- const isAttachment = postType === ATTACHMENT_POST_TYPE;
70
67
  const isRevisionsMode = useSelect( ( select ) => {
71
68
  return unlock( select( editorStore ) ).isRevisionsMode();
72
69
  } );
@@ -99,11 +96,7 @@ const SidebarContent = ( {
99
96
  }, [ tabName ] );
100
97
 
101
98
  let tabContent;
102
- if ( isAttachment ) {
103
- tabContent = (
104
- <MediaMetadataPanel onActionPerformed={ onActionPerformed } />
105
- );
106
- } else if ( isRevisionsMode ) {
99
+ if ( isRevisionsMode ) {
107
100
  tabContent = <PostRevisionSummary />;
108
101
  } else {
109
102
  tabContent = (
@@ -159,12 +152,10 @@ const SidebarContent = ( {
159
152
  <Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>
160
153
  { tabContent }
161
154
  </Tabs.TabPanel>
162
- { ! isAttachment && (
163
- <Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>
164
- <BlockInspector />
165
- { isRevisionsMode && <RevisionBlockDiffPanel /> }
166
- </Tabs.TabPanel>
167
- ) }
155
+ <Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>
156
+ <BlockInspector />
157
+ { isRevisionsMode && <RevisionBlockDiffPanel /> }
158
+ </Tabs.TabPanel>
168
159
  </Tabs.Context.Provider>
169
160
  </PluginSidebar>
170
161
  );