@wordpress/editor 14.0.0 → 14.1.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/CHANGELOG.md +2 -0
  2. package/README.md +164 -20
  3. package/build/components/block-settings-menu/content-only-settings-menu.js +14 -5
  4. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  5. package/build/components/document-tools/index.js +12 -3
  6. package/build/components/document-tools/index.js.map +1 -1
  7. package/build/components/editor/index.js +77 -0
  8. package/build/components/editor/index.js.map +1 -0
  9. package/build/components/editor-interface/index.js +6 -8
  10. package/build/components/editor-interface/index.js.map +1 -1
  11. package/build/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  12. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  13. package/build/components/entities-saved-states/index.js +28 -0
  14. package/build/components/entities-saved-states/index.js.map +1 -1
  15. package/build/components/global-styles-provider/index.js +9 -2
  16. package/build/components/global-styles-provider/index.js.map +1 -1
  17. package/build/components/header/back-button.js +4 -1
  18. package/build/components/header/back-button.js.map +1 -1
  19. package/build/components/header/index.js +1 -5
  20. package/build/components/header/index.js.map +1 -1
  21. package/build/components/index.js +7 -0
  22. package/build/components/index.js.map +1 -1
  23. package/build/components/media-categories/index.js +1 -1
  24. package/build/components/media-categories/index.js.map +1 -1
  25. package/build/components/post-actions/actions.js +10 -4
  26. package/build/components/post-actions/actions.js.map +1 -1
  27. package/build/components/post-last-revision/index.js +35 -9
  28. package/build/components/post-last-revision/index.js.map +1 -1
  29. package/build/components/post-preview-button/index.js +1 -0
  30. package/build/components/post-preview-button/index.js.map +1 -1
  31. package/build/components/post-publish-button/index.js +4 -0
  32. package/build/components/post-publish-button/index.js.map +1 -1
  33. package/build/components/post-publish-button/label.js +5 -0
  34. package/build/components/post-publish-button/label.js.map +1 -1
  35. package/build/components/post-publish-panel/index.js +5 -0
  36. package/build/components/post-publish-panel/index.js.map +1 -1
  37. package/build/components/post-sticky/check.js +8 -0
  38. package/build/components/post-sticky/check.js.map +1 -1
  39. package/build/components/post-sticky/index.js +5 -1
  40. package/build/components/post-sticky/index.js.map +1 -1
  41. package/build/components/post-switch-to-draft-button/index.js +11 -2
  42. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  43. package/build/components/post-sync-status/index.js +6 -2
  44. package/build/components/post-sync-status/index.js.map +1 -1
  45. package/build/components/post-taxonomies/check.js +8 -0
  46. package/build/components/post-taxonomies/check.js.map +1 -1
  47. package/build/components/post-taxonomies/flat-term-selector.js +14 -2
  48. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  49. package/build/components/post-taxonomies/index.js +9 -0
  50. package/build/components/post-taxonomies/index.js.map +1 -1
  51. package/build/components/post-taxonomies/panel.js +10 -0
  52. package/build/components/post-taxonomies/panel.js.map +1 -1
  53. package/build/components/post-title/index.js +4 -8
  54. package/build/components/post-title/index.js.map +1 -1
  55. package/build/components/post-title/post-title-raw.js +3 -7
  56. package/build/components/post-title/post-title-raw.js.map +1 -1
  57. package/build/components/post-trash/check.js +8 -0
  58. package/build/components/post-trash/check.js.map +1 -1
  59. package/build/components/post-trash/index.js +6 -1
  60. package/build/components/post-trash/index.js.map +1 -1
  61. package/build/components/post-url/panel.js +25 -3
  62. package/build/components/post-url/panel.js.map +1 -1
  63. package/build/components/post-visibility/index.js +1 -0
  64. package/build/components/post-visibility/index.js.map +1 -1
  65. package/build/components/provider/disable-non-page-content-blocks.js +5 -3
  66. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  67. package/build/components/provider/index.js +18 -15
  68. package/build/components/provider/index.js.map +1 -1
  69. package/build/components/sidebar/post-summary.js +3 -2
  70. package/build/components/sidebar/post-summary.js.map +1 -1
  71. package/build/components/table-of-contents/index.js +11 -0
  72. package/build/components/table-of-contents/index.js.map +1 -1
  73. package/build/components/template-part-menu-items/convert-to-regular.js +38 -0
  74. package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  75. package/build/components/template-part-menu-items/convert-to-template-part.js +77 -0
  76. package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  77. package/build/components/template-part-menu-items/index.js +67 -0
  78. package/build/components/template-part-menu-items/index.js.map +1 -0
  79. package/build/components/template-part-menu-items/index.native.js +10 -0
  80. package/build/components/template-part-menu-items/index.native.js.map +1 -0
  81. package/build/components/template-validation-notice/index.js +1 -0
  82. package/build/components/template-validation-notice/index.js.map +1 -1
  83. package/build/components/theme-support-check/index.js +9 -0
  84. package/build/components/theme-support-check/index.js.map +1 -1
  85. package/build/components/time-to-read/index.js +6 -0
  86. package/build/components/time-to-read/index.js.map +1 -1
  87. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -0
  88. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  89. package/build/components/word-count/index.js +5 -1
  90. package/build/components/word-count/index.js.map +1 -1
  91. package/build/dataviews/api.js +61 -0
  92. package/build/dataviews/api.js.map +1 -0
  93. package/build/dataviews/store/private-actions.js +28 -0
  94. package/build/dataviews/store/private-actions.js.map +1 -0
  95. package/build/dataviews/store/private-selectors.js +20 -0
  96. package/build/dataviews/store/private-selectors.js.map +1 -0
  97. package/build/dataviews/store/reducer.js +36 -0
  98. package/build/dataviews/store/reducer.js.map +1 -0
  99. package/build/hooks/pattern-overrides.js +2 -1
  100. package/build/hooks/pattern-overrides.js.map +1 -1
  101. package/build/index.js +12 -0
  102. package/build/index.js.map +1 -1
  103. package/build/private-apis.js +2 -6
  104. package/build/private-apis.js.map +1 -1
  105. package/build/private-apis.native.js +0 -2
  106. package/build/private-apis.native.js.map +1 -1
  107. package/build/store/private-actions.js +21 -0
  108. package/build/store/private-actions.js.map +1 -1
  109. package/build/store/private-selectors.js +5 -0
  110. package/build/store/private-selectors.js.map +1 -1
  111. package/build/store/reducer.js +4 -1
  112. package/build/store/reducer.js.map +1 -1
  113. package/build-module/components/block-settings-menu/content-only-settings-menu.js +14 -5
  114. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  115. package/build-module/components/document-tools/index.js +12 -3
  116. package/build-module/components/document-tools/index.js.map +1 -1
  117. package/build-module/components/editor/index.js +71 -0
  118. package/build-module/components/editor/index.js.map +1 -0
  119. package/build-module/components/editor-interface/index.js +6 -8
  120. package/build-module/components/editor-interface/index.js.map +1 -1
  121. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +10 -0
  122. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  123. package/build-module/components/entities-saved-states/index.js +28 -0
  124. package/build-module/components/entities-saved-states/index.js.map +1 -1
  125. package/build-module/components/global-styles-provider/index.js +9 -2
  126. package/build-module/components/global-styles-provider/index.js.map +1 -1
  127. package/build-module/components/header/back-button.js +4 -1
  128. package/build-module/components/header/back-button.js.map +1 -1
  129. package/build-module/components/header/index.js +1 -5
  130. package/build-module/components/header/index.js.map +1 -1
  131. package/build-module/components/index.js +7 -0
  132. package/build-module/components/index.js.map +1 -1
  133. package/build-module/components/media-categories/index.js +1 -1
  134. package/build-module/components/media-categories/index.js.map +1 -1
  135. package/build-module/components/post-actions/actions.js +10 -4
  136. package/build-module/components/post-actions/actions.js.map +1 -1
  137. package/build-module/components/post-last-revision/index.js +34 -11
  138. package/build-module/components/post-last-revision/index.js.map +1 -1
  139. package/build-module/components/post-preview-button/index.js +1 -0
  140. package/build-module/components/post-preview-button/index.js.map +1 -1
  141. package/build-module/components/post-publish-button/index.js +4 -0
  142. package/build-module/components/post-publish-button/index.js.map +1 -1
  143. package/build-module/components/post-publish-button/label.js +6 -0
  144. package/build-module/components/post-publish-button/label.js.map +1 -1
  145. package/build-module/components/post-publish-panel/index.js +5 -0
  146. package/build-module/components/post-publish-panel/index.js.map +1 -1
  147. package/build-module/components/post-sticky/check.js +9 -0
  148. package/build-module/components/post-sticky/check.js.map +1 -1
  149. package/build-module/components/post-sticky/index.js +6 -0
  150. package/build-module/components/post-sticky/index.js.map +1 -1
  151. package/build-module/components/post-switch-to-draft-button/index.js +10 -1
  152. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  153. package/build-module/components/post-sync-status/index.js +7 -1
  154. package/build-module/components/post-sync-status/index.js.map +1 -1
  155. package/build-module/components/post-taxonomies/check.js +9 -0
  156. package/build-module/components/post-taxonomies/check.js.map +1 -1
  157. package/build-module/components/post-taxonomies/flat-term-selector.js +14 -2
  158. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  159. package/build-module/components/post-taxonomies/index.js +9 -0
  160. package/build-module/components/post-taxonomies/index.js.map +1 -1
  161. package/build-module/components/post-taxonomies/panel.js +10 -0
  162. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  163. package/build-module/components/post-title/index.js +4 -8
  164. package/build-module/components/post-title/index.js.map +1 -1
  165. package/build-module/components/post-title/post-title-raw.js +3 -7
  166. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  167. package/build-module/components/post-trash/check.js +9 -0
  168. package/build-module/components/post-trash/check.js.map +1 -1
  169. package/build-module/components/post-trash/index.js +7 -0
  170. package/build-module/components/post-trash/index.js.map +1 -1
  171. package/build-module/components/post-url/panel.js +26 -3
  172. package/build-module/components/post-url/panel.js.map +1 -1
  173. package/build-module/components/post-visibility/index.js +1 -0
  174. package/build-module/components/post-visibility/index.js.map +1 -1
  175. package/build-module/components/provider/disable-non-page-content-blocks.js +5 -3
  176. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  177. package/build-module/components/provider/index.js +18 -15
  178. package/build-module/components/provider/index.js.map +1 -1
  179. package/build-module/components/sidebar/post-summary.js +3 -2
  180. package/build-module/components/sidebar/post-summary.js.map +1 -1
  181. package/build-module/components/table-of-contents/index.js +11 -0
  182. package/build-module/components/table-of-contents/index.js.map +1 -1
  183. package/build-module/components/template-part-menu-items/convert-to-regular.js +31 -0
  184. package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  185. package/build-module/components/template-part-menu-items/convert-to-template-part.js +71 -0
  186. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  187. package/build-module/components/template-part-menu-items/index.js +59 -0
  188. package/build-module/components/template-part-menu-items/index.js.map +1 -0
  189. package/build-module/components/template-part-menu-items/index.native.js +4 -0
  190. package/build-module/components/template-part-menu-items/index.native.js.map +1 -0
  191. package/build-module/components/template-validation-notice/index.js +1 -0
  192. package/build-module/components/template-validation-notice/index.js.map +1 -1
  193. package/build-module/components/theme-support-check/index.js +10 -0
  194. package/build-module/components/theme-support-check/index.js.map +1 -1
  195. package/build-module/components/time-to-read/index.js +6 -0
  196. package/build-module/components/time-to-read/index.js.map +1 -1
  197. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -0
  198. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  199. package/build-module/components/word-count/index.js +6 -0
  200. package/build-module/components/word-count/index.js.map +1 -1
  201. package/build-module/dataviews/api.js +54 -0
  202. package/build-module/dataviews/api.js.map +1 -0
  203. package/build-module/dataviews/store/private-actions.js +21 -0
  204. package/build-module/dataviews/store/private-actions.js.map +1 -0
  205. package/build-module/dataviews/store/private-selectors.js +14 -0
  206. package/build-module/dataviews/store/private-selectors.js.map +1 -0
  207. package/build-module/dataviews/store/reducer.js +29 -0
  208. package/build-module/dataviews/store/reducer.js.map +1 -0
  209. package/build-module/hooks/pattern-overrides.js +2 -1
  210. package/build-module/hooks/pattern-overrides.js.map +1 -1
  211. package/build-module/index.js +1 -0
  212. package/build-module/index.js.map +1 -1
  213. package/build-module/private-apis.js +2 -6
  214. package/build-module/private-apis.js.map +1 -1
  215. package/build-module/private-apis.native.js +0 -2
  216. package/build-module/private-apis.native.js.map +1 -1
  217. package/build-module/store/private-actions.js +1 -0
  218. package/build-module/store/private-actions.js.map +1 -1
  219. package/build-module/store/private-selectors.js +4 -0
  220. package/build-module/store/private-selectors.js.map +1 -1
  221. package/build-module/store/reducer.js +3 -1
  222. package/build-module/store/reducer.js.map +1 -1
  223. package/build-style/style-rtl.css +35 -43
  224. package/build-style/style.css +35 -43
  225. package/build-types/dataviews/store/private-actions.d.ts +17 -0
  226. package/build-types/dataviews/store/private-actions.d.ts.map +1 -0
  227. package/build-types/dataviews/store/private-selectors.d.ts +10 -0
  228. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -0
  229. package/build-types/dataviews/store/reducer.d.ts +11 -0
  230. package/build-types/dataviews/store/reducer.d.ts.map +1 -0
  231. package/package.json +35 -35
  232. package/src/components/block-settings-menu/content-only-settings-menu.js +26 -12
  233. package/src/components/collapsible-block-toolbar/style.scss +3 -1
  234. package/src/components/document-tools/index.js +13 -4
  235. package/src/components/editor/index.js +88 -0
  236. package/src/components/editor-interface/index.js +5 -5
  237. package/src/components/editor-interface/style.scss +3 -0
  238. package/src/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  239. package/src/components/entities-saved-states/index.js +26 -0
  240. package/src/components/entities-saved-states/style.scss +0 -7
  241. package/src/components/global-styles-provider/index.js +12 -2
  242. package/src/components/header/back-button.js +6 -1
  243. package/src/components/header/index.js +1 -8
  244. package/src/components/header/style.scss +1 -1
  245. package/src/components/index.js +7 -0
  246. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -3
  247. package/src/components/media-categories/index.js +1 -3
  248. package/src/components/post-actions/actions.js +9 -3
  249. package/src/components/post-card-panel/style.scss +4 -0
  250. package/src/components/post-last-revision/index.js +30 -7
  251. package/src/components/post-last-revision/style.scss +4 -0
  252. package/src/components/post-panel-row/style.scss +2 -1
  253. package/src/components/post-preview-button/index.js +1 -0
  254. package/src/components/post-preview-button/test/index.js +10 -2
  255. package/src/components/post-publish-button/index.js +3 -0
  256. package/src/components/post-publish-button/label.js +5 -0
  257. package/src/components/post-publish-panel/index.js +4 -0
  258. package/src/components/post-publish-panel/style.scss +28 -36
  259. package/src/components/post-status/style.scss +5 -0
  260. package/src/components/post-sticky/check.js +8 -0
  261. package/src/components/post-sticky/index.js +5 -0
  262. package/src/components/post-switch-to-draft-button/index.js +10 -1
  263. package/src/components/post-sync-status/index.js +7 -8
  264. package/src/components/post-taxonomies/check.js +8 -0
  265. package/src/components/post-taxonomies/flat-term-selector.js +13 -2
  266. package/src/components/post-taxonomies/index.js +8 -0
  267. package/src/components/post-taxonomies/panel.js +9 -0
  268. package/src/components/post-title/index.js +2 -5
  269. package/src/components/post-title/post-title-raw.js +2 -5
  270. package/src/components/post-trash/check.js +8 -0
  271. package/src/components/post-trash/index.js +6 -0
  272. package/src/components/post-url/panel.js +13 -5
  273. package/src/components/post-visibility/index.js +1 -0
  274. package/src/components/provider/disable-non-page-content-blocks.js +9 -4
  275. package/src/components/provider/index.js +17 -17
  276. package/src/components/save-publish-panels/style.scss +0 -8
  277. package/src/components/sidebar/post-summary.js +3 -1
  278. package/src/components/table-of-contents/index.js +10 -0
  279. package/src/components/template-part-menu-items/convert-to-regular.js +32 -0
  280. package/src/components/template-part-menu-items/convert-to-template-part.js +75 -0
  281. package/src/components/template-part-menu-items/index.js +59 -0
  282. package/src/components/template-part-menu-items/index.native.js +3 -0
  283. package/src/components/template-validation-notice/index.js +1 -0
  284. package/src/components/theme-support-check/index.js +9 -0
  285. package/src/components/time-to-read/index.js +5 -0
  286. package/src/components/visual-editor/edit-template-blocks-notification.js +1 -0
  287. package/src/components/word-count/index.js +5 -0
  288. package/src/dataviews/api.js +55 -0
  289. package/src/dataviews/store/private-actions.ts +30 -0
  290. package/src/dataviews/store/private-selectors.ts +15 -0
  291. package/src/dataviews/store/reducer.ts +44 -0
  292. package/src/hooks/pattern-overrides.js +2 -0
  293. package/src/index.js +1 -0
  294. package/src/private-apis.js +2 -6
  295. package/src/private-apis.native.js +0 -2
  296. package/src/store/private-actions.js +1 -0
  297. package/src/store/private-selectors.js +5 -0
  298. package/src/store/reducer.js +2 -0
  299. package/src/style.scss +1 -0
  300. package/tsconfig.json +36 -0
  301. package/tsconfig.tsbuildinfo +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "14.0.0",
3
+ "version": "14.1.0",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,39 +32,39 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.16.0",
35
- "@wordpress/a11y": "^4.0.0",
36
- "@wordpress/api-fetch": "^7.0.0",
37
- "@wordpress/blob": "^4.0.0",
38
- "@wordpress/block-editor": "^13.0.0",
39
- "@wordpress/blocks": "^13.0.0",
40
- "@wordpress/commands": "^1.0.0",
41
- "@wordpress/components": "^28.0.0",
42
- "@wordpress/compose": "^7.0.0",
43
- "@wordpress/core-data": "^7.0.0",
44
- "@wordpress/data": "^10.0.0",
45
- "@wordpress/date": "^5.0.0",
46
- "@wordpress/deprecated": "^4.0.0",
47
- "@wordpress/dom": "^4.0.0",
48
- "@wordpress/element": "^6.0.0",
49
- "@wordpress/hooks": "^4.0.0",
50
- "@wordpress/html-entities": "^4.0.0",
51
- "@wordpress/i18n": "^5.0.0",
52
- "@wordpress/icons": "^10.0.0",
53
- "@wordpress/interface": "^6.0.0",
54
- "@wordpress/keyboard-shortcuts": "^5.0.0",
55
- "@wordpress/keycodes": "^4.0.0",
56
- "@wordpress/media-utils": "^5.0.0",
57
- "@wordpress/notices": "^5.0.0",
58
- "@wordpress/patterns": "^2.0.0",
59
- "@wordpress/plugins": "^7.0.0",
60
- "@wordpress/preferences": "^4.0.0",
61
- "@wordpress/private-apis": "^1.0.0",
62
- "@wordpress/reusable-blocks": "^5.0.0",
63
- "@wordpress/rich-text": "^7.0.0",
64
- "@wordpress/server-side-render": "^5.0.0",
65
- "@wordpress/url": "^4.0.0",
66
- "@wordpress/warning": "^3.0.0",
67
- "@wordpress/wordcount": "^4.0.0",
35
+ "@wordpress/a11y": "^4.1.0",
36
+ "@wordpress/api-fetch": "^7.1.0",
37
+ "@wordpress/blob": "^4.1.0",
38
+ "@wordpress/block-editor": "^13.1.0",
39
+ "@wordpress/blocks": "^13.1.0",
40
+ "@wordpress/commands": "^1.1.0",
41
+ "@wordpress/components": "^28.1.0",
42
+ "@wordpress/compose": "^7.1.0",
43
+ "@wordpress/core-data": "^7.1.0",
44
+ "@wordpress/data": "^10.1.0",
45
+ "@wordpress/date": "^5.1.0",
46
+ "@wordpress/deprecated": "^4.1.0",
47
+ "@wordpress/dom": "^4.1.0",
48
+ "@wordpress/element": "^6.1.0",
49
+ "@wordpress/hooks": "^4.1.0",
50
+ "@wordpress/html-entities": "^4.1.0",
51
+ "@wordpress/i18n": "^5.1.0",
52
+ "@wordpress/icons": "^10.1.0",
53
+ "@wordpress/interface": "^6.1.0",
54
+ "@wordpress/keyboard-shortcuts": "^5.1.0",
55
+ "@wordpress/keycodes": "^4.1.0",
56
+ "@wordpress/media-utils": "^5.1.0",
57
+ "@wordpress/notices": "^5.1.0",
58
+ "@wordpress/patterns": "^2.1.0",
59
+ "@wordpress/plugins": "^7.1.0",
60
+ "@wordpress/preferences": "^4.1.0",
61
+ "@wordpress/private-apis": "^1.1.0",
62
+ "@wordpress/reusable-blocks": "^5.1.0",
63
+ "@wordpress/rich-text": "^7.1.0",
64
+ "@wordpress/server-side-render": "^5.1.0",
65
+ "@wordpress/url": "^4.1.0",
66
+ "@wordpress/warning": "^3.1.0",
67
+ "@wordpress/wordcount": "^4.1.0",
68
68
  "change-case": "^4.1.2",
69
69
  "client-zip": "^2.4.5",
70
70
  "clsx": "^2.1.1",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "2f30cddff15723ac7017fd009fc5913b7b419400"
86
+ "gitHead": "66d3bf12e67d16deddc4b4a9ec42e1d0bed3479a"
87
87
  }
@@ -19,7 +19,7 @@ import { store as editorStore } from '../../store';
19
19
  import { unlock } from '../../lock-unlock';
20
20
 
21
21
  function ContentOnlySettingsMenuItems( { clientId, onClose } ) {
22
- const { entity, onNavigateToEntityRecord } = useSelect(
22
+ const { entity, onNavigateToEntityRecord, canEditTemplates } = useSelect(
23
23
  ( select ) => {
24
24
  const {
25
25
  getBlockEditingMode,
@@ -46,11 +46,12 @@ function ContentOnlySettingsMenuItems( { clientId, onClose } ) {
46
46
  getBlockAttributes( patternParent ).ref
47
47
  );
48
48
  } else {
49
- const { getCurrentPostType, getCurrentTemplateId } =
50
- select( editorStore );
51
- const currentPostType = getCurrentPostType();
49
+ const { getCurrentTemplateId } = select( editorStore );
52
50
  const templateId = getCurrentTemplateId();
53
- if ( currentPostType === 'page' && templateId ) {
51
+ const { getContentLockingParent } = unlock(
52
+ select( blockEditorStore )
53
+ );
54
+ if ( ! getContentLockingParent( clientId ) && templateId ) {
54
55
  record = select( coreStore ).getEntityRecord(
55
56
  'postType',
56
57
  'wp_template',
@@ -58,7 +59,12 @@ function ContentOnlySettingsMenuItems( { clientId, onClose } ) {
58
59
  );
59
60
  }
60
61
  }
62
+ const _canEditTemplates = select( coreStore ).canUser(
63
+ 'create',
64
+ 'templates'
65
+ );
61
66
  return {
67
+ canEditTemplates: _canEditTemplates,
62
68
  entity: record,
63
69
  onNavigateToEntityRecord:
64
70
  getSettings().onNavigateToEntityRecord,
@@ -77,6 +83,19 @@ function ContentOnlySettingsMenuItems( { clientId, onClose } ) {
77
83
  }
78
84
 
79
85
  const isPattern = entity.type === 'wp_block';
86
+ let helpText = isPattern
87
+ ? __(
88
+ 'Edit the pattern to move, delete, or make further changes to this block.'
89
+ )
90
+ : __(
91
+ 'Edit the template to move, delete, or make further changes to this block.'
92
+ );
93
+
94
+ if ( ! canEditTemplates ) {
95
+ helpText = __(
96
+ 'Only users with permissions to edit the template can move or delete this block'
97
+ );
98
+ }
80
99
 
81
100
  return (
82
101
  <>
@@ -88,6 +107,7 @@ function ContentOnlySettingsMenuItems( { clientId, onClose } ) {
88
107
  postType: entity.type,
89
108
  } );
90
109
  } }
110
+ disabled={ ! canEditTemplates }
91
111
  >
92
112
  { isPattern ? __( 'Edit pattern' ) : __( 'Edit template' ) }
93
113
  </MenuItem>
@@ -97,13 +117,7 @@ function ContentOnlySettingsMenuItems( { clientId, onClose } ) {
97
117
  as="p"
98
118
  className="editor-content-only-settings-menu__description"
99
119
  >
100
- { isPattern
101
- ? __(
102
- 'Edit the pattern to move, delete, or make further changes to this block.'
103
- )
104
- : __(
105
- 'Edit the template to move, delete, or make further changes to this block.'
106
- ) }
120
+ { helpText }
107
121
  </Text>
108
122
  </>
109
123
  );
@@ -7,6 +7,7 @@
7
7
  .block-editor-block-contextual-toolbar {
8
8
  border-bottom: 0;
9
9
  height: 100%;
10
+ background: transparent;
10
11
  }
11
12
 
12
13
  // These rules ensure that icons are always positioned in a way that lines up with the rest of the icons in the toolbar.
@@ -64,8 +65,9 @@
64
65
  // Move up a little to prevent the toolbar shift when focus is on the vertical movers.
65
66
  @include break-small() {
66
67
  &:not(.is-horizontal) .block-editor-block-mover__move-button-container {
68
+ height: $grid-unit-50;
67
69
  position: relative;
68
- top: -10px;
70
+ top: -5px; // Should be -4px, but that causes scrolling when focus lands on the movers, in a 60px header.
69
71
  }
70
72
  }
71
73
  }
@@ -28,10 +28,6 @@ import { store as editorStore } from '../../store';
28
28
  import EditorHistoryRedo from '../editor-history/redo';
29
29
  import EditorHistoryUndo from '../editor-history/undo';
30
30
 
31
- const preventDefault = ( event ) => {
32
- event.preventDefault();
33
- };
34
-
35
31
  function DocumentTools( { className, disableBlockTools = false } ) {
36
32
  const { setIsInserterOpened, setIsListViewOpened } =
37
33
  useDispatch( editorStore );
@@ -72,6 +68,19 @@ function DocumentTools( { className, disableBlockTools = false } ) {
72
68
  };
73
69
  }, [] );
74
70
 
71
+ const preventDefault = ( event ) => {
72
+ // Because the inserter behaves like a dialog,
73
+ // if the inserter is opened already then when we click on the toggle button
74
+ // then the initial click event will close the inserter and then be propagated
75
+ // to the inserter toggle and it will open it again.
76
+ // To prevent this we need to stop the propagation of the event.
77
+ // This won't be necessary when the inserter no longer behaves like a dialog.
78
+
79
+ if ( isInserterOpened ) {
80
+ event.preventDefault();
81
+ }
82
+ };
83
+
75
84
  const isLargeViewport = useViewportMatch( 'medium' );
76
85
  const isWideViewport = useViewportMatch( 'wide' );
77
86
 
@@ -0,0 +1,88 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect } from '@wordpress/data';
5
+ import { store as coreStore } from '@wordpress/core-data';
6
+ import { Notice } from '@wordpress/components';
7
+ import { __ } from '@wordpress/i18n';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import { TEMPLATE_POST_TYPE } from '../../store/constants';
13
+ import EditorInterface from '../editor-interface';
14
+ import { ExperimentalEditorProvider } from '../provider';
15
+ import Sidebar from '../sidebar';
16
+
17
+ function Editor( {
18
+ postType,
19
+ postId,
20
+ templateId,
21
+ settings,
22
+ children,
23
+ initialEdits,
24
+
25
+ // This could be part of the settings.
26
+ onActionPerformed,
27
+
28
+ // The following abstractions are not ideal but necessary
29
+ // to account for site editor and post editor differences for now.
30
+ extraContent,
31
+ extraSidebarPanels,
32
+ ...props
33
+ } ) {
34
+ const { post, template, hasLoadedPost } = useSelect(
35
+ ( select ) => {
36
+ const { getEntityRecord, hasFinishedResolution } =
37
+ select( coreStore );
38
+ return {
39
+ post: getEntityRecord( 'postType', postType, postId ),
40
+ template: templateId
41
+ ? getEntityRecord(
42
+ 'postType',
43
+ TEMPLATE_POST_TYPE,
44
+ templateId
45
+ )
46
+ : undefined,
47
+ hasLoadedPost: hasFinishedResolution( 'getEntityRecord', [
48
+ 'postType',
49
+ postType,
50
+ postId,
51
+ ] ),
52
+ };
53
+ },
54
+ [ postType, postId, templateId ]
55
+ );
56
+
57
+ return (
58
+ <>
59
+ { hasLoadedPost && ! post && (
60
+ <Notice status="warning" isDismissible={ false }>
61
+ { __(
62
+ "You attempted to edit an item that doesn't exist. Perhaps it was deleted?"
63
+ ) }
64
+ </Notice>
65
+ ) }
66
+ { !! post && (
67
+ <ExperimentalEditorProvider
68
+ post={ post }
69
+ __unstableTemplate={ template }
70
+ settings={ settings }
71
+ initialEdits={ initialEdits }
72
+ useSubRegistry={ false }
73
+ >
74
+ <EditorInterface { ...props }>
75
+ { extraContent }
76
+ </EditorInterface>
77
+ <Sidebar
78
+ onActionPerformed={ onActionPerformed }
79
+ extraPanels={ extraSidebarPanels }
80
+ />
81
+ { children }
82
+ </ExperimentalEditorProvider>
83
+ ) }
84
+ </>
85
+ );
86
+ }
87
+
88
+ export default Editor;
@@ -121,8 +121,10 @@ export default function EditorInterface( {
121
121
  <InterfaceSkeleton
122
122
  enableRegionNavigation={ enableRegionNavigation }
123
123
  isDistractionFree={ isDistractionFree && isWideViewport }
124
- className={ clsx( className, {
124
+ className={ clsx( 'editor-editor-interface', className, {
125
125
  'is-entity-save-view-open': !! entitiesSavedStatesCallback,
126
+ 'is-distraction-free':
127
+ isDistractionFree && isWideViewport && ! isPreviewMode,
126
128
  } ) }
127
129
  labels={ {
128
130
  ...interfaceLabels,
@@ -160,7 +162,7 @@ export default function EditorInterface( {
160
162
 
161
163
  <EditorContentSlotFill.Slot>
162
164
  { ( [ editorCanvasView ] ) =>
163
- ! isPreviewMode && editorCanvasView ? (
165
+ editorCanvasView ? (
164
166
  editorCanvasView
165
167
  ) : (
166
168
  <>
@@ -206,9 +208,7 @@ export default function EditorInterface( {
206
208
  isRichEditingEnabled &&
207
209
  blockEditorMode !== 'zoom-out' &&
208
210
  mode === 'visual' && (
209
- <div className="edit-post-layout__footer">
210
- <BlockBreadcrumb rootLabelText={ documentLabel } />
211
- </div>
211
+ <BlockBreadcrumb rootLabelText={ documentLabel } />
212
212
  )
213
213
  }
214
214
  actions={
@@ -0,0 +1,3 @@
1
+ .editor-editor-interface .entities-saved-states__panel-header {
2
+ height: $header-height + $border-width;
3
+ }
@@ -5,6 +5,15 @@ import { useSelect } from '@wordpress/data';
5
5
  import { store as coreStore } from '@wordpress/core-data';
6
6
  import { useMemo, useState } from '@wordpress/element';
7
7
 
8
+ /**
9
+ * Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.
10
+ *
11
+ * @return {Object} An object containing the following properties:
12
+ * - dirtyEntityRecords: An array of dirty entity records.
13
+ * - isDirty: A boolean indicating if there are any dirty entity records.
14
+ * - setUnselectedEntities: A function to set the unselected entities.
15
+ * - unselectedEntities: An array of unselected entities.
16
+ */
8
17
  export const useIsDirty = () => {
9
18
  const { editedEntities, siteEdits, siteEntityConfig } = useSelect(
10
19
  ( select ) => {
@@ -26,6 +26,15 @@ function identity( values ) {
26
26
  return values;
27
27
  }
28
28
 
29
+ /**
30
+ * Renders the component for managing saved states of entities.
31
+ *
32
+ * @param {Object} props The component props.
33
+ * @param {Function} props.close The function to close the dialog.
34
+ * @param {Function} props.renderDialog The function to render the dialog.
35
+ *
36
+ * @return {JSX.Element} The rendered component.
37
+ */
29
38
  export default function EntitiesSavedStates( {
30
39
  close,
31
40
  renderDialog = undefined,
@@ -40,6 +49,23 @@ export default function EntitiesSavedStates( {
40
49
  );
41
50
  }
42
51
 
52
+ /**
53
+ * Renders a panel for saving entities with dirty records.
54
+ *
55
+ * @param {Object} props The component props.
56
+ * @param {string} props.additionalPrompt Additional prompt to display.
57
+ * @param {Function} props.close Function to close the panel.
58
+ * @param {Function} props.onSave Function to call when saving entities.
59
+ * @param {boolean} props.saveEnabled Flag indicating if save is enabled.
60
+ * @param {string} props.saveLabel Label for the save button.
61
+ * @param {Function} props.renderDialog Function to render a custom dialog.
62
+ * @param {Array} props.dirtyEntityRecords Array of dirty entity records.
63
+ * @param {boolean} props.isDirty Flag indicating if there are dirty entities.
64
+ * @param {Function} props.setUnselectedEntities Function to set unselected entities.
65
+ * @param {Array} props.unselectedEntities Array of unselected entities.
66
+ *
67
+ * @return {JSX.Element} The rendered component.
68
+ */
43
69
  export function EntitiesSavedStatesExtensible( {
44
70
  additionalPrompt = undefined,
45
71
  close,
@@ -31,13 +31,6 @@
31
31
  }
32
32
  }
33
33
 
34
- .edit-post-layout,
35
- .edit-site-editor__interface-skeleton {
36
- .entities-saved-states__panel-header {
37
- height: $header-height + $border-width;
38
- }
39
- }
40
-
41
34
  .entities-saved-states__post-meta {
42
35
  margin-left: $grid-unit-30;
43
36
  align-items: center;
@@ -163,7 +163,13 @@ function useGlobalStylesUserConfig() {
163
163
  }, [ settings, styles, _links ] );
164
164
 
165
165
  const setConfig = useCallback(
166
- ( callback, options = {} ) => {
166
+ /**
167
+ * Set the global styles config.
168
+ * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values.
169
+ * Otherwise, overwrite the current config with the incoming object.
170
+ * @param {Object} options Options for editEntityRecord Core selector.
171
+ */
172
+ ( callbackOrObject, options = {} ) => {
167
173
  const record = getEditedEntityRecord(
168
174
  'root',
169
175
  'globalStyles',
@@ -175,7 +181,11 @@ function useGlobalStylesUserConfig() {
175
181
  settings: record?.settings ?? {},
176
182
  _links: record?._links ?? {},
177
183
  };
178
- const updatedConfig = callback( currentConfig );
184
+
185
+ const updatedConfig =
186
+ typeof callbackOrObject === 'function'
187
+ ? callbackOrObject( currentConfig )
188
+ : callbackOrObject;
179
189
 
180
190
  editEntityRecord(
181
191
  'root',
@@ -20,7 +20,12 @@ const BackButtonSlot = ( { children } ) => {
20
20
  return children;
21
21
  }
22
22
 
23
- return <Slot bubblesVirtually />;
23
+ return (
24
+ <Slot
25
+ bubblesVirtually
26
+ fillProps={ { length: ! fills ? 0 : fills.length } }
27
+ />
28
+ );
24
29
  };
25
30
  BackButton.Slot = BackButtonSlot;
26
31
 
@@ -25,7 +25,6 @@ import MoreMenu from '../more-menu';
25
25
  import PostPreviewButton from '../post-preview-button';
26
26
  import PostPublishButtonOrToggle from '../post-publish-button/post-publish-button-or-toggle';
27
27
  import PostSavedState from '../post-saved-state';
28
- import PostTypeSupportCheck from '../post-type-support-check';
29
28
  import PostViewLink from '../post-view-link';
30
29
  import PreviewDropdown from '../preview-dropdown';
31
30
  import { store as editorStore } from '../../store';
@@ -117,13 +116,7 @@ function Header( {
117
116
  ! isBlockToolsCollapsed && hasTopToolbar,
118
117
  } ) }
119
118
  >
120
- { ! title ? (
121
- <PostTypeSupportCheck supportKeys="title">
122
- <DocumentBar />
123
- </PostTypeSupportCheck>
124
- ) : (
125
- title
126
- ) }
119
+ { ! title ? <DocumentBar /> : title }
127
120
  </div>
128
121
  </motion.div>
129
122
  <motion.div
@@ -190,7 +190,7 @@
190
190
  }
191
191
  }
192
192
 
193
- .is-distraction-free {
193
+ .editor-editor-interface.is-distraction-free {
194
194
  .interface-interface-skeleton__header {
195
195
  border-bottom: none;
196
196
  }
@@ -106,4 +106,11 @@ export { default as EditorProvider } from './provider';
106
106
 
107
107
  export * from './deprecated';
108
108
  export const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
109
+
110
+ /**
111
+ * Component handles the global keyboard shortcuts for the Text editor.
112
+ *
113
+ * It provides functionality for various keyboard shortcuts such as toggling editor mode,
114
+ * toggling distraction-free mode, undo/redo.
115
+ */
109
116
  export const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;
@@ -33,9 +33,6 @@
33
33
  &__shortcut-description {
34
34
  flex: 1;
35
35
  margin: 0;
36
-
37
- // IE 11 flex item fix - ensure the item does not collapse.
38
- flex-basis: auto;
39
36
  }
40
37
 
41
38
  &__shortcut-key-combination {
@@ -191,9 +191,7 @@ const inserterMediaCategories = [
191
191
  per_page: 'page_size',
192
192
  search: 'q',
193
193
  };
194
- const url = new URL(
195
- 'https://api.openverse.engineering/v1/images/'
196
- );
194
+ const url = new URL( 'https://api.openverse.org/v1/images/' );
197
195
  Object.entries( finalQuery ).forEach( ( [ key, value ] ) => {
198
196
  const queryKey = mapFromInserterMediaRequest[ key ] || key;
199
197
  url.searchParams.set( queryKey, value );
@@ -783,7 +783,7 @@ const duplicatePostAction = {
783
783
  sprintf(
784
784
  // translators: %s: Title of the created template e.g: "Category".
785
785
  __( '"%s" successfully created.' ),
786
- newItem.title?.rendered || title
786
+ decodeEntities( newItem.title?.rendered || title )
787
787
  ),
788
788
  {
789
789
  id: 'duplicate-post-action',
@@ -1030,11 +1030,13 @@ export const duplicateTemplatePartAction = {
1030
1030
  };
1031
1031
 
1032
1032
  export function usePostActions( postType, onActionPerformed ) {
1033
- const { postTypeObject } = useSelect(
1033
+ const { defaultActions, postTypeObject } = useSelect(
1034
1034
  ( select ) => {
1035
1035
  const { getPostType } = select( coreStore );
1036
+ const { getEntityActions } = unlock( select( editorStore ) );
1036
1037
  return {
1037
1038
  postTypeObject: getPostType( postType ),
1039
+ defaultActions: getEntityActions( 'postType', postType ),
1038
1040
  };
1039
1041
  },
1040
1042
  [ postType ]
@@ -1049,6 +1051,7 @@ export function usePostActions( postType, onActionPerformed ) {
1049
1051
  const isPattern = postType === PATTERN_POST_TYPE;
1050
1052
  const isLoaded = !! postTypeObject;
1051
1053
  const supportsRevisions = !! postTypeObject?.supports?.revisions;
1054
+ const supportsTitle = !! postTypeObject?.supports?.title;
1052
1055
  return useMemo( () => {
1053
1056
  if ( ! isLoaded ) {
1054
1057
  return [];
@@ -1064,13 +1067,14 @@ export function usePostActions( postType, onActionPerformed ) {
1064
1067
  : false,
1065
1068
  isTemplateOrTemplatePart && duplicateTemplatePartAction,
1066
1069
  isPattern && duplicatePatternAction,
1067
- renamePostAction,
1070
+ supportsTitle && renamePostAction,
1068
1071
  isPattern && exportPatternAsJSONAction,
1069
1072
  isTemplateOrTemplatePart ? resetTemplateAction : restorePostAction,
1070
1073
  isTemplateOrTemplatePart || isPattern
1071
1074
  ? deletePostAction
1072
1075
  : trashPostAction,
1073
1076
  ! isTemplateOrTemplatePart && permanentlyDeletePostAction,
1077
+ ...defaultActions,
1074
1078
  ].filter( Boolean );
1075
1079
 
1076
1080
  if ( onActionPerformed ) {
@@ -1116,6 +1120,7 @@ export function usePostActions( postType, onActionPerformed ) {
1116
1120
 
1117
1121
  return actions;
1118
1122
  }, [
1123
+ defaultActions,
1119
1124
  isTemplateOrTemplatePart,
1120
1125
  isPattern,
1121
1126
  postTypeObject?.viewable,
@@ -1124,5 +1129,6 @@ export function usePostActions( postType, onActionPerformed ) {
1124
1129
  onActionPerformed,
1125
1130
  isLoaded,
1126
1131
  supportsRevisions,
1132
+ supportsTitle,
1127
1133
  ] );
1128
1134
  }
@@ -35,6 +35,10 @@
35
35
 
36
36
  .editor-post-card-panel__icon.is-sync {
37
37
  fill: var(--wp-block-synced-color);
38
+
39
+ & + .editor-post-card-panel__title {
40
+ color: var(--wp-block-synced-color);
41
+ }
38
42
  }
39
43
 
40
44
  .editor-post-card-panel__title-badge {
@@ -11,15 +11,11 @@ import { addQueryArgs } from '@wordpress/url';
11
11
  * Internal dependencies
12
12
  */
13
13
  import PostLastRevisionCheck from './check';
14
+ import PostPanelRow from '../post-panel-row';
14
15
  import { store as editorStore } from '../../store';
15
16
 
16
- /**
17
- * Renders the component for displaying the last revision of a post.
18
- *
19
- * @return {Component} The component to be rendered.
20
- */
21
- function PostLastRevision() {
22
- const { lastRevisionId, revisionsCount } = useSelect( ( select ) => {
17
+ function usePostLastRevisionInfo() {
18
+ return useSelect( ( select ) => {
23
19
  const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =
24
20
  select( editorStore );
25
21
  return {
@@ -27,6 +23,15 @@ function PostLastRevision() {
27
23
  revisionsCount: getCurrentPostRevisionsCount(),
28
24
  };
29
25
  }, [] );
26
+ }
27
+
28
+ /**
29
+ * Renders the component for displaying the last revision of a post.
30
+ *
31
+ * @return {Component} The component to be rendered.
32
+ */
33
+ function PostLastRevision() {
34
+ const { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();
30
35
 
31
36
  return (
32
37
  <PostLastRevisionCheck>
@@ -47,4 +52,22 @@ function PostLastRevision() {
47
52
  );
48
53
  }
49
54
 
55
+ export function PrivatePostLastRevision() {
56
+ const { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();
57
+ return (
58
+ <PostLastRevisionCheck>
59
+ <PostPanelRow label={ __( 'Revisions' ) }>
60
+ <Button
61
+ href={ addQueryArgs( 'revision.php', {
62
+ revision: lastRevisionId,
63
+ } ) }
64
+ className="editor-private-post-last-revision__button"
65
+ text={ revisionsCount }
66
+ variant="tertiary"
67
+ />
68
+ </PostPanelRow>
69
+ </PostLastRevisionCheck>
70
+ );
71
+ }
72
+
50
73
  export default PostLastRevision;
@@ -28,3 +28,7 @@
28
28
  padding: $grid-unit-20;
29
29
  }
30
30
  }
31
+
32
+ .editor-private-post-last-revision__button {
33
+ display: inline-block;
34
+ }