@wordpress/editor 14.17.1 → 14.19.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 (410) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +2 -0
  3. package/build/bindings/pattern-overrides.js +0 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +0 -1
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/user.js +0 -1
  8. package/build/components/autocompleters/user.js.map +1 -1
  9. package/build/components/block-removal-warnings/index.js +0 -1
  10. package/build/components/block-removal-warnings/index.js.map +1 -1
  11. package/build/components/block-settings-menu/content-only-settings-menu.js +0 -1
  12. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  13. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
  14. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  15. package/build/components/collab-sidebar/comments.js +0 -1
  16. package/build/components/collab-sidebar/comments.js.map +1 -1
  17. package/build/components/collab-sidebar/index.js +0 -1
  18. package/build/components/collab-sidebar/index.js.map +1 -1
  19. package/build/components/collab-sidebar/utils.js +0 -1
  20. package/build/components/collab-sidebar/utils.js.map +1 -1
  21. package/build/components/deprecated.js +0 -1
  22. package/build/components/deprecated.js.map +1 -1
  23. package/build/components/document-outline/index.js +16 -17
  24. package/build/components/document-outline/index.js.map +1 -1
  25. package/build/components/editor/index.js +9 -5
  26. package/build/components/editor/index.js.map +1 -1
  27. package/build/components/editor-help/index.native.js +0 -1
  28. package/build/components/editor-help/index.native.js.map +1 -1
  29. package/build/components/editor-notices/index.js +0 -1
  30. package/build/components/editor-notices/index.js.map +1 -1
  31. package/build/components/editor-snackbars/index.js +0 -1
  32. package/build/components/editor-snackbars/index.js.map +1 -1
  33. package/build/components/entities-saved-states/entity-record-item.js +2 -1
  34. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  35. package/build/components/entities-saved-states/entity-type-list.js +2 -2
  36. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  37. package/build/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
  38. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  39. package/build/components/entities-saved-states/index.js +66 -43
  40. package/build/components/entities-saved-states/index.js.map +1 -1
  41. package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
  42. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  43. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
  44. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  45. package/build/components/list-view-sidebar/index.js +0 -1
  46. package/build/components/list-view-sidebar/index.js.map +1 -1
  47. package/build/components/local-autosave-monitor/index.js +0 -1
  48. package/build/components/local-autosave-monitor/index.js.map +1 -1
  49. package/build/components/mode-switcher/index.js +0 -1
  50. package/build/components/mode-switcher/index.js.map +1 -1
  51. package/build/components/page-attributes/parent.js +8 -5
  52. package/build/components/page-attributes/parent.js.map +1 -1
  53. package/build/components/post-actions/actions.js +0 -1
  54. package/build/components/post-actions/actions.js.map +1 -1
  55. package/build/components/post-actions/index.js +19 -29
  56. package/build/components/post-actions/index.js.map +1 -1
  57. package/build/components/post-author/check.js +3 -4
  58. package/build/components/post-author/check.js.map +1 -1
  59. package/build/components/post-author/combobox.js +4 -2
  60. package/build/components/post-author/combobox.js.map +1 -1
  61. package/build/components/post-author/hook.js +8 -5
  62. package/build/components/post-author/hook.js.map +1 -1
  63. package/build/components/post-card-panel/index.js +2 -2
  64. package/build/components/post-card-panel/index.js.map +1 -1
  65. package/build/components/post-featured-image/index.js +4 -2
  66. package/build/components/post-featured-image/index.js.map +1 -1
  67. package/build/components/post-fields/index.js +0 -1
  68. package/build/components/post-fields/index.js.map +1 -1
  69. package/build/components/post-format/index.js +0 -1
  70. package/build/components/post-format/index.js.map +1 -1
  71. package/build/components/post-format/panel.js +0 -1
  72. package/build/components/post-format/panel.js.map +1 -1
  73. package/build/components/post-publish-button/index.js +0 -1
  74. package/build/components/post-publish-button/index.js.map +1 -1
  75. package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
  76. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  77. package/build/components/post-publish-panel/maybe-post-format-panel.js +0 -1
  78. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  79. package/build/components/post-publish-panel/maybe-tags-panel.js +1 -1
  80. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  81. package/build/components/post-publish-panel/maybe-upload-media.js +0 -1
  82. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  83. package/build/components/post-publish-panel/media-util.js +0 -1
  84. package/build/components/post-publish-panel/media-util.js.map +1 -1
  85. package/build/components/post-saved-state/index.js +0 -1
  86. package/build/components/post-saved-state/index.js.map +1 -1
  87. package/build/components/post-schedule/index.js +0 -1
  88. package/build/components/post-schedule/index.js.map +1 -1
  89. package/build/components/post-taxonomies/check.js +1 -1
  90. package/build/components/post-taxonomies/check.js.map +1 -1
  91. package/build/components/post-taxonomies/flat-term-selector.js +2 -3
  92. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  93. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -3
  94. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  95. package/build/components/post-taxonomies/index.js +1 -2
  96. package/build/components/post-taxonomies/index.js.map +1 -1
  97. package/build/components/post-taxonomies/most-used-terms.js +0 -1
  98. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  99. package/build/components/post-template/block-theme.js +68 -48
  100. package/build/components/post-template/block-theme.js.map +1 -1
  101. package/build/components/post-template/classic-theme.js +30 -19
  102. package/build/components/post-template/classic-theme.js.map +1 -1
  103. package/build/components/post-template/create-new-template-modal.js +3 -1
  104. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  105. package/build/components/post-template/panel.js +3 -11
  106. package/build/components/post-template/panel.js.map +1 -1
  107. package/build/components/post-template/swap-template-button.js +0 -1
  108. package/build/components/post-template/swap-template-button.js.map +1 -1
  109. package/build/components/post-transform-panel/hooks.js +0 -1
  110. package/build/components/post-transform-panel/hooks.js.map +1 -1
  111. package/build/components/post-type-support-check/index.js +0 -1
  112. package/build/components/post-type-support-check/index.js.map +1 -1
  113. package/build/components/preferences-modal/block-visibility.js +2 -2
  114. package/build/components/preferences-modal/block-visibility.js.map +1 -1
  115. package/build/components/preferences-modal/index.js +1 -2
  116. package/build/components/preferences-modal/index.js.map +1 -1
  117. package/build/components/preview-dropdown/index.js +6 -3
  118. package/build/components/preview-dropdown/index.js.map +1 -1
  119. package/build/components/provider/disable-non-page-content-blocks.js +0 -1
  120. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  121. package/build/components/provider/index.js +19 -19
  122. package/build/components/provider/index.js.map +1 -1
  123. package/build/components/provider/index.native.js +0 -1
  124. package/build/components/provider/index.native.js.map +1 -1
  125. package/build/components/provider/use-block-editor-settings.js +0 -1
  126. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  127. package/build/components/sidebar/header.js +1 -1
  128. package/build/components/sidebar/header.js.map +1 -1
  129. package/build/components/sidebar/index.js +1 -2
  130. package/build/components/sidebar/index.js.map +1 -1
  131. package/build/components/start-page-options/index.js +148 -23
  132. package/build/components/start-page-options/index.js.map +1 -1
  133. package/build/components/start-template-options/index.js +0 -1
  134. package/build/components/start-template-options/index.js.map +1 -1
  135. package/build/components/template-part-content-panel/index.js +0 -1
  136. package/build/components/template-part-content-panel/index.js.map +1 -1
  137. package/build/components/theme-support-check/index.js +0 -1
  138. package/build/components/theme-support-check/index.js.map +1 -1
  139. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -1
  140. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  141. package/build/components/visual-editor/use-select-nearest-editable-block.js +0 -1
  142. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  143. package/build/dataviews/store/private-actions.js +0 -1
  144. package/build/dataviews/store/private-actions.js.map +1 -1
  145. package/build/dataviews/store/reducer.js +0 -1
  146. package/build/dataviews/store/reducer.js.map +1 -1
  147. package/build/hooks/custom-sources-backwards-compatibility.js +0 -1
  148. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  149. package/build/hooks/pattern-overrides.js +0 -1
  150. package/build/hooks/pattern-overrides.js.map +1 -1
  151. package/build/store/actions.js +0 -1
  152. package/build/store/actions.js.map +1 -1
  153. package/build/store/private-actions.js +29 -3
  154. package/build/store/private-actions.js.map +1 -1
  155. package/build/store/private-selectors.js +44 -1
  156. package/build/store/private-selectors.js.map +1 -1
  157. package/build/store/reducer.js +0 -1
  158. package/build/store/reducer.js.map +1 -1
  159. package/build/store/reducer.native.js +0 -1
  160. package/build/store/reducer.native.js.map +1 -1
  161. package/build/store/selectors.js +0 -1
  162. package/build/store/selectors.js.map +1 -1
  163. package/build/utils/get-template-info.js +0 -1
  164. package/build/utils/get-template-info.js.map +1 -1
  165. package/build/utils/media-upload/index.js +5 -2
  166. package/build/utils/media-upload/index.js.map +1 -1
  167. package/build/utils/terms.js +0 -1
  168. package/build/utils/terms.js.map +1 -1
  169. package/build-module/bindings/pattern-overrides.js +0 -1
  170. package/build-module/bindings/pattern-overrides.js.map +1 -1
  171. package/build-module/bindings/post-meta.js +0 -1
  172. package/build-module/bindings/post-meta.js.map +1 -1
  173. package/build-module/components/autocompleters/user.js +0 -1
  174. package/build-module/components/autocompleters/user.js.map +1 -1
  175. package/build-module/components/block-removal-warnings/index.js +0 -1
  176. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  177. package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -1
  178. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  179. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
  180. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  181. package/build-module/components/collab-sidebar/comments.js +0 -1
  182. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  183. package/build-module/components/collab-sidebar/index.js +0 -1
  184. package/build-module/components/collab-sidebar/index.js.map +1 -1
  185. package/build-module/components/collab-sidebar/utils.js +0 -1
  186. package/build-module/components/collab-sidebar/utils.js.map +1 -1
  187. package/build-module/components/deprecated.js +0 -1
  188. package/build-module/components/deprecated.js.map +1 -1
  189. package/build-module/components/document-outline/index.js +17 -18
  190. package/build-module/components/document-outline/index.js.map +1 -1
  191. package/build-module/components/editor/index.js +9 -5
  192. package/build-module/components/editor/index.js.map +1 -1
  193. package/build-module/components/editor-help/index.native.js +0 -1
  194. package/build-module/components/editor-help/index.native.js.map +1 -1
  195. package/build-module/components/editor-notices/index.js +0 -1
  196. package/build-module/components/editor-notices/index.js.map +1 -1
  197. package/build-module/components/editor-snackbars/index.js +0 -1
  198. package/build-module/components/editor-snackbars/index.js.map +1 -1
  199. package/build-module/components/entities-saved-states/entity-record-item.js +2 -1
  200. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  201. package/build-module/components/entities-saved-states/entity-type-list.js +2 -2
  202. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  203. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
  204. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  205. package/build-module/components/entities-saved-states/index.js +67 -44
  206. package/build-module/components/entities-saved-states/index.js.map +1 -1
  207. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
  208. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  209. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
  210. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  211. package/build-module/components/list-view-sidebar/index.js +0 -1
  212. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  213. package/build-module/components/local-autosave-monitor/index.js +0 -1
  214. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  215. package/build-module/components/mode-switcher/index.js +0 -1
  216. package/build-module/components/mode-switcher/index.js.map +1 -1
  217. package/build-module/components/page-attributes/parent.js +8 -5
  218. package/build-module/components/page-attributes/parent.js.map +1 -1
  219. package/build-module/components/post-actions/actions.js +0 -1
  220. package/build-module/components/post-actions/actions.js.map +1 -1
  221. package/build-module/components/post-actions/index.js +19 -29
  222. package/build-module/components/post-actions/index.js.map +1 -1
  223. package/build-module/components/post-author/check.js +3 -4
  224. package/build-module/components/post-author/check.js.map +1 -1
  225. package/build-module/components/post-author/combobox.js +4 -2
  226. package/build-module/components/post-author/combobox.js.map +1 -1
  227. package/build-module/components/post-author/hook.js +8 -5
  228. package/build-module/components/post-author/hook.js.map +1 -1
  229. package/build-module/components/post-card-panel/index.js +2 -2
  230. package/build-module/components/post-card-panel/index.js.map +1 -1
  231. package/build-module/components/post-featured-image/index.js +4 -2
  232. package/build-module/components/post-featured-image/index.js.map +1 -1
  233. package/build-module/components/post-fields/index.js +0 -1
  234. package/build-module/components/post-fields/index.js.map +1 -1
  235. package/build-module/components/post-format/index.js +0 -1
  236. package/build-module/components/post-format/index.js.map +1 -1
  237. package/build-module/components/post-format/panel.js +0 -1
  238. package/build-module/components/post-format/panel.js.map +1 -1
  239. package/build-module/components/post-publish-button/index.js +0 -1
  240. package/build-module/components/post-publish-button/index.js.map +1 -1
  241. package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
  242. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  243. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +0 -1
  244. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  245. package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -1
  246. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  247. package/build-module/components/post-publish-panel/maybe-upload-media.js +0 -1
  248. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  249. package/build-module/components/post-publish-panel/media-util.js +0 -1
  250. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  251. package/build-module/components/post-saved-state/index.js +0 -1
  252. package/build-module/components/post-saved-state/index.js.map +1 -1
  253. package/build-module/components/post-schedule/index.js +0 -1
  254. package/build-module/components/post-schedule/index.js.map +1 -1
  255. package/build-module/components/post-taxonomies/check.js +1 -1
  256. package/build-module/components/post-taxonomies/check.js.map +1 -1
  257. package/build-module/components/post-taxonomies/flat-term-selector.js +2 -3
  258. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  259. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -3
  260. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  261. package/build-module/components/post-taxonomies/index.js +1 -2
  262. package/build-module/components/post-taxonomies/index.js.map +1 -1
  263. package/build-module/components/post-taxonomies/most-used-terms.js +0 -1
  264. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  265. package/build-module/components/post-template/block-theme.js +68 -48
  266. package/build-module/components/post-template/block-theme.js.map +1 -1
  267. package/build-module/components/post-template/classic-theme.js +30 -19
  268. package/build-module/components/post-template/classic-theme.js.map +1 -1
  269. package/build-module/components/post-template/create-new-template-modal.js +3 -1
  270. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  271. package/build-module/components/post-template/panel.js +3 -11
  272. package/build-module/components/post-template/panel.js.map +1 -1
  273. package/build-module/components/post-template/swap-template-button.js +0 -1
  274. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  275. package/build-module/components/post-transform-panel/hooks.js +0 -1
  276. package/build-module/components/post-transform-panel/hooks.js.map +1 -1
  277. package/build-module/components/post-type-support-check/index.js +0 -1
  278. package/build-module/components/post-type-support-check/index.js.map +1 -1
  279. package/build-module/components/preferences-modal/block-visibility.js +2 -2
  280. package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
  281. package/build-module/components/preferences-modal/index.js +1 -2
  282. package/build-module/components/preferences-modal/index.js.map +1 -1
  283. package/build-module/components/preview-dropdown/index.js +6 -3
  284. package/build-module/components/preview-dropdown/index.js.map +1 -1
  285. package/build-module/components/provider/disable-non-page-content-blocks.js +0 -1
  286. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  287. package/build-module/components/provider/index.js +19 -19
  288. package/build-module/components/provider/index.js.map +1 -1
  289. package/build-module/components/provider/index.native.js +0 -1
  290. package/build-module/components/provider/index.native.js.map +1 -1
  291. package/build-module/components/provider/use-block-editor-settings.js +0 -1
  292. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  293. package/build-module/components/sidebar/header.js +1 -1
  294. package/build-module/components/sidebar/header.js.map +1 -1
  295. package/build-module/components/sidebar/index.js +1 -2
  296. package/build-module/components/sidebar/index.js.map +1 -1
  297. package/build-module/components/start-page-options/index.js +148 -24
  298. package/build-module/components/start-page-options/index.js.map +1 -1
  299. package/build-module/components/start-template-options/index.js +0 -1
  300. package/build-module/components/start-template-options/index.js.map +1 -1
  301. package/build-module/components/template-part-content-panel/index.js +0 -1
  302. package/build-module/components/template-part-content-panel/index.js.map +1 -1
  303. package/build-module/components/theme-support-check/index.js +0 -1
  304. package/build-module/components/theme-support-check/index.js.map +1 -1
  305. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -1
  306. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  307. package/build-module/components/visual-editor/use-select-nearest-editable-block.js +0 -1
  308. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  309. package/build-module/dataviews/store/private-actions.js +0 -1
  310. package/build-module/dataviews/store/private-actions.js.map +1 -1
  311. package/build-module/dataviews/store/reducer.js +0 -1
  312. package/build-module/dataviews/store/reducer.js.map +1 -1
  313. package/build-module/hooks/custom-sources-backwards-compatibility.js +0 -1
  314. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  315. package/build-module/hooks/pattern-overrides.js +0 -1
  316. package/build-module/hooks/pattern-overrides.js.map +1 -1
  317. package/build-module/store/actions.js +0 -1
  318. package/build-module/store/actions.js.map +1 -1
  319. package/build-module/store/private-actions.js +25 -1
  320. package/build-module/store/private-actions.js.map +1 -1
  321. package/build-module/store/private-selectors.js +43 -1
  322. package/build-module/store/private-selectors.js.map +1 -1
  323. package/build-module/store/reducer.js +0 -1
  324. package/build-module/store/reducer.js.map +1 -1
  325. package/build-module/store/reducer.native.js +0 -1
  326. package/build-module/store/reducer.native.js.map +1 -1
  327. package/build-module/store/selectors.js +0 -1
  328. package/build-module/store/selectors.js.map +1 -1
  329. package/build-module/utils/get-template-info.js +0 -1
  330. package/build-module/utils/get-template-info.js.map +1 -1
  331. package/build-module/utils/media-upload/index.js +5 -2
  332. package/build-module/utils/media-upload/index.js.map +1 -1
  333. package/build-module/utils/terms.js +0 -1
  334. package/build-module/utils/terms.js.map +1 -1
  335. package/build-style/style-rtl.css +49 -8
  336. package/build-style/style.css +49 -8
  337. package/build-types/components/document-outline/index.d.ts.map +1 -1
  338. package/build-types/components/editor/index.d.ts.map +1 -1
  339. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
  340. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
  341. package/build-types/components/entities-saved-states/index.d.ts +6 -2
  342. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  343. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  344. package/build-types/components/post-actions/index.d.ts.map +1 -1
  345. package/build-types/components/post-author/check.d.ts.map +1 -1
  346. package/build-types/components/post-author/combobox.d.ts.map +1 -1
  347. package/build-types/components/post-author/hook.d.ts +1 -0
  348. package/build-types/components/post-author/hook.d.ts.map +1 -1
  349. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  350. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
  351. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -1
  352. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  353. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  354. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  355. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  356. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  357. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
  358. package/build-types/components/post-template/hooks.d.ts +1 -1
  359. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  360. package/build-types/components/post-template/panel.d.ts.map +1 -1
  361. package/build-types/components/preferences-modal/block-visibility.d.ts.map +1 -1
  362. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  363. package/build-types/components/provider/index.d.ts.map +1 -1
  364. package/build-types/components/start-page-options/index.d.ts +2 -1
  365. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  366. package/build-types/store/private-actions.d.ts +4 -0
  367. package/build-types/store/private-actions.d.ts.map +1 -1
  368. package/build-types/store/private-selectors.d.ts +13 -0
  369. package/build-types/store/private-selectors.d.ts.map +1 -1
  370. package/build-types/utils/media-upload/index.d.ts +3 -1
  371. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  372. package/package.json +37 -37
  373. package/src/components/document-outline/index.js +22 -16
  374. package/src/components/editor/index.js +24 -13
  375. package/src/components/entities-saved-states/entity-record-item.js +1 -0
  376. package/src/components/entities-saved-states/entity-type-list.js +6 -2
  377. package/src/components/entities-saved-states/index.js +98 -58
  378. package/src/components/entities-saved-states/style.scss +40 -5
  379. package/src/components/page-attributes/parent.js +55 -38
  380. package/src/components/post-actions/index.js +19 -37
  381. package/src/components/post-author/check.js +7 -4
  382. package/src/components/post-author/combobox.js +3 -1
  383. package/src/components/post-author/hook.js +4 -3
  384. package/src/components/post-card-panel/index.js +7 -5
  385. package/src/components/post-featured-image/index.js +2 -0
  386. package/src/components/post-publish-panel/maybe-category-panel.js +6 -2
  387. package/src/components/post-publish-panel/maybe-tags-panel.js +5 -1
  388. package/src/components/post-taxonomies/check.js +5 -3
  389. package/src/components/post-taxonomies/flat-term-selector.js +2 -2
  390. package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  391. package/src/components/post-taxonomies/index.js +5 -1
  392. package/src/components/post-taxonomies/test/index.js +32 -18
  393. package/src/components/post-template/block-theme.js +76 -56
  394. package/src/components/post-template/classic-theme.js +31 -15
  395. package/src/components/post-template/create-new-template-modal.js +1 -0
  396. package/src/components/post-template/panel.js +2 -12
  397. package/src/components/post-text-editor/style.scss +0 -2
  398. package/src/components/preferences-modal/block-visibility.js +2 -1
  399. package/src/components/preferences-modal/index.js +1 -1
  400. package/src/components/preview-dropdown/index.js +8 -6
  401. package/src/components/provider/index.js +21 -30
  402. package/src/components/sidebar/header.js +1 -1
  403. package/src/components/sidebar/index.js +1 -1
  404. package/src/components/start-page-options/index.js +149 -23
  405. package/src/components/start-page-options/style.scss +27 -0
  406. package/src/components/visual-editor/edit-template-blocks-notification.js +1 -1
  407. package/src/store/private-actions.js +33 -0
  408. package/src/store/private-selectors.js +57 -0
  409. package/src/utils/media-upload/index.js +3 -0
  410. package/tsconfig.tsbuildinfo +1 -1
@@ -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","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 {React.ReactNode} 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\taria-label={\n\t\t\t\t// translators: %s: Current post parent.\n\t\t\t\tsprintf( __( 'Change parent: %s' ), parentTitle )\n\t\t\t}\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: %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 %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;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;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ACW,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","isLoading","select","_pType$hierarchical","getPostType","getEntityRecords","getEntityRecord","isResolving","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 {React.ReactNode} 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 {\n\t\tisHierarchical,\n\t\tparentPostId,\n\t\tparentPostTitle,\n\t\tpageItems,\n\t\tisLoading,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetPostType,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst { getCurrentPostId, getEditedPostAttribute } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\t\tconst pageId = getEditedPostAttribute( 'parent' );\n\t\t\tconst pType = getPostType( postTypeSlug );\n\t\t\tconst postId = getCurrentPostId();\n\t\t\tconst postIsHierarchical = pType?.hierarchical ?? false;\n\t\t\tconst query = {\n\t\t\t\tper_page: 100,\n\t\t\t\texclude: postId,\n\t\t\t\tparent_exclude: postId,\n\t\t\t\torderby: 'menu_order',\n\t\t\t\torder: 'asc',\n\t\t\t\t_fields: 'id,title,parent',\n\t\t\t};\n\n\t\t\t// Perform a search when the field is changed.\n\t\t\tif ( !! fieldValue ) {\n\t\t\t\tquery.search = fieldValue;\n\t\t\t}\n\n\t\t\tconst parentPost = pageId\n\t\t\t\t? getEntityRecord( 'postType', postTypeSlug, pageId )\n\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\tisHierarchical: postIsHierarchical,\n\t\t\t\tparentPostId: pageId,\n\t\t\t\tparentPostTitle: parentPost ? getTitle( parentPost ) : '',\n\t\t\t\tpageItems: postIsHierarchical\n\t\t\t\t\t? getEntityRecords( 'postType', postTypeSlug, query )\n\t\t\t\t\t: null,\n\t\t\t\tisLoading: postIsHierarchical\n\t\t\t\t\t? isResolving( 'getEntityRecords', [\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\t\t\tquery,\n\t\t\t\t\t ] )\n\t\t\t\t\t: false,\n\t\t\t};\n\t\t},\n\t\t[ fieldValue ]\n\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\tisLoading={ isLoading }\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\taria-label={\n\t\t\t\t// translators: %s: Current post parent.\n\t\t\t\tsprintf( __( 'Change parent: %s' ), parentTitle )\n\t\t\t}\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: %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 %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;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,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnD,SAASC,QAAQA,CAAEC,IAAI,EAAG;EACzB,OAAOA,IAAI,EAAEC,KAAK,EAAEC,QAAQ,GACzBhB,c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C4H,GAAG,EAAGN,gBAAkB;IAAApC,QAAA,eAC9D5D,IAAA,CAACnB,QAAQ;MACRoH,YAAY,EAAGA,YAAc;MAC7BjB,SAAS,EAAC,oCAAoC;MAC9CuB,gBAAgB,EAAC,kCAAkC;MACnDC,YAAY;MACZC,YAAY,EAAGA,CAAE;QAAElB,MAAM;QAAEmB;MAAS,CAAC,kBACpC1G,IAAA,CAACsF,gBAAgB;QAACC,MAAM,EAAGA,MAAQ;QAACC,OAAO,EAAGkB;MAAU,CAAE,CACxD;MACHC,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,kBAC5B1G,KAAA;QAAK8E,SAAS,EAAC,oBAAoB;QAAApB,QAAA,gBAClC5D,IAAA,CAACN,sBAAsB;UACtBW,KAAK,EAAG3B,EAAE,CAAE,QAAS,CAAG;UACxBkI,OAAO,EAAGA;QAAS,CACnB,CAAC,eACF1G,KAAA;UAAA0D,QAAA,GACG3E,wBAAwB,CACzBN,OAAO,CACN;UACAD,EAAE,CACD,wLACD,CAAC,EACDiB,mBAAmB,CAAEkG,OAAQ,CAAC,CAACgB,OAAO,CACrC,SAAS,EACT,WACD,CACD,CAAC,EACD;YACCC,GAAG,eAAE9G,IAAA,UAAM;UACZ,CACD,CAAC,eACDA,IAAA;YAAA4D,QAAA,EACG3E,wBAAwB,CACzBP,EAAE,CACD,mFACD,CAAC,EACD;cACCqF,CAAC,eACA/D,IAAA,CAACjB,YAAY;gBACZgI,IAAI,EAAGrI,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":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","useSelect","useMemo","useEffect","store","coreStore","editorStore","unlock","useSetAsHomepageAction","useSetAsPostsPageAction","jsx","_jsx","usePostActions","postType","onActionPerformed","context","defaultActions","select","getEntityActions","canManageOptions","hasFrontPageTemplate","getEntityRecords","templates","per_page","canUser","kind","name","find","template","slug","setAsHomepageAction","setAsPostsPageAction","shouldShowHomepageActions","registerPostTypeSchema","actions","push","sort","a","b","id","filter","action","i","length","callback","existingCallback","items","argsObject","_items","RenderModal","ExistingRenderModal","props"],"sources":["@wordpress/editor/src/components/post-actions/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMemo, useEffect } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useSetAsHomepageAction } from './set-as-homepage';\nimport { useSetAsPostsPageAction } from './set-as-posts-page';\n\nexport function usePostActions( { postType, onActionPerformed, context } ) {\n\tconst { defaultActions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityActions } = unlock( select( editorStore ) );\n\t\t\treturn {\n\t\t\t\tdefaultActions: getEntityActions( 'postType', postType ),\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tconst { canManageOptions, hasFrontPageTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst templates = getEntityRecords( 'postType', 'wp_template', {\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\tcanManageOptions: select( coreStore ).canUser( 'update', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'site',\n\t\t\t\t} ),\n\t\t\t\thasFrontPageTemplate: !! templates?.find(\n\t\t\t\t\t( template ) => template?.slug === 'front-page'\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t);\n\n\tconst setAsHomepageAction = useSetAsHomepageAction();\n\tconst setAsPostsPageAction = useSetAsPostsPageAction();\n\tconst shouldShowHomepageActions =\n\t\tcanManageOptions && ! hasFrontPageTemplate;\n\n\tconst { registerPostTypeSchema } = unlock( useDispatch( editorStore ) );\n\tuseEffect( () => {\n\t\tregisterPostTypeSchema( postType );\n\t}, [ registerPostTypeSchema, postType ] );\n\n\treturn useMemo( () => {\n\t\tlet actions = [ ...defaultActions ];\n\t\tif ( shouldShowHomepageActions ) {\n\t\t\tactions.push( setAsHomepageAction, setAsPostsPageAction );\n\t\t}\n\n\t\t// Ensure \"Move to trash\" is always the last action.\n\t\tactions = actions.sort( ( a, b ) =>\n\t\t\tb.id === 'move-to-trash' ? -1 : 0\n\t\t);\n\n\t\t// Filter actions based on provided context. If not provided\n\t\t// all actions are returned. We'll have a single entry for getting the actions\n\t\t// and the consumer should provide the context to filter the actions, if needed.\n\t\t// Actions should also provide the `context` they support, if it's specific, to\n\t\t// compare with the provided context to get all the actions.\n\t\t// Right now the only supported context is `list`.\n\t\tactions = actions.filter( ( action ) => {\n\t\t\tif ( ! action.context ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn action.context === context;\n\t\t} );\n\n\t\tif ( onActionPerformed ) {\n\t\t\tfor ( let i = 0; i < actions.length; ++i ) {\n\t\t\t\tif ( actions[ i ].callback ) {\n\t\t\t\t\tconst existingCallback = actions[ i ].callback;\n\t\t\t\t\tactions[ i ] = {\n\t\t\t\t\t\t...actions[ i ],\n\t\t\t\t\t\tcallback: ( items, argsObject ) => {\n\t\t\t\t\t\t\texistingCallback( items, {\n\t\t\t\t\t\t\t\t...argsObject,\n\t\t\t\t\t\t\t\tonActionPerformed: ( _items ) => {\n\t\t\t\t\t\t\t\t\tif ( argsObject?.onActionPerformed ) {\n\t\t\t\t\t\t\t\t\t\targsObject.onActionPerformed( _items );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonActionPerformed(\n\t\t\t\t\t\t\t\t\t\tactions[ i ].id,\n\t\t\t\t\t\t\t\t\t\t_items\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} );\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif ( actions[ i ].RenderModal ) {\n\t\t\t\t\tconst ExistingRenderModal = actions[ i ].RenderModal;\n\t\t\t\t\tactions[ i ] = {\n\t\t\t\t\t\t...actions[ i ],\n\t\t\t\t\t\tRenderModal: ( props ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ExistingRenderModal\n\t\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t\tonActionPerformed={ ( _items ) => {\n\t\t\t\t\t\t\t\t\t\tif ( props.onActionPerformed ) {\n\t\t\t\t\t\t\t\t\t\t\tprops.onActionPerformed( _items );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonActionPerformed(\n\t\t\t\t\t\t\t\t\t\t\tactions[ i ].id,\n\t\t\t\t\t\t\t\t\t\t\t_items\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);\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn actions;\n\t}, [\n\t\tcontext,\n\t\tdefaultActions,\n\t\tonActionPerformed,\n\t\tsetAsHomepageAction,\n\t\tsetAsPostsPageAction,\n\t\tshouldShowHomepageActions,\n\t] );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,OAAO,EAAEC,SAAS,QAAQ,oBAAoB;AACvD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,sBAAsB,QAAQ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jC,iBAAiB,CAAEkC,MAAO,CAAC;kBACvC;kBACAlC,iBAAiB,CAChBoB,OAAO,CAAEQ,CAAC,CAAE,CAACH,EAAE,EACfS,MACD,CAAC;gBACF;cACD,CAAE,CAAC;YACJ;UACD,CAAC;QACF;QACA,IAAKd,OAAO,CAAEQ,CAAC,CAAE,CAACO,WAAW,EAAG;UAC/B,MAAMC,mBAAmB,GAAGhB,OAAO,CAAEQ,CAAC,CAAE,CAACO,WAAW;UACpDf,OAAO,CAAEQ,CAAC,CAAE,GAAG;YACd,GAAGR,OAAO,CAAEQ,CAAC,CAAE;YACfO,WAAW,EAAIE,KAAK,IAAM;cACzB,oBACCxC,IAAA,CAACuC,mBAAmB;gBAAA,GACdC,KAAK;gBACVrC,iBAAiB,EAAKkC,MAAM,IAAM;kBACjC,IAAKG,KAAK,CAACrC,iBAAiB,EAAG;oBAC9BqC,KAAK,CAACrC,iBAAiB,CAAEkC,MAAO,CAAC;kBAClC;kBACAlC,iBAAiB,CAChBoB,OAAO,CAAEQ,CAAC,CAAE,CAACH,EAAE,EACfS,MACD,CAAC;gBACF;cAAG,CACH,CAAC;YAEJ;UACD,CAAC;QACF;MACD;IACD;IAEA,OAAOd,OAAO;EACf,CAAC,EAAE,CACFnB,OAAO,EACPC,cAAc,EACdF,iBAAiB,EACjBgB,mBAAmB,EACnBC,oBAAoB,EACpBC,yBAAyB,CACxB,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["useDispatch","useSelect","useMemo","useEffect","store","coreStore","editorStore","unlock","useSetAsHomepageAction","useSetAsPostsPageAction","jsx","_jsx","usePostActions","postType","onActionPerformed","context","defaultActions","select","getEntityActions","canManageOptions","hasFrontPageTemplate","getEntityRecords","templates","per_page","canUser","kind","name","find","template","slug","setAsHomepageAction","setAsPostsPageAction","shouldShowHomepageActions","registerPostTypeSchema","actions","push","sort","a","b","id","filter","action","i","length","callback","existingCallback","items","argsObject","_items","RenderModal","ExistingRenderModal","props"],"sources":["@wordpress/editor/src/components/post-actions/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMemo, useEffect } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useSetAsHomepageAction } from './set-as-homepage';\nimport { useSetAsPostsPageAction } from './set-as-posts-page';\n\nexport function usePostActions( { postType, onActionPerformed, context } ) {\n\tconst { defaultActions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityActions } = unlock( select( editorStore ) );\n\t\t\treturn {\n\t\t\t\tdefaultActions: getEntityActions( 'postType', postType ),\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tconst { canManageOptions, hasFrontPageTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst templates = getEntityRecords( 'postType', 'wp_template', {\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\n\t\t\treturn {\n\t\t\t\tcanManageOptions: select( coreStore ).canUser( 'update', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'site',\n\t\t\t\t} ),\n\t\t\t\thasFrontPageTemplate: !! templates?.find(\n\t\t\t\t\t( template ) => template?.slug === 'front-page'\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t);\n\n\tconst setAsHomepageAction = useSetAsHomepageAction();\n\tconst setAsPostsPageAction = useSetAsPostsPageAction();\n\tconst shouldShowHomepageActions =\n\t\tcanManageOptions && ! hasFrontPageTemplate;\n\n\tconst { registerPostTypeSchema } = unlock( useDispatch( editorStore ) );\n\tuseEffect( () => {\n\t\tregisterPostTypeSchema( postType );\n\t}, [ registerPostTypeSchema, postType ] );\n\n\treturn useMemo( () => {\n\t\tlet actions = [ ...defaultActions ];\n\t\tif ( shouldShowHomepageActions ) {\n\t\t\tactions.push( setAsHomepageAction, setAsPostsPageAction );\n\t\t}\n\n\t\t// Ensure \"Move to trash\" is always the last action.\n\t\tactions = actions.sort( ( a, b ) =>\n\t\t\tb.id === 'move-to-trash' ? -1 : 0\n\t\t);\n\n\t\t// Filter actions based on provided context. If not provided\n\t\t// all actions are returned. We'll have a single entry for getting the actions\n\t\t// and the consumer should provide the context to filter the actions, if needed.\n\t\t// Actions should also provide the `context` they support, if it's specific, to\n\t\t// compare with the provided context to get all the actions.\n\t\t// Right now the only supported context is `list`.\n\t\tactions = actions.filter( ( action ) => {\n\t\t\tif ( ! action.context ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn action.context === context;\n\t\t} );\n\n\t\tif ( onActionPerformed ) {\n\t\t\tfor ( let i = 0; i < actions.length; ++i ) {\n\t\t\t\tif ( actions[ i ].callback ) {\n\t\t\t\t\tconst existingCallback = actions[ i ].callback;\n\t\t\t\t\tactions[ i ] = {\n\t\t\t\t\t\t...actions[ i ],\n\t\t\t\t\t\tcallback: ( items, argsObject ) => {\n\t\t\t\t\t\t\texistingCallback( items, {\n\t\t\t\t\t\t\t\t...argsObject,\n\t\t\t\t\t\t\t\tonActionPerformed: ( _items ) => {\n\t\t\t\t\t\t\t\t\tif ( argsObject?.onActionPerformed ) {\n\t\t\t\t\t\t\t\t\t\targsObject.onActionPerformed( _items );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonActionPerformed(\n\t\t\t\t\t\t\t\t\t\tactions[ i ].id,\n\t\t\t\t\t\t\t\t\t\t_items\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} );\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tif ( actions[ i ].RenderModal ) {\n\t\t\t\t\tconst ExistingRenderModal = actions[ i ].RenderModal;\n\t\t\t\t\tactions[ i ] = {\n\t\t\t\t\t\t...actions[ i ],\n\t\t\t\t\t\tRenderModal: ( props ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ExistingRenderModal\n\t\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t\tonActionPerformed={ ( _items ) => {\n\t\t\t\t\t\t\t\t\t\tif ( props.onActionPerformed ) {\n\t\t\t\t\t\t\t\t\t\t\tprops.onActionPerformed( _items );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonActionPerformed(\n\t\t\t\t\t\t\t\t\t\t\tactions[ i ].id,\n\t\t\t\t\t\t\t\t\t\t\t_items\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);\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn actions;\n\t}, [\n\t\tcontext,\n\t\tdefaultActions,\n\t\tonActionPerformed,\n\t\tsetAsHomepageAction,\n\t\tsetAsPostsPageAction,\n\t\tshouldShowHomepageActions,\n\t] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,OAAO,EAAEC,SAAS,QAAQ,oBAAoB;AACvD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,sBAAsB,QAAQ,mBAAmB;AAC1D,SAASC,uBAAuB,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9D,OAAO,SAASC,cAAcA,CAAE;EAAEC,QAAQ;EAAEC,iBAAiB;EAAEC;AAAQ,CAAC,EAAG;EAC1E,MAAM;IAAEC;EAAe,CAAC,GAAGf,SAAS,CACjCgB,MAAM,IAAM;IACb,MAAM;MAAEC;IAAiB,CAAC,GAAGX,MAAM,CAAEU,MAAM,CAAEX,WAAY,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AEQ,CAAC,CAAE,GAAG;YACd,GAAGR,OAAO,CAAEQ,CAAC,CAAE;YACfO,WAAW,EAAIE,KAAK,IAAM;cACzB,oBACCxC,IAAA,CAACuC,mBAAmB;gBAAA,GACdC,KAAK;gBACVrC,iBAAiB,EAAKkC,MAAM,IAAM;kBACjC,IAAKG,KAAK,CAACrC,iBAAiB,EAAG;oBAC9BqC,KAAK,CAACrC,iBAAiB,CAAEkC,MAAO,CAAC;kBAClC;kBACAlC,iBAAiB,CAChBoB,OAAO,CAAEQ,CAAC,CAAE,CAACH,EAAE,EACfS,MACD,CAAC;gBACF;cAAG,CACH,CAAC;YAEJ;UACD,CAAC;QACF;MACD;IACD;IAEA,OAAOd,OAAO;EACf,CAAC,EAAE,CACFnB,OAAO,EACPC,cAAc,EACdF,iBAAiB,EACjBgB,mBAAmB,EACnBC,oBAAoB,EACpBC,yBAAyB,CACxB,CAAC;AACJ","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -19,9 +18,14 @@ const {
19
18
  Menu,
20
19
  kebabCase
21
20
  } = unlock(componentsPrivateApis);
22
- function useEditedEntityRecordsWithPermissions(postType, postIds) {
21
+ export default function PostActions({
22
+ postType,
23
+ postId,
24
+ onActionPerformed
25
+ }) {
26
+ const [activeModalAction, setActiveModalAction] = useState(null);
23
27
  const {
24
- items,
28
+ item,
25
29
  permissions
26
30
  } = useSelect(select => {
27
31
  const {
@@ -29,39 +33,25 @@ function useEditedEntityRecordsWithPermissions(postType, postIds) {
29
33
  getEntityRecordPermissions
30
34
  } = unlock(select(coreStore));
31
35
  return {
32
- items: postIds.map(postId => getEditedEntityRecord('postType', postType, postId)),
33
- permissions: postIds.map(postId => getEntityRecordPermissions('postType', postType, postId))
36
+ item: getEditedEntityRecord('postType', postType, postId),
37
+ permissions: getEntityRecordPermissions('postType', postType, postId)
34
38
  };
35
- }, [postIds, postType]);
36
- return useMemo(() => {
37
- return items.map((item, index) => ({
39
+ }, [postId, postType]);
40
+ const itemWithPermissions = useMemo(() => {
41
+ return {
38
42
  ...item,
39
- permissions: permissions[index]
40
- }));
41
- }, [items, permissions]);
42
- }
43
- export default function PostActions({
44
- postType,
45
- postId,
46
- onActionPerformed
47
- }) {
48
- const [activeModalAction, setActiveModalAction] = useState(null);
49
- const _postIds = useMemo(() => {
50
- if (Array.isArray(postId)) {
51
- return postId;
52
- }
53
- return postId ? [postId] : [];
54
- }, [postId]);
55
- const itemsWithPermissions = useEditedEntityRecordsWithPermissions(postType, _postIds);
43
+ permissions
44
+ };
45
+ }, [item, permissions]);
56
46
  const allActions = usePostActions({
57
47
  postType,
58
48
  onActionPerformed
59
49
  });
60
50
  const actions = useMemo(() => {
61
51
  return allActions.filter(action => {
62
- return (!action.isEligible || itemsWithPermissions.some(itemWithPermissions => action.isEligible(itemWithPermissions))) && (itemsWithPermissions.length < 2 || action.supportsBulk);
52
+ return !action.isEligible || action.isEligible(itemWithPermissions);
63
53
  });
64
- }, [allActions, itemsWithPermissions]);
54
+ }, [allActions, itemWithPermissions]);
65
55
  return /*#__PURE__*/_jsxs(_Fragment, {
66
56
  children: [/*#__PURE__*/_jsxs(Menu, {
67
57
  placement: "bottom-end",
@@ -77,13 +67,13 @@ export default function PostActions({
77
67
  }), /*#__PURE__*/_jsx(Menu.Popover, {
78
68
  children: /*#__PURE__*/_jsx(ActionsDropdownMenuGroup, {
79
69
  actions: actions,
80
- items: itemsWithPermissions,
70
+ items: [itemWithPermissions],
81
71
  setActiveModalAction: setActiveModalAction
82
72
  })
83
73
  })]
84
74
  }), !!activeModalAction && /*#__PURE__*/_jsx(ActionModal, {
85
75
  action: activeModalAction,
86
- items: itemsWithPermissions,
76
+ items: [itemWithPermissions],
87
77
  closeModal: () => setActiveModalAction(null)
88
78
  })]
89
79
  });
@@ -1 +1 @@
1
- {"version":3,"names":["useRegistry","useSelect","useState","useMemo","__","privateApis","componentsPrivateApis","Button","Modal","moreVertical","store","coreStore","unlock","usePostActions","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Menu","kebabCase","useEditedEntityRecordsWithPermissions","postType","postIds","items","permissions","select","getEditedEntityRecord","getEntityRecordPermissions","map","postId","item","index","PostActions","onActionPerformed","activeModalAction","setActiveModalAction","_postIds","Array","isArray","itemsWithPermissions","allActions","actions","filter","action","isEligible","some","itemWithPermissions","length","supportsBulk","children","placement","TriggerButton","render","size","icon","label","disabled","accessibleWhenDisabled","className","Popover","ActionsDropdownMenuGroup","ActionModal","closeModal","DropdownMenuItemTrigger","onClick","Item","ItemLabel","title","modalHeader","__experimentalHideHeader","hideModalHeader","onRequestClose","focusOnMount","overlayClassName","id","RenderModal","registry","Group","callback"],"sources":["@wordpress/editor/src/components/post-actions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as componentsPrivateApis,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { usePostActions } from './actions';\n\nconst { Menu, kebabCase } = unlock( componentsPrivateApis );\n\nfunction useEditedEntityRecordsWithPermissions( postType, postIds ) {\n\tconst { items, permissions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getEntityRecordPermissions } =\n\t\t\t\tunlock( select( coreStore ) );\n\t\t\treturn {\n\t\t\t\titems: postIds.map( ( postId ) =>\n\t\t\t\t\tgetEditedEntityRecord( 'postType', postType, postId )\n\t\t\t\t),\n\t\t\t\tpermissions: postIds.map( ( postId ) =>\n\t\t\t\t\tgetEntityRecordPermissions( 'postType', postType, postId )\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postIds, postType ]\n\t);\n\n\treturn useMemo( () => {\n\t\treturn items.map( ( item, index ) => ( {\n\t\t\t...item,\n\t\t\tpermissions: permissions[ index ],\n\t\t} ) );\n\t}, [ items, permissions ] );\n}\n\nexport default function PostActions( { postType, postId, onActionPerformed } ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState( null );\n\tconst _postIds = useMemo( () => {\n\t\tif ( Array.isArray( postId ) ) {\n\t\t\treturn postId;\n\t\t}\n\t\treturn postId ? [ postId ] : [];\n\t}, [ postId ] );\n\n\tconst itemsWithPermissions = useEditedEntityRecordsWithPermissions(\n\t\tpostType,\n\t\t_postIds\n\t);\n\tconst allActions = usePostActions( { postType, onActionPerformed } );\n\n\tconst actions = useMemo( () => {\n\t\treturn allActions.filter( ( action ) => {\n\t\t\treturn (\n\t\t\t\t( ! action.isEligible ||\n\t\t\t\t\titemsWithPermissions.some( ( itemWithPermissions ) =>\n\t\t\t\t\t\taction.isEligible( itemWithPermissions )\n\t\t\t\t\t) ) &&\n\t\t\t\t( itemsWithPermissions.length < 2 || action.supportsBulk )\n\t\t\t);\n\t\t} );\n\t}, [ allActions, itemsWithPermissions ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Menu placement=\"bottom-end\">\n\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"editor-all-actions-button\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<Menu.Popover>\n\t\t\t\t\t<ActionsDropdownMenuGroup\n\t\t\t\t\t\tactions={ actions }\n\t\t\t\t\t\titems={ itemsWithPermissions }\n\t\t\t\t\t\tsetActiveModalAction={ setActiveModalAction }\n\t\t\t\t\t/>\n\t\t\t\t</Menu.Popover>\n\t\t\t</Menu>\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ itemsWithPermissions }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n// From now on all the functions on this file are copied as from the dataviews packages,\n// The editor packages should not be using the dataviews packages directly,\n// and the dataviews package should not be using the editor packages directly,\n// so duplicating the code here seems like the least bad option.\n\nfunction DropdownMenuItemTrigger( { action, onClick, items } ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Menu.Item onClick={ onClick }>\n\t\t\t<Menu.ItemLabel>{ label }</Menu.ItemLabel>\n\t\t</Menu.Item>\n\t);\n}\n\nexport function ActionModal( { action, items, closeModal } ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ action.modalHeader || label }\n\t\t\t__experimentalHideHeader={ !! action.hideModalHeader }\n\t\t\tonRequestClose={ closeModal ?? ( () => {} ) }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"medium\"\n\t\t\toverlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(\n\t\t\t\taction.id\n\t\t\t) }` }\n\t\t>\n\t\t\t<action.RenderModal items={ items } closeModal={ closeModal } />\n\t\t</Modal>\n\t);\n}\n\nfunction ActionsDropdownMenuGroup( { actions, items, setActiveModalAction } ) {\n\tconst registry = useRegistry();\n\treturn (\n\t\t<Menu.Group>\n\t\t\t{ actions.map( ( action ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenuItemTrigger\n\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t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AEqD;UAAS,CAAE,CAAC;QACvC,CAAG;QACHrD,KAAK,EAAGA;MAAO,GATToB,MAAM,CAAC+B,EAUb,CAAC;IAEJ,CAAE;EAAC,CACQ,CAAC;AAEf","ignoreList":[]}
1
+ {"version":3,"names":["useRegistry","useSelect","useState","useMemo","__","privateApis","componentsPrivateApis","Button","Modal","moreVertical","store","coreStore","unlock","usePostActions","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Menu","kebabCase","PostActions","postType","postId","onActionPerformed","activeModalAction","setActiveModalAction","item","permissions","select","getEditedEntityRecord","getEntityRecordPermissions","itemWithPermissions","allActions","actions","filter","action","isEligible","children","placement","TriggerButton","render","size","icon","label","disabled","length","accessibleWhenDisabled","className","Popover","ActionsDropdownMenuGroup","items","ActionModal","closeModal","DropdownMenuItemTrigger","onClick","Item","ItemLabel","title","modalHeader","__experimentalHideHeader","hideModalHeader","onRequestClose","focusOnMount","overlayClassName","id","RenderModal","registry","Group","map","callback"],"sources":["@wordpress/editor/src/components/post-actions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as componentsPrivateApis,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { usePostActions } from './actions';\n\nconst { Menu, kebabCase } = unlock( componentsPrivateApis );\n\nexport default function PostActions( { postType, postId, onActionPerformed } ) {\n\tconst [ activeModalAction, setActiveModalAction ] = useState( null );\n\n\tconst { item, permissions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getEntityRecordPermissions } =\n\t\t\t\tunlock( select( coreStore ) );\n\t\t\treturn {\n\t\t\t\titem: getEditedEntityRecord( 'postType', postType, postId ),\n\t\t\t\tpermissions: getEntityRecordPermissions(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId, postType ]\n\t);\n\tconst itemWithPermissions = useMemo( () => {\n\t\treturn {\n\t\t\t...item,\n\t\t\tpermissions,\n\t\t};\n\t}, [ item, permissions ] );\n\tconst allActions = usePostActions( { postType, onActionPerformed } );\n\n\tconst actions = useMemo( () => {\n\t\treturn allActions.filter( ( action ) => {\n\t\t\treturn (\n\t\t\t\t! action.isEligible || action.isEligible( itemWithPermissions )\n\t\t\t);\n\t\t} );\n\t}, [ allActions, itemWithPermissions ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Menu placement=\"bottom-end\">\n\t\t\t\t<Menu.TriggerButton\n\t\t\t\t\trender={\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\tclassName=\"editor-all-actions-button\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<Menu.Popover>\n\t\t\t\t\t<ActionsDropdownMenuGroup\n\t\t\t\t\t\tactions={ actions }\n\t\t\t\t\t\titems={ [ itemWithPermissions ] }\n\t\t\t\t\t\tsetActiveModalAction={ setActiveModalAction }\n\t\t\t\t\t/>\n\t\t\t\t</Menu.Popover>\n\t\t\t</Menu>\n\t\t\t{ !! activeModalAction && (\n\t\t\t\t<ActionModal\n\t\t\t\t\taction={ activeModalAction }\n\t\t\t\t\titems={ [ itemWithPermissions ] }\n\t\t\t\t\tcloseModal={ () => setActiveModalAction( null ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n// From now on all the functions on this file are copied as from the dataviews packages,\n// The editor packages should not be using the dataviews packages directly,\n// and the dataviews package should not be using the editor packages directly,\n// so duplicating the code here seems like the least bad option.\n\nfunction DropdownMenuItemTrigger( { action, onClick, items } ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Menu.Item onClick={ onClick }>\n\t\t\t<Menu.ItemLabel>{ label }</Menu.ItemLabel>\n\t\t</Menu.Item>\n\t);\n}\n\nexport function ActionModal( { action, items, closeModal } ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ action.modalHeader || label }\n\t\t\t__experimentalHideHeader={ !! action.hideModalHeader }\n\t\t\tonRequestClose={ closeModal ?? ( () => {} ) }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"medium\"\n\t\t\toverlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(\n\t\t\t\taction.id\n\t\t\t) }` }\n\t\t>\n\t\t\t<action.RenderModal items={ items } closeModal={ closeModal } />\n\t\t</Modal>\n\t);\n}\n\nfunction ActionsDropdownMenuGroup( { actions, items, setActiveModalAction } ) {\n\tconst registry = useRegistry();\n\treturn (\n\t\t<Menu.Group>\n\t\t\t{ actions.map( ( action ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenuItemTrigger\n\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( 'RenderModal' in action ) {\n\t\t\t\t\t\t\t\tsetActiveModalAction( action );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taction.callback( items, { registry } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\titems={ items }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Menu.Group>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;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AAA,CAACK,IAAI,CAACiD,KAAK;IAAA9B,QAAA,EACRJ,OAAO,CAACmC,GAAG,CAAIjC,MAAM,IAAM;MAC5B,oBACCtB,IAAA,CAACwC,uBAAuB;QAEvBlB,MAAM,EAAGA,MAAQ;QACjBmB,OAAO,EAAGA,CAAA,KAAM;UACf,IAAK,aAAa,IAAInB,MAAM,EAAG;YAC9BV,oBAAoB,CAAEU,MAAO,CAAC;YAC9B;UACD;UACAA,MAAM,CAACkC,QAAQ,CAAEnB,KAAK,EAAE;YAAEgB;UAAS,CAAE,CAAC;QACvC,CAAG;QACHhB,KAAK,EAAGA;MAAO,GATTf,MAAM,CAAC6B,EAUb,CAAC;IAEJ,CAAE;EAAC,CACQ,CAAC;AAEf","ignoreList":[]}
@@ -28,12 +28,11 @@ export default function PostAuthorCheck({
28
28
  hasAssignAuthorAction,
29
29
  hasAuthors
30
30
  } = useSelect(select => {
31
- var _post$_links$wpActio;
32
31
  const post = select(editorStore).getCurrentPost();
33
- const authors = select(coreStore).getUsers(AUTHORS_QUERY);
32
+ const canAssignAuthor = post?._links?.['wp:action-assign-author'] ? true : false;
34
33
  return {
35
- hasAssignAuthorAction: (_post$_links$wpActio = post._links?.['wp:action-assign-author']) !== null && _post$_links$wpActio !== void 0 ? _post$_links$wpActio : false,
36
- hasAuthors: authors?.length >= 1
34
+ hasAssignAuthorAction: canAssignAuthor,
35
+ hasAuthors: canAssignAuthor ? select(coreStore).getUsers(AUTHORS_QUERY)?.length >= 1 : false
37
36
  };
38
37
  }, []);
39
38
  if (!hasAssignAuthorAction || !hasAuthors) {
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","coreStore","PostTypeSupportCheck","editorStore","AUTHORS_QUERY","jsx","_jsx","PostAuthorCheck","children","hasAssignAuthorAction","hasAuthors","select","_post$_links$wpActio","post","getCurrentPost","authors","getUsers","_links","length","supportKeys"],"sources":["@wordpress/editor/src/components/post-author/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { AUTHORS_QUERY } from './constants';\n\n/**\n * Wrapper component that renders its children only if the post type supports the author.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} The component to be rendered. Return `null` if the post type doesn't\n * supports the author or if there are no authors available.\n */\nexport default function PostAuthorCheck( { children } ) {\n\tconst { hasAssignAuthorAction, hasAuthors } = useSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tconst authors = select( coreStore ).getUsers( AUTHORS_QUERY );\n\t\treturn {\n\t\t\thasAssignAuthorAction:\n\t\t\t\tpost._links?.[ 'wp:action-assign-author' ] ?? false,\n\t\t\thasAuthors: authors?.length >= 1,\n\t\t};\n\t}, [] );\n\n\tif ( ! hasAssignAuthorAction || ! hasAuthors ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"author\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,SAASC,aAAa,QAAQ,aAAa;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA;AASA,eAAe,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACvD,MAAM;IAAEC,qBAAqB;IAAEC;EAAW,CAAC,GAAGX,SAAS,CAAIY,MAAM,IAAM;IAAA,IAAAC,oBAAA;IACtE,MAAMC,IAAI,GAAGF,MAAM,CAAER,WAAY,CAAC,CAACW,cAAc,CAAC,CAAC;IACnD,MAAMC,OAAO,GAAGJ,MAAM,CAAEV,SAAU,CAAC,CAACe,QAAQ,CAAEZ,aAAc,CAAC;IAC7D,OAAO;MACNK,qBAAqB,GAAAG,oBAAA,GACpBC,IAAI,CAACI,MAAM,GAAI,yBAAyB,CAAE,cAAAL,oBAAA,cAAAA,oBAAA,GAAI,KAAK;MACpDF,UAAU,EAAEK,OAAO,EAAEG,MAAM,IAAI;IAChC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAET,qBAAqB,IAAI,CAAEC,UAAU,EAAG;IAC9C,OAAO,IAAI;EACZ;EAEA,oBACCJ,IAAA,CAACJ,oBAAoB;IAACiB,WAAW,EAAC,QAAQ;IAAAX,QAAA,EACvCA;EAAQ,CACW,CAAC;AAEzB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","coreStore","PostTypeSupportCheck","editorStore","AUTHORS_QUERY","jsx","_jsx","PostAuthorCheck","children","hasAssignAuthorAction","hasAuthors","select","post","getCurrentPost","canAssignAuthor","_links","getUsers","length","supportKeys"],"sources":["@wordpress/editor/src/components/post-author/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { AUTHORS_QUERY } from './constants';\n\n/**\n * Wrapper component that renders its children only if the post type supports the author.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} The component to be rendered. Return `null` if the post type doesn't\n * supports the author or if there are no authors available.\n */\nexport default function PostAuthorCheck( { children } ) {\n\tconst { hasAssignAuthorAction, hasAuthors } = useSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tconst canAssignAuthor = post?._links?.[ 'wp:action-assign-author' ]\n\t\t\t? true\n\t\t\t: false;\n\t\treturn {\n\t\t\thasAssignAuthorAction: canAssignAuthor,\n\t\t\thasAuthors: canAssignAuthor\n\t\t\t\t? select( coreStore ).getUsers( AUTHORS_QUERY )?.length >= 1\n\t\t\t\t: false,\n\t\t};\n\t}, [] );\n\n\tif ( ! hasAssignAuthorAction || ! hasAuthors ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"author\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,SAASC,aAAa,QAAQ,aAAa;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA;AASA,eAAe,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACvD,MAAM;IAAEC,qBAAqB;IAAEC;EAAW,CAAC,GAAGX,SAAS,CAAIY,MAAM,IAAM;IACtE,MAAMC,IAAI,GAAGD,MAAM,CAAER,WAAY,CAAC,CAACU,cAAc,CAAC,CAAC;IACnD,MAAMC,eAAe,GAAGF,IAAI,EAAEG,MAAM,GAAI,yBAAyB,CAAE,GAChE,IAAI,GACJ,KAAK;IACR,OAAO;MACNN,qBAAqB,EAAEK,eAAe;MACtCJ,UAAU,EAAEI,eAAe,GACxBH,MAAM,CAAEV,SAAU,CAAC,CAACe,QAAQ,CAAEZ,aAAc,CAAC,EAAEa,MAAM,IAAI,CAAC,GAC1D;IACJ,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAER,qBAAqB,IAAI,CAAEC,UAAU,EAAG;IAC9C,OAAO,IAAI;EACZ;EAEA,oBACCJ,IAAA,CAACJ,oBAAoB;IAACgB,WAAW,EAAC,QAAQ;IAAAV,QAAA,EACvCA;EAAQ,CACW,CAAC;AAEzB","ignoreList":[]}
@@ -20,7 +20,8 @@ export default function PostAuthorCombobox() {
20
20
  } = useDispatch(editorStore);
21
21
  const {
22
22
  authorId,
23
- authorOptions
23
+ authorOptions,
24
+ isLoading
24
25
  } = useAuthorsQuery(fieldValue);
25
26
 
26
27
  /**
@@ -54,7 +55,8 @@ export default function PostAuthorCombobox() {
54
55
  onFilterValueChange: debounce(handleKeydown, 300),
55
56
  onChange: handleSelect,
56
57
  allowReset: false,
57
- hideLabelFromVision: true
58
+ hideLabelFromVision: true,
59
+ isLoading: isLoading
58
60
  });
59
61
  }
60
62
  //# sourceMappingURL=combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["debounce","useState","useDispatch","__","ComboboxControl","store","editorStore","useAuthorsQuery","jsx","_jsx","PostAuthorCombobox","fieldValue","setFieldValue","editPost","authorId","authorOptions","handleSelect","postAuthorId","author","handleKeydown","inputValue","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onFilterValueChange","onChange","allowReset","hideLabelFromVision"],"sources":["@wordpress/editor/src/components/post-author/combobox.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { debounce } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { ComboboxControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAuthorsQuery } from './hook';\n\nexport default function PostAuthorCombobox() {\n\tconst [ fieldValue, setFieldValue ] = useState();\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { authorId, authorOptions } = useAuthorsQuery( fieldValue );\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {number} postAuthorId The selected Author.\n\t */\n\tconst handleSelect = ( postAuthorId ) => {\n\t\tif ( ! postAuthorId ) {\n\t\t\treturn;\n\t\t}\n\t\teditPost( { author: postAuthorId } );\n\t};\n\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\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Author' ) }\n\t\t\toptions={ authorOptions }\n\t\t\tvalue={ authorId }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleSelect }\n\t\t\tallowReset={ false }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;;AAEvD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,eAAe,QAAQ,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,eAAe,SAASC,kBAAkBA,CAAA,EAAG;EAC5C,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAGX,QAAQ,CAAC,CAAC;EAEhD,MAAM;IAAEY;EAAS,CAAC,GAAGX,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAM;IAAEQ,QAAQ;IAAEC;EAAc,CAAC,GAAGR,eAAe,CAAEI,UAAW,CAAC;;EAEjE;AACD;AACA;AACA;AACA;EACC,MAAMK,YAAY,GAAKC,YAAY,IAAM;IACxC,IAAK,CAAEA,YAAY,EAAG;MACrB;IACD;IACAJ,QAAQ,CAAE;MAAEK,MAAM,EAAED;IAAa,CAAE,CAAC;EACrC,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAME,aAAa,GAAKC,UAAU,IAAM;IACvCR,aAAa,CAAEQ,UAAW,CAAC;EAC5B,CAAC;EAED,oBACCX,IAAA,CAACL,eAAe;IACfiB,uBAAuB;IACvBC,qBAAqB;IACrBC,KAAK,EAAGpB,EAAE,CAAE,QAAS,CAAG;IACxBqB,OAAO,EAAGT,aAAe;IACzBU,KAAK,EAAGX,QAAU;IAClBY,mBAAmB,EAAG1B,QAAQ,CAAEmB,aAAa,EAAE,GAAI,CAAG;IACtDQ,QAAQ,EAAGX,YAAc;IACzBY,UAAU,EAAG,KAAO;IACpBC,mBAAmB;EAAA,CACnB,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["debounce","useState","useDispatch","__","ComboboxControl","store","editorStore","useAuthorsQuery","jsx","_jsx","PostAuthorCombobox","fieldValue","setFieldValue","editPost","authorId","authorOptions","isLoading","handleSelect","postAuthorId","author","handleKeydown","inputValue","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onFilterValueChange","onChange","allowReset","hideLabelFromVision"],"sources":["@wordpress/editor/src/components/post-author/combobox.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { debounce } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { ComboboxControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAuthorsQuery } from './hook';\n\nexport default function PostAuthorCombobox() {\n\tconst [ fieldValue, setFieldValue ] = useState();\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { authorId, authorOptions, isLoading } =\n\t\tuseAuthorsQuery( fieldValue );\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {number} postAuthorId The selected Author.\n\t */\n\tconst handleSelect = ( postAuthorId ) => {\n\t\tif ( ! postAuthorId ) {\n\t\t\treturn;\n\t\t}\n\t\teditPost( { author: postAuthorId } );\n\t};\n\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\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Author' ) }\n\t\t\toptions={ authorOptions }\n\t\t\tvalue={ authorId }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleSelect }\n\t\t\tallowReset={ false }\n\t\t\thideLabelFromVision\n\t\t\tisLoading={ isLoading }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;;AAEvD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,eAAe,QAAQ,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzC,eAAe,SAASC,kBAAkBA,CAAA,EAAG;EAC5C,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAGX,QAAQ,CAAC,CAAC;EAEhD,MAAM;IAAEY;EAAS,CAAC,GAAGX,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAM;IAAEQ,QAAQ;IAAEC,aAAa;IAAEC;EAAU,CAAC,GAC3CT,eAAe,CAAEI,UAAW,CAAC;;EAE9B;AACD;AACA;AACA;AACA;EACC,MAAMM,YAAY,GAAKC,YAAY,IAAM;IACxC,IAAK,CAAEA,YAAY,EAAG;MACrB;IACD;IACAL,QAAQ,CAAE;MAAEM,MAAM,EAAED;IAAa,CAAE,CAAC;EACrC,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAME,aAAa,GAAKC,UAAU,IAAM;IACvCT,aAAa,CAAES,UAAW,CAAC;EAC5B,CAAC;EAED,oBACCZ,IAAA,CAACL,eAAe;IACfkB,uBAAuB;IACvBC,qBAAqB;IACrBC,KAAK,EAAGrB,EAAE,CAAE,QAAS,CAAG;IACxBsB,OAAO,EAAGV,aAAe;IACzBW,KAAK,EAAGZ,QAAU;IAClBa,mBAAmB,EAAG3B,QAAQ,CAAEoB,aAAa,EAAE,GAAI,CAAG;IACtDQ,QAAQ,EAAGX,YAAc;IACzBY,UAAU,EAAG,KAAO;IACpBC,mBAAmB;IACnBd,SAAS,EAAGA;EAAW,CACvB,CAAC;AAEJ","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -17,11 +16,13 @@ export function useAuthorsQuery(search) {
17
16
  const {
18
17
  authorId,
19
18
  authors,
20
- postAuthor
19
+ postAuthor,
20
+ isLoading
21
21
  } = useSelect(select => {
22
22
  const {
23
23
  getUser,
24
- getUsers
24
+ getUsers,
25
+ isResolving
25
26
  } = select(coreStore);
26
27
  const {
27
28
  getEditedPostAttribute
@@ -37,7 +38,8 @@ export function useAuthorsQuery(search) {
37
38
  return {
38
39
  authorId: _authorId,
39
40
  authors: getUsers(query),
40
- postAuthor: getUser(_authorId, BASE_QUERY)
41
+ postAuthor: getUser(_authorId, BASE_QUERY),
42
+ isLoading: isResolving('getUsers', [query])
41
43
  };
42
44
  }, [search]);
43
45
  const authorOptions = useMemo(() => {
@@ -69,7 +71,8 @@ export function useAuthorsQuery(search) {
69
71
  return {
70
72
  authorId,
71
73
  authorOptions,
72
- postAuthor
74
+ postAuthor,
75
+ isLoading
73
76
  };
74
77
  }
75
78
  //# sourceMappingURL=hook.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","useMemo","useSelect","decodeEntities","store","coreStore","editorStore","AUTHORS_QUERY","BASE_QUERY","useAuthorsQuery","search","authorId","authors","postAuthor","select","getUser","getUsers","getEditedPostAttribute","_authorId","query","search_columns","authorOptions","fetchedAuthors","map","author","value","id","label","name","foundAuthor","findIndex","currentAuthor"],"sources":["@wordpress/editor/src/components/post-author/hook.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { AUTHORS_QUERY, BASE_QUERY } from './constants';\n\nexport function useAuthorsQuery( search ) {\n\tconst { authorId, authors, postAuthor } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getUser, getUsers } = select( coreStore );\n\t\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\t\tconst _authorId = getEditedPostAttribute( 'author' );\n\t\t\tconst query = { ...AUTHORS_QUERY };\n\n\t\t\tif ( search ) {\n\t\t\t\tquery.search = search;\n\t\t\t\tquery.search_columns = [ 'name' ];\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthors: getUsers( query ),\n\t\t\t\tpostAuthor: getUser( _authorId, BASE_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[ search ]\n\t);\n\n\tconst authorOptions = useMemo( () => {\n\t\tconst fetchedAuthors = ( authors ?? [] ).map( ( author ) => {\n\t\t\treturn {\n\t\t\t\tvalue: author.id,\n\t\t\t\tlabel: decodeEntities( author.name ),\n\t\t\t};\n\t\t} );\n\n\t\t// Ensure the current author is included in the dropdown list.\n\t\tconst foundAuthor = fetchedAuthors.findIndex(\n\t\t\t( { value } ) => postAuthor?.id === value\n\t\t);\n\n\t\tlet currentAuthor = [];\n\t\tif ( foundAuthor < 0 && postAuthor ) {\n\t\t\tcurrentAuthor = [\n\t\t\t\t{\n\t\t\t\t\tvalue: postAuthor.id,\n\t\t\t\t\tlabel: decodeEntities( postAuthor.name ),\n\t\t\t\t},\n\t\t\t];\n\t\t} else if ( foundAuthor < 0 && ! postAuthor ) {\n\t\t\tcurrentAuthor = [\n\t\t\t\t{\n\t\t\t\t\tvalue: 0,\n\t\t\t\t\tlabel: __( '(No author)' ),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn [ ...currentAuthor, ...fetchedAuthors ];\n\t}, [ authors, postAuthor ] );\n\n\treturn { authorId, authorOptions, postAuthor };\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,SAASC,aAAa,EAAEC,UAAU,QAAQ,aAAa;AAEvD,OAAO,SAASC,eAAeA,CAAEC,MAAM,EAAG;EACzC,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAW,CAAC,GAAGX,SAAS,CAChDY,MAAM,IAAM;IACb,MAAM;MAAEC,OAAO;MAAEC;IAAS,CAAC,GAAGF,MAAM,CAAET,SAAU,CAAC;IACjD,MAAM;MAAEY;IAAuB,CAAC,GAAGH,MAAM,CAAER,WAAY,CAAC;IACxD,MAAMY,SAAS,GAAGD,sBAAsB,CAAE,QAAS,CAAC;IACpD,MAAME,KAAK,GAAG;MAAE,GAAGZ;IAAc,CAAC;IAElC,IAAKG,MAAM,EAAG;MACbS,KAAK,CAACT,MAAM,GAAGA,MAAM;MACrBS,KAAK,CAACC,cAAc,GAAG,CAAE,MAAM,CAAE;IAClC;IAEA,OAAO;MACNT,QAAQ,EAAEO,SAAS;MACnBN,OAAO,EAAEI,QAAQ,CAAEG,KAAM,CAAC;MAC1BN,UAAU,EAAEE,OAAO,CAAEG,SAAS,EAAEV,UAAW;IAC5C,CAAC;EACF,CAAC,EACD,CAAEE,MAAM,CACT,CAAC;EAED,MAAMW,aAAa,GAAGpB,OAAO,CAAE,MAAM;IACpC,MAAMqB,cAAc,GAAG,CAAEV,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,EAAE,EAAGW,GAAG,CAAIC,MAAM,IAAM;MAC3D,OAAO;QACNC,KAAK,EAAED,MAAM,CAACE,EAAE;QAChBC,KAAK,EAAExB,cAAc,CAAEqB,MAAM,CAACI,IAAK;MACpC,CAAC;IACF,CAAE,CAAC;;IAEH;IACA,MAAMC,WAAW,GAAGP,cAAc,CAACQ,SAAS,CAC3C,CAAE;MAAEL;IAAM,CAAC,KAAMZ,UAAU,EAAEa,EAAE,KAAKD,KACrC,CAAC;IAED,IAAIM,aAAa,GAAG,EAAE;IACtB,IAAKF,WAAW,GAAG,CAAC,IAAIhB,UAAU,EAAG;MACpCkB,aAAa,GAAG,CACf;QACCN,KAAK,EAAEZ,UAAU,CAACa,EAAE;QACpBC,KAAK,EAAExB,cAAc,CAAEU,UAAU,CAACe,IAAK;MACxC,CAAC,CACD;IACF,CAAC,MAAM,IAAKC,WAAW,GAAG,CAAC,IAAI,CAAEhB,UAAU,EAAG;MAC7CkB,aAAa,GAAG,CACf;QACCN,KAAK,EAAE,CAAC;QACRE,KAAK,EAAE3B,EAAE,CAAE,aAAc;MAC1B,CAAC,CACD;IACF;IAEA,OAAO,CAAE,GAAG+B,aAAa,EAAE,GAAGT,cAAc,CAAE;EAC/C,CAAC,EAAE,CAAEV,OAAO,EAAEC,UAAU,CAAG,CAAC;EAE5B,OAAO;IAAEF,QAAQ;IAAEU,aAAa;IAAER;EAAW,CAAC;AAC/C","ignoreList":[]}
1
+ {"version":3,"names":["__","useMemo","useSelect","decodeEntities","store","coreStore","editorStore","AUTHORS_QUERY","BASE_QUERY","useAuthorsQuery","search","authorId","authors","postAuthor","isLoading","select","getUser","getUsers","isResolving","getEditedPostAttribute","_authorId","query","search_columns","authorOptions","fetchedAuthors","map","author","value","id","label","name","foundAuthor","findIndex","currentAuthor"],"sources":["@wordpress/editor/src/components/post-author/hook.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { AUTHORS_QUERY, BASE_QUERY } from './constants';\n\nexport function useAuthorsQuery( search ) {\n\tconst { authorId, authors, postAuthor, isLoading } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getUser, getUsers, isResolving } = select( coreStore );\n\t\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\t\tconst _authorId = getEditedPostAttribute( 'author' );\n\t\t\tconst query = { ...AUTHORS_QUERY };\n\n\t\t\tif ( search ) {\n\t\t\t\tquery.search = search;\n\t\t\t\tquery.search_columns = [ 'name' ];\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthors: getUsers( query ),\n\t\t\t\tpostAuthor: getUser( _authorId, BASE_QUERY ),\n\t\t\t\tisLoading: isResolving( 'getUsers', [ query ] ),\n\t\t\t};\n\t\t},\n\t\t[ search ]\n\t);\n\n\tconst authorOptions = useMemo( () => {\n\t\tconst fetchedAuthors = ( authors ?? [] ).map( ( author ) => {\n\t\t\treturn {\n\t\t\t\tvalue: author.id,\n\t\t\t\tlabel: decodeEntities( author.name ),\n\t\t\t};\n\t\t} );\n\n\t\t// Ensure the current author is included in the dropdown list.\n\t\tconst foundAuthor = fetchedAuthors.findIndex(\n\t\t\t( { value } ) => postAuthor?.id === value\n\t\t);\n\n\t\tlet currentAuthor = [];\n\t\tif ( foundAuthor < 0 && postAuthor ) {\n\t\t\tcurrentAuthor = [\n\t\t\t\t{\n\t\t\t\t\tvalue: postAuthor.id,\n\t\t\t\t\tlabel: decodeEntities( postAuthor.name ),\n\t\t\t\t},\n\t\t\t];\n\t\t} else if ( foundAuthor < 0 && ! postAuthor ) {\n\t\t\tcurrentAuthor = [\n\t\t\t\t{\n\t\t\t\t\tvalue: 0,\n\t\t\t\t\tlabel: __( '(No author)' ),\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn [ ...currentAuthor, ...fetchedAuthors ];\n\t}, [ authors, postAuthor ] );\n\n\treturn { authorId, authorOptions, postAuthor, isLoading };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,SAASC,aAAa,EAAEC,UAAU,QAAQ,aAAa;AAEvD,OAAO,SAASC,eAAeA,CAAEC,MAAM,EAAG;EACzC,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC,UAAU;IAAEC;EAAU,CAAC,GAAGZ,SAAS,CAC3Da,MAAM,IAAM;IACb,MAAM;MAAEC,OAAO;MAAEC,QAAQ;MAAEC;IAAY,CAAC,GAAGH,MAAM,CAAEV,SAAU,CAAC;IAC9D,MAAM;MAAEc;IAAuB,CAAC,GAAGJ,MAAM,CAAET,WAAY,CAAC;IACxD,MAAMc,SAAS,GAAGD,sBAAsB,CAAE,QAAS,CAAC;IACpD,MAAME,KAAK,GAAG;MAAE,GAAGd;IAAc,CAAC;IAElC,IAAKG,MAAM,EAAG;MACbW,KAAK,CAACX,MAAM,GAAGA,MAAM;MACrBW,KAAK,CAACC,cAAc,GAAG,CAAE,MAAM,CAAE;IAClC;IAEA,OAAO;MACNX,QAAQ,EAAES,SAAS;MACnBR,OAAO,EAAEK,QAAQ,CAAEI,KAAM,CAAC;MAC1BR,UAAU,EAAEG,OAAO,CAAEI,SAAS,EAAE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/_jsx(Badge, {
102
102
  children: pageTypeBadge
103
103
  })]
104
- }), /*#__PURE__*/_jsx(PostActions, {
104
+ }), postIds.length === 1 && /*#__PURE__*/_jsx(PostActions, {
105
105
  postType: postType,
106
- postId: postId,
106
+ postId: postIds[0],
107
107
  onActionPerformed: onActionPerformed
108
108
  })]
109
109
  }), postIds.length > 1 && /*#__PURE__*/_jsx(Text, {
@@ -1 +1 @@
1
- {"version":3,"names":["Icon","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalText","Text","privateApis","componentsPrivateApis","store","coreStore","useSelect","useMemo","__","sprintf","__unstableStripHTML","stripHTML","editorStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","unlock","PostActions","usePageTypeBadge","getTemplateInfo","jsx","_jsx","jsxs","_jsxs","Badge","PostCardPanel","postType","postId","onActionPerformed","postIds","Array","isArray","postTitle","icon","labels","select","getEditedEntityRecord","getEntityRecord","getPostType","getPostIcon","_title","_record","length","_getEntityRecord","default_template_types","templateTypes","_templateInfo","includes","template","title","area","pageTypeBadge","name","spacing","className","children","align","numberOfLines","truncate","as","toLowerCase"],"sources":["@wordpress/editor/src/components/post-card-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport PostActions from '../post-actions';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\nconst { Badge } = unlock( componentsPrivateApis );\n\n/**\n * Renders a title of the post type and the available quick actions available within a 3-dot dropdown.\n *\n * @param {Object} props - Component props.\n * @param {string} [props.postType] - The post type string.\n * @param {string|string[]} [props.postId] - The post id or list of post ids.\n * @param {Function} [props.onActionPerformed] - A callback function for when a quick action is performed.\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostCardPanel( {\n\tpostType,\n\tpostId,\n\tonActionPerformed,\n} ) {\n\tconst postIds = useMemo(\n\t\t() => ( Array.isArray( postId ) ? postId : [ postId ] ),\n\t\t[ postId ]\n\t);\n\tconst { postTitle, icon, labels } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getEntityRecord, getPostType } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getPostIcon } = unlock( select( editorStore ) );\n\t\t\tlet _title = '';\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostIds[ 0 ]\n\t\t\t);\n\t\t\tif ( postIds.length === 1 ) {\n\t\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\t\tgetEntityRecord( 'root', '__unstableBase' ) ?? {};\n\n\t\t\t\tconst _templateInfo = [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t].includes( postType )\n\t\t\t\t\t? getTemplateInfo( {\n\t\t\t\t\t\t\ttemplate: _record,\n\t\t\t\t\t\t\ttemplateTypes,\n\t\t\t\t\t } )\n\t\t\t\t\t: {};\n\t\t\t\t_title = _templateInfo?.title || _record?.title;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tpostTitle: _title,\n\t\t\t\ticon: getPostIcon( postType, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t};\n\t\t},\n\t\t[ postIds, postType ]\n\t);\n\n\tconst pageTypeBadge = usePageTypeBadge( postId );\n\tlet title = __( 'No title' );\n\tif ( labels?.name && postIds.length > 1 ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: %i number of selected items %s: Name of the plural post type e.g: \"Posts\".\n\t\t\t__( '%i %s' ),\n\t\t\tpostId.length,\n\t\t\tlabels?.name\n\t\t);\n\t} else if ( postTitle ) {\n\t\ttitle = stripHTML( postTitle );\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 1 } className=\"editor-post-card-panel\">\n\t\t\t<HStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\talign=\"flex-start\"\n\t\t\t>\n\t\t\t\t<Icon className=\"editor-post-card-panel__icon\" icon={ icon } />\n\t\t\t\t<Text\n\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\ttruncate\n\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"editor-post-card-panel__title-name\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</span>\n\t\t\t\t\t{ pageTypeBadge && postIds.length === 1 && (\n\t\t\t\t\t\t<Badge>{ pageTypeBadge }</Badge>\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t\t<PostActions\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t\t{ postIds.length > 1 && (\n\t\t\t\t<Text className=\"editor-post-card-panel__description\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: %s: Name of the plural post type e.g: \"Posts\".\n\t\t\t\t\t\t__( 'Changes will be applied to all selected %s.' ),\n\t\t\t\t\t\tlabels?.name.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;A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experimentalVStack","VStack","__experimentalText","Text","privateApis","componentsPrivateApis","store","coreStore","useSelect","useMemo","__","sprintf","__unstableStripHTML","stripHTML","editorStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","unlock","PostActions","usePageTypeBadge","getTemplateInfo","jsx","_jsx","jsxs","_jsxs","Badge","PostCardPanel","postType","postId","onActionPerformed","postIds","Array","isArray","postTitle","icon","labels","select","getEditedEntityRecord","getEntityRecord","getPostType","getPostIcon","_title","_record","length","_getEntityRecord","default_template_types","templateTypes","_templateInfo","includes","template","title","area","pageTypeBadge","name","spacing","className","children","align","numberOfLines","truncate","as","toLowerCase"],"sources":["@wordpress/editor/src/components/post-card-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport PostActions from '../post-actions';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\nconst { Badge } = unlock( componentsPrivateApis );\n\n/**\n * Renders a title of the post type and the available quick actions available within a 3-dot dropdown.\n *\n * @param {Object} props - Component props.\n * @param {string} [props.postType] - The post type string.\n * @param {string|string[]} [props.postId] - The post id or list of post ids.\n * @param {Function} [props.onActionPerformed] - A callback function for when a quick action is performed.\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostCardPanel( {\n\tpostType,\n\tpostId,\n\tonActionPerformed,\n} ) {\n\tconst postIds = useMemo(\n\t\t() => ( Array.isArray( postId ) ? postId : [ postId ] ),\n\t\t[ postId ]\n\t);\n\tconst { postTitle, icon, labels } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getEntityRecord, getPostType } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getPostIcon } = unlock( select( editorStore ) );\n\t\t\tlet _title = '';\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostIds[ 0 ]\n\t\t\t);\n\t\t\tif ( postIds.length === 1 ) {\n\t\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\t\tgetEntityRecord( 'root', '__unstableBase' ) ?? {};\n\n\t\t\t\tconst _templateInfo = [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t].includes( postType )\n\t\t\t\t\t? getTemplateInfo( {\n\t\t\t\t\t\t\ttemplate: _record,\n\t\t\t\t\t\t\ttemplateTypes,\n\t\t\t\t\t } )\n\t\t\t\t\t: {};\n\t\t\t\t_title = _templateInfo?.title || _record?.title;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tpostTitle: _title,\n\t\t\t\ticon: getPostIcon( postType, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t};\n\t\t},\n\t\t[ postIds, postType ]\n\t);\n\n\tconst pageTypeBadge = usePageTypeBadge( postId );\n\tlet title = __( 'No title' );\n\tif ( labels?.name && postIds.length > 1 ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: %i number of selected items %s: Name of the plural post type e.g: \"Posts\".\n\t\t\t__( '%i %s' ),\n\t\t\tpostId.length,\n\t\t\tlabels?.name\n\t\t);\n\t} else if ( postTitle ) {\n\t\ttitle = stripHTML( postTitle );\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 1 } className=\"editor-post-card-panel\">\n\t\t\t<HStack\n\t\t\t\tspacing={ 2 }\n\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\talign=\"flex-start\"\n\t\t\t>\n\t\t\t\t<Icon className=\"editor-post-card-panel__icon\" icon={ icon } />\n\t\t\t\t<Text\n\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\ttruncate\n\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\tas=\"h2\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"editor-post-card-panel__title-name\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</span>\n\t\t\t\t\t{ pageTypeBadge && postIds.length === 1 && (\n\t\t\t\t\t\t<Badge>{ pageTypeBadge }</Badge>\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t\t{ postIds.length === 1 && (\n\t\t\t\t\t<PostActions\n\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\tpostId={ postIds[ 0 ] }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ postIds.length > 1 && (\n\t\t\t\t<Text className=\"editor-post-card-panel__description\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: %s: Name of the plural post type e.g: \"Posts\".\n\t\t\t\t\t\t__( 'Changes will be applied to all selected %s.' ),\n\t\t\t\t\t\tlabels?.name.toLowerCase()\n\t\t\t\t\t) }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,IAAI,EACJC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,EAC1BC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAA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AAA,CAACzB,MAAM;MACNuD,OAAO,EAAG,CAAG;MACbC,SAAS,EAAC,gCAAgC;MAC1CE,KAAK,EAAC,YAAY;MAAAD,QAAA,gBAElBlC,IAAA,CAACzB,IAAI;QAAC0D,SAAS,EAAC,8BAA8B;QAACrB,IAAI,EAAGA;MAAM,CAAE,CAAC,eAC/DV,KAAA,CAACrB,IAAI;QACJuD,aAAa,EAAG,CAAG;QACnBC,QAAQ;QACRJ,SAAS,EAAC,+BAA+B;QACzCK,EAAE,EAAC,IAAI;QAAAJ,QAAA,gBAEPlC,IAAA;UAAMiC,SAAS,EAAC,oCAAoC;UAAAC,QAAA,EACjDN;QAAK,CACF,CAAC,EACLE,aAAa,IAAItB,OAAO,CAACa,MAAM,KAAK,CAAC,iBACtCrB,IAAA,CAACG,KAAK;UAAA+B,QAAA,EAAGJ;QAAa,CAAS,CAC/B;MAAA,CACI,CAAC,EACLtB,OAAO,CAACa,MAAM,KAAK,CAAC,iBACrBrB,IAAA,CAACJ,WAAW;QACXS,QAAQ,EAAGA,QAAU;QACrBC,MAAM,EAAGE,OAAO,CAAE,CAAC,CAAI;QACvBD,iBAAiB,EAAGA;MAAmB,CACvC,CACD;IAAA,CACM,CAAC,EACPC,OAAO,CAACa,MAAM,GAAG,CAAC,iBACnBrB,IAAA,CAACnB,IAAI;MAACoD,SAAS,EAAC,qCAAqC;MAAAC,QAAA,EAClD7C,OAAO;MACR;MACAD,EAAE,CAAE,6CAA8C,CAAC,EACnDyB,MAAM,EAAEkB,IAAI,CAACQ,WAAW,CAAC,CAC1B;IAAC,CACI,CACN;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
@@ -97,7 +97,8 @@ function PostFeaturedImage({
97
97
  onError(message) {
98
98
  noticeOperations.removeAllNotices();
99
99
  noticeOperations.createErrorNotice(message);
100
- }
100
+ },
101
+ multiple: false
101
102
  });
102
103
  }
103
104
 
@@ -253,7 +254,8 @@ const applyWithDispatch = withDispatch((dispatch, {
253
254
  onError(message) {
254
255
  noticeOperations.removeAllNotices();
255
256
  noticeOperations.createErrorNotice(message);
256
- }
257
+ },
258
+ multiple: false
257
259
  });
258
260
  },
259
261
  onRemoveImage() {