@wordpress/editor 14.4.0 → 14.6.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 (375) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/bindings/post-meta.js +12 -0
  3. package/build/bindings/post-meta.js.map +1 -1
  4. package/build/components/blog-title/index.js +1 -1
  5. package/build/components/blog-title/index.js.map +1 -1
  6. package/build/components/commands/index.js +8 -2
  7. package/build/components/commands/index.js.map +1 -1
  8. package/build/components/create-template-part-modal/index.js +1 -0
  9. package/build/components/create-template-part-modal/index.js.map +1 -1
  10. package/build/components/document-bar/index.js +1 -1
  11. package/build/components/document-bar/index.js.map +1 -1
  12. package/build/components/global-styles-provider/index.js +17 -4
  13. package/build/components/global-styles-provider/index.js.map +1 -1
  14. package/build/components/header/index.js +2 -3
  15. package/build/components/header/index.js.map +1 -1
  16. package/build/components/inserter-sidebar/index.js +5 -2
  17. package/build/components/inserter-sidebar/index.js.map +1 -1
  18. package/build/components/page-attributes/parent.js +11 -6
  19. package/build/components/page-attributes/parent.js.map +1 -1
  20. package/build/components/post-actions/actions.js +10 -811
  21. package/build/components/post-actions/actions.js.map +1 -1
  22. package/build/components/post-actions/index.js +20 -19
  23. package/build/components/post-actions/index.js.map +1 -1
  24. package/build/components/post-author/hook.js +10 -3
  25. package/build/components/post-author/hook.js.map +1 -1
  26. package/build/components/post-author/panel.js +2 -1
  27. package/build/components/post-author/panel.js.map +1 -1
  28. package/build/components/post-card-panel/index.js +21 -21
  29. package/build/components/post-card-panel/index.js.map +1 -1
  30. package/build/components/post-comments/index.js +6 -20
  31. package/build/components/post-comments/index.js.map +1 -1
  32. package/build/components/post-featured-image/index.js +2 -0
  33. package/build/components/post-featured-image/index.js.map +1 -1
  34. package/build/components/post-publish-panel/postpublish.js +4 -0
  35. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  36. package/build/components/post-slug/index.js +1 -0
  37. package/build/components/post-slug/index.js.map +1 -1
  38. package/build/components/post-status/index.js +17 -41
  39. package/build/components/post-status/index.js.map +1 -1
  40. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -1
  41. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  42. package/build/components/post-template/create-new-template-modal.js +3 -0
  43. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  44. package/build/components/post-url/index.js +6 -5
  45. package/build/components/post-url/index.js.map +1 -1
  46. package/build/components/post-url/panel.js +3 -2
  47. package/build/components/post-url/panel.js.map +1 -1
  48. package/build/components/preview-dropdown/index.js +82 -17
  49. package/build/components/preview-dropdown/index.js.map +1 -1
  50. package/build/components/provider/disable-non-page-content-blocks.js +14 -18
  51. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  52. package/build/components/sidebar/post-summary.js +10 -7
  53. package/build/components/sidebar/post-summary.js.map +1 -1
  54. package/build/components/site-discussion/index.js +6 -20
  55. package/build/components/site-discussion/index.js.map +1 -1
  56. package/build/components/template-content-panel/index.js +15 -13
  57. package/build/components/template-content-panel/index.js.map +1 -1
  58. package/build/components/visual-editor/index.js +2 -1
  59. package/build/components/visual-editor/index.js.map +1 -1
  60. package/build/dataviews/actions/duplicate-pattern.js +48 -0
  61. package/build/dataviews/actions/duplicate-pattern.js.map +1 -0
  62. package/build/dataviews/actions/duplicate-post.js +146 -0
  63. package/build/dataviews/actions/duplicate-post.js.map +1 -0
  64. package/build/dataviews/actions/duplicate-post.native.js +9 -0
  65. package/build/dataviews/actions/duplicate-post.native.js.map +1 -0
  66. package/build/dataviews/actions/duplicate-template-part.js +67 -0
  67. package/build/dataviews/actions/duplicate-template-part.js.map +1 -0
  68. package/build/dataviews/actions/export-pattern.native.js +9 -0
  69. package/build/dataviews/actions/export-pattern.native.js.map +1 -0
  70. package/build/dataviews/actions/permanently-delete-post.js +107 -0
  71. package/build/dataviews/actions/permanently-delete-post.js.map +1 -0
  72. package/build/dataviews/actions/rename-post.js +125 -0
  73. package/build/dataviews/actions/rename-post.js.map +1 -0
  74. package/build/dataviews/actions/reorder-page.js +116 -0
  75. package/build/dataviews/actions/reorder-page.js.map +1 -0
  76. package/build/dataviews/actions/reorder-page.native.js +9 -0
  77. package/build/dataviews/actions/reorder-page.native.js.map +1 -0
  78. package/build/dataviews/actions/reset-post.js +1 -1
  79. package/build/dataviews/actions/reset-post.js.map +1 -1
  80. package/build/dataviews/actions/restore-post.js +112 -0
  81. package/build/dataviews/actions/restore-post.js.map +1 -0
  82. package/build/dataviews/actions/trash-post.js +142 -0
  83. package/build/dataviews/actions/trash-post.js.map +1 -0
  84. package/build/dataviews/actions/utils.js +9 -1
  85. package/build/dataviews/actions/utils.js.map +1 -1
  86. package/build/dataviews/actions/view-post-revisions.js +49 -0
  87. package/build/dataviews/actions/view-post-revisions.js.map +1 -0
  88. package/build/dataviews/actions/view-post.js +36 -0
  89. package/build/dataviews/actions/view-post.js.map +1 -0
  90. package/build/dataviews/fields/index.js +32 -0
  91. package/build/dataviews/fields/index.js.map +1 -0
  92. package/build/dataviews/store/private-actions.js +59 -0
  93. package/build/dataviews/store/private-actions.js.map +1 -1
  94. package/build/dataviews/store/private-selectors.js +10 -10
  95. package/build/dataviews/store/private-selectors.js.map +1 -1
  96. package/build/dataviews/store/reducer.js +15 -1
  97. package/build/dataviews/store/reducer.js.map +1 -1
  98. package/build/dataviews/types.js.map +1 -1
  99. package/build/private-apis.js +2 -2
  100. package/build/private-apis.js.map +1 -1
  101. package/build/store/actions.js +16 -2
  102. package/build/store/actions.js.map +1 -1
  103. package/build/store/private-actions.js +9 -2
  104. package/build/store/private-actions.js.map +1 -1
  105. package/build/store/private-selectors.js +33 -2
  106. package/build/store/private-selectors.js.map +1 -1
  107. package/build/store/utils/is-template-revertable.js +1 -1
  108. package/build/store/utils/is-template-revertable.js.map +1 -1
  109. package/build-module/bindings/post-meta.js +12 -0
  110. package/build-module/bindings/post-meta.js.map +1 -1
  111. package/build-module/components/blog-title/index.js +1 -1
  112. package/build-module/components/blog-title/index.js.map +1 -1
  113. package/build-module/components/commands/index.js +8 -2
  114. package/build-module/components/commands/index.js.map +1 -1
  115. package/build-module/components/create-template-part-modal/index.js +1 -0
  116. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  117. package/build-module/components/document-bar/index.js +1 -1
  118. package/build-module/components/document-bar/index.js.map +1 -1
  119. package/build-module/components/global-styles-provider/index.js +17 -4
  120. package/build-module/components/global-styles-provider/index.js.map +1 -1
  121. package/build-module/components/header/index.js +2 -3
  122. package/build-module/components/header/index.js.map +1 -1
  123. package/build-module/components/inserter-sidebar/index.js +5 -2
  124. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  125. package/build-module/components/page-attributes/parent.js +12 -7
  126. package/build-module/components/page-attributes/parent.js.map +1 -1
  127. package/build-module/components/post-actions/actions.js +12 -814
  128. package/build-module/components/post-actions/actions.js.map +1 -1
  129. package/build-module/components/post-actions/index.js +20 -19
  130. package/build-module/components/post-actions/index.js.map +1 -1
  131. package/build-module/components/post-author/hook.js +10 -3
  132. package/build-module/components/post-author/hook.js.map +1 -1
  133. package/build-module/components/post-author/panel.js +2 -1
  134. package/build-module/components/post-author/panel.js.map +1 -1
  135. package/build-module/components/post-card-panel/index.js +21 -21
  136. package/build-module/components/post-card-panel/index.js.map +1 -1
  137. package/build-module/components/post-comments/index.js +7 -23
  138. package/build-module/components/post-comments/index.js.map +1 -1
  139. package/build-module/components/post-featured-image/index.js +2 -0
  140. package/build-module/components/post-featured-image/index.js.map +1 -1
  141. package/build-module/components/post-publish-panel/postpublish.js +4 -0
  142. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  143. package/build-module/components/post-slug/index.js +1 -0
  144. package/build-module/components/post-slug/index.js.map +1 -1
  145. package/build-module/components/post-status/index.js +19 -43
  146. package/build-module/components/post-status/index.js.map +1 -1
  147. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +3 -2
  148. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  149. package/build-module/components/post-template/create-new-template-modal.js +3 -0
  150. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  151. package/build-module/components/post-url/index.js +7 -6
  152. package/build-module/components/post-url/index.js.map +1 -1
  153. package/build-module/components/post-url/panel.js +4 -5
  154. package/build-module/components/post-url/panel.js.map +1 -1
  155. package/build-module/components/preview-dropdown/index.js +84 -19
  156. package/build-module/components/preview-dropdown/index.js.map +1 -1
  157. package/build-module/components/provider/disable-non-page-content-blocks.js +15 -19
  158. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  159. package/build-module/components/sidebar/post-summary.js +10 -7
  160. package/build-module/components/sidebar/post-summary.js.map +1 -1
  161. package/build-module/components/site-discussion/index.js +7 -21
  162. package/build-module/components/site-discussion/index.js.map +1 -1
  163. package/build-module/components/template-content-panel/index.js +16 -14
  164. package/build-module/components/template-content-panel/index.js.map +1 -1
  165. package/build-module/components/visual-editor/index.js +2 -1
  166. package/build-module/components/visual-editor/index.js.map +1 -1
  167. package/build-module/dataviews/actions/duplicate-pattern.js +39 -0
  168. package/build-module/dataviews/actions/duplicate-pattern.js.map +1 -0
  169. package/build-module/dataviews/actions/duplicate-post.js +139 -0
  170. package/build-module/dataviews/actions/duplicate-post.js.map +1 -0
  171. package/build-module/dataviews/actions/duplicate-post.native.js +3 -0
  172. package/build-module/dataviews/actions/duplicate-post.native.js.map +1 -0
  173. package/build-module/dataviews/actions/duplicate-template-part.js +58 -0
  174. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -0
  175. package/build-module/dataviews/actions/export-pattern.native.js +3 -0
  176. package/build-module/dataviews/actions/export-pattern.native.js.map +1 -0
  177. package/build-module/dataviews/actions/permanently-delete-post.js +99 -0
  178. package/build-module/dataviews/actions/permanently-delete-post.js.map +1 -0
  179. package/build-module/dataviews/actions/rename-post.js +118 -0
  180. package/build-module/dataviews/actions/rename-post.js.map +1 -0
  181. package/build-module/dataviews/actions/reorder-page.js +111 -0
  182. package/build-module/dataviews/actions/reorder-page.js.map +1 -0
  183. package/build-module/dataviews/actions/reorder-page.native.js +3 -0
  184. package/build-module/dataviews/actions/reorder-page.native.js.map +1 -0
  185. package/build-module/dataviews/actions/reset-post.js +1 -1
  186. package/build-module/dataviews/actions/reset-post.js.map +1 -1
  187. package/build-module/dataviews/actions/restore-post.js +104 -0
  188. package/build-module/dataviews/actions/restore-post.js.map +1 -0
  189. package/build-module/dataviews/actions/trash-post.js +135 -0
  190. package/build-module/dataviews/actions/trash-post.js.map +1 -0
  191. package/build-module/dataviews/actions/utils.js +7 -1
  192. package/build-module/dataviews/actions/utils.js.map +1 -1
  193. package/build-module/dataviews/actions/view-post-revisions.js +43 -0
  194. package/build-module/dataviews/actions/view-post-revisions.js.map +1 -0
  195. package/build-module/dataviews/actions/view-post.js +30 -0
  196. package/build-module/dataviews/actions/view-post.js.map +1 -0
  197. package/build-module/dataviews/fields/index.js +26 -0
  198. package/build-module/dataviews/fields/index.js.map +1 -0
  199. package/build-module/dataviews/store/private-actions.js +54 -0
  200. package/build-module/dataviews/store/private-actions.js.map +1 -1
  201. package/build-module/dataviews/store/private-selectors.js +8 -9
  202. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  203. package/build-module/dataviews/store/reducer.js +15 -1
  204. package/build-module/dataviews/store/reducer.js.map +1 -1
  205. package/build-module/dataviews/types.js.map +1 -1
  206. package/build-module/private-apis.js +2 -2
  207. package/build-module/private-apis.js.map +1 -1
  208. package/build-module/store/actions.js +16 -2
  209. package/build-module/store/actions.js.map +1 -1
  210. package/build-module/store/private-actions.js +9 -2
  211. package/build-module/store/private-actions.js.map +1 -1
  212. package/build-module/store/private-selectors.js +32 -2
  213. package/build-module/store/private-selectors.js.map +1 -1
  214. package/build-module/store/utils/is-template-revertable.js +1 -1
  215. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  216. package/build-style/style-rtl.css +21 -34
  217. package/build-style/style.css +21 -34
  218. package/build-types/bindings/post-meta.d.ts +6 -0
  219. package/build-types/bindings/post-meta.d.ts.map +1 -1
  220. package/build-types/components/commands/index.d.ts.map +1 -1
  221. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  222. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  223. package/build-types/components/header/index.d.ts.map +1 -1
  224. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  225. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  226. package/build-types/components/post-actions/actions.d.ts +1 -26
  227. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  228. package/build-types/components/post-actions/index.d.ts +3 -2
  229. package/build-types/components/post-actions/index.d.ts.map +1 -1
  230. package/build-types/components/post-author/hook.d.ts +1 -1
  231. package/build-types/components/post-author/hook.d.ts.map +1 -1
  232. package/build-types/components/post-author/panel.d.ts.map +1 -1
  233. package/build-types/components/post-card-panel/index.d.ts +4 -2
  234. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  235. package/build-types/components/post-comments/index.d.ts.map +1 -1
  236. package/build-types/components/post-slug/index.d.ts.map +1 -1
  237. package/build-types/components/post-status/index.d.ts +2 -1
  238. package/build-types/components/post-status/index.d.ts.map +1 -1
  239. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +1 -17
  240. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  241. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
  242. package/build-types/components/post-url/index.d.ts.map +1 -1
  243. package/build-types/components/post-url/panel.d.ts.map +1 -1
  244. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  245. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
  246. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  247. package/build-types/components/site-discussion/index.d.ts.map +1 -1
  248. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  249. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  250. package/build-types/dataviews/actions/duplicate-pattern.d.ts +5 -0
  251. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +1 -0
  252. package/build-types/dataviews/actions/duplicate-post.d.ts +5 -0
  253. package/build-types/dataviews/actions/duplicate-post.d.ts.map +1 -0
  254. package/build-types/dataviews/actions/duplicate-post.native.d.ts +3 -0
  255. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +1 -0
  256. package/build-types/dataviews/actions/duplicate-template-part.d.ts +5 -0
  257. package/build-types/dataviews/actions/duplicate-template-part.d.ts.map +1 -0
  258. package/build-types/dataviews/actions/export-pattern.native.d.ts +3 -0
  259. package/build-types/dataviews/actions/export-pattern.native.d.ts.map +1 -0
  260. package/build-types/dataviews/actions/permanently-delete-post.d.ts +5 -0
  261. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +1 -0
  262. package/build-types/dataviews/actions/rename-post.d.ts +5 -0
  263. package/build-types/dataviews/actions/rename-post.d.ts.map +1 -0
  264. package/build-types/dataviews/actions/reorder-page.d.ts +8 -0
  265. package/build-types/dataviews/actions/reorder-page.d.ts.map +1 -0
  266. package/build-types/dataviews/actions/reorder-page.native.d.ts +3 -0
  267. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +1 -0
  268. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
  269. package/build-types/dataviews/actions/restore-post.d.ts +5 -0
  270. package/build-types/dataviews/actions/restore-post.d.ts.map +1 -0
  271. package/build-types/dataviews/actions/trash-post.d.ts +5 -0
  272. package/build-types/dataviews/actions/trash-post.d.ts.map +1 -0
  273. package/build-types/dataviews/actions/utils.d.ts +5 -3
  274. package/build-types/dataviews/actions/utils.d.ts.map +1 -1
  275. package/build-types/dataviews/actions/view-post-revisions.d.ts +8 -0
  276. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +1 -0
  277. package/build-types/dataviews/actions/view-post.d.ts +8 -0
  278. package/build-types/dataviews/actions/view-post.d.ts.map +1 -0
  279. package/build-types/dataviews/fields/index.d.ts +8 -0
  280. package/build-types/dataviews/fields/index.d.ts.map +1 -0
  281. package/build-types/dataviews/store/private-actions.d.ts +8 -3
  282. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  283. package/build-types/dataviews/store/private-selectors.d.ts +2 -1
  284. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  285. package/build-types/dataviews/store/reducer.d.ts +4 -1
  286. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  287. package/build-types/dataviews/types.d.ts +66 -8
  288. package/build-types/dataviews/types.d.ts.map +1 -1
  289. package/build-types/store/actions.d.ts.map +1 -1
  290. package/build-types/store/private-actions.d.ts.map +1 -1
  291. package/build-types/store/private-selectors.d.ts +11 -0
  292. package/build-types/store/private-selectors.d.ts.map +1 -1
  293. package/build-types/store/reducer.d.ts +1 -0
  294. package/build-types/store/reducer.d.ts.map +1 -1
  295. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -1
  296. package/package.json +36 -36
  297. package/src/bindings/post-meta.js +20 -0
  298. package/src/components/block-manager/style.scss +2 -2
  299. package/src/components/blog-title/index.js +1 -1
  300. package/src/components/commands/index.js +4 -2
  301. package/src/components/create-template-part-modal/index.js +1 -0
  302. package/src/components/document-bar/index.js +1 -1
  303. package/src/components/document-bar/style.scss +1 -1
  304. package/src/components/editor-interface/style.scss +5 -0
  305. package/src/components/error-boundary/style.native.scss +1 -1
  306. package/src/components/error-boundary/style.scss +1 -1
  307. package/src/components/global-styles-provider/index.js +16 -3
  308. package/src/components/header/index.js +1 -2
  309. package/src/components/inserter-sidebar/index.js +10 -4
  310. package/src/components/list-view-sidebar/style.scss +4 -0
  311. package/src/components/page-attributes/parent.js +38 -16
  312. package/src/components/post-actions/actions.js +10 -1044
  313. package/src/components/post-actions/index.js +25 -17
  314. package/src/components/post-author/hook.js +11 -3
  315. package/src/components/post-author/panel.js +3 -1
  316. package/src/components/post-card-panel/index.js +29 -28
  317. package/src/components/post-comments/index.js +7 -20
  318. package/src/components/post-discussion/style.scss +0 -9
  319. package/src/components/post-featured-image/index.js +2 -0
  320. package/src/components/post-format/style.scss +0 -6
  321. package/src/components/post-publish-panel/postpublish.js +8 -2
  322. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +10 -10
  323. package/src/components/post-slug/index.js +1 -0
  324. package/src/components/post-status/index.js +11 -41
  325. package/src/components/post-status/style.scss +0 -19
  326. package/src/components/post-taxonomies/hierarchical-term-selector.js +3 -1
  327. package/src/components/post-template/create-new-template-modal.js +7 -1
  328. package/src/components/post-url/index.js +15 -9
  329. package/src/components/post-url/panel.js +8 -2
  330. package/src/components/preview-dropdown/index.js +113 -35
  331. package/src/components/preview-dropdown/style.scss +5 -0
  332. package/src/components/provider/disable-non-page-content-blocks.js +27 -24
  333. package/src/components/save-publish-panels/style.scss +3 -3
  334. package/src/components/sidebar/post-summary.js +20 -16
  335. package/src/components/site-discussion/index.js +7 -19
  336. package/src/components/site-discussion/style.scss +0 -14
  337. package/src/components/template-content-panel/index.js +40 -22
  338. package/src/components/visual-editor/index.js +8 -6
  339. package/src/components/visual-editor/style.scss +1 -3
  340. package/src/dataviews/actions/duplicate-pattern.tsx +40 -0
  341. package/src/dataviews/actions/duplicate-post.native.tsx +3 -0
  342. package/src/dataviews/actions/duplicate-post.tsx +174 -0
  343. package/src/dataviews/actions/duplicate-template-part.tsx +70 -0
  344. package/src/dataviews/actions/export-pattern.native.tsx +3 -0
  345. package/src/dataviews/actions/permanently-delete-post.tsx +116 -0
  346. package/src/dataviews/actions/rename-post.tsx +146 -0
  347. package/src/dataviews/actions/reorder-page.native.tsx +3 -0
  348. package/src/dataviews/actions/reorder-page.tsx +125 -0
  349. package/src/dataviews/actions/reset-post.tsx +2 -1
  350. package/src/dataviews/actions/restore-post.tsx +134 -0
  351. package/src/dataviews/actions/trash-post.tsx +196 -0
  352. package/src/dataviews/actions/utils.ts +14 -4
  353. package/src/dataviews/actions/view-post-revisions.tsx +47 -0
  354. package/src/dataviews/actions/view-post.tsx +30 -0
  355. package/src/dataviews/fields/index.ts +26 -0
  356. package/src/dataviews/store/private-actions.ts +109 -0
  357. package/src/dataviews/store/private-selectors.ts +9 -17
  358. package/src/dataviews/store/reducer.ts +20 -1
  359. package/src/dataviews/types.ts +58 -6
  360. package/src/private-apis.js +2 -2
  361. package/src/store/actions.js +36 -13
  362. package/src/store/private-actions.js +9 -5
  363. package/src/store/private-selectors.js +45 -2
  364. package/src/store/test/private-selectors.js +78 -0
  365. package/src/store/utils/is-template-revertable.js +2 -1
  366. package/tsconfig.tsbuildinfo +1 -1
  367. package/build/dataviews/actions/index.js +0 -32
  368. package/build/dataviews/actions/index.js.map +0 -1
  369. package/build-module/dataviews/actions/index.js +0 -24
  370. package/build-module/dataviews/actions/index.js.map +0 -1
  371. package/build-types/dataviews/actions/index.d.ts +0 -2
  372. package/build-types/dataviews/actions/index.d.ts.map +0 -1
  373. package/src/components/document-outline/test/__snapshots__/index.js.snap +0 -111
  374. package/src/components/document-outline/test/index.js +0 -185
  375. package/src/dataviews/actions/index.ts +0 -25
@@ -17,7 +17,6 @@ import { store as coreStore } from '@wordpress/core-data';
17
17
  */
18
18
  import { unlock } from '../../lock-unlock';
19
19
  import { usePostActions } from './actions';
20
- import { store as editorStore } from '../../store';
21
20
 
22
21
  const {
23
22
  DropdownMenuV2: DropdownMenu,
@@ -27,28 +26,38 @@ const {
27
26
  kebabCase,
28
27
  } = unlock( componentsPrivateApis );
29
28
 
30
- export default function PostActions( { onActionPerformed, buttonProps } ) {
29
+ export default function PostActions( { postType, postId, onActionPerformed } ) {
31
30
  const [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );
32
- const { item, postType } = useSelect( ( select ) => {
33
- const { getCurrentPostType, getCurrentPostId } = select( editorStore );
34
- const { getEditedEntityRecord } = select( coreStore );
35
- const _postType = getCurrentPostType();
31
+ const { item, permissions } = useSelect(
32
+ ( select ) => {
33
+ const { getEditedEntityRecord, getEntityRecordPermissions } =
34
+ unlock( select( coreStore ) );
35
+ return {
36
+ item: getEditedEntityRecord( 'postType', postType, postId ),
37
+ permissions: getEntityRecordPermissions(
38
+ 'postType',
39
+ postType,
40
+ postId
41
+ ),
42
+ };
43
+ },
44
+ [ postId, postType ]
45
+ );
46
+ const itemWithPermissions = useMemo( () => {
36
47
  return {
37
- item: getEditedEntityRecord(
38
- 'postType',
39
- _postType,
40
- getCurrentPostId()
41
- ),
42
- postType: _postType,
48
+ ...item,
49
+ permissions,
43
50
  };
44
- }, [] );
51
+ }, [ item, permissions ] );
45
52
  const allActions = usePostActions( { postType, onActionPerformed } );
46
53
 
47
54
  const actions = useMemo( () => {
48
55
  return allActions.filter( ( action ) => {
49
- return ! action.isEligible || action.isEligible( item );
56
+ return (
57
+ ! action.isEligible || action.isEligible( itemWithPermissions )
58
+ );
50
59
  } );
51
- }, [ allActions, item ] );
60
+ }, [ allActions, itemWithPermissions ] );
52
61
 
53
62
  return (
54
63
  <DropdownMenu
@@ -64,7 +73,6 @@ export default function PostActions( { onActionPerformed, buttonProps } ) {
64
73
  onClick={ () =>
65
74
  setIsActionsMenuOpen( ! isActionsMenuOpen )
66
75
  }
67
- { ...buttonProps }
68
76
  />
69
77
  }
70
78
  onOpenChange={ setIsActionsMenuOpen }
@@ -72,7 +80,7 @@ export default function PostActions( { onActionPerformed, buttonProps } ) {
72
80
  >
73
81
  <ActionsDropdownMenuGroup
74
82
  actions={ actions }
75
- item={ item }
83
+ item={ itemWithPermissions }
76
84
  onClose={ () => {
77
85
  setIsActionsMenuOpen( false );
78
86
  } }
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
+ import { __ } from '@wordpress/i18n';
4
5
  import { useMemo } from '@wordpress/element';
5
6
  import { useSelect } from '@wordpress/data';
6
7
  import { decodeEntities } from '@wordpress/html-entities';
@@ -46,17 +47,24 @@ export function useAuthorsQuery( search ) {
46
47
  ( { value } ) => postAuthor?.id === value
47
48
  );
48
49
 
50
+ let currentAuthor = [];
49
51
  if ( foundAuthor < 0 && postAuthor ) {
50
- return [
52
+ currentAuthor = [
51
53
  {
52
54
  value: postAuthor.id,
53
55
  label: decodeEntities( postAuthor.name ),
54
56
  },
55
- ...fetchedAuthors,
57
+ ];
58
+ } else if ( foundAuthor < 0 && ! postAuthor ) {
59
+ currentAuthor = [
60
+ {
61
+ value: 0,
62
+ label: __( '(No author)' ),
63
+ },
56
64
  ];
57
65
  }
58
66
 
59
- return fetchedAuthors;
67
+ return [ ...currentAuthor, ...fetchedAuthors ];
60
68
  }, [ authors, postAuthor ] );
61
69
 
62
70
  return { authorId, authorOptions, postAuthor };
@@ -4,6 +4,7 @@
4
4
  import { __, sprintf } from '@wordpress/i18n';
5
5
  import { Button, Dropdown } from '@wordpress/components';
6
6
  import { useState, useMemo } from '@wordpress/element';
7
+ import { decodeEntities } from '@wordpress/html-entities';
7
8
  import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
8
9
 
9
10
  /**
@@ -16,7 +17,8 @@ import { useAuthorsQuery } from './hook';
16
17
 
17
18
  function PostAuthorToggle( { isOpen, onClick } ) {
18
19
  const { postAuthor } = useAuthorsQuery();
19
- const authorName = postAuthor?.name || '';
20
+ const authorName =
21
+ decodeEntities( postAuthor?.name ) || __( '(No author)' );
20
22
  return (
21
23
  <Button
22
24
  size="compact"
@@ -26,59 +26,56 @@ import {
26
26
  GLOBAL_POST_TYPES,
27
27
  } from '../../store/constants';
28
28
  import { unlock } from '../../lock-unlock';
29
+ import PostActions from '../post-actions';
29
30
 
30
- export default function PostCardPanel( { actions } ) {
31
+ export default function PostCardPanel( {
32
+ postType,
33
+ postId,
34
+ onActionPerformed,
35
+ } ) {
31
36
  const { isFrontPage, isPostsPage, title, icon, isSync } = useSelect(
32
37
  ( select ) => {
33
- const {
34
- getEditedPostAttribute,
35
- getCurrentPostType,
36
- getCurrentPostId,
37
- __experimentalGetTemplateInfo,
38
- } = select( editorStore );
39
- const { canUser } = select( coreStore );
40
- const { getEditedEntityRecord } = select( coreStore );
38
+ const { __experimentalGetTemplateInfo } = select( editorStore );
39
+ const { canUser, getEditedEntityRecord } = select( coreStore );
41
40
  const siteSettings = canUser( 'read', {
42
41
  kind: 'root',
43
42
  name: 'site',
44
43
  } )
45
44
  ? getEditedEntityRecord( 'root', 'site' )
46
45
  : undefined;
47
- const _type = getCurrentPostType();
48
- const _id = getCurrentPostId();
49
- const _record = getEditedEntityRecord( 'postType', _type, _id );
46
+ const _record = getEditedEntityRecord(
47
+ 'postType',
48
+ postType,
49
+ postId
50
+ );
50
51
  const _templateInfo =
51
52
  [ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(
52
- _type
53
+ postType
53
54
  ) && __experimentalGetTemplateInfo( _record );
54
55
  let _isSync = false;
55
- if ( GLOBAL_POST_TYPES.includes( _type ) ) {
56
- if ( PATTERN_POST_TYPE === _type ) {
56
+ if ( GLOBAL_POST_TYPES.includes( postType ) ) {
57
+ if ( PATTERN_POST_TYPE === postType ) {
57
58
  // When the post is first created, the top level wp_pattern_sync_status is not set so get meta value instead.
58
59
  const currentSyncStatus =
59
- getEditedPostAttribute( 'meta' )
60
- ?.wp_pattern_sync_status === 'unsynced'
60
+ _record?.meta?.wp_pattern_sync_status === 'unsynced'
61
61
  ? 'unsynced'
62
- : getEditedPostAttribute(
63
- 'wp_pattern_sync_status'
64
- );
62
+ : _record?.wp_pattern_sync_status;
65
63
  _isSync = currentSyncStatus !== 'unsynced';
66
64
  } else {
67
65
  _isSync = true;
68
66
  }
69
67
  }
70
68
  return {
71
- title:
72
- _templateInfo?.title || getEditedPostAttribute( 'title' ),
73
- icon: unlock( select( editorStore ) ).getPostIcon( _type, {
69
+ title: _templateInfo?.title || _record?.title,
70
+ icon: unlock( select( editorStore ) ).getPostIcon( postType, {
74
71
  area: _record?.area,
75
72
  } ),
76
73
  isSync: _isSync,
77
- isFrontPage: siteSettings?.page_on_front === _id,
78
- isPostsPage: siteSettings?.page_for_posts === _id,
74
+ isFrontPage: siteSettings?.page_on_front === postId,
75
+ isPostsPage: siteSettings?.page_for_posts === postId,
79
76
  };
80
77
  },
81
- []
78
+ [ postId, postType ]
82
79
  );
83
80
  return (
84
81
  <div className="editor-post-card-panel">
@@ -101,7 +98,7 @@ export default function PostCardPanel( { actions } ) {
101
98
  as="h2"
102
99
  lineHeight="20px"
103
100
  >
104
- { title ? decodeEntities( title ) : __( 'No Title' ) }
101
+ { title ? decodeEntities( title ) : __( 'No title' ) }
105
102
  { isFrontPage && (
106
103
  <span className="editor-post-card-panel__title-badge">
107
104
  { __( 'Homepage' ) }
@@ -113,7 +110,11 @@ export default function PostCardPanel( { actions } ) {
113
110
  </span>
114
111
  ) }
115
112
  </Text>
116
- { actions }
113
+ <PostActions
114
+ postType={ postType }
115
+ postId={ postId }
116
+ onActionPerformed={ onActionPerformed }
117
+ />
117
118
  </HStack>
118
119
  </div>
119
120
  );
@@ -4,7 +4,6 @@
4
4
  import { __, _x } from '@wordpress/i18n';
5
5
  import {
6
6
  RadioControl,
7
- __experimentalText as Text,
8
7
  __experimentalVStack as VStack,
9
8
  } from '@wordpress/components';
10
9
  import { useDispatch, useSelect } from '@wordpress/data';
@@ -16,29 +15,17 @@ import { store as editorStore } from '../../store';
16
15
 
17
16
  const COMMENT_OPTIONS = [
18
17
  {
19
- label: (
20
- <>
21
- { _x( 'Open', 'Adjective: e.g. "Comments are open"' ) }
22
- <Text variant="muted" size={ 12 }>
23
- { __( 'Visitors can add new comments and replies.' ) }
24
- </Text>
25
- </>
26
- ),
18
+ label: _x( 'Open', 'Adjective: e.g. "Comments are open"' ),
27
19
  value: 'open',
20
+ description: __( 'Visitors can add new comments and replies.' ),
28
21
  },
29
22
  {
30
- label: (
31
- <>
32
- { __( 'Closed' ) }
33
- <Text variant="muted" size={ 12 }>
34
- { __( 'Visitors cannot add new comments or replies.' ) }
35
- </Text>
36
- <Text variant="muted" size={ 12 }>
37
- { __( 'Existing comments remain visible.' ) }
38
- </Text>
39
- </>
40
- ),
23
+ label: __( 'Closed' ),
41
24
  value: 'closed',
25
+ description: [
26
+ __( 'Visitors cannot add new comments or replies.' ),
27
+ __( 'Existing comments remain visible.' ),
28
+ ].join( ' ' ),
42
29
  },
43
30
  ];
44
31
 
@@ -2,15 +2,6 @@
2
2
  // sidebar width - popover padding - form margin
3
3
  min-width: $sidebar-width - $grid-unit-20 - $grid-unit-20;
4
4
  margin: $grid-unit-10;
5
-
6
- .components-radio-control__option {
7
- align-items: flex-start;
8
- }
9
-
10
- .components-radio-control__label .components-text {
11
- display: block;
12
- margin-top: $grid-unit-05;
13
- }
14
5
  }
15
6
  .editor-post-discussion__panel-toggle {
16
7
 
@@ -180,6 +180,8 @@ function PostFeaturedImage( {
180
180
  : `editor-post-featured-image-${ featuredImageId }-describedby`
181
181
  }
182
182
  aria-haspopup="dialog"
183
+ disabled={ isLoading }
184
+ accessibleWhenDisabled
183
185
  >
184
186
  { !! featuredImageId && media && (
185
187
  <img
@@ -7,9 +7,3 @@
7
7
  min-width: $sidebar-width - $grid-unit-20 - $grid-unit-20;
8
8
  margin: $grid-unit-10;
9
9
  }
10
-
11
- .editor-post-format__options {
12
- .components-base-control__field > .components-v-stack {
13
- gap: $grid-unit-15;
14
- }
15
- }
@@ -44,7 +44,7 @@ const getFuturePostUrl = ( post ) => {
44
44
  function CopyButton( { text, onCopy, children } ) {
45
45
  const ref = useCopyToClipboard( text, onCopy );
46
46
  return (
47
- <Button variant="secondary" ref={ ref }>
47
+ <Button __next40pxDefaultSize variant="secondary" ref={ ref }>
48
48
  { children }
49
49
  </Button>
50
50
  );
@@ -122,6 +122,7 @@ class PostPublishPanelPostpublish extends Component {
122
122
  </p>
123
123
  <div className="post-publish-panel__postpublish-post-address-container">
124
124
  <TextControl
125
+ __next40pxDefaultSize
125
126
  __nextHasNoMarginBottom
126
127
  className="post-publish-panel__postpublish-post-address"
127
128
  readOnly
@@ -145,12 +146,17 @@ class PostPublishPanelPostpublish extends Component {
145
146
 
146
147
  <div className="post-publish-panel__postpublish-buttons">
147
148
  { ! isScheduled && (
148
- <Button variant="primary" href={ link }>
149
+ <Button
150
+ variant="primary"
151
+ href={ link }
152
+ __next40pxDefaultSize
153
+ >
149
154
  { viewPostLabel }
150
155
  </Button>
151
156
  ) }
152
157
  <Button
153
158
  variant={ isScheduled ? 'primary' : 'secondary' }
159
+ __next40pxDefaultSize
154
160
  href={ addLink }
155
161
  >
156
162
  { addNewPostLabel }
@@ -22,7 +22,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
22
22
  font-weight: 500;
23
23
  line-height: 1.4;
24
24
  text-transform: uppercase;
25
- display: inline-block;
25
+ display: block;
26
26
  margin-bottom: calc(4px * 2);
27
27
  padding: 0;
28
28
  }
@@ -120,7 +120,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
120
120
  post address
121
121
  </label>
122
122
  <input
123
- class="components-text-control__input"
123
+ class="components-text-control__input is-next-40px-default-size"
124
124
  id="inspector-text-control-0"
125
125
  readonly=""
126
126
  type="text"
@@ -132,7 +132,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
132
132
  class="post-publish-panel__postpublish-post-address__copy-button-wrap"
133
133
  >
134
134
  <button
135
- class="components-button is-secondary"
135
+ class="components-button is-next-40px-default-size is-secondary"
136
136
  type="button"
137
137
  >
138
138
  Copy
@@ -143,11 +143,11 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
143
143
  class="post-publish-panel__postpublish-buttons"
144
144
  >
145
145
  <a
146
- class="components-button is-primary"
146
+ class="components-button is-next-40px-default-size is-primary"
147
147
  href="https://wordpress.local/sample-page/"
148
148
  />
149
149
  <a
150
- class="components-button is-secondary"
150
+ class="components-button is-next-40px-default-size is-secondary"
151
151
  href="post-new.php?"
152
152
  />
153
153
  </div>
@@ -214,7 +214,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
214
214
  font-weight: 500;
215
215
  line-height: 1.4;
216
216
  text-transform: uppercase;
217
- display: inline-block;
217
+ display: block;
218
218
  margin-bottom: calc(4px * 2);
219
219
  padding: 0;
220
220
  }
@@ -312,7 +312,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
312
312
  post address
313
313
  </label>
314
314
  <input
315
- class="components-text-control__input"
315
+ class="components-text-control__input is-next-40px-default-size"
316
316
  id="inspector-text-control-1"
317
317
  readonly=""
318
318
  type="text"
@@ -324,7 +324,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
324
324
  class="post-publish-panel__postpublish-post-address__copy-button-wrap"
325
325
  >
326
326
  <button
327
- class="components-button is-secondary"
327
+ class="components-button is-next-40px-default-size is-secondary"
328
328
  type="button"
329
329
  >
330
330
  Copy
@@ -335,11 +335,11 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
335
335
  class="post-publish-panel__postpublish-buttons"
336
336
  >
337
337
  <a
338
- class="components-button is-primary"
338
+ class="components-button is-next-40px-default-size is-primary"
339
339
  href="https://wordpress.local/sample-page/"
340
340
  />
341
341
  <a
342
- class="components-button is-secondary"
342
+ class="components-button is-next-40px-default-size is-secondary"
343
343
  href="post-new.php?"
344
344
  />
345
345
  </div>
@@ -24,6 +24,7 @@ function PostSlugControl() {
24
24
 
25
25
  return (
26
26
  <TextControl
27
+ __next40pxDefaultSize
27
28
  __nextHasNoMarginBottom
28
29
  label={ __( 'Slug' ) }
29
30
  autoComplete="off"
@@ -5,7 +5,6 @@ import {
5
5
  Button,
6
6
  CheckboxControl,
7
7
  Dropdown,
8
- __experimentalText as Text,
9
8
  __experimentalVStack as VStack,
10
9
  TextControl,
11
10
  RadioControl,
@@ -49,59 +48,29 @@ const postStatusesInfo = {
49
48
 
50
49
  export const STATUS_OPTIONS = [
51
50
  {
52
- label: (
53
- <>
54
- { __( 'Draft' ) }
55
- <Text variant="muted" size={ 12 }>
56
- { __( 'Not ready to publish.' ) }
57
- </Text>
58
- </>
59
- ),
51
+ label: __( 'Draft' ),
60
52
  value: 'draft',
53
+ description: __( 'Not ready to publish.' ),
61
54
  },
62
55
  {
63
- label: (
64
- <>
65
- { __( 'Pending' ) }
66
- <Text variant="muted" size={ 12 }>
67
- { __( 'Waiting for review before publishing.' ) }
68
- </Text>
69
- </>
70
- ),
56
+ label: __( 'Pending' ),
71
57
  value: 'pending',
58
+ description: __( 'Waiting for review before publishing.' ),
72
59
  },
73
60
  {
74
- label: (
75
- <>
76
- { __( 'Private' ) }
77
- <Text variant="muted" size={ 12 }>
78
- { __( 'Only visible to site admins and editors.' ) }
79
- </Text>
80
- </>
81
- ),
61
+ label: __( 'Private' ),
82
62
  value: 'private',
63
+ description: __( 'Only visible to site admins and editors.' ),
83
64
  },
84
65
  {
85
- label: (
86
- <>
87
- { __( 'Scheduled' ) }
88
- <Text variant="muted" size={ 12 }>
89
- { __( 'Publish automatically on a chosen date.' ) }
90
- </Text>
91
- </>
92
- ),
66
+ label: __( 'Scheduled' ),
93
67
  value: 'future',
68
+ description: __( 'Publish automatically on a chosen date.' ),
94
69
  },
95
70
  {
96
- label: (
97
- <>
98
- { __( 'Published' ) }
99
- <Text variant="muted" size={ 12 }>
100
- { __( 'Visible to everyone.' ) }
101
- </Text>
102
- </>
103
- ),
71
+ label: __( 'Published' ),
104
72
  value: 'publish',
73
+ description: __( 'Visible to everyone.' ),
105
74
  },
106
75
  ];
107
76
 
@@ -285,6 +254,7 @@ export default function PostStatus() {
285
254
  id={ passwordInputId }
286
255
  __next40pxDefaultSize
287
256
  __nextHasNoMarginBottom
257
+ maxLength={ 255 }
288
258
  />
289
259
  </div>
290
260
  ) }
@@ -18,25 +18,6 @@
18
18
  padding: $grid-unit-20;
19
19
  }
20
20
 
21
- .editor-change-status__options {
22
- .components-base-control__field > .components-v-stack {
23
- gap: $grid-unit-15;
24
- }
25
-
26
- // TODO: it's not great to override component styles.. This might be resolved
27
- // by the new radio control component.
28
- .components-radio-control__option {
29
- align-items: flex-start;
30
- }
31
-
32
- label {
33
- .components-text {
34
- display: block;
35
- margin-top: $grid-unit-05;
36
- }
37
- }
38
- }
39
-
40
21
  .editor-change-status__password-legend {
41
22
  padding: 0;
42
23
  margin-bottom: $grid-unit-10;
@@ -12,6 +12,7 @@ import {
12
12
  withFilters,
13
13
  Flex,
14
14
  FlexItem,
15
+ SearchControl,
15
16
  } from '@wordpress/components';
16
17
  import { useDispatch, useSelect } from '@wordpress/data';
17
18
  import { useDebounce } from '@wordpress/compose';
@@ -406,7 +407,8 @@ export function HierarchicalTermSelector( { slug } ) {
406
407
  return (
407
408
  <Flex direction="column" gap="4">
408
409
  { showFilter && (
409
- <TextControl
410
+ <SearchControl
411
+ __next40pxDefaultSize
410
412
  __nextHasNoMarginBottom
411
413
  label={ filterLabel }
412
414
  value={ filterValue }
@@ -118,6 +118,7 @@ export default function CreateNewTemplateModal( { onClose } ) {
118
118
  >
119
119
  <VStack spacing="3">
120
120
  <TextControl
121
+ __next40pxDefaultSize
121
122
  __nextHasNoMarginBottom
122
123
  label={ __( 'Name' ) }
123
124
  value={ title }
@@ -129,11 +130,16 @@ export default function CreateNewTemplateModal( { onClose } ) {
129
130
  ) }
130
131
  />
131
132
  <HStack justify="right">
132
- <Button variant="tertiary" onClick={ cancel }>
133
+ <Button
134
+ __next40pxDefaultSize
135
+ variant="tertiary"
136
+ onClick={ cancel }
137
+ >
133
138
  { __( 'Cancel' ) }
134
139
  </Button>
135
140
 
136
141
  <Button
142
+ __next40pxDefaultSize
137
143
  variant="primary"
138
144
  type="submit"
139
145
  isBusy={ isBusy }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { useSelect, useDispatch } from '@wordpress/data';
5
5
  import { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';
6
- import { useState } from '@wordpress/element';
6
+ import { useState, createInterpolateElement } from '@wordpress/element';
7
7
  import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
8
8
  import { __ } from '@wordpress/i18n';
9
9
  import {
@@ -83,14 +83,20 @@ export default function PostURL( { onClose } ) {
83
83
  <VStack spacing={ 3 }>
84
84
  { isEditable && (
85
85
  <div>
86
- { __( 'Customize the last part of the URL. ' ) }
87
- <ExternalLink
88
- href={ __(
89
- 'https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink'
90
- ) }
91
- >
92
- { __( 'Learn more.' ) }
93
- </ExternalLink>
86
+ { createInterpolateElement(
87
+ __(
88
+ 'Customize the last part of the URL. <a>Learn more.</a>'
89
+ ),
90
+ {
91
+ a: (
92
+ <ExternalLink
93
+ href={ __(
94
+ 'https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink'
95
+ ) }
96
+ />
97
+ ),
98
+ }
99
+ ) }
94
100
  </div>
95
101
  ) }
96
102
  <div>
@@ -3,7 +3,11 @@
3
3
  */
4
4
  import { useMemo, useState } from '@wordpress/element';
5
5
  import { useSelect } from '@wordpress/data';
6
- import { Dropdown, Button } from '@wordpress/components';
6
+ import {
7
+ Dropdown,
8
+ Button,
9
+ __experimentalTruncate as Truncate,
10
+ } from '@wordpress/components';
7
11
  import { __, sprintf } from '@wordpress/i18n';
8
12
  import { safeDecodeURIComponent } from '@wordpress/url';
9
13
  import { store as coreStore } from '@wordpress/core-data';
@@ -86,7 +90,9 @@ function PostURLToggle( { isOpen, onClick } ) {
86
90
  aria-label={ sprintf( __( 'Change link: %s' ), decodedSlug ) }
87
91
  onClick={ onClick }
88
92
  >
89
- { isFrontPage ? postLink : <>/{ decodedSlug }</> }
93
+ <Truncate numberOfLines={ 1 }>
94
+ { isFrontPage ? postLink : `/${ decodedSlug }` }
95
+ </Truncate>
90
96
  </Button>
91
97
  );
92
98
  }