@wordpress/editor 14.5.0 → 14.7.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 (415) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +37 -0
  3. package/build/bindings/post-meta.js +12 -10
  4. package/build/bindings/post-meta.js.map +1 -1
  5. package/build/components/block-manager/index.js +4 -1
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/block-settings-menu/content-only-settings-menu.js +5 -8
  8. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  9. package/build/components/create-template-part-modal/index.js +1 -0
  10. package/build/components/create-template-part-modal/index.js.map +1 -1
  11. package/build/components/document-bar/index.js +4 -4
  12. package/build/components/document-bar/index.js.map +1 -1
  13. package/build/components/editor-history/redo.js +4 -1
  14. package/build/components/editor-history/redo.js.map +1 -1
  15. package/build/components/editor-history/undo.js +4 -1
  16. package/build/components/editor-history/undo.js.map +1 -1
  17. package/build/components/editor-interface/index.js +2 -3
  18. package/build/components/editor-interface/index.js.map +1 -1
  19. package/build/components/error-boundary/index.js +4 -1
  20. package/build/components/error-boundary/index.js.map +1 -1
  21. package/build/components/global-styles-provider/index.js +17 -4
  22. package/build/components/global-styles-provider/index.js.map +1 -1
  23. package/build/components/index.js +8 -0
  24. package/build/components/index.js.map +1 -1
  25. package/build/components/inserter-sidebar/index.js +8 -7
  26. package/build/components/inserter-sidebar/index.js.map +1 -1
  27. package/build/components/local-autosave-monitor/index.js +5 -5
  28. package/build/components/local-autosave-monitor/index.js.map +1 -1
  29. package/build/components/page-attributes/parent.js +10 -6
  30. package/build/components/page-attributes/parent.js.map +1 -1
  31. package/build/components/plugin-preview-menu-item/index.js +57 -0
  32. package/build/components/plugin-preview-menu-item/index.js.map +1 -0
  33. package/build/components/post-actions/actions.js +4 -499
  34. package/build/components/post-actions/actions.js.map +1 -1
  35. package/build/components/post-actions/index.js +13 -25
  36. package/build/components/post-actions/index.js.map +1 -1
  37. package/build/components/post-card-panel/index.js +20 -20
  38. package/build/components/post-card-panel/index.js.map +1 -1
  39. package/build/components/post-excerpt/panel.js +4 -1
  40. package/build/components/post-excerpt/panel.js.map +1 -1
  41. package/build/components/post-featured-image/index.js +14 -3
  42. package/build/components/post-featured-image/index.js.map +1 -1
  43. package/build/components/post-format/index.js +4 -1
  44. package/build/components/post-format/index.js.map +1 -1
  45. package/build/components/post-last-revision/index.js +4 -1
  46. package/build/components/post-last-revision/index.js.map +1 -1
  47. package/build/components/post-locked-modal/index.js +12 -3
  48. package/build/components/post-locked-modal/index.js.map +1 -1
  49. package/build/components/post-publish-panel/index.js +4 -1
  50. package/build/components/post-publish-panel/index.js.map +1 -1
  51. package/build/components/post-publish-panel/maybe-post-format-panel.js +4 -1
  52. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  53. package/build/components/post-publish-panel/maybe-upload-media.js +14 -8
  54. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  55. package/build/components/post-publish-panel/postpublish.js +4 -0
  56. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  57. package/build/components/post-slug/index.js +1 -0
  58. package/build/components/post-slug/index.js.map +1 -1
  59. package/build/components/post-status/index.js +4 -2
  60. package/build/components/post-status/index.js.map +1 -1
  61. package/build/components/post-taxonomies/hierarchical-term-selector.js +6 -2
  62. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  63. package/build/components/post-taxonomies/most-used-terms.js +4 -1
  64. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  65. package/build/components/post-template/block-theme.js +13 -4
  66. package/build/components/post-template/block-theme.js.map +1 -1
  67. package/build/components/post-template/classic-theme.js +4 -1
  68. package/build/components/post-template/classic-theme.js.map +1 -1
  69. package/build/components/post-title/index.js +32 -46
  70. package/build/components/post-title/index.js.map +1 -1
  71. package/build/components/post-url/index.js +10 -6
  72. package/build/components/post-url/index.js.map +1 -1
  73. package/build/components/preview-dropdown/index.js +26 -14
  74. package/build/components/preview-dropdown/index.js.map +1 -1
  75. package/build/components/provider/use-block-editor-settings.js +5 -6
  76. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  77. package/build/components/save-publish-panels/index.js +8 -2
  78. package/build/components/save-publish-panels/index.js.map +1 -1
  79. package/build/components/sidebar/post-summary.js +10 -7
  80. package/build/components/sidebar/post-summary.js.map +1 -1
  81. package/build/components/start-template-options/index.js +4 -1
  82. package/build/components/start-template-options/index.js.map +1 -1
  83. package/build/components/table-of-contents/index.js +4 -1
  84. package/build/components/table-of-contents/index.js.map +1 -1
  85. package/build/components/template-content-panel/index.js +1 -1
  86. package/build/components/template-content-panel/index.js.map +1 -1
  87. package/build/components/text-editor/index.js +4 -1
  88. package/build/components/text-editor/index.js.map +1 -1
  89. package/build/components/visual-editor/index.js +1 -6
  90. package/build/components/visual-editor/index.js.map +1 -1
  91. package/build/dataviews/actions/duplicate-pattern.js +48 -0
  92. package/build/dataviews/actions/duplicate-pattern.js.map +1 -0
  93. package/build/dataviews/actions/duplicate-post.js +146 -0
  94. package/build/dataviews/actions/duplicate-post.js.map +1 -0
  95. package/build/dataviews/actions/duplicate-post.native.js +9 -0
  96. package/build/dataviews/actions/duplicate-post.native.js.map +1 -0
  97. package/build/dataviews/actions/duplicate-template-part.js +67 -0
  98. package/build/dataviews/actions/duplicate-template-part.js.map +1 -0
  99. package/build/dataviews/actions/export-pattern.js +2 -0
  100. package/build/dataviews/actions/export-pattern.js.map +1 -1
  101. package/build/dataviews/actions/permanently-delete-post.js +2 -0
  102. package/build/dataviews/actions/permanently-delete-post.js.map +1 -1
  103. package/build/dataviews/actions/rename-post.js +125 -0
  104. package/build/dataviews/actions/rename-post.js.map +1 -0
  105. package/build/dataviews/actions/reorder-page.js +116 -0
  106. package/build/dataviews/actions/reorder-page.js.map +1 -0
  107. package/build/dataviews/actions/reorder-page.native.js +9 -0
  108. package/build/dataviews/actions/reorder-page.native.js.map +1 -0
  109. package/build/dataviews/actions/reset-post.js +9 -3
  110. package/build/dataviews/actions/reset-post.js.map +1 -1
  111. package/build/dataviews/actions/trash-post.js +8 -2
  112. package/build/dataviews/actions/trash-post.js.map +1 -1
  113. package/build/dataviews/actions/utils.js +9 -1
  114. package/build/dataviews/actions/utils.js.map +1 -1
  115. package/build/dataviews/actions/view-post-revisions.js +49 -0
  116. package/build/dataviews/actions/view-post-revisions.js.map +1 -0
  117. package/build/dataviews/actions/view-post.js +36 -0
  118. package/build/dataviews/actions/view-post.js.map +1 -0
  119. package/build/dataviews/fields/index.js +32 -0
  120. package/build/dataviews/fields/index.js.map +1 -0
  121. package/build/dataviews/store/private-actions.js +16 -2
  122. package/build/dataviews/store/private-actions.js.map +1 -1
  123. package/build/dataviews/types.js.map +1 -1
  124. package/build/private-apis.js +2 -2
  125. package/build/private-apis.js.map +1 -1
  126. package/build/store/private-actions.js +2 -2
  127. package/build/store/private-actions.js.map +1 -1
  128. package/build/store/utils/is-template-revertable.js +1 -1
  129. package/build/store/utils/is-template-revertable.js.map +1 -1
  130. package/build-module/bindings/post-meta.js +12 -10
  131. package/build-module/bindings/post-meta.js.map +1 -1
  132. package/build-module/components/block-manager/index.js +4 -1
  133. package/build-module/components/block-manager/index.js.map +1 -1
  134. package/build-module/components/block-settings-menu/content-only-settings-menu.js +6 -9
  135. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  136. package/build-module/components/create-template-part-modal/index.js +1 -0
  137. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  138. package/build-module/components/document-bar/index.js +4 -4
  139. package/build-module/components/document-bar/index.js.map +1 -1
  140. package/build-module/components/editor-history/redo.js +4 -1
  141. package/build-module/components/editor-history/redo.js.map +1 -1
  142. package/build-module/components/editor-history/undo.js +4 -1
  143. package/build-module/components/editor-history/undo.js.map +1 -1
  144. package/build-module/components/editor-interface/index.js +2 -3
  145. package/build-module/components/editor-interface/index.js.map +1 -1
  146. package/build-module/components/error-boundary/index.js +4 -1
  147. package/build-module/components/error-boundary/index.js.map +1 -1
  148. package/build-module/components/global-styles-provider/index.js +17 -4
  149. package/build-module/components/global-styles-provider/index.js.map +1 -1
  150. package/build-module/components/index.js +1 -0
  151. package/build-module/components/index.js.map +1 -1
  152. package/build-module/components/inserter-sidebar/index.js +8 -7
  153. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  154. package/build-module/components/local-autosave-monitor/index.js +5 -5
  155. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  156. package/build-module/components/page-attributes/parent.js +10 -6
  157. package/build-module/components/page-attributes/parent.js.map +1 -1
  158. package/build-module/components/plugin-preview-menu-item/index.js +52 -0
  159. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -0
  160. package/build-module/components/post-actions/actions.js +5 -501
  161. package/build-module/components/post-actions/actions.js.map +1 -1
  162. package/build-module/components/post-actions/index.js +13 -25
  163. package/build-module/components/post-actions/index.js.map +1 -1
  164. package/build-module/components/post-card-panel/index.js +20 -20
  165. package/build-module/components/post-card-panel/index.js.map +1 -1
  166. package/build-module/components/post-excerpt/panel.js +4 -1
  167. package/build-module/components/post-excerpt/panel.js.map +1 -1
  168. package/build-module/components/post-featured-image/index.js +14 -3
  169. package/build-module/components/post-featured-image/index.js.map +1 -1
  170. package/build-module/components/post-format/index.js +4 -1
  171. package/build-module/components/post-format/index.js.map +1 -1
  172. package/build-module/components/post-last-revision/index.js +4 -1
  173. package/build-module/components/post-last-revision/index.js.map +1 -1
  174. package/build-module/components/post-locked-modal/index.js +12 -3
  175. package/build-module/components/post-locked-modal/index.js.map +1 -1
  176. package/build-module/components/post-publish-panel/index.js +4 -1
  177. package/build-module/components/post-publish-panel/index.js.map +1 -1
  178. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +4 -1
  179. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  180. package/build-module/components/post-publish-panel/maybe-upload-media.js +14 -8
  181. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  182. package/build-module/components/post-publish-panel/postpublish.js +4 -0
  183. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  184. package/build-module/components/post-slug/index.js +1 -0
  185. package/build-module/components/post-slug/index.js.map +1 -1
  186. package/build-module/components/post-status/index.js +4 -2
  187. package/build-module/components/post-status/index.js.map +1 -1
  188. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +7 -3
  189. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  190. package/build-module/components/post-taxonomies/most-used-terms.js +4 -1
  191. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  192. package/build-module/components/post-template/block-theme.js +13 -4
  193. package/build-module/components/post-template/block-theme.js.map +1 -1
  194. package/build-module/components/post-template/classic-theme.js +4 -1
  195. package/build-module/components/post-template/classic-theme.js.map +1 -1
  196. package/build-module/components/post-title/index.js +33 -47
  197. package/build-module/components/post-title/index.js.map +1 -1
  198. package/build-module/components/post-url/index.js +11 -7
  199. package/build-module/components/post-url/index.js.map +1 -1
  200. package/build-module/components/preview-dropdown/index.js +26 -14
  201. package/build-module/components/preview-dropdown/index.js.map +1 -1
  202. package/build-module/components/provider/use-block-editor-settings.js +6 -7
  203. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  204. package/build-module/components/save-publish-panels/index.js +8 -2
  205. package/build-module/components/save-publish-panels/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-summary.js +10 -7
  207. package/build-module/components/sidebar/post-summary.js.map +1 -1
  208. package/build-module/components/start-template-options/index.js +4 -1
  209. package/build-module/components/start-template-options/index.js.map +1 -1
  210. package/build-module/components/table-of-contents/index.js +4 -1
  211. package/build-module/components/table-of-contents/index.js.map +1 -1
  212. package/build-module/components/template-content-panel/index.js +1 -1
  213. package/build-module/components/template-content-panel/index.js.map +1 -1
  214. package/build-module/components/text-editor/index.js +4 -1
  215. package/build-module/components/text-editor/index.js.map +1 -1
  216. package/build-module/components/visual-editor/index.js +1 -6
  217. package/build-module/components/visual-editor/index.js.map +1 -1
  218. package/build-module/dataviews/actions/duplicate-pattern.js +39 -0
  219. package/build-module/dataviews/actions/duplicate-pattern.js.map +1 -0
  220. package/build-module/dataviews/actions/duplicate-post.js +139 -0
  221. package/build-module/dataviews/actions/duplicate-post.js.map +1 -0
  222. package/build-module/dataviews/actions/duplicate-post.native.js +3 -0
  223. package/build-module/dataviews/actions/duplicate-post.native.js.map +1 -0
  224. package/build-module/dataviews/actions/duplicate-template-part.js +58 -0
  225. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -0
  226. package/build-module/dataviews/actions/export-pattern.js +2 -0
  227. package/build-module/dataviews/actions/export-pattern.js.map +1 -1
  228. package/build-module/dataviews/actions/permanently-delete-post.js +3 -0
  229. package/build-module/dataviews/actions/permanently-delete-post.js.map +1 -1
  230. package/build-module/dataviews/actions/rename-post.js +118 -0
  231. package/build-module/dataviews/actions/rename-post.js.map +1 -0
  232. package/build-module/dataviews/actions/reorder-page.js +111 -0
  233. package/build-module/dataviews/actions/reorder-page.js.map +1 -0
  234. package/build-module/dataviews/actions/reorder-page.native.js +3 -0
  235. package/build-module/dataviews/actions/reorder-page.native.js.map +1 -0
  236. package/build-module/dataviews/actions/reset-post.js +9 -3
  237. package/build-module/dataviews/actions/reset-post.js.map +1 -1
  238. package/build-module/dataviews/actions/trash-post.js +8 -2
  239. package/build-module/dataviews/actions/trash-post.js.map +1 -1
  240. package/build-module/dataviews/actions/utils.js +7 -1
  241. package/build-module/dataviews/actions/utils.js.map +1 -1
  242. package/build-module/dataviews/actions/view-post-revisions.js +43 -0
  243. package/build-module/dataviews/actions/view-post-revisions.js.map +1 -0
  244. package/build-module/dataviews/actions/view-post.js +30 -0
  245. package/build-module/dataviews/actions/view-post.js.map +1 -0
  246. package/build-module/dataviews/fields/index.js +26 -0
  247. package/build-module/dataviews/fields/index.js.map +1 -0
  248. package/build-module/dataviews/store/private-actions.js +16 -2
  249. package/build-module/dataviews/store/private-actions.js.map +1 -1
  250. package/build-module/dataviews/types.js.map +1 -1
  251. package/build-module/private-apis.js +2 -2
  252. package/build-module/private-apis.js.map +1 -1
  253. package/build-module/store/private-actions.js +2 -2
  254. package/build-module/store/private-actions.js.map +1 -1
  255. package/build-module/store/utils/is-template-revertable.js +1 -1
  256. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  257. package/build-style/style-rtl.css +14 -38
  258. package/build-style/style.css +14 -38
  259. package/build-types/bindings/post-meta.d.ts +0 -3
  260. package/build-types/bindings/post-meta.d.ts.map +1 -1
  261. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -1
  262. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  263. package/build-types/components/editor-history/redo.d.ts.map +1 -1
  264. package/build-types/components/editor-history/undo.d.ts.map +1 -1
  265. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  266. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  267. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  268. package/build-types/components/index.d.ts +1 -0
  269. package/build-types/components/index.d.ts.map +1 -1
  270. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  271. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  272. package/build-types/components/plugin-preview-menu-item/index.d.ts +3 -0
  273. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -0
  274. package/build-types/components/post-actions/actions.d.ts +1 -26
  275. package/build-types/components/post-actions/actions.d.ts.map +1 -1
  276. package/build-types/components/post-actions/index.d.ts +3 -2
  277. package/build-types/components/post-actions/index.d.ts.map +1 -1
  278. package/build-types/components/post-card-panel/index.d.ts +4 -2
  279. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  280. package/build-types/components/post-format/index.d.ts.map +1 -1
  281. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  282. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  283. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  284. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
  285. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  286. package/build-types/components/post-slug/index.d.ts.map +1 -1
  287. package/build-types/components/post-status/index.d.ts.map +1 -1
  288. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +1 -17
  289. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  290. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
  291. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  292. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  293. package/build-types/components/post-url/index.d.ts.map +1 -1
  294. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  295. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  296. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  297. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  298. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  299. package/build-types/components/template-content-panel/index.d.ts.map +1 -1
  300. package/build-types/components/text-editor/index.d.ts.map +1 -1
  301. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  302. package/build-types/dataviews/actions/duplicate-pattern.d.ts +5 -0
  303. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +1 -0
  304. package/build-types/dataviews/actions/duplicate-post.d.ts +5 -0
  305. package/build-types/dataviews/actions/duplicate-post.d.ts.map +1 -0
  306. package/build-types/dataviews/actions/duplicate-post.native.d.ts +3 -0
  307. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +1 -0
  308. package/build-types/dataviews/actions/duplicate-template-part.d.ts +5 -0
  309. package/build-types/dataviews/actions/duplicate-template-part.d.ts.map +1 -0
  310. package/build-types/dataviews/actions/export-pattern.d.ts.map +1 -1
  311. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +1 -1
  312. package/build-types/dataviews/actions/rename-post.d.ts +5 -0
  313. package/build-types/dataviews/actions/rename-post.d.ts.map +1 -0
  314. package/build-types/dataviews/actions/reorder-page.d.ts +8 -0
  315. package/build-types/dataviews/actions/reorder-page.d.ts.map +1 -0
  316. package/build-types/dataviews/actions/reorder-page.native.d.ts +3 -0
  317. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +1 -0
  318. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
  319. package/build-types/dataviews/actions/trash-post.d.ts.map +1 -1
  320. package/build-types/dataviews/actions/utils.d.ts +5 -3
  321. package/build-types/dataviews/actions/utils.d.ts.map +1 -1
  322. package/build-types/dataviews/actions/view-post-revisions.d.ts +8 -0
  323. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +1 -0
  324. package/build-types/dataviews/actions/view-post.d.ts +8 -0
  325. package/build-types/dataviews/actions/view-post.d.ts.map +1 -0
  326. package/build-types/dataviews/fields/index.d.ts +8 -0
  327. package/build-types/dataviews/fields/index.d.ts.map +1 -0
  328. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  329. package/build-types/dataviews/types.d.ts +57 -8
  330. package/build-types/dataviews/types.d.ts.map +1 -1
  331. package/build-types/store/private-actions.d.ts.map +1 -1
  332. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -1
  333. package/package.json +36 -36
  334. package/src/bindings/post-meta.js +14 -8
  335. package/src/components/block-manager/index.js +2 -0
  336. package/src/components/block-manager/style.scss +2 -2
  337. package/src/components/block-settings-menu/content-only-settings-menu.js +5 -9
  338. package/src/components/create-template-part-modal/index.js +1 -0
  339. package/src/components/create-template-part-modal/style.scss +1 -1
  340. package/src/components/document-bar/index.js +4 -4
  341. package/src/components/document-outline/style.scss +1 -1
  342. package/src/components/editor-history/redo.js +2 -0
  343. package/src/components/editor-history/undo.js +2 -0
  344. package/src/components/editor-interface/index.js +2 -4
  345. package/src/components/error-boundary/index.js +6 -1
  346. package/src/components/error-boundary/style.native.scss +1 -1
  347. package/src/components/error-boundary/style.scss +1 -1
  348. package/src/components/global-styles-provider/index.js +16 -3
  349. package/src/components/header/style.scss +6 -3
  350. package/src/components/index.js +1 -0
  351. package/src/components/inserter-sidebar/index.js +12 -5
  352. package/src/components/local-autosave-monitor/index.js +6 -6
  353. package/src/components/page-attributes/parent.js +18 -13
  354. package/src/components/plugin-preview-menu-item/index.js +52 -0
  355. package/src/components/post-actions/actions.js +5 -616
  356. package/src/components/post-actions/index.js +24 -34
  357. package/src/components/post-card-panel/index.js +28 -27
  358. package/src/components/post-card-panel/style.scss +1 -1
  359. package/src/components/post-discussion/style.scss +0 -9
  360. package/src/components/post-excerpt/panel.js +2 -0
  361. package/src/components/post-featured-image/index.js +8 -0
  362. package/src/components/post-featured-image/style.scss +1 -2
  363. package/src/components/post-format/index.js +2 -0
  364. package/src/components/post-format/style.scss +0 -6
  365. package/src/components/post-last-revision/index.js +2 -0
  366. package/src/components/post-locked-modal/index.js +14 -2
  367. package/src/components/post-locked-modal/style.scss +1 -1
  368. package/src/components/post-publish-panel/index.js +2 -0
  369. package/src/components/post-publish-panel/maybe-post-format-panel.js +2 -0
  370. package/src/components/post-publish-panel/maybe-upload-media.js +37 -29
  371. package/src/components/post-publish-panel/postpublish.js +8 -2
  372. package/src/components/post-publish-panel/style.scss +3 -1
  373. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +8 -8
  374. package/src/components/post-slug/index.js +1 -0
  375. package/src/components/post-status/index.js +3 -2
  376. package/src/components/post-status/style.scss +0 -19
  377. package/src/components/post-taxonomies/hierarchical-term-selector.js +5 -1
  378. package/src/components/post-taxonomies/most-used-terms.js +2 -0
  379. package/src/components/post-template/block-theme.js +15 -9
  380. package/src/components/post-template/classic-theme.js +2 -0
  381. package/src/components/post-title/index.js +30 -41
  382. package/src/components/post-url/index.js +17 -9
  383. package/src/components/preview-dropdown/index.js +28 -20
  384. package/src/components/provider/use-block-editor-settings.js +5 -5
  385. package/src/components/resizable-editor/style.scss +2 -2
  386. package/src/components/save-publish-panels/index.js +4 -0
  387. package/src/components/save-publish-panels/style.scss +3 -3
  388. package/src/components/sidebar/post-summary.js +20 -16
  389. package/src/components/site-discussion/style.scss +0 -14
  390. package/src/components/start-template-options/index.js +6 -1
  391. package/src/components/table-of-contents/index.js +2 -0
  392. package/src/components/template-content-panel/index.js +4 -1
  393. package/src/components/text-editor/index.js +2 -0
  394. package/src/components/visual-editor/index.js +2 -9
  395. package/src/dataviews/actions/duplicate-pattern.tsx +40 -0
  396. package/src/dataviews/actions/duplicate-post.native.tsx +3 -0
  397. package/src/dataviews/actions/duplicate-post.tsx +174 -0
  398. package/src/dataviews/actions/duplicate-template-part.tsx +70 -0
  399. package/src/dataviews/actions/export-pattern.tsx +2 -0
  400. package/src/dataviews/actions/permanently-delete-post.tsx +2 -0
  401. package/src/dataviews/actions/rename-post.tsx +146 -0
  402. package/src/dataviews/actions/reorder-page.native.tsx +3 -0
  403. package/src/dataviews/actions/reorder-page.tsx +125 -0
  404. package/src/dataviews/actions/reset-post.tsx +6 -1
  405. package/src/dataviews/actions/trash-post.tsx +4 -0
  406. package/src/dataviews/actions/utils.ts +14 -4
  407. package/src/dataviews/actions/view-post-revisions.tsx +47 -0
  408. package/src/dataviews/actions/view-post.tsx +30 -0
  409. package/src/dataviews/fields/index.ts +26 -0
  410. package/src/dataviews/store/private-actions.ts +42 -1
  411. package/src/dataviews/types.ts +47 -6
  412. package/src/private-apis.js +2 -2
  413. package/src/store/private-actions.js +4 -2
  414. package/src/store/utils/is-template-revertable.js +2 -1
  415. package/tsconfig.tsbuildinfo +1 -1
@@ -198,7 +198,10 @@ function PostParentToggle({
198
198
  });
199
199
  }
200
200
  export function ParentRow() {
201
- const homeUrl = useSelect(select => select(coreStore).getUnstableBase()?.home, []);
201
+ const homeUrl = useSelect(select => {
202
+ // Site index.
203
+ return select(coreStore).getEntityRecord('root', '__unstableBase')?.home;
204
+ }, []);
202
205
  // Use internal state instead of a ref to make sure that the component
203
206
  // re-renders when the popover's anchor updates.
204
207
  const [popoverAnchor, setPopoverAnchor] = useState(null);
@@ -237,11 +240,12 @@ export function ParentRow() {
237
240
  children: [createInterpolateElement(sprintf( /* translators: %1$s The home URL of the WordPress installation without the scheme. */
238
241
  __('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'), filterURLForDisplay(homeUrl).replace(/([/.])/g, '<wbr />$1')), {
239
242
  wbr: /*#__PURE__*/_jsx("wbr", {})
240
- }), /*#__PURE__*/_jsxs("p", {
241
- children: [__('They also show up as sub-items in the default navigation menu. '), /*#__PURE__*/_jsx(ExternalLink, {
242
- href: __('https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'),
243
- children: __('Learn more')
244
- })]
243
+ }), /*#__PURE__*/_jsx("p", {
244
+ children: createInterpolateElement(__('They also show up as sub-items in the default navigation menu. <a>Learn more.</a>'), {
245
+ a: /*#__PURE__*/_jsx(ExternalLink, {
246
+ href: __('https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes')
247
+ })
248
+ })
245
249
  })]
246
250
  }), /*#__PURE__*/_jsx(PageAttributesParent, {})]
247
251
  })
@@ -1 +1 @@
1
- {"version":3,"names":["removeAccents","__","sprintf","Button","Dropdown","ComboboxControl","ExternalLink","debounce","createInterpolateElement","useState","useMemo","useSelect","useDispatch","decodeEntities","store","coreStore","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","filterURLForDisplay","PostPanelRow","buildTermsTree","editorStore","jsx","_jsx","jsxs","_jsxs","getTitle","post","title","rendered","id","getItemPriority","name","searchValue","normalizedName","toLowerCase","normalizedSearch","startsWith","length","Infinity","PageAttributesParent","editPost","fieldValue","setFieldValue","isHierarchical","parentPostId","parentPostTitle","pageItems","select","_pType$hierarchical","getPostType","getEntityRecords","getEntityRecord","getCurrentPostId","getEditedPostAttribute","postTypeSlug","pageId","pType","postId","postIsHierarchical","hierarchical","query","per_page","exclude","parent_exclude","orderby","order","_fields","search","parentPost","parentOptions","getOptionsFromTree","tree","level","mappedNodes","map","treeNode","value","label","repeat","rawName","children","sortedNodes","sort","a","b","priorityA","priorityB","flat","item","parent","opts","optsHasParent","find","unshift","handleKeydown","inputValue","handleChange","selectedPostId","__nextHasNoMarginBottom","__next40pxDefaultSize","className","help","options","onFilterValueChange","onChange","hideLabelFromVision","PostParentToggle","isOpen","onClick","parentTitle","size","variant","ParentRow","homeUrl","getUnstableBase","home","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","ref","contentClassName","focusOnMount","renderToggle","onToggle","renderContent","onClose","replace","wbr","href"],"sources":["@wordpress/editor/src/components/page-attributes/parent.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tDropdown,\n\tComboboxControl,\n\tExternalLink,\n} from '@wordpress/components';\nimport { debounce } from '@wordpress/compose';\nimport {\n\tcreateInterpolateElement,\n\tuseState,\n\tuseMemo,\n} from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { filterURLForDisplay } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostPanelRow from '../post-panel-row';\nimport { buildTermsTree } from '../../utils/terms';\nimport { store as editorStore } from '../../store';\n\nfunction getTitle( post ) {\n\treturn post?.title?.rendered\n\t\t? decodeEntities( post.title.rendered )\n\t\t: `#${ post.id } (${ __( 'no title' ) })`;\n}\n\nexport const getItemPriority = ( name, searchValue ) => {\n\tconst normalizedName = removeAccents( name || '' ).toLowerCase();\n\tconst normalizedSearch = removeAccents( searchValue || '' ).toLowerCase();\n\tif ( normalizedName === normalizedSearch ) {\n\t\treturn 0;\n\t}\n\n\tif ( normalizedName.startsWith( normalizedSearch ) ) {\n\t\treturn normalizedName.length;\n\t}\n\n\treturn Infinity;\n};\n\n/**\n * Renders the Page Attributes Parent component. A dropdown menu in an editor interface\n * for selecting the parent page of a given page.\n *\n * @return {Component|null} The component to be rendered. Return null if post type is not hierarchical.\n */\nexport function PageAttributesParent() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ fieldValue, setFieldValue ] = useState( false );\n\tconst { isHierarchical, parentPostId, parentPostTitle, pageItems } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getPostType, getEntityRecords, getEntityRecord } =\n\t\t\t\t\tselect( coreStore );\n\t\t\t\tconst { getCurrentPostId, getEditedPostAttribute } =\n\t\t\t\t\tselect( editorStore );\n\t\t\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\t\t\tconst pageId = getEditedPostAttribute( 'parent' );\n\t\t\t\tconst pType = getPostType( postTypeSlug );\n\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\tconst postIsHierarchical = pType?.hierarchical ?? false;\n\t\t\t\tconst query = {\n\t\t\t\t\tper_page: 100,\n\t\t\t\t\texclude: postId,\n\t\t\t\t\tparent_exclude: postId,\n\t\t\t\t\torderby: 'menu_order',\n\t\t\t\t\torder: 'asc',\n\t\t\t\t\t_fields: 'id,title,parent',\n\t\t\t\t};\n\n\t\t\t\t// Perform a search when the field is changed.\n\t\t\t\tif ( !! fieldValue ) {\n\t\t\t\t\tquery.search = fieldValue;\n\t\t\t\t}\n\n\t\t\t\tconst parentPost = pageId\n\t\t\t\t\t? getEntityRecord( 'postType', postTypeSlug, pageId )\n\t\t\t\t\t: null;\n\n\t\t\t\treturn {\n\t\t\t\t\tisHierarchical: postIsHierarchical,\n\t\t\t\t\tparentPostId: pageId,\n\t\t\t\t\tparentPostTitle: parentPost ? getTitle( parentPost ) : '',\n\t\t\t\t\tpageItems: postIsHierarchical\n\t\t\t\t\t\t? getEntityRecords( 'postType', postTypeSlug, query )\n\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ fieldValue ]\n\t\t);\n\n\tconst parentOptions = useMemo( () => {\n\t\tconst getOptionsFromTree = ( tree, level = 0 ) => {\n\t\t\tconst mappedNodes = tree.map( ( treeNode ) => [\n\t\t\t\t{\n\t\t\t\t\tvalue: treeNode.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t'— '.repeat( level ) + decodeEntities( treeNode.name ),\n\t\t\t\t\trawName: treeNode.name,\n\t\t\t\t},\n\t\t\t\t...getOptionsFromTree( treeNode.children || [], level + 1 ),\n\t\t\t] );\n\n\t\t\tconst sortedNodes = mappedNodes.sort( ( [ a ], [ b ] ) => {\n\t\t\t\tconst priorityA = getItemPriority( a.rawName, fieldValue );\n\t\t\t\tconst priorityB = getItemPriority( b.rawName, fieldValue );\n\t\t\t\treturn priorityA >= priorityB ? 1 : -1;\n\t\t\t} );\n\n\t\t\treturn sortedNodes.flat();\n\t\t};\n\n\t\tif ( ! pageItems ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet tree = pageItems.map( ( item ) => ( {\n\t\t\tid: item.id,\n\t\t\tparent: item.parent,\n\t\t\tname: getTitle( item ),\n\t\t} ) );\n\n\t\t// Only build a hierarchical tree when not searching.\n\t\tif ( ! fieldValue ) {\n\t\t\ttree = buildTermsTree( tree );\n\t\t}\n\n\t\tconst opts = getOptionsFromTree( tree );\n\n\t\t// Ensure the current parent is in the options list.\n\t\tconst optsHasParent = opts.find(\n\t\t\t( item ) => item.value === parentPostId\n\t\t);\n\t\tif ( parentPostTitle && ! optsHasParent ) {\n\t\t\topts.unshift( {\n\t\t\t\tvalue: parentPostId,\n\t\t\t\tlabel: parentPostTitle,\n\t\t\t} );\n\t\t}\n\t\treturn opts;\n\t}, [ pageItems, fieldValue, parentPostTitle, parentPostId ] );\n\n\tif ( ! isHierarchical ) {\n\t\treturn null;\n\t}\n\t/**\n\t * Handle user input.\n\t *\n\t * @param {string} inputValue The current value of the input field.\n\t */\n\tconst handleKeydown = ( inputValue ) => {\n\t\tsetFieldValue( inputValue );\n\t};\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {Object} selectedPostId The selected Author.\n\t */\n\tconst handleChange = ( selectedPostId ) => {\n\t\teditPost( { parent: selectedPostId } );\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"editor-page-attributes__parent\"\n\t\t\tlabel={ __( 'Parent' ) }\n\t\t\thelp={ __( 'Choose a parent page.' ) }\n\t\t\tvalue={ parentPostId }\n\t\t\toptions={ parentOptions }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleChange }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n}\n\nfunction PostParentToggle( { isOpen, onClick } ) {\n\tconst parentPost = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst parentPostId = getEditedPostAttribute( 'parent' );\n\t\tif ( ! parentPostId ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\treturn getEntityRecord( 'postType', postTypeSlug, parentPostId );\n\t}, [] );\n\tconst parentTitle = useMemo(\n\t\t() => ( ! parentPost ? __( 'None' ) : getTitle( parentPost ) ),\n\t\t[ parentPost ]\n\t);\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-parent__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post parent.\n\t\t\taria-label={ sprintf( __( 'Change parent: %s' ), parentTitle ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ parentTitle }\n\t\t</Button>\n\t);\n}\n\nexport function ParentRow() {\n\tconst homeUrl = useSelect(\n\t\t( select ) => select( coreStore ).getUnstableBase()?.home,\n\t\t[]\n\t);\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\treturn (\n\t\t<PostPanelRow label={ __( 'Parent' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"editor-post-parent__panel-dropdown\"\n\t\t\t\tcontentClassName=\"editor-post-parent__panel-dialog\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<PostParentToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<div className=\"editor-post-parent\">\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Parent' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %1$s The home URL of the WordPress installation without the scheme. */\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Child pages inherit characteristics from their parent, such as URL structure. For instance, if \"Pricing\" is a child of \"Services\", its URL would be %1$s<wbr />/services<wbr />/pricing.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tfilterURLForDisplay( homeUrl ).replace(\n\t\t\t\t\t\t\t\t\t\t/([/.])/g,\n\t\t\t\t\t\t\t\t\t\t'<wbr />$1'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\twbr: <wbr />,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'They also show up as sub-items in the default navigation menu. '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<PageAttributesParent />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n\nexport default PageAttributesParent;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,MAAM,EACNC,QAAQ,EACRC,eAAe,EACfC,YAAY,QACN,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,wBAAwB,EACxBC,QAAQ,EACRC,OAAO,QACD,oBAAoB;AAC3B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;AACxG,SAASC,mBAAmB,QAAQ,gBAAgB;;AAEpD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,mBAAmB;AAC5C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASN,KAAK,IAAIO,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,I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AACnB,QAAQ;MACRmH,YAAY,EAAGA,YAAc;MAC7BlB,SAAS,EAAC,oCAAoC;MAC9CwB,gBAAgB,EAAC,kCAAkC;MACnDC,YAAY;MACZC,YAAY,EAAGA,CAAE;QAAEnB,MAAM;QAAEoB;MAAS,CAAC,kBACpCzG,IAAA,CAACoF,gBAAgB;QAACC,MAAM,EAAGA,MAAQ;QAACC,OAAO,EAAGmB;MAAU,CAAE,CACxD;MACHC,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,kBAC5BzG,KAAA;QAAK4E,SAAS,EAAC,oBAAoB;QAAApB,QAAA,gBAClC1D,IAAA,CAACN,sBAAsB;UACtBW,KAAK,EAAG3B,EAAE,CAAE,QAAS,CAAG;UACxBiI,OAAO,EAAGA;QAAS,CACnB,CAAC,eACFzG,KAAA;UAAAwD,QAAA,GACGzE,wBAAwB,CACzBN,OAAO,EACN;UACAD,EAAE,CACD,0LACD,CAAC,EACDiB,mBAAmB,CAAEgG,OAAQ,CAAC,CAACiB,OAAO,CACrC,SAAS,EACT,WACD,CACD,CAAC,EACD;YACCC,GAAG,eAAE7G,IAAA,UAAM;UACZ,CACD,CAAC,eACDE,KAAA;YAAAwD,QAAA,GACGhF,EAAE,CACH,iEACD,CAAC,eACDsB,IAAA,CAACjB,YAAY;cACZ+H,IAAI,EAAGpI,EAAE,CACR,yFACD,CAAG;cAAAgF,QAAA,EAEDhF,EAAE,CAAE,YAAa;YAAC,CACP,CAAC;UAAA,CACb,CAAC;QAAA,CACA,CAAC,eACNsB,IAAA,CAACiB,oBAAoB,IAAE,CAAC;MAAA,CACpB;IACH,CACH;EAAC,CACW,CAAC;AAEjB;AAEA,eAAeA,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["removeAccents","__","sprintf","Button","Dropdown","ComboboxControl","ExternalLink","debounce","createInterpolateElement","useState","useMemo","useSelect","useDispatch","decodeEntities","store","coreStore","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","filterURLForDisplay","PostPanelRow","buildTermsTree","editorStore","jsx","_jsx","jsxs","_jsxs","getTitle","post","title","rendered","id","getItemPriority","name","searchValue","normalizedName","toLowerCase","normalizedSearch","startsWith","length","Infinity","PageAttributesParent","editPost","fieldValue","setFieldValue","isHierarchical","parentPostId","parentPostTitle","pageItems","select","_pType$hierarchical","getPostType","getEntityRecords","getEntityRecord","getCurrentPostId","getEditedPostAttribute","postTypeSlug","pageId","pType","postId","postIsHierarchical","hierarchical","query","per_page","exclude","parent_exclude","orderby","order","_fields","search","parentPost","parentOptions","getOptionsFromTree","tree","level","mappedNodes","map","treeNode","value","label","repeat","rawName","children","sortedNodes","sort","a","b","priorityA","priorityB","flat","item","parent","opts","optsHasParent","find","unshift","handleKeydown","inputValue","handleChange","selectedPostId","__nextHasNoMarginBottom","__next40pxDefaultSize","className","help","options","onFilterValueChange","onChange","hideLabelFromVision","PostParentToggle","isOpen","onClick","parentTitle","size","variant","ParentRow","homeUrl","home","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","ref","contentClassName","focusOnMount","renderToggle","onToggle","renderContent","onClose","replace","wbr","href"],"sources":["@wordpress/editor/src/components/page-attributes/parent.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tDropdown,\n\tComboboxControl,\n\tExternalLink,\n} from '@wordpress/components';\nimport { debounce } from '@wordpress/compose';\nimport {\n\tcreateInterpolateElement,\n\tuseState,\n\tuseMemo,\n} from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { filterURLForDisplay } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostPanelRow from '../post-panel-row';\nimport { buildTermsTree } from '../../utils/terms';\nimport { store as editorStore } from '../../store';\n\nfunction getTitle( post ) {\n\treturn post?.title?.rendered\n\t\t? decodeEntities( post.title.rendered )\n\t\t: `#${ post.id } (${ __( 'no title' ) })`;\n}\n\nexport const getItemPriority = ( name, searchValue ) => {\n\tconst normalizedName = removeAccents( name || '' ).toLowerCase();\n\tconst normalizedSearch = removeAccents( searchValue || '' ).toLowerCase();\n\tif ( normalizedName === normalizedSearch ) {\n\t\treturn 0;\n\t}\n\n\tif ( normalizedName.startsWith( normalizedSearch ) ) {\n\t\treturn normalizedName.length;\n\t}\n\n\treturn Infinity;\n};\n\n/**\n * Renders the Page Attributes Parent component. A dropdown menu in an editor interface\n * for selecting the parent page of a given page.\n *\n * @return {Component|null} The component to be rendered. Return null if post type is not hierarchical.\n */\nexport function PageAttributesParent() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ fieldValue, setFieldValue ] = useState( false );\n\tconst { isHierarchical, parentPostId, parentPostTitle, pageItems } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getPostType, getEntityRecords, getEntityRecord } =\n\t\t\t\t\tselect( coreStore );\n\t\t\t\tconst { getCurrentPostId, getEditedPostAttribute } =\n\t\t\t\t\tselect( editorStore );\n\t\t\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\t\t\tconst pageId = getEditedPostAttribute( 'parent' );\n\t\t\t\tconst pType = getPostType( postTypeSlug );\n\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\tconst postIsHierarchical = pType?.hierarchical ?? false;\n\t\t\t\tconst query = {\n\t\t\t\t\tper_page: 100,\n\t\t\t\t\texclude: postId,\n\t\t\t\t\tparent_exclude: postId,\n\t\t\t\t\torderby: 'menu_order',\n\t\t\t\t\torder: 'asc',\n\t\t\t\t\t_fields: 'id,title,parent',\n\t\t\t\t};\n\n\t\t\t\t// Perform a search when the field is changed.\n\t\t\t\tif ( !! fieldValue ) {\n\t\t\t\t\tquery.search = fieldValue;\n\t\t\t\t}\n\n\t\t\t\tconst parentPost = pageId\n\t\t\t\t\t? getEntityRecord( 'postType', postTypeSlug, pageId )\n\t\t\t\t\t: null;\n\n\t\t\t\treturn {\n\t\t\t\t\tisHierarchical: postIsHierarchical,\n\t\t\t\t\tparentPostId: pageId,\n\t\t\t\t\tparentPostTitle: parentPost ? getTitle( parentPost ) : '',\n\t\t\t\t\tpageItems: postIsHierarchical\n\t\t\t\t\t\t? getEntityRecords( 'postType', postTypeSlug, query )\n\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ fieldValue ]\n\t\t);\n\n\tconst parentOptions = useMemo( () => {\n\t\tconst getOptionsFromTree = ( tree, level = 0 ) => {\n\t\t\tconst mappedNodes = tree.map( ( treeNode ) => [\n\t\t\t\t{\n\t\t\t\t\tvalue: treeNode.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t'— '.repeat( level ) + decodeEntities( treeNode.name ),\n\t\t\t\t\trawName: treeNode.name,\n\t\t\t\t},\n\t\t\t\t...getOptionsFromTree( treeNode.children || [], level + 1 ),\n\t\t\t] );\n\n\t\t\tconst sortedNodes = mappedNodes.sort( ( [ a ], [ b ] ) => {\n\t\t\t\tconst priorityA = getItemPriority( a.rawName, fieldValue );\n\t\t\t\tconst priorityB = getItemPriority( b.rawName, fieldValue );\n\t\t\t\treturn priorityA >= priorityB ? 1 : -1;\n\t\t\t} );\n\n\t\t\treturn sortedNodes.flat();\n\t\t};\n\n\t\tif ( ! pageItems ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet tree = pageItems.map( ( item ) => ( {\n\t\t\tid: item.id,\n\t\t\tparent: item.parent,\n\t\t\tname: getTitle( item ),\n\t\t} ) );\n\n\t\t// Only build a hierarchical tree when not searching.\n\t\tif ( ! fieldValue ) {\n\t\t\ttree = buildTermsTree( tree );\n\t\t}\n\n\t\tconst opts = getOptionsFromTree( tree );\n\n\t\t// Ensure the current parent is in the options list.\n\t\tconst optsHasParent = opts.find(\n\t\t\t( item ) => item.value === parentPostId\n\t\t);\n\t\tif ( parentPostTitle && ! optsHasParent ) {\n\t\t\topts.unshift( {\n\t\t\t\tvalue: parentPostId,\n\t\t\t\tlabel: parentPostTitle,\n\t\t\t} );\n\t\t}\n\t\treturn opts;\n\t}, [ pageItems, fieldValue, parentPostTitle, parentPostId ] );\n\n\tif ( ! isHierarchical ) {\n\t\treturn null;\n\t}\n\t/**\n\t * Handle user input.\n\t *\n\t * @param {string} inputValue The current value of the input field.\n\t */\n\tconst handleKeydown = ( inputValue ) => {\n\t\tsetFieldValue( inputValue );\n\t};\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {Object} selectedPostId The selected Author.\n\t */\n\tconst handleChange = ( selectedPostId ) => {\n\t\teditPost( { parent: selectedPostId } );\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"editor-page-attributes__parent\"\n\t\t\tlabel={ __( 'Parent' ) }\n\t\t\thelp={ __( 'Choose a parent page.' ) }\n\t\t\tvalue={ parentPostId }\n\t\t\toptions={ parentOptions }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleChange }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n}\n\nfunction PostParentToggle( { isOpen, onClick } ) {\n\tconst parentPost = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst parentPostId = getEditedPostAttribute( 'parent' );\n\t\tif ( ! parentPostId ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\treturn getEntityRecord( 'postType', postTypeSlug, parentPostId );\n\t}, [] );\n\tconst parentTitle = useMemo(\n\t\t() => ( ! parentPost ? __( 'None' ) : getTitle( parentPost ) ),\n\t\t[ parentPost ]\n\t);\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-parent__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post parent.\n\t\t\taria-label={ sprintf( __( 'Change parent: %s' ), parentTitle ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ parentTitle }\n\t\t</Button>\n\t);\n}\n\nexport function ParentRow() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\t// Site index.\n\t\treturn select( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t?.home;\n\t}, [] );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\treturn (\n\t\t<PostPanelRow label={ __( 'Parent' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"editor-post-parent__panel-dropdown\"\n\t\t\t\tcontentClassName=\"editor-post-parent__panel-dialog\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<PostParentToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<div className=\"editor-post-parent\">\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Parent' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %1$s The home URL of the WordPress installation without the scheme. */\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Child pages inherit characteristics from their parent, such as URL structure. For instance, if \"Pricing\" is a child of \"Services\", its URL would be %1$s<wbr />/services<wbr />/pricing.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tfilterURLForDisplay( homeUrl ).replace(\n\t\t\t\t\t\t\t\t\t\t/([/.])/g,\n\t\t\t\t\t\t\t\t\t\t'<wbr />$1'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\twbr: <wbr />,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'They also show up as sub-items in the default navigation menu. <a>Learn more.</a>'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<PageAttributesParent />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n\nexport default PageAttributesParent;\n"],"mappings":"AAAA;AACA;A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EACN;UACAD,EAAE,CACD,0LACD,CAAC,EACDiB,mBAAmB,CAAEgG,OAAQ,CAAC,CAACgB,OAAO,CACrC,SAAS,EACT,WACD,CACD,CAAC,EACD;YACCC,GAAG,eAAE5G,IAAA,UAAM;UACZ,CACD,CAAC,eACDA,IAAA;YAAA0D,QAAA,EACGzE,wBAAwB,CACzBP,EAAE,CACD,mFACD,CAAC,EACD;cACCmF,CAAC,eACA7D,IAAA,CAACjB,YAAY;gBACZ8H,IAAI,EAAGnI,EAAE,CACR,yFACD;cAAG,CACH;YAEH,CACD;UAAC,CACC,CAAC;QAAA,CACA,CAAC,eACNsB,IAAA,CAACiB,oBAAoB,IAAE,CAAC;MAAA,CACpB;IACH,CACH;EAAC,CACW,CAAC;AAEjB;AAEA,eAAeA,oBAAoB","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { compose } from '@wordpress/compose';
5
+ import { MenuItem } from '@wordpress/components';
6
+ import { withPluginContext } from '@wordpress/plugins';
7
+ import { ActionItem } from '@wordpress/interface';
8
+
9
+ /**
10
+ * Renders a menu item in the Preview dropdown, which can be used as a button or link depending on the props provided.
11
+ * The text within the component appears as the menu item label.
12
+ *
13
+ * @param {Object} props Component properties.
14
+ * @param {string} [props.href] When `href` is provided, the menu item is rendered as an anchor instead of a button. It corresponds to the `href` attribute of the anchor.
15
+ * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The icon to be rendered to the left of the menu item label. Can be a Dashicon slug or an SVG WP element.
16
+ * @param {Function} [props.onClick] The callback function to be executed when the user clicks the menu item.
17
+ * @param {...*} [props.other] Any additional props are passed through to the underlying MenuItem component.
18
+ *
19
+ * @example
20
+ * ```jsx
21
+ * import { __ } from '@wordpress/i18n';
22
+ * import { PluginPreviewMenuItem } from '@wordpress/editor';
23
+ * import { external } from '@wordpress/icons';
24
+ *
25
+ * function onPreviewClick() {
26
+ * // Handle preview action
27
+ * }
28
+ *
29
+ * const ExternalPreviewMenuItem = () => (
30
+ * <PreviewDropdownMenuItem
31
+ * icon={ external }
32
+ * onClick={ onPreviewClick }
33
+ * >
34
+ * { __( 'Preview in new tab' ) }
35
+ * </PreviewDropdownMenuItem>
36
+ * );
37
+ * registerPlugin( 'external-preview-menu-item', {
38
+ * render: ExternalPreviewMenuItem,
39
+ * } );
40
+ * ```
41
+ *
42
+ * @return {Component} The rendered menu item component.
43
+ */
44
+ export default compose(withPluginContext((context, ownProps) => {
45
+ var _ownProps$as;
46
+ return {
47
+ as: (_ownProps$as = ownProps.as) !== null && _ownProps$as !== void 0 ? _ownProps$as : MenuItem,
48
+ icon: ownProps.icon || context.icon,
49
+ name: 'core/plugin-preview-menu'
50
+ };
51
+ }))(ActionItem);
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["compose","MenuItem","withPluginContext","ActionItem","context","ownProps","_ownProps$as","as","icon","name"],"sources":["@wordpress/editor/src/components/plugin-preview-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { MenuItem } from '@wordpress/components';\nimport { withPluginContext } from '@wordpress/plugins';\nimport { ActionItem } from '@wordpress/interface';\n\n/**\n * Renders a menu item in the Preview dropdown, which can be used as a button or link depending on the props provided.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.href] When `href` is provided, the menu item is rendered as an anchor instead of a button. It corresponds to the `href` attribute of the anchor.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The icon to be rendered to the left of the menu item label. Can be a Dashicon slug or an SVG WP element.\n * @param {Function} [props.onClick] The callback function to be executed when the user clicks the menu item.\n * @param {...*} [props.other] Any additional props are passed through to the underlying MenuItem component.\n *\n * @example\n * ```jsx\n * import { __ } from '@wordpress/i18n';\n * import { PluginPreviewMenuItem } from '@wordpress/editor';\n * import { external } from '@wordpress/icons';\n *\n * function onPreviewClick() {\n * // Handle preview action\n * }\n *\n * const ExternalPreviewMenuItem = () => (\n * <PreviewDropdownMenuItem\n * icon={ external }\n * onClick={ onPreviewClick }\n * >\n * { __( 'Preview in new tab' ) }\n * </PreviewDropdownMenuItem>\n * );\n * registerPlugin( 'external-preview-menu-item', {\n * render: ExternalPreviewMenuItem,\n * } );\n * ```\n *\n * @return {Component} The rendered menu item component.\n */\nexport default compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\tas: ownProps.as ?? MenuItem,\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t\tname: 'core/plugin-preview-menu',\n\t\t};\n\t} )\n)( ActionItem );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,UAAU,QAAQ,sBAAsB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeH,OAAO,CACrBE,iBAAiB,CAAE,CAAEE,OAAO,EAAEC,QAAQ,KAAM;EAAA,IAAAC,YAAA;EAC3C,OAAO;IACNC,EAAE,GAAAD,YAAA,GAAED,QAAQ,CAACE,EAAE,cAAAD,YAAA,cAAAA,YAAA,GAAIL,QAAQ;IAC3BO,IAAI,EAAEH,QAAQ,CAACG,IAAI,IAAIJ,OAAO,CAACI,IAAI;IACnCC,IAAI,EAAE;EACP,CAAC;AACF,CAAE,CACH,CAAC,CAAEN,UAAW,CAAC","ignoreList":[]}