@wordpress/editor 14.12.0 → 14.13.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 (742) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +120 -99
  3. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  4. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  5. package/build/components/collab-sidebar/add-comment.js +17 -65
  6. package/build/components/collab-sidebar/add-comment.js.map +1 -1
  7. package/build/components/collab-sidebar/comment-author-info.js +76 -0
  8. package/build/components/collab-sidebar/comment-author-info.js.map +1 -0
  9. package/build/components/collab-sidebar/comment-button-toolbar.js +2 -2
  10. package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
  11. package/build/components/collab-sidebar/comment-button.js +2 -2
  12. package/build/components/collab-sidebar/comment-button.js.map +1 -1
  13. package/build/components/collab-sidebar/comment-form.js +64 -0
  14. package/build/components/collab-sidebar/comment-form.js.map +1 -0
  15. package/build/components/collab-sidebar/comments.js +33 -91
  16. package/build/components/collab-sidebar/comments.js.map +1 -1
  17. package/build/components/create-template-part-modal/index.js +1 -2
  18. package/build/components/create-template-part-modal/index.js.map +1 -1
  19. package/build/components/document-bar/index.js +10 -3
  20. package/build/components/document-bar/index.js.map +1 -1
  21. package/build/components/document-outline/check.js +4 -4
  22. package/build/components/document-outline/check.js.map +1 -1
  23. package/build/components/document-outline/index.js +8 -8
  24. package/build/components/document-outline/index.js.map +1 -1
  25. package/build/components/document-tools/index.js +1 -1
  26. package/build/components/document-tools/index.js.map +1 -1
  27. package/build/components/editor-history/redo.js +1 -1
  28. package/build/components/editor-history/redo.js.map +1 -1
  29. package/build/components/editor-history/undo.js +1 -1
  30. package/build/components/editor-history/undo.js.map +1 -1
  31. package/build/components/editor-interface/content-slot-fill.js +1 -10
  32. package/build/components/editor-interface/content-slot-fill.js.map +1 -1
  33. package/build/components/editor-interface/index.js +3 -9
  34. package/build/components/editor-interface/index.js.map +1 -1
  35. package/build/components/editor-notices/index.js +1 -1
  36. package/build/components/editor-notices/index.js.map +1 -1
  37. package/build/components/editor-snackbars/index.js +1 -1
  38. package/build/components/editor-snackbars/index.js.map +1 -1
  39. package/build/components/entities-saved-states/entity-record-item.js +9 -1
  40. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  41. package/build/components/entities-saved-states/index.js +2 -2
  42. package/build/components/entities-saved-states/index.js.map +1 -1
  43. package/build/components/page-attributes/check.js +3 -3
  44. package/build/components/page-attributes/check.js.map +1 -1
  45. package/build/components/page-attributes/order.js +1 -1
  46. package/build/components/page-attributes/order.js.map +1 -1
  47. package/build/components/page-attributes/panel.js +1 -1
  48. package/build/components/page-attributes/panel.js.map +1 -1
  49. package/build/components/page-attributes/parent.js +1 -1
  50. package/build/components/page-attributes/parent.js.map +1 -1
  51. package/build/components/plugin-document-setting-panel/index.js +2 -2
  52. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  53. package/build/components/plugin-more-menu-item/index.js +2 -1
  54. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  55. package/build/components/plugin-post-publish-panel/index.js +2 -2
  56. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  57. package/build/components/plugin-post-status-info/index.js +4 -4
  58. package/build/components/plugin-post-status-info/index.js.map +1 -1
  59. package/build/components/plugin-pre-publish-panel/index.js +2 -2
  60. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  61. package/build/components/plugin-preview-menu-item/index.js +2 -1
  62. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  63. package/build/components/plugin-sidebar/index.js +1 -0
  64. package/build/components/plugin-sidebar/index.js.map +1 -1
  65. package/build/components/plugin-sidebar-more-menu-item/index.js +2 -1
  66. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  67. package/build/components/post-actions/actions.js +3 -3
  68. package/build/components/post-actions/actions.js.map +1 -1
  69. package/build/components/post-author/check.js +3 -3
  70. package/build/components/post-author/check.js.map +1 -1
  71. package/build/components/post-author/index.js +1 -1
  72. package/build/components/post-author/index.js.map +1 -1
  73. package/build/components/post-author/panel.js +1 -1
  74. package/build/components/post-author/panel.js.map +1 -1
  75. package/build/components/post-card-panel/index.js +9 -4
  76. package/build/components/post-card-panel/index.js.map +1 -1
  77. package/build/components/post-comments/index.js +1 -1
  78. package/build/components/post-comments/index.js.map +1 -1
  79. package/build/components/post-discussion/panel.js +1 -1
  80. package/build/components/post-discussion/panel.js.map +1 -1
  81. package/build/components/post-excerpt/check.js +3 -3
  82. package/build/components/post-excerpt/check.js.map +1 -1
  83. package/build/components/post-excerpt/panel.js +1 -1
  84. package/build/components/post-excerpt/panel.js.map +1 -1
  85. package/build/components/post-excerpt/plugin.js +4 -4
  86. package/build/components/post-excerpt/plugin.js.map +1 -1
  87. package/build/components/post-featured-image/check.js +3 -3
  88. package/build/components/post-featured-image/check.js.map +1 -1
  89. package/build/components/post-featured-image/index.js +39 -9
  90. package/build/components/post-featured-image/index.js.map +1 -1
  91. package/build/components/post-featured-image/panel.js +1 -1
  92. package/build/components/post-featured-image/panel.js.map +1 -1
  93. package/build/components/post-fields/index.js +70 -0
  94. package/build/components/post-fields/index.js.map +1 -0
  95. package/build/components/post-format/check.js +9 -12
  96. package/build/components/post-format/check.js.map +1 -1
  97. package/build/components/post-format/index.js +1 -1
  98. package/build/components/post-format/index.js.map +1 -1
  99. package/build/components/post-format/panel.js +1 -1
  100. package/build/components/post-format/panel.js.map +1 -1
  101. package/build/components/post-last-revision/check.js +3 -3
  102. package/build/components/post-last-revision/check.js.map +1 -1
  103. package/build/components/post-last-revision/index.js +1 -1
  104. package/build/components/post-last-revision/index.js.map +1 -1
  105. package/build/components/post-last-revision/panel.js +1 -1
  106. package/build/components/post-last-revision/panel.js.map +1 -1
  107. package/build/components/post-locked-modal/index.js +1 -1
  108. package/build/components/post-locked-modal/index.js.map +1 -1
  109. package/build/components/post-pending-status/check.js +3 -3
  110. package/build/components/post-pending-status/check.js.map +1 -1
  111. package/build/components/post-pending-status/index.js +1 -1
  112. package/build/components/post-pending-status/index.js.map +1 -1
  113. package/build/components/post-preview-button/index.js +1 -1
  114. package/build/components/post-preview-button/index.js.map +1 -1
  115. package/build/components/post-publish-panel/index.js +5 -2
  116. package/build/components/post-publish-panel/index.js.map +1 -1
  117. package/build/components/post-schedule/check.js +3 -3
  118. package/build/components/post-schedule/check.js.map +1 -1
  119. package/build/components/post-schedule/index.js +1 -1
  120. package/build/components/post-schedule/index.js.map +1 -1
  121. package/build/components/post-schedule/label.js +1 -1
  122. package/build/components/post-schedule/label.js.map +1 -1
  123. package/build/components/post-schedule/panel.js +1 -1
  124. package/build/components/post-schedule/panel.js.map +1 -1
  125. package/build/components/post-slug/check.js +3 -3
  126. package/build/components/post-slug/check.js.map +1 -1
  127. package/build/components/post-slug/index.js +1 -1
  128. package/build/components/post-slug/index.js.map +1 -1
  129. package/build/components/post-sticky/check.js +3 -3
  130. package/build/components/post-sticky/check.js.map +1 -1
  131. package/build/components/post-sticky/index.js +1 -1
  132. package/build/components/post-sticky/index.js.map +1 -1
  133. package/build/components/post-switch-to-draft-button/index.js +1 -1
  134. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  135. package/build/components/post-sync-status/index.js +1 -1
  136. package/build/components/post-sync-status/index.js.map +1 -1
  137. package/build/components/post-taxonomies/check.js +3 -3
  138. package/build/components/post-taxonomies/check.js.map +1 -1
  139. package/build/components/post-taxonomies/flat-term-selector.js +1 -1
  140. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  141. package/build/components/post-taxonomies/panel.js +16 -13
  142. package/build/components/post-taxonomies/panel.js.map +1 -1
  143. package/build/components/post-template/classic-theme.js +2 -2
  144. package/build/components/post-template/classic-theme.js.map +1 -1
  145. package/build/components/post-template/panel.js +1 -1
  146. package/build/components/post-template/panel.js.map +1 -1
  147. package/build/components/post-text-editor/index.js +1 -1
  148. package/build/components/post-text-editor/index.js.map +1 -1
  149. package/build/components/post-title/index.js +20 -18
  150. package/build/components/post-title/index.js.map +1 -1
  151. package/build/components/post-title/post-title-raw.js +1 -1
  152. package/build/components/post-title/post-title-raw.js.map +1 -1
  153. package/build/components/post-trash/check.js +3 -3
  154. package/build/components/post-trash/check.js.map +1 -1
  155. package/build/components/post-trash/index.js +1 -1
  156. package/build/components/post-trash/index.js.map +1 -1
  157. package/build/components/post-type-support-check/index.js +6 -6
  158. package/build/components/post-type-support-check/index.js.map +1 -1
  159. package/build/components/post-url/check.js +3 -3
  160. package/build/components/post-url/check.js.map +1 -1
  161. package/build/components/post-url/index.js +1 -1
  162. package/build/components/post-url/index.js.map +1 -1
  163. package/build/components/post-url/label.js +1 -1
  164. package/build/components/post-url/label.js.map +1 -1
  165. package/build/components/post-url/panel.js +1 -1
  166. package/build/components/post-url/panel.js.map +1 -1
  167. package/build/components/post-visibility/check.js +1 -1
  168. package/build/components/post-visibility/check.js.map +1 -1
  169. package/build/components/post-visibility/index.js +1 -1
  170. package/build/components/post-visibility/index.js.map +1 -1
  171. package/build/components/preferences-modal/block-visibility.js +87 -0
  172. package/build/components/preferences-modal/block-visibility.js.map +1 -0
  173. package/build/components/preferences-modal/enable-panel.js +27 -19
  174. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  175. package/build/components/preferences-modal/enable-publish-sidebar.js +13 -10
  176. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  177. package/build/components/preferences-modal/index.js +2 -2
  178. package/build/components/preferences-modal/index.js.map +1 -1
  179. package/build/components/provider/index.js +14 -8
  180. package/build/components/provider/index.js.map +1 -1
  181. package/build/components/table-of-contents/index.js +1 -1
  182. package/build/components/table-of-contents/index.js.map +1 -1
  183. package/build/components/theme-support-check/index.js +4 -4
  184. package/build/components/theme-support-check/index.js.map +1 -1
  185. package/build/components/time-to-read/index.js +1 -1
  186. package/build/components/time-to-read/index.js.map +1 -1
  187. package/build/components/unsaved-changes-warning/index.js +1 -1
  188. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  189. package/build/components/word-count/index.js +1 -1
  190. package/build/components/word-count/index.js.map +1 -1
  191. package/build/components/zoom-out-toggle/index.js +8 -3
  192. package/build/components/zoom-out-toggle/index.js.map +1 -1
  193. package/build/dataviews/api.js +41 -0
  194. package/build/dataviews/api.js.map +1 -1
  195. package/build/dataviews/store/private-actions.js +26 -4
  196. package/build/dataviews/store/private-actions.js.map +1 -1
  197. package/build/dataviews/store/private-selectors.js +5 -0
  198. package/build/dataviews/store/private-selectors.js.map +1 -1
  199. package/build/dataviews/store/reducer.js +23 -0
  200. package/build/dataviews/store/reducer.js.map +1 -1
  201. package/build/private-apis.js +4 -0
  202. package/build/private-apis.js.map +1 -1
  203. package/build/store/actions.js +11 -9
  204. package/build/store/actions.js.map +1 -1
  205. package/build/store/private-selectors.js +5 -1
  206. package/build/store/private-selectors.js.map +1 -1
  207. package/build/store/reducer.native.js +1 -0
  208. package/build/store/reducer.native.js.map +1 -1
  209. package/build/store/selectors.js +34 -42
  210. package/build/store/selectors.js.map +1 -1
  211. package/build/utils/get-template-info.js +60 -0
  212. package/build/utils/get-template-info.js.map +1 -0
  213. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  214. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  215. package/build-module/components/collab-sidebar/add-comment.js +18 -67
  216. package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
  217. package/build-module/components/collab-sidebar/comment-author-info.js +71 -0
  218. package/build-module/components/collab-sidebar/comment-author-info.js.map +1 -0
  219. package/build-module/components/collab-sidebar/comment-button-toolbar.js +2 -2
  220. package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
  221. package/build-module/components/collab-sidebar/comment-button.js +2 -2
  222. package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
  223. package/build-module/components/collab-sidebar/comment-form.js +59 -0
  224. package/build-module/components/collab-sidebar/comment-form.js.map +1 -0
  225. package/build-module/components/collab-sidebar/comments.js +33 -91
  226. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  227. package/build-module/components/create-template-part-modal/index.js +1 -2
  228. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  229. package/build-module/components/document-bar/index.js +10 -3
  230. package/build-module/components/document-bar/index.js.map +1 -1
  231. package/build-module/components/document-outline/check.js +4 -4
  232. package/build-module/components/document-outline/check.js.map +1 -1
  233. package/build-module/components/document-outline/index.js +8 -8
  234. package/build-module/components/document-outline/index.js.map +1 -1
  235. package/build-module/components/document-tools/index.js +1 -1
  236. package/build-module/components/document-tools/index.js.map +1 -1
  237. package/build-module/components/editor-history/redo.js +1 -1
  238. package/build-module/components/editor-history/redo.js.map +1 -1
  239. package/build-module/components/editor-history/undo.js +1 -1
  240. package/build-module/components/editor-history/undo.js.map +1 -1
  241. package/build-module/components/editor-interface/content-slot-fill.js +2 -11
  242. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -1
  243. package/build-module/components/editor-interface/index.js +4 -10
  244. package/build-module/components/editor-interface/index.js.map +1 -1
  245. package/build-module/components/editor-notices/index.js +1 -1
  246. package/build-module/components/editor-notices/index.js.map +1 -1
  247. package/build-module/components/editor-snackbars/index.js +1 -1
  248. package/build-module/components/editor-snackbars/index.js.map +1 -1
  249. package/build-module/components/entities-saved-states/entity-record-item.js +9 -1
  250. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  251. package/build-module/components/entities-saved-states/index.js +2 -2
  252. package/build-module/components/entities-saved-states/index.js.map +1 -1
  253. package/build-module/components/page-attributes/check.js +3 -3
  254. package/build-module/components/page-attributes/check.js.map +1 -1
  255. package/build-module/components/page-attributes/order.js +1 -1
  256. package/build-module/components/page-attributes/order.js.map +1 -1
  257. package/build-module/components/page-attributes/panel.js +1 -1
  258. package/build-module/components/page-attributes/panel.js.map +1 -1
  259. package/build-module/components/page-attributes/parent.js +1 -1
  260. package/build-module/components/page-attributes/parent.js.map +1 -1
  261. package/build-module/components/plugin-document-setting-panel/index.js +2 -2
  262. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  263. package/build-module/components/plugin-more-menu-item/index.js +2 -1
  264. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  265. package/build-module/components/plugin-post-publish-panel/index.js +2 -2
  266. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  267. package/build-module/components/plugin-post-status-info/index.js +4 -4
  268. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  269. package/build-module/components/plugin-pre-publish-panel/index.js +2 -2
  270. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  271. package/build-module/components/plugin-preview-menu-item/index.js +2 -1
  272. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  273. package/build-module/components/plugin-sidebar/index.js +1 -0
  274. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  275. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -1
  276. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  277. package/build-module/components/post-actions/actions.js +3 -3
  278. package/build-module/components/post-actions/actions.js.map +1 -1
  279. package/build-module/components/post-author/check.js +3 -3
  280. package/build-module/components/post-author/check.js.map +1 -1
  281. package/build-module/components/post-author/index.js +1 -1
  282. package/build-module/components/post-author/index.js.map +1 -1
  283. package/build-module/components/post-author/panel.js +1 -1
  284. package/build-module/components/post-author/panel.js.map +1 -1
  285. package/build-module/components/post-card-panel/index.js +9 -4
  286. package/build-module/components/post-card-panel/index.js.map +1 -1
  287. package/build-module/components/post-comments/index.js +1 -1
  288. package/build-module/components/post-comments/index.js.map +1 -1
  289. package/build-module/components/post-discussion/panel.js +1 -1
  290. package/build-module/components/post-discussion/panel.js.map +1 -1
  291. package/build-module/components/post-excerpt/check.js +3 -3
  292. package/build-module/components/post-excerpt/check.js.map +1 -1
  293. package/build-module/components/post-excerpt/panel.js +1 -1
  294. package/build-module/components/post-excerpt/panel.js.map +1 -1
  295. package/build-module/components/post-excerpt/plugin.js +4 -4
  296. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  297. package/build-module/components/post-featured-image/check.js +3 -3
  298. package/build-module/components/post-featured-image/check.js.map +1 -1
  299. package/build-module/components/post-featured-image/index.js +40 -10
  300. package/build-module/components/post-featured-image/index.js.map +1 -1
  301. package/build-module/components/post-featured-image/panel.js +1 -1
  302. package/build-module/components/post-featured-image/panel.js.map +1 -1
  303. package/build-module/components/post-fields/index.js +62 -0
  304. package/build-module/components/post-fields/index.js.map +1 -0
  305. package/build-module/components/post-format/check.js +10 -11
  306. package/build-module/components/post-format/check.js.map +1 -1
  307. package/build-module/components/post-format/index.js +1 -1
  308. package/build-module/components/post-format/index.js.map +1 -1
  309. package/build-module/components/post-format/panel.js +1 -1
  310. package/build-module/components/post-format/panel.js.map +1 -1
  311. package/build-module/components/post-last-revision/check.js +3 -3
  312. package/build-module/components/post-last-revision/check.js.map +1 -1
  313. package/build-module/components/post-last-revision/index.js +1 -1
  314. package/build-module/components/post-last-revision/index.js.map +1 -1
  315. package/build-module/components/post-last-revision/panel.js +1 -1
  316. package/build-module/components/post-last-revision/panel.js.map +1 -1
  317. package/build-module/components/post-locked-modal/index.js +1 -1
  318. package/build-module/components/post-locked-modal/index.js.map +1 -1
  319. package/build-module/components/post-pending-status/check.js +3 -3
  320. package/build-module/components/post-pending-status/check.js.map +1 -1
  321. package/build-module/components/post-pending-status/index.js +1 -1
  322. package/build-module/components/post-pending-status/index.js.map +1 -1
  323. package/build-module/components/post-preview-button/index.js +1 -1
  324. package/build-module/components/post-preview-button/index.js.map +1 -1
  325. package/build-module/components/post-publish-panel/index.js +5 -2
  326. package/build-module/components/post-publish-panel/index.js.map +1 -1
  327. package/build-module/components/post-schedule/check.js +3 -3
  328. package/build-module/components/post-schedule/check.js.map +1 -1
  329. package/build-module/components/post-schedule/index.js +1 -1
  330. package/build-module/components/post-schedule/index.js.map +1 -1
  331. package/build-module/components/post-schedule/label.js +1 -1
  332. package/build-module/components/post-schedule/label.js.map +1 -1
  333. package/build-module/components/post-schedule/panel.js +1 -1
  334. package/build-module/components/post-schedule/panel.js.map +1 -1
  335. package/build-module/components/post-slug/check.js +3 -3
  336. package/build-module/components/post-slug/check.js.map +1 -1
  337. package/build-module/components/post-slug/index.js +1 -1
  338. package/build-module/components/post-slug/index.js.map +1 -1
  339. package/build-module/components/post-sticky/check.js +3 -3
  340. package/build-module/components/post-sticky/check.js.map +1 -1
  341. package/build-module/components/post-sticky/index.js +1 -1
  342. package/build-module/components/post-sticky/index.js.map +1 -1
  343. package/build-module/components/post-switch-to-draft-button/index.js +1 -1
  344. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  345. package/build-module/components/post-sync-status/index.js +1 -1
  346. package/build-module/components/post-sync-status/index.js.map +1 -1
  347. package/build-module/components/post-taxonomies/check.js +3 -3
  348. package/build-module/components/post-taxonomies/check.js.map +1 -1
  349. package/build-module/components/post-taxonomies/flat-term-selector.js +1 -1
  350. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  351. package/build-module/components/post-taxonomies/panel.js +17 -12
  352. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  353. package/build-module/components/post-template/classic-theme.js +2 -2
  354. package/build-module/components/post-template/classic-theme.js.map +1 -1
  355. package/build-module/components/post-template/panel.js +1 -1
  356. package/build-module/components/post-template/panel.js.map +1 -1
  357. package/build-module/components/post-text-editor/index.js +1 -1
  358. package/build-module/components/post-text-editor/index.js.map +1 -1
  359. package/build-module/components/post-title/index.js +20 -18
  360. package/build-module/components/post-title/index.js.map +1 -1
  361. package/build-module/components/post-title/post-title-raw.js +1 -1
  362. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  363. package/build-module/components/post-trash/check.js +3 -3
  364. package/build-module/components/post-trash/check.js.map +1 -1
  365. package/build-module/components/post-trash/index.js +1 -1
  366. package/build-module/components/post-trash/index.js.map +1 -1
  367. package/build-module/components/post-type-support-check/index.js +6 -6
  368. package/build-module/components/post-type-support-check/index.js.map +1 -1
  369. package/build-module/components/post-url/check.js +3 -3
  370. package/build-module/components/post-url/check.js.map +1 -1
  371. package/build-module/components/post-url/index.js +1 -1
  372. package/build-module/components/post-url/index.js.map +1 -1
  373. package/build-module/components/post-url/label.js +1 -1
  374. package/build-module/components/post-url/label.js.map +1 -1
  375. package/build-module/components/post-url/panel.js +1 -1
  376. package/build-module/components/post-url/panel.js.map +1 -1
  377. package/build-module/components/post-visibility/check.js +1 -1
  378. package/build-module/components/post-visibility/check.js.map +1 -1
  379. package/build-module/components/post-visibility/index.js +1 -1
  380. package/build-module/components/post-visibility/index.js.map +1 -1
  381. package/build-module/components/preferences-modal/block-visibility.js +80 -0
  382. package/build-module/components/preferences-modal/block-visibility.js.map +1 -0
  383. package/build-module/components/preferences-modal/enable-panel.js +27 -19
  384. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  385. package/build-module/components/preferences-modal/enable-publish-sidebar.js +13 -10
  386. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  387. package/build-module/components/preferences-modal/index.js +2 -2
  388. package/build-module/components/preferences-modal/index.js.map +1 -1
  389. package/build-module/components/provider/index.js +14 -8
  390. package/build-module/components/provider/index.js.map +1 -1
  391. package/build-module/components/table-of-contents/index.js +1 -1
  392. package/build-module/components/table-of-contents/index.js.map +1 -1
  393. package/build-module/components/theme-support-check/index.js +4 -4
  394. package/build-module/components/theme-support-check/index.js.map +1 -1
  395. package/build-module/components/time-to-read/index.js +1 -1
  396. package/build-module/components/time-to-read/index.js.map +1 -1
  397. package/build-module/components/unsaved-changes-warning/index.js +1 -1
  398. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  399. package/build-module/components/word-count/index.js +1 -1
  400. package/build-module/components/word-count/index.js.map +1 -1
  401. package/build-module/components/zoom-out-toggle/index.js +8 -3
  402. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  403. package/build-module/dataviews/api.js +39 -0
  404. package/build-module/dataviews/api.js.map +1 -1
  405. package/build-module/dataviews/store/private-actions.js +23 -3
  406. package/build-module/dataviews/store/private-actions.js.map +1 -1
  407. package/build-module/dataviews/store/private-selectors.js +4 -0
  408. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  409. package/build-module/dataviews/store/reducer.js +23 -0
  410. package/build-module/dataviews/store/reducer.js.map +1 -1
  411. package/build-module/private-apis.js +4 -0
  412. package/build-module/private-apis.js.map +1 -1
  413. package/build-module/store/actions.js +11 -9
  414. package/build-module/store/actions.js.map +1 -1
  415. package/build-module/store/private-selectors.js +6 -3
  416. package/build-module/store/private-selectors.js.map +1 -1
  417. package/build-module/store/reducer.native.js +2 -1
  418. package/build-module/store/reducer.native.js.map +1 -1
  419. package/build-module/store/selectors.js +33 -39
  420. package/build-module/store/selectors.js.map +1 -1
  421. package/build-module/utils/get-template-info.js +51 -0
  422. package/build-module/utils/get-template-info.js.map +1 -0
  423. package/build-style/style-rtl.css +11 -81
  424. package/build-style/style.css +11 -81
  425. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +2 -2
  426. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
  427. package/build-types/components/collab-sidebar/add-comment.d.ts +2 -2
  428. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  429. package/build-types/components/collab-sidebar/comment-author-info.d.ts +17 -0
  430. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -0
  431. package/build-types/components/collab-sidebar/comment-form.d.ts +18 -0
  432. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -0
  433. package/build-types/components/collab-sidebar/comments.d.ts +2 -2
  434. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  435. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  436. package/build-types/components/document-bar/index.d.ts +2 -2
  437. package/build-types/components/document-bar/index.d.ts.map +1 -1
  438. package/build-types/components/document-outline/check.d.ts +5 -5
  439. package/build-types/components/document-outline/check.d.ts.map +1 -1
  440. package/build-types/components/document-outline/index.d.ts +4 -6
  441. package/build-types/components/document-outline/index.d.ts.map +1 -1
  442. package/build-types/components/document-tools/index.d.ts.map +1 -1
  443. package/build-types/components/editor-interface/content-slot-fill.d.ts +12 -1
  444. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -1
  445. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  446. package/build-types/components/editor-notices/index.d.ts +2 -2
  447. package/build-types/components/editor-notices/index.d.ts.map +1 -1
  448. package/build-types/components/editor-snackbars/index.d.ts +2 -2
  449. package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
  450. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
  451. package/build-types/components/entities-saved-states/index.d.ts +4 -4
  452. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  453. package/build-types/components/header/back-button.d.ts.map +1 -1
  454. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  455. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  456. package/build-types/components/page-attributes/check.d.ts +5 -5
  457. package/build-types/components/page-attributes/check.d.ts.map +1 -1
  458. package/build-types/components/page-attributes/order.d.ts +2 -2
  459. package/build-types/components/page-attributes/order.d.ts.map +1 -1
  460. package/build-types/components/page-attributes/panel.d.ts +2 -2
  461. package/build-types/components/page-attributes/panel.d.ts.map +1 -1
  462. package/build-types/components/page-attributes/parent.d.ts +2 -2
  463. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  464. package/build-types/components/plugin-document-setting-panel/index.d.ts +4 -4
  465. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  466. package/build-types/components/plugin-more-menu-item/index.d.ts +4 -2
  467. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
  468. package/build-types/components/plugin-post-publish-panel/index.d.ts +4 -4
  469. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  470. package/build-types/components/plugin-post-status-info/index.d.ts +6 -6
  471. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  472. package/build-types/components/plugin-pre-publish-panel/index.d.ts +4 -4
  473. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  474. package/build-types/components/plugin-preview-menu-item/index.d.ts +4 -2
  475. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
  476. package/build-types/components/plugin-sidebar/index.d.ts +2 -0
  477. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  478. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +4 -2
  479. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
  480. package/build-types/components/post-author/check.d.ts +5 -5
  481. package/build-types/components/post-author/check.d.ts.map +1 -1
  482. package/build-types/components/post-author/index.d.ts +2 -2
  483. package/build-types/components/post-author/index.d.ts.map +1 -1
  484. package/build-types/components/post-author/panel.d.ts +2 -2
  485. package/build-types/components/post-author/panel.d.ts.map +1 -1
  486. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  487. package/build-types/components/post-discussion/panel.d.ts +2 -2
  488. package/build-types/components/post-discussion/panel.d.ts.map +1 -1
  489. package/build-types/components/post-excerpt/check.d.ts +5 -5
  490. package/build-types/components/post-excerpt/check.d.ts.map +1 -1
  491. package/build-types/components/post-excerpt/panel.d.ts +2 -2
  492. package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
  493. package/build-types/components/post-excerpt/plugin.d.ts +6 -6
  494. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  495. package/build-types/components/post-featured-image/check.d.ts +5 -5
  496. package/build-types/components/post-featured-image/check.d.ts.map +1 -1
  497. package/build-types/components/post-featured-image/panel.d.ts +2 -2
  498. package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
  499. package/build-types/components/post-fields/index.d.ts +12 -0
  500. package/build-types/components/post-fields/index.d.ts.map +1 -0
  501. package/build-types/components/post-format/check.d.ts +11 -4
  502. package/build-types/components/post-format/check.d.ts.map +1 -1
  503. package/build-types/components/post-format/index.d.ts +2 -2
  504. package/build-types/components/post-format/index.d.ts.map +1 -1
  505. package/build-types/components/post-format/panel.d.ts +2 -2
  506. package/build-types/components/post-format/panel.d.ts.map +1 -1
  507. package/build-types/components/post-last-revision/check.d.ts +5 -5
  508. package/build-types/components/post-last-revision/check.d.ts.map +1 -1
  509. package/build-types/components/post-last-revision/index.d.ts +2 -2
  510. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  511. package/build-types/components/post-last-revision/panel.d.ts +2 -2
  512. package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
  513. package/build-types/components/post-locked-modal/index.d.ts +2 -2
  514. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  515. package/build-types/components/post-pending-status/check.d.ts +5 -5
  516. package/build-types/components/post-pending-status/check.d.ts.map +1 -1
  517. package/build-types/components/post-pending-status/index.d.ts +2 -2
  518. package/build-types/components/post-pending-status/index.d.ts.map +1 -1
  519. package/build-types/components/post-preview-button/index.d.ts +2 -2
  520. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  521. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  522. package/build-types/components/post-schedule/check.d.ts +5 -5
  523. package/build-types/components/post-schedule/check.d.ts.map +1 -1
  524. package/build-types/components/post-schedule/index.d.ts +2 -2
  525. package/build-types/components/post-schedule/index.d.ts.map +1 -1
  526. package/build-types/components/post-schedule/label.d.ts +2 -2
  527. package/build-types/components/post-schedule/label.d.ts.map +1 -1
  528. package/build-types/components/post-schedule/panel.d.ts +2 -2
  529. package/build-types/components/post-schedule/panel.d.ts.map +1 -1
  530. package/build-types/components/post-slug/check.d.ts +5 -5
  531. package/build-types/components/post-slug/check.d.ts.map +1 -1
  532. package/build-types/components/post-slug/index.d.ts +2 -2
  533. package/build-types/components/post-slug/index.d.ts.map +1 -1
  534. package/build-types/components/post-sticky/check.d.ts +5 -5
  535. package/build-types/components/post-sticky/check.d.ts.map +1 -1
  536. package/build-types/components/post-sticky/index.d.ts +2 -2
  537. package/build-types/components/post-sticky/index.d.ts.map +1 -1
  538. package/build-types/components/post-switch-to-draft-button/index.d.ts +2 -2
  539. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
  540. package/build-types/components/post-sync-status/index.d.ts +2 -2
  541. package/build-types/components/post-sync-status/index.d.ts.map +1 -1
  542. package/build-types/components/post-taxonomies/check.d.ts +5 -5
  543. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  544. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +2 -2
  545. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  546. package/build-types/components/post-taxonomies/panel.d.ts +6 -2
  547. package/build-types/components/post-taxonomies/panel.d.ts.map +1 -1
  548. package/build-types/components/post-template/panel.d.ts +2 -2
  549. package/build-types/components/post-template/panel.d.ts.map +1 -1
  550. package/build-types/components/post-text-editor/index.d.ts +2 -2
  551. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  552. package/build-types/components/post-title/index.d.ts +1 -1
  553. package/build-types/components/post-trash/check.d.ts +5 -5
  554. package/build-types/components/post-trash/check.d.ts.map +1 -1
  555. package/build-types/components/post-trash/index.d.ts +2 -2
  556. package/build-types/components/post-trash/index.d.ts.map +1 -1
  557. package/build-types/components/post-type-support-check/index.d.ts +8 -8
  558. package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
  559. package/build-types/components/post-url/check.d.ts +5 -5
  560. package/build-types/components/post-url/check.d.ts.map +1 -1
  561. package/build-types/components/post-url/index.d.ts +2 -2
  562. package/build-types/components/post-url/index.d.ts.map +1 -1
  563. package/build-types/components/post-url/label.d.ts +2 -2
  564. package/build-types/components/post-url/label.d.ts.map +1 -1
  565. package/build-types/components/post-url/panel.d.ts +2 -2
  566. package/build-types/components/post-url/panel.d.ts.map +1 -1
  567. package/build-types/components/post-visibility/check.d.ts +2 -2
  568. package/build-types/components/post-visibility/check.d.ts.map +1 -1
  569. package/build-types/components/post-visibility/index.d.ts +2 -2
  570. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  571. package/build-types/components/preferences-modal/block-visibility.d.ts +2 -0
  572. package/build-types/components/preferences-modal/block-visibility.d.ts.map +1 -0
  573. package/build-types/components/preferences-modal/enable-panel.d.ts +1 -2
  574. package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -1
  575. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  576. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +1 -2
  577. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -1
  578. package/build-types/components/provider/index.d.ts +2 -2
  579. package/build-types/components/provider/index.d.ts.map +1 -1
  580. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  581. package/build-types/components/theme-support-check/index.d.ts +6 -6
  582. package/build-types/components/theme-support-check/index.d.ts.map +1 -1
  583. package/build-types/components/time-to-read/index.d.ts +2 -2
  584. package/build-types/components/time-to-read/index.d.ts.map +1 -1
  585. package/build-types/components/unsaved-changes-warning/index.d.ts +2 -2
  586. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
  587. package/build-types/components/word-count/index.d.ts +2 -2
  588. package/build-types/components/word-count/index.d.ts.map +1 -1
  589. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
  590. package/build-types/dataviews/api.d.ts +24 -0
  591. package/build-types/dataviews/api.d.ts.map +1 -1
  592. package/build-types/dataviews/store/private-actions.d.ts +14 -2
  593. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  594. package/build-types/dataviews/store/private-selectors.d.ts +1 -0
  595. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  596. package/build-types/dataviews/store/reducer.d.ts +10 -2
  597. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  598. package/build-types/private-apis.d.ts.map +1 -1
  599. package/build-types/store/actions.d.ts +7 -5
  600. package/build-types/store/actions.d.ts.map +1 -1
  601. package/build-types/store/private-selectors.d.ts +1 -0
  602. package/build-types/store/private-selectors.d.ts.map +1 -1
  603. package/build-types/store/reducer.d.ts +5 -0
  604. package/build-types/store/reducer.d.ts.map +1 -1
  605. package/build-types/store/selectors.d.ts +4 -11
  606. package/build-types/store/selectors.d.ts.map +1 -1
  607. package/build-types/utils/get-template-info.d.ts +6 -0
  608. package/build-types/utils/get-template-info.d.ts.map +1 -0
  609. package/package.json +2 -2
  610. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  611. package/src/components/collab-sidebar/add-comment.js +21 -78
  612. package/src/components/collab-sidebar/comment-author-info.js +68 -0
  613. package/src/components/collab-sidebar/comment-button-toolbar.js +3 -3
  614. package/src/components/collab-sidebar/comment-button.js +3 -3
  615. package/src/components/collab-sidebar/comment-form.js +62 -0
  616. package/src/components/collab-sidebar/comments.js +39 -101
  617. package/src/components/create-template-part-modal/index.js +3 -2
  618. package/src/components/document-bar/index.js +12 -3
  619. package/src/components/document-outline/check.js +4 -4
  620. package/src/components/document-outline/index.js +9 -9
  621. package/src/components/document-tools/index.js +3 -2
  622. package/src/components/editor-history/redo.js +1 -1
  623. package/src/components/editor-history/undo.js +1 -1
  624. package/src/components/editor-interface/content-slot-fill.js +4 -9
  625. package/src/components/editor-interface/index.js +1 -11
  626. package/src/components/editor-notices/index.js +1 -1
  627. package/src/components/editor-snackbars/index.js +1 -1
  628. package/src/components/entities-saved-states/entity-record-item.js +12 -4
  629. package/src/components/entities-saved-states/index.js +2 -2
  630. package/src/components/header/style.scss +2 -1
  631. package/src/components/page-attributes/check.js +3 -3
  632. package/src/components/page-attributes/order.js +1 -1
  633. package/src/components/page-attributes/panel.js +1 -1
  634. package/src/components/page-attributes/parent.js +1 -1
  635. package/src/components/plugin-document-setting-panel/index.js +2 -2
  636. package/src/components/plugin-more-menu-item/index.js +2 -1
  637. package/src/components/plugin-post-publish-panel/index.js +2 -2
  638. package/src/components/plugin-post-status-info/index.js +4 -4
  639. package/src/components/plugin-pre-publish-panel/index.js +2 -2
  640. package/src/components/plugin-preview-menu-item/index.js +2 -1
  641. package/src/components/plugin-sidebar/index.js +1 -0
  642. package/src/components/plugin-sidebar-more-menu-item/index.js +2 -2
  643. package/src/components/post-actions/actions.js +3 -3
  644. package/src/components/post-author/check.js +3 -3
  645. package/src/components/post-author/index.js +1 -1
  646. package/src/components/post-author/panel.js +1 -1
  647. package/src/components/post-card-panel/index.js +18 -5
  648. package/src/components/post-comments/index.js +1 -1
  649. package/src/components/post-discussion/panel.js +1 -1
  650. package/src/components/post-excerpt/check.js +3 -3
  651. package/src/components/post-excerpt/panel.js +1 -1
  652. package/src/components/post-excerpt/plugin.js +4 -4
  653. package/src/components/post-featured-image/check.js +3 -3
  654. package/src/components/post-featured-image/index.js +107 -43
  655. package/src/components/post-featured-image/panel.js +1 -1
  656. package/src/components/post-featured-image/style.scss +23 -13
  657. package/src/components/post-fields/index.ts +76 -0
  658. package/src/components/post-format/check.js +9 -11
  659. package/src/components/post-format/index.js +1 -1
  660. package/src/components/post-format/panel.js +1 -1
  661. package/src/components/post-last-revision/check.js +3 -3
  662. package/src/components/post-last-revision/index.js +1 -1
  663. package/src/components/post-last-revision/panel.js +1 -1
  664. package/src/components/post-locked-modal/index.js +1 -1
  665. package/src/components/post-pending-status/check.js +3 -3
  666. package/src/components/post-pending-status/index.js +1 -1
  667. package/src/components/post-preview-button/index.js +1 -1
  668. package/src/components/post-publish-panel/index.js +7 -3
  669. package/src/components/post-schedule/check.js +3 -3
  670. package/src/components/post-schedule/index.js +1 -1
  671. package/src/components/post-schedule/label.js +1 -1
  672. package/src/components/post-schedule/panel.js +1 -1
  673. package/src/components/post-slug/check.js +3 -3
  674. package/src/components/post-slug/index.js +1 -1
  675. package/src/components/post-sticky/check.js +3 -3
  676. package/src/components/post-sticky/index.js +1 -1
  677. package/src/components/post-switch-to-draft-button/index.js +1 -1
  678. package/src/components/post-sync-status/index.js +1 -1
  679. package/src/components/post-taxonomies/check.js +3 -3
  680. package/src/components/post-taxonomies/flat-term-selector.js +1 -1
  681. package/src/components/post-taxonomies/panel.js +15 -12
  682. package/src/components/post-template/classic-theme.js +2 -2
  683. package/src/components/post-template/panel.js +1 -1
  684. package/src/components/post-text-editor/index.js +1 -1
  685. package/src/components/post-title/index.js +20 -18
  686. package/src/components/post-title/post-title-raw.js +1 -1
  687. package/src/components/post-trash/check.js +3 -3
  688. package/src/components/post-trash/index.js +1 -1
  689. package/src/components/post-type-support-check/index.js +6 -6
  690. package/src/components/post-url/check.js +3 -3
  691. package/src/components/post-url/index.js +1 -1
  692. package/src/components/post-url/label.js +1 -1
  693. package/src/components/post-url/panel.js +1 -1
  694. package/src/components/post-visibility/check.js +1 -1
  695. package/src/components/post-visibility/index.js +1 -1
  696. package/src/components/preferences-modal/block-visibility.js +96 -0
  697. package/src/components/preferences-modal/enable-panel.js +27 -17
  698. package/src/components/preferences-modal/enable-publish-sidebar.js +18 -15
  699. package/src/components/preferences-modal/index.js +2 -2
  700. package/src/components/provider/index.js +55 -30
  701. package/src/components/table-of-contents/index.js +1 -1
  702. package/src/components/theme-support-check/index.js +4 -4
  703. package/src/components/time-to-read/index.js +1 -1
  704. package/src/components/unsaved-changes-warning/index.js +1 -1
  705. package/src/components/word-count/index.js +1 -1
  706. package/src/components/zoom-out-toggle/index.js +26 -13
  707. package/src/dataviews/api.js +41 -0
  708. package/src/dataviews/store/private-actions.ts +57 -3
  709. package/src/dataviews/store/private-selectors.ts +4 -0
  710. package/src/dataviews/store/reducer.ts +38 -1
  711. package/src/private-apis.js +4 -1
  712. package/src/store/actions.js +13 -9
  713. package/src/store/private-selectors.js +13 -8
  714. package/src/store/reducer.native.js +2 -0
  715. package/src/store/selectors.js +80 -62
  716. package/src/store/test/selectors.js +0 -255
  717. package/src/style.scss +0 -1
  718. package/src/utils/get-template-info.js +52 -0
  719. package/src/utils/test/get-template-info.js +224 -0
  720. package/tsconfig.tsbuildinfo +1 -1
  721. package/build/components/block-manager/category.js +0 -107
  722. package/build/components/block-manager/category.js.map +0 -1
  723. package/build/components/block-manager/checklist.js +0 -35
  724. package/build/components/block-manager/checklist.js.map +0 -1
  725. package/build/components/block-manager/index.js +0 -115
  726. package/build/components/block-manager/index.js.map +0 -1
  727. package/build-module/components/block-manager/category.js +0 -99
  728. package/build-module/components/block-manager/category.js.map +0 -1
  729. package/build-module/components/block-manager/checklist.js +0 -28
  730. package/build-module/components/block-manager/checklist.js.map +0 -1
  731. package/build-module/components/block-manager/index.js +0 -107
  732. package/build-module/components/block-manager/index.js.map +0 -1
  733. package/build-types/components/block-manager/category.d.ts +0 -6
  734. package/build-types/components/block-manager/category.d.ts.map +0 -1
  735. package/build-types/components/block-manager/checklist.d.ts +0 -7
  736. package/build-types/components/block-manager/checklist.d.ts.map +0 -1
  737. package/build-types/components/block-manager/index.d.ts +0 -2
  738. package/build-types/components/block-manager/index.d.ts.map +0 -1
  739. package/src/components/block-manager/category.js +0 -96
  740. package/src/components/block-manager/checklist.js +0 -30
  741. package/src/components/block-manager/index.js +0 -145
  742. package/src/components/block-manager/style.scss +0 -82
@@ -0,0 +1,62 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useEffect, useMemo } from '@wordpress/element';
5
+ import { useEntityRecords } from '@wordpress/core-data';
6
+ import { useDispatch, useSelect } from '@wordpress/data';
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { unlock } from '../../lock-unlock';
11
+ import { store as editorStore } from '../../store';
12
+ function usePostFields() {
13
+ const postType = 'page'; // TODO: this could be page or post (experimental).
14
+
15
+ const {
16
+ registerPostTypeSchema
17
+ } = unlock(useDispatch(editorStore));
18
+ useEffect(() => {
19
+ registerPostTypeSchema(postType);
20
+ }, [registerPostTypeSchema, postType]);
21
+ const {
22
+ defaultFields
23
+ } = useSelect(select => {
24
+ const {
25
+ getEntityFields
26
+ } = unlock(select(editorStore));
27
+ return {
28
+ defaultFields: getEntityFields('postType', postType)
29
+ };
30
+ }, [postType]);
31
+ const {
32
+ records: authors,
33
+ isResolving: isLoadingAuthors
34
+ } = useEntityRecords('root', 'user', {
35
+ per_page: -1
36
+ });
37
+ const fields = useMemo(() => defaultFields.map(field => {
38
+ if (field.id === 'author') {
39
+ return {
40
+ ...field,
41
+ elements: authors?.map(({
42
+ id,
43
+ name
44
+ }) => ({
45
+ value: id,
46
+ label: name
47
+ }))
48
+ };
49
+ }
50
+ return field;
51
+ }), [authors, defaultFields]);
52
+ return {
53
+ isLoading: isLoadingAuthors,
54
+ fields
55
+ };
56
+ }
57
+
58
+ /**
59
+ * Hook to get the fields for a post (BasePost or BasePostWithEmbeddedAuthor).
60
+ */
61
+ export default usePostFields;
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useMemo","useEntityRecords","useDispatch","useSelect","unlock","store","editorStore","usePostFields","postType","registerPostTypeSchema","defaultFields","select","getEntityFields","records","authors","isResolving","isLoadingAuthors","per_page","fields","map","field","id","elements","name","value","label","isLoading"],"sources":["@wordpress/editor/src/components/post-fields/index.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport type { Field } from '@wordpress/dataviews';\nimport type { BasePostWithEmbeddedAuthor } from '@wordpress/fields';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\ninterface UsePostFieldsReturn {\n\tisLoading: boolean;\n\tfields: Field< BasePostWithEmbeddedAuthor >[];\n}\n\ninterface Author {\n\tid: number;\n\tname: string;\n}\n\nfunction usePostFields(): UsePostFieldsReturn {\n\tconst postType = 'page'; // TODO: this could be page or post (experimental).\n\n\tconst { registerPostTypeSchema } = unlock( useDispatch( editorStore ) );\n\tuseEffect( () => {\n\t\tregisterPostTypeSchema( postType );\n\t}, [ registerPostTypeSchema, postType ] );\n\n\tconst { defaultFields } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityFields } = unlock( select( editorStore ) );\n\t\t\treturn {\n\t\t\t\tdefaultFields: getEntityFields( 'postType', postType ),\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tconst { records: authors, isResolving: isLoadingAuthors } =\n\t\tuseEntityRecords< Author >( 'root', 'user', { per_page: -1 } );\n\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\tdefaultFields.map(\n\t\t\t\t( field: Field< BasePostWithEmbeddedAuthor > ) => {\n\t\t\t\t\tif ( field.id === 'author' ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\telements: authors?.map( ( { id, name } ) => ( {\n\t\t\t\t\t\t\t\tvalue: id,\n\t\t\t\t\t\t\t\tlabel: name,\n\t\t\t\t\t\t\t} ) ),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn field;\n\t\t\t\t}\n\t\t\t) as Field< BasePostWithEmbeddedAuthor >[],\n\t\t[ authors, defaultFields ]\n\t);\n\n\treturn {\n\t\tisLoading: isLoadingAuthors,\n\t\tfields,\n\t};\n}\n\n/**\n * Hook to get the fields for a post (BasePost or BasePostWithEmbeddedAuthor).\n */\nexport default usePostFields;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AAIxD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAYlD,SAASC,aAAaA,CAAA,EAAwB;EAC7C,MAAMC,QAAQ,GAAG,MAAM,CAAC,CAAC;;EAEzB,MAAM;IAAEC;EAAuB,CAAC,GAAGL,MAAM,CAAEF,WAAW,CAAEI,WAAY,CAAE,CAAC;EACvEP,SAAS,CAAE,MAAM;IAChBU,sBAAsB,CAAED,QAAS,CAAC;EACnC,CAAC,EAAE,CAAEC,sBAAsB,EAAED,QAAQ,CAAG,CAAC;EAEzC,MAAM;IAAEE;EAAc,CAAC,GAAGP,SAAS,CAChCQ,MAAM,IAAM;IACb,MAAM;MAAEC;IAAgB,CAAC,GAAGR,MAAM,CAAEO,MAAM,CAAEL,WAAY,CAAE,CAAC;IAC3D,OAAO;MACNI,aAAa,EAAEE,eAAe,CAAE,UAAU,EAAEJ,QAAS;IACtD,CAAC;EACF,CAAC,EACD,CAAEA,QAAQ,CACX,CAAC;EAED,MAAM;IAAEK,OAAO,EAAEC,OAAO;IAAEC,WAAW,EAAEC;EAAiB,CAAC,GACxDf,gBAAgB,CAAY,MAAM,EAAE,MAAM,EAAE;IAAEgB,QAAQ,EAAE,CAAC;EAAE,CAAE,CAAC;EAE/D,MAAMC,MAAM,GAAGlB,OAAO,CACrB,MACCU,aAAa,CAACS,GAAG,CACdC,KAA0C,IAAM;IACjD,IAAKA,KAAK,CAACC,EAAE,KAAK,QAAQ,EAAG;MAC5B,OAAO;QACN,GAAGD,KAAK;QACRE,QAAQ,EAAER,OAAO,EAAEK,GAAG,CAAE,CAAE;UAAEE,EAAE;UAAEE;QAAK,CAAC,MAAQ;UAC7CC,KAAK,EAAEH,EAAE;UACTI,KAAK,EAAEF;QACR,CAAC,CAAG;MACL,CAAC;IACF;IAEA,OAAOH,KAAK;EACb,CACD,CAA0C,EAC3C,CAAEN,OAAO,EAAEJ,aAAa,CACzB,CAAC;EAED,OAAO;IACNgB,SAAS,EAAEV,gBAAgB;IAC3BE;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA,eAAeX,aAAa","ignoreList":[]}
@@ -8,8 +8,17 @@ import { useSelect } from '@wordpress/data';
8
8
  */
9
9
  import PostTypeSupportCheck from '../post-type-support-check';
10
10
  import { store as editorStore } from '../../store';
11
+
12
+ /**
13
+ * Component check if there are any post formats.
14
+ *
15
+ * @param {Object} props The component props.
16
+ * @param {React.ReactNode} props.children The child elements to render.
17
+ *
18
+ * @return {React.ReactNode} The rendered component or null if post formats are disabled.
19
+ */
11
20
  import { jsx as _jsx } from "react/jsx-runtime";
12
- function PostFormatCheck({
21
+ export default function PostFormatCheck({
13
22
  children
14
23
  }) {
15
24
  const disablePostFormats = useSelect(select => select(editorStore).getEditorSettings().disablePostFormats, []);
@@ -21,14 +30,4 @@ function PostFormatCheck({
21
30
  children: children
22
31
  });
23
32
  }
24
-
25
- /**
26
- * Component check if there are any post formats.
27
- *
28
- * @param {Object} props The component props.
29
- * @param {Element} props.children The child elements to render.
30
- *
31
- * @return {Component|null} The rendered component or null if post formats are disabled.
32
- */
33
- export default PostFormatCheck;
34
33
  //# sourceMappingURL=check.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","jsx","_jsx","PostFormatCheck","children","disablePostFormats","select","getEditorSettings","supportKeys"],"sources":["@wordpress/editor/src/components/post-format/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\nfunction PostFormatCheck( { children } ) {\n\tconst disablePostFormats = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().disablePostFormats,\n\t\t[]\n\t);\n\n\tif ( disablePostFormats ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"post-formats\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\n/**\n * Component check if there are any post formats.\n *\n * @param {Object} props The component props.\n * @param {Element} props.children The child elements to render.\n *\n * @return {Component|null} The rendered component or null if post formats are disabled.\n */\nexport default PostFormatCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACxC,MAAMC,kBAAkB,GAAGR,SAAS,CACjCS,MAAM,IACPA,MAAM,CAAEN,WAAY,CAAC,CAACO,iBAAiB,CAAC,CAAC,CAACF,kBAAkB,EAC7D,EACD,CAAC;EAED,IAAKA,kBAAkB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,oBACCH,IAAA,CAACJ,oBAAoB;IAACU,WAAW,EAAC,cAAc;IAAAJ,QAAA,EAC7CA;EAAQ,CACW,CAAC;AAEzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeD,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","jsx","_jsx","PostFormatCheck","children","disablePostFormats","select","getEditorSettings","supportKeys"],"sources":["@wordpress/editor/src/components/post-format/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\n/**\n * Component check if there are any post formats.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children The child elements to render.\n *\n * @return {React.ReactNode} The rendered component or null if post formats are disabled.\n */\nexport default function PostFormatCheck( { children } ) {\n\tconst disablePostFormats = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().disablePostFormats,\n\t\t[]\n\t);\n\n\tif ( disablePostFormats ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"post-formats\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,eAAe,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACvD,MAAMC,kBAAkB,GAAGR,SAAS,CACjCS,MAAM,IACPA,MAAM,CAAEN,WAAY,CAAC,CAACO,iBAAiB,CAAC,CAAC,CAACF,kBAAkB,EAC7D,EACD,CAAC;EAED,IAAKA,kBAAkB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,oBACCH,IAAA,CAACJ,oBAAoB;IAACU,WAAW,EAAC,cAAc;IAAAJ,QAAA,EAC7CA;EAAQ,CACW,CAAC;AAEzB","ignoreList":[]}
@@ -65,7 +65,7 @@ export const POST_FORMATS = [{
65
65
  * <PostFormat />
66
66
  * ```
67
67
  *
68
- * @return {JSX.Element} The rendered PostFormat component.
68
+ * @return {React.ReactNode} The rendered PostFormat component.
69
69
  */
70
70
  export default function PostFormat() {
71
71
  const instanceId = useInstanceId(PostFormat);
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","Button","RadioControl","useDispatch","useSelect","useInstanceId","store","coreStore","PostFormatCheck","editorStore","jsx","_jsx","jsxs","_jsxs","POST_FORMATS","id","caption","sort","a","b","normalizedA","toUpperCase","normalizedB","PostFormat","instanceId","postFormatSelectorId","postFormat","suggestedFormat","supportedFormats","select","getEditedPostAttribute","getSuggestedPostFormat","_postFormat","themeSupports","getThemeSupports","formats","filter","format","includes","suggestion","find","editPost","onUpdatePostFormat","children","className","label","selected","onChange","options","map","value","hideLabelFromVision","__next40pxDefaultSize","variant","onClick"],"sources":["@wordpress/editor/src/components/post-format/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button, RadioControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFormatCheck from './check';\nimport { store as editorStore } from '../../store';\n\n// All WP post formats, sorted alphabetically by translated name.\nexport const POST_FORMATS = [\n\t{ id: 'aside', caption: __( 'Aside' ) },\n\t{ id: 'audio', caption: __( 'Audio' ) },\n\t{ id: 'chat', caption: __( 'Chat' ) },\n\t{ id: 'gallery', caption: __( 'Gallery' ) },\n\t{ id: 'image', caption: __( 'Image' ) },\n\t{ id: 'link', caption: __( 'Link' ) },\n\t{ id: 'quote', caption: __( 'Quote' ) },\n\t{ id: 'standard', caption: __( 'Standard' ) },\n\t{ id: 'status', caption: __( 'Status' ) },\n\t{ id: 'video', caption: __( 'Video' ) },\n].sort( ( a, b ) => {\n\tconst normalizedA = a.caption.toUpperCase();\n\tconst normalizedB = b.caption.toUpperCase();\n\n\tif ( normalizedA < normalizedB ) {\n\t\treturn -1;\n\t}\n\tif ( normalizedA > normalizedB ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n} );\n\n/**\n * `PostFormat` a component that allows changing the post format while also providing a suggestion for the current post.\n *\n * @example\n * ```jsx\n * <PostFormat />\n * ```\n *\n * @return {JSX.Element} The rendered PostFormat component.\n */\nexport default function PostFormat() {\n\tconst instanceId = useInstanceId( PostFormat );\n\tconst postFormatSelectorId = `post-format-selector-${ instanceId }`;\n\n\tconst { postFormat, suggestedFormat, supportedFormats } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst _postFormat = getEditedPostAttribute( 'format' );\n\t\t\tconst themeSupports = select( coreStore ).getThemeSupports();\n\t\t\treturn {\n\t\t\t\tpostFormat: _postFormat ?? 'standard',\n\t\t\t\tsuggestedFormat: getSuggestedPostFormat(),\n\t\t\t\tsupportedFormats: themeSupports.formats,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst formats = POST_FORMATS.filter( ( format ) => {\n\t\t// Ensure current format is always in the set.\n\t\t// The current format may not be a format supported by the theme.\n\t\treturn (\n\t\t\tsupportedFormats?.includes( format.id ) || postFormat === format.id\n\t\t);\n\t} );\n\tconst suggestion = formats.find(\n\t\t( format ) => format.id === suggestedFormat\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\treturn (\n\t\t<PostFormatCheck>\n\t\t\t<div className=\"editor-post-format\">\n\t\t\t\t<RadioControl\n\t\t\t\t\tclassName=\"editor-post-format__options\"\n\t\t\t\t\tlabel={ __( 'Post Format' ) }\n\t\t\t\t\tselected={ postFormat }\n\t\t\t\t\tonChange={ ( format ) => onUpdatePostFormat( format ) }\n\t\t\t\t\tid={ postFormatSelectorId }\n\t\t\t\t\toptions={ formats.map( ( format ) => ( {\n\t\t\t\t\t\tlabel: format.caption,\n\t\t\t\t\t\tvalue: format.id,\n\t\t\t\t\t} ) ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t/>\n\t\t\t\t{ suggestion && suggestion.id !== postFormat && (\n\t\t\t\t\t<p className=\"editor-post-format__suggestion\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tonUpdatePostFormat( suggestion.id )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post format */\n\t\t\t\t\t\t\t\t__( 'Apply suggested format: %s' ),\n\t\t\t\t\t\t\t\tsuggestion.caption\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</PostFormatCheck>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,EAAEC,YAAY,QAAQ,uBAAuB;AAC5D,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,IAAIC,SAA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AEM,WAAY,CAAC;EAE/C,MAAMiC,kBAAkB,GAAKL,MAAM,IAAMI,QAAQ,CAAE;IAAEJ;EAAO,CAAE,CAAC;EAE/D,oBACC1B,IAAA,CAACH,eAAe;IAAAmC,QAAA,eACf9B,KAAA;MAAK+B,SAAS,EAAC,oBAAoB;MAAAD,QAAA,gBAClChC,IAAA,CAACT,YAAY;QACZ0C,SAAS,EAAC,6BAA6B;QACvCC,KAAK,EAAG9C,EAAE,CAAE,aAAc,CAAG;QAC7B+C,QAAQ,EAAGpB,UAAY;QACvBqB,QAAQ,EAAKV,MAAM,IAAMK,kBAAkB,CAAEL,MAAO,CAAG;QACvDtB,EAAE,EAAGU,oBAAsB;QAC3BuB,OAAO,EAAGb,OAAO,CAACc,GAAG,CAAIZ,MAAM,KAAQ;UACtCQ,KAAK,EAAER,MAAM,CAACrB,OAAO;UACrBkC,KAAK,EAAEb,MAAM,CAACtB;QACf,CAAC,CAAG,CAAG;QACPoC,mBAAmB;MAAA,CACnB,CAAC,EACAZ,UAAU,IAAIA,UAAU,CAACxB,EAAE,KAAKW,UAAU,iBAC3Cf,IAAA;QAAGiC,SAAS,EAAC,gCAAgC;QAAAD,QAAA,eAC5ChC,IAAA,CAACV,MAAM;UACNmD,qBAAqB;UACrBC,OAAO,EAAC,MAAM;UACdC,OAAO,EAAGA,CAAA,KACTZ,kBAAkB,CAAEH,UAAU,CAACxB,EAAG,CAClC;UAAA4B,QAAA,EAEC3C,OAAO,CACR;UACAD,EAAE,CAAE,4BAA6B,CAAC,EAClCwC,UAAU,CAACvB,OACZ;QAAC,CACM;MAAC,CACP,CACH;IAAA,CACG;EAAC,CACU,CAAC;AAEpB","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","Button","RadioControl","useDispatch","useSelect","useInstanceId","store","coreStore","PostFormatCheck","editorStore","jsx","_jsx","jsxs","_jsxs","POST_FORMATS","id","caption","sort","a","b","normalizedA","toUpperCase","normalizedB","PostFormat","instanceId","postFormatSelectorId","postFormat","suggestedFormat","supportedFormats","select","getEditedPostAttribute","getSuggestedPostFormat","_postFormat","themeSupports","getThemeSupports","formats","filter","format","includes","suggestion","find","editPost","onUpdatePostFormat","children","className","label","selected","onChange","options","map","value","hideLabelFromVision","__next40pxDefaultSize","variant","onClick"],"sources":["@wordpress/editor/src/components/post-format/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button, RadioControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFormatCheck from './check';\nimport { store as editorStore } from '../../store';\n\n// All WP post formats, sorted alphabetically by translated name.\nexport const POST_FORMATS = [\n\t{ id: 'aside', caption: __( 'Aside' ) },\n\t{ id: 'audio', caption: __( 'Audio' ) },\n\t{ id: 'chat', caption: __( 'Chat' ) },\n\t{ id: 'gallery', caption: __( 'Gallery' ) },\n\t{ id: 'image', caption: __( 'Image' ) },\n\t{ id: 'link', caption: __( 'Link' ) },\n\t{ id: 'quote', caption: __( 'Quote' ) },\n\t{ id: 'standard', caption: __( 'Standard' ) },\n\t{ id: 'status', caption: __( 'Status' ) },\n\t{ id: 'video', caption: __( 'Video' ) },\n].sort( ( a, b ) => {\n\tconst normalizedA = a.caption.toUpperCase();\n\tconst normalizedB = b.caption.toUpperCase();\n\n\tif ( normalizedA < normalizedB ) {\n\t\treturn -1;\n\t}\n\tif ( normalizedA > normalizedB ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n} );\n\n/**\n * `PostFormat` a component that allows changing the post format while also providing a suggestion for the current post.\n *\n * @example\n * ```jsx\n * <PostFormat />\n * ```\n *\n * @return {React.ReactNode} The rendered PostFormat component.\n */\nexport default function PostFormat() {\n\tconst instanceId = useInstanceId( PostFormat );\n\tconst postFormatSelectorId = `post-format-selector-${ instanceId }`;\n\n\tconst { postFormat, suggestedFormat, supportedFormats } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst _postFormat = getEditedPostAttribute( 'format' );\n\t\t\tconst themeSupports = select( coreStore ).getThemeSupports();\n\t\t\treturn {\n\t\t\t\tpostFormat: _postFormat ?? 'standard',\n\t\t\t\tsuggestedFormat: getSuggestedPostFormat(),\n\t\t\t\tsupportedFormats: themeSupports.formats,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst formats = POST_FORMATS.filter( ( format ) => {\n\t\t// Ensure current format is always in the set.\n\t\t// The current format may not be a format supported by the theme.\n\t\treturn (\n\t\t\tsupportedFormats?.includes( format.id ) || postFormat === format.id\n\t\t);\n\t} );\n\tconst suggestion = formats.find(\n\t\t( format ) => format.id === suggestedFormat\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\treturn (\n\t\t<PostFormatCheck>\n\t\t\t<div className=\"editor-post-format\">\n\t\t\t\t<RadioControl\n\t\t\t\t\tclassName=\"editor-post-format__options\"\n\t\t\t\t\tlabel={ __( 'Post Format' ) }\n\t\t\t\t\tselected={ postFormat }\n\t\t\t\t\tonChange={ ( format ) => onUpdatePostFormat( format ) }\n\t\t\t\t\tid={ postFormatSelectorId }\n\t\t\t\t\toptions={ formats.map( ( format ) => ( {\n\t\t\t\t\t\tlabel: format.caption,\n\t\t\t\t\t\tvalue: format.id,\n\t\t\t\t\t} ) ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t/>\n\t\t\t\t{ suggestion && suggestion.id !== postFormat && (\n\t\t\t\t\t<p className=\"editor-post-format__suggestion\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tonUpdatePostFormat( suggestion.id )\n\t\t\t\t\t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;QAAAD,QAAA,eAC5ChC,IAAA,CAACV,MAAM;UACNmD,qBAAqB;UACrBC,OAAO,EAAC,MAAM;UACdC,OAAO,EAAGA,CAAA,KACTZ,kBAAkB,CAAEH,UAAU,CAACxB,EAAG,CAClC;UAAA4B,QAAA,EAEC3C,OAAO,CACR;UACAD,EAAE,CAAE,4BAA6B,CAAC,EAClCwC,UAAU,CAACvB,OACZ;QAAC,CACM;MAAC,CACP,CACH;IAAA,CACG;EAAC,CACU,CAAC;AAEpB","ignoreList":[]}
@@ -18,7 +18,7 @@ import { store as editorStore } from '../../store';
18
18
  /**
19
19
  * Renders the Post Author Panel component.
20
20
  *
21
- * @return {Component} The component to be rendered.
21
+ * @return {React.ReactNode} The rendered component.
22
22
  */
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  function PostFormat() {
@@ -1 +1 @@
1
- {"version":3,"names":["Button","Dropdown","__","sprintf","useSelect","useState","useMemo","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","default","PostFormatForm","POST_FORMATS","PostFormatCheck","PostPanelRow","store","editorStore","jsx","_jsx","jsxs","_jsxs","PostFormat","postFormat","select","getEditedPostAttribute","_postFormat","activeFormat","find","format","id","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","children","label","ref","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","size","variant","caption","onClick","renderContent","onClose","className","title"],"sources":["@wordpress/editor/src/components/post-format/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Dropdown } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { default as PostFormatForm, POST_FORMATS } from './';\nimport PostFormatCheck from './check';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the Post Author Panel component.\n *\n * @return {Component} The component to be rendered.\n */\nfunction PostFormat() {\n\tconst { postFormat } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst _postFormat = getEditedPostAttribute( 'format' );\n\t\treturn {\n\t\t\tpostFormat: _postFormat ?? 'standard',\n\t\t};\n\t}, [] );\n\tconst activeFormat = POST_FORMATS.find(\n\t\t( format ) => format.id === postFormat\n\t);\n\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<PostFormatCheck>\n\t\t\t<PostPanelRow label={ __( 'Format' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tcontentClassName=\"editor-post-format__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Current post format.\n\t\t\t\t\t\t\t\t__( 'Change format: %s' ),\n\t\t\t\t\t\t\t\tactiveFormat?.caption\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ activeFormat?.caption }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<div className=\"editor-post-format__dialog-content\">\n\t\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\t\ttitle={ __( 'Format' ) }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFormatForm />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostFormatCheck>\n\t);\n}\n\nexport default PostFormat;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,QAAQ,QAAQ,uBAAuB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAExG;AACA;AACA;AACA,SAASC,OAAO,IAAIC,cAAc,EAAEC,YAAY,QAAQ,IAAI;AAC5D,OAAOC,eAAe,MAAM,SAAS;AACrC,OAAOC,YAAY,MAAM,mBAAmB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAKA,SAASC,UAAUA,CAAA,EAAG;EACrB,MAAM;IAAEC;EAAW,CAAC,GAAGjB,SAAS,CAAIkB,MAAM,IAAM;IAC/C,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEP,WAAY,CAAC;IACxD,MAAMS,WAAW,GAAGD,sBAAsB,CAAE,QAAS,CAAC;IACtD,OAAO;MACNF,UAAU,EAAEG,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAI;IAC5B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MA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IAAE,CAAC;QAAA,CACd;MACH,CACH;IAAC,CACW;EAAC,CACC,CAAC;AAEpB;AAEA,eAAeU,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["Button","Dropdown","__","sprintf","useSelect","useState","useMemo","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","default","PostFormatForm","POST_FORMATS","PostFormatCheck","PostPanelRow","store","editorStore","jsx","_jsx","jsxs","_jsxs","PostFormat","postFormat","select","getEditedPostAttribute","_postFormat","activeFormat","find","format","id","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","children","label","ref","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","size","variant","caption","onClick","renderContent","onClose","className","title"],"sources":["@wordpress/editor/src/components/post-format/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Dropdown } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { default as PostFormatForm, POST_FORMATS } from './';\nimport PostFormatCheck from './check';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the Post Author Panel component.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostFormat() {\n\tconst { postFormat } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst _postFormat = getEditedPostAttribute( 'format' );\n\t\treturn {\n\t\t\tpostFormat: _postFormat ?? 'standard',\n\t\t};\n\t}, [] );\n\tconst activeFormat = POST_FORMATS.find(\n\t\t( format ) => format.id === postFormat\n\t);\n\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<PostFormatCheck>\n\t\t\t<PostPanelRow label={ __( 'Format' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tcontentClassName=\"editor-post-format__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Current post format.\n\t\t\t\t\t\t\t\t__( 'Change format: %s' ),\n\t\t\t\t\t\t\t\tactiveFormat?.caption\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ activeFormat?.caption }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<div className=\"editor-post-format__dialog-content\">\n\t\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\t\ttitle={ __( 'Format' ) }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFormatForm />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostFormatCheck>\n\t);\n}\n\nexport default PostFormat;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,QAAQ,QAAQ,uBAA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eACfnB,IAAA,CAACJ,YAAY;MAACwB,KAAK,EAAGnC,EAAE,CAAE,QAAS,CAAG;MAACoC,GAAG,EAAGR,gBAAkB;MAAAM,QAAA,eAC9DnB,IAAA,CAAChB,QAAQ;QACR8B,YAAY,EAAGA,YAAc;QAC7BQ,gBAAgB,EAAC,4BAA4B;QAC7CC,YAAY;QACZC,YAAY,EAAGA,CAAE;UAAEC,MAAM;UAAEC;QAAS,CAAC,kBACpC1B,IAAA,CAACjB,MAAM;UACN4C,IAAI,EAAC,SAAS;UACdC,OAAO,EAAC,UAAU;UAClB,iBAAgBH,MAAQ;UACxB,cAAavC,OAAO;UACnB;UACAD,EAAE,CAAE,mBAAoB,CAAC,EACzBuB,YAAY,EAAEqB,OACf,CAAG;UACHC,OAAO,EAAGJ,QAAU;UAAAP,QAAA,EAElBX,YAAY,EAAEqB;QAAO,CAChB,CACN;QACHE,aAAa,EAAGA,CAAE;UAAEC;QAAQ,CAAC,kBAC5B9B,KAAA;UAAK+B,SAAS,EAAC,oCAAoC;UAAAd,QAAA,gBAClDnB,IAAA,CAACT,sBAAsB;YACtB2C,KAAK,EAAGjD,EAAE,CAAE,QAAS,CAAG;YACxB+C,OAAO,EAAGA;UAAS,CACnB,CAAC,eACFhC,IAAA,CAACP,cAAc,IAAE,CAAC;QAAA,CACd;MACH,CACH;IAAC,CACW;EAAC,CACC,CAAC;AAEpB;AAEA,eAAeU,UAAU","ignoreList":[]}
@@ -12,10 +12,10 @@ import { store as editorStore } from '../../store';
12
12
  /**
13
13
  * Wrapper component that renders its children if the post has more than one revision.
14
14
  *
15
- * @param {Object} props Props.
16
- * @param {Element} props.children Children to be rendered.
15
+ * @param {Object} props Props.
16
+ * @param {React.ReactNode} props.children Children to be rendered.
17
17
  *
18
- * @return {Component|null} Rendered child components if post has more than one revision, otherwise null.
18
+ * @return {React.ReactNode} Rendered child components if post has more than one revision, otherwise null.
19
19
  */
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
  function PostLastRevisionCheck({
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","jsx","_jsx","PostLastRevisionCheck","children","lastRevisionId","revisionsCount","select","getCurrentPostLastRevisionId","getCurrentPostRevisionsCount","supportKeys"],"sources":["@wordpress/editor/src/components/post-last-revision/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children if the post has more than one revision.\n *\n * @param {Object} props Props.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {Component|null} Rendered child components if post has more than one revision, otherwise null.\n */\nfunction PostLastRevisionCheck( { children } ) {\n\tconst { lastRevisionId, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n\n\tif ( ! lastRevisionId || revisionsCount < 2 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"revisions\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostLastRevisionCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,SAASC,qBAAqBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC9C,MAAM;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACnE,MAAM;MAAEC,4BAA4B;MAAEC;IAA6B,CAAC,GACnEF,MAAM,CAAEP,WAAY,CAAC;IACtB,OAAO;MACNK,cAAc,EAAEG,4BAA4B,CAAC,CAAC;MAC9CF,cAAc,EAAEG,4BAA4B,CAAC;IAC9C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEJ,cAAc,IAAIC,cAAc,GAAG,CAAC,EAAG;IAC7C,OAAO,IAAI;EACZ;EAEA,oBACCJ,IAAA,CAACJ,oBAAoB;IAACY,WAAW,EAAC,WAAW;IAAAN,QAAA,EAC1CA;EAAQ,CACW,CAAC;AAEzB;AAEA,eAAeD,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","jsx","_jsx","PostLastRevisionCheck","children","lastRevisionId","revisionsCount","select","getCurrentPostLastRevisionId","getCurrentPostRevisionsCount","supportKeys"],"sources":["@wordpress/editor/src/components/post-last-revision/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\n/**\n * Wrapper component that renders its children if the post has more than one revision.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered.\n *\n * @return {React.ReactNode} Rendered child components if post has more than one revision, otherwise null.\n */\nfunction PostLastRevisionCheck( { children } ) {\n\tconst { lastRevisionId, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n\n\tif ( ! lastRevisionId || revisionsCount < 2 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"revisions\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostLastRevisionCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,SAASC,qBAAqBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC9C,MAAM;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACnE,MAAM;MAAEC,4BAA4B;MAAEC;IAA6B,CAAC,GACnEF,MAAM,CAAEP,WAAY,CAAC;IACtB,OAAO;MACNK,cAAc,EAAEG,4BAA4B,CAAC,CAAC;MAC9CF,cAAc,EAAEG,4BAA4B,CAAC;IAC9C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEJ,cAAc,IAAIC,cAAc,GAAG,CAAC,EAAG;IAC7C,OAAO,IAAI;EACZ;EAEA,oBACCJ,IAAA,CAACJ,oBAAoB;IAACY,WAAW,EAAC,WAAW;IAAAN,QAAA,EAC1CA;EAAQ,CACW,CAAC;AAEzB;AAEA,eAAeD,qBAAqB","ignoreList":[]}
@@ -30,7 +30,7 @@ function usePostLastRevisionInfo() {
30
30
  /**
31
31
  * Renders the component for displaying the last revision of a post.
32
32
  *
33
- * @return {Component} The component to be rendered.
33
+ * @return {React.ReactNode} The rendered component.
34
34
  */
35
35
  function PostLastRevision() {
36
36
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["sprintf","__","Button","useSelect","backup","addQueryArgs","PostLastRevisionCheck","PostPanelRow","store","editorStore","jsx","_jsx","usePostLastRevisionInfo","select","getCurrentPostLastRevisionId","getCurrentPostRevisionsCount","lastRevisionId","revisionsCount","PostLastRevision","children","__next40pxDefaultSize","href","revision","className","icon","iconPosition","text","PrivatePostLastRevision","label","variant","size"],"sources":["@wordpress/editor/src/components/post-last-revision/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from './check';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\nfunction usePostLastRevisionInfo() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n}\n\n/**\n * Renders the component for displaying the last revision of a post.\n *\n * @return {Component} The component to be rendered.\n */\nfunction PostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\trevision: lastRevisionId,\n\t\t\t\t} ) }\n\t\t\t\tclassName=\"editor-post-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t\ticonPosition=\"right\"\n\t\t\t\ttext={ sprintf(\n\t\t\t\t\t/* translators: %s: number of revisions. */\n\t\t\t\t\t__( 'Revisions (%s)' ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport function PrivatePostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostPanelRow label={ __( 'Revisions' ) }>\n\t\t\t\t<Button\n\t\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\t\trevision: lastRevisionId,\n\t\t\t\t\t} ) }\n\t\t\t\t\tclassName=\"editor-private-post-last-revision__button\"\n\t\t\t\t\ttext={ revisionsCount }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default PostLastRevision;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,SAAS;AAC3C,OAAOC,YAAY,MAAM,mBAAmB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnD,SAASC,uBAAuBA,CAAA,EAAG;EAClC,OAAOT,SAAS,CAAIU,MAAM,IAAM;IAC/B,MAAM;MAAEC,4BAA4B;MAAEC;IAA6B,CAAC,GACnEF,MAAM,CAAEJ,WAAY,CAAC;IACtB,OAAO;MACNO,cAAc,EAAEF,4BAA4B,CAAC,CAAC;MAC9CG,cAAc,EAAEF,4BAA4B,CAAC;IAC9C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASG,gBAAgBA,CAAA,EAAG;EAC3B,MAAM;IAAEF,cAAc;IAAEC;EAAe,CAAC,GAAGL,uBAAuB,CAAC,CAAC;EAEpE,oBACCD,IAAA,CAACL,qBAAqB;IAAAa,QAAA,eACrBR,IAAA,CAACT,MAAM;MACNkB,qBAAqB;MACrBC,IAAI,EAAGhB,YAAY,CAAE,cAAc,EAAE;QACpCiB,QAAQ,EAAEN;MACX,CAAE,CAAG;MACLO,SAAS,EAAC,kCAAkC;MAC5CC,IAAI,EAAGpB,MAAQ;MACfqB,YAAY,EAAC,OAAO;MACpBC,IAAI,EAAG1B,OAAO,CACb;MACAC,EAAE,CAAE,gBAAiB,CAAC,EACtBgB,cACD;IAAG,CACH;EAAC,CACoB,CAAC;AAE1B;AAEA,OAAO,SAASU,uBAAuBA,CAAA,EAAG;EACzC,MAAM;IAAEX,cAAc;IAAEC;EAAe,CAAC,GAAGL,uBAAuB,CAAC,CAAC;EACpE,oBACCD,IAAA,CAACL,qBAAqB;IAAAa,QAAA,eACrBR,IAAA,CAACJ,YAAY;MAACqB,KAAK,EAAG3B,EAAE,CAAE,WAAY,CAAG;MAAAkB,QAAA,eACxCR,IAAA,CAACT,MAAM;QACNmB,IAAI,EAAGhB,YAAY,CAAE,cAAc,EAAE;UACpCiB,QAAQ,EAAEN;QACX,CAAE,CAAG;QACLO,SAAS,EAAC,2CAA2C;QACrDG,IAAI,EAAGT,cAAgB;QACvBY,OAAO,EAAC,UAAU;QAClBC,IAAI,EAAC;MAAS,CACd;IAAC,CACW;EAAC,CACO,CAAC;AAE1B;AAEA,eAAeZ,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["sprintf","__","Button","useSelect","backup","addQueryArgs","PostLastRevisionCheck","PostPanelRow","store","editorStore","jsx","_jsx","usePostLastRevisionInfo","select","getCurrentPostLastRevisionId","getCurrentPostRevisionsCount","lastRevisionId","revisionsCount","PostLastRevision","children","__next40pxDefaultSize","href","revision","className","icon","iconPosition","text","PrivatePostLastRevision","label","variant","size"],"sources":["@wordpress/editor/src/components/post-last-revision/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from './check';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\nfunction usePostLastRevisionInfo() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n}\n\n/**\n * Renders the component for displaying the last revision of a post.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\trevision: lastRevisionId,\n\t\t\t\t} ) }\n\t\t\t\tclassName=\"editor-post-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t\ticonPosition=\"right\"\n\t\t\t\ttext={ sprintf(\n\t\t\t\t\t/* translators: %s: number of revisions. */\n\t\t\t\t\t__( 'Revisions (%s)' ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport function PrivatePostLastRevision() {\n\tconst { lastRevisionId, revisionsCount } = usePostLastRevisionInfo();\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PostPanelRow label={ __( 'Revisions' ) }>\n\t\t\t\t<Button\n\t\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\t\trevision: lastRevisionId,\n\t\t\t\t\t} ) }\n\t\t\t\t\tclassName=\"editor-private-post-last-revision__button\"\n\t\t\t\t\ttext={ revisionsCount }\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\n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M;IAAEX,cAAc;IAAEC;EAAe,CAAC,GAAGL,uBAAuB,CAAC,CAAC;EACpE,oBACCD,IAAA,CAACL,qBAAqB;IAAAa,QAAA,eACrBR,IAAA,CAACJ,YAAY;MAACqB,KAAK,EAAG3B,EAAE,CAAE,WAAY,CAAG;MAAAkB,QAAA,eACxCR,IAAA,CAACT,MAAM;QACNmB,IAAI,EAAGhB,YAAY,CAAE,cAAc,EAAE;UACpCiB,QAAQ,EAAEN;QACX,CAAE,CAAG;QACLO,SAAS,EAAC,2CAA2C;QACrDG,IAAI,EAAGT,cAAgB;QACvBY,OAAO,EAAC,UAAU;QAClBC,IAAI,EAAC;MAAS,CACd;IAAC,CACW;EAAC,CACO,CAAC;AAE1B;AAEA,eAAeZ,gBAAgB","ignoreList":[]}
@@ -12,7 +12,7 @@ import PostLastRevisionCheck from './check';
12
12
  /**
13
13
  * Renders the panel for displaying the last revision of a post.
14
14
  *
15
- * @return {Component} The component to be rendered.
15
+ * @return {React.ReactNode} The rendered component.
16
16
  */
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  function PostLastRevisionPanel() {
@@ -1 +1 @@
1
- {"version":3,"names":["PanelBody","PostLastRevision","PostLastRevisionCheck","jsx","_jsx","PostLastRevisionPanel","children","className"],"sources":["@wordpress/editor/src/components/post-last-revision/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevision from './';\nimport PostLastRevisionCheck from './check';\n\n/**\n * Renders the panel for displaying the last revision of a post.\n *\n * @return {Component} The component to be rendered.\n */\nfunction PostLastRevisionPanel() {\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PanelBody className=\"editor-post-last-revision__panel\">\n\t\t\t\t<PostLastRevision />\n\t\t\t</PanelBody>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default PostLastRevisionPanel;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;;AAEjD;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,IAAI;AACjC,OAAOC,qBAAqB,MAAM,SAAS;;AAE3C;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,SAASC,qBAAqBA,CAAA,EAAG;EAChC,oBACCD,IAAA,CAACF,qBAAqB;IAAAI,QAAA,eACrBF,IAAA,CAACJ,SAAS;MAACO,SAAS,EAAC,kCAAkC;MAAAD,QAAA,eACtDF,IAAA,CAACH,gBAAgB,IAAE;IAAC,CACV;EAAC,CACU,CAAC;AAE1B;AAEA,eAAeI,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["PanelBody","PostLastRevision","PostLastRevisionCheck","jsx","_jsx","PostLastRevisionPanel","children","className"],"sources":["@wordpress/editor/src/components/post-last-revision/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevision from './';\nimport PostLastRevisionCheck from './check';\n\n/**\n * Renders the panel for displaying the last revision of a post.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostLastRevisionPanel() {\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PanelBody className=\"editor-post-last-revision__panel\">\n\t\t\t\t<PostLastRevision />\n\t\t\t</PanelBody>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default PostLastRevisionPanel;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;;AAEjD;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,IAAI;AACjC,OAAOC,qBAAqB,MAAM,SAAS;;AAE3C;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,SAASC,qBAAqBA,CAAA,EAAG;EAChC,oBACCD,IAAA,CAACF,qBAAqB;IAAAI,QAAA,eACrBF,IAAA,CAACJ,SAAS;MAACO,SAAS,EAAC,kCAAkC;MAAAD,QAAA,eACtDF,IAAA,CAACH,gBAAgB,IAAE;IAAC,CACV;EAAC,CACU,CAAC;AAE1B;AAEA,eAAeI,qBAAqB","ignoreList":[]}
@@ -19,7 +19,7 @@ import { store as editorStore } from '../../store';
19
19
  * A modal component that is displayed when a post is locked for editing by another user.
20
20
  * The modal provides information about the lock status and options to take over or exit the editor.
21
21
  *
22
- * @return {JSX.Element|null} The rendered PostLockedModal component.
22
+ * @return {React.ReactNode} The rendered PostLockedModal component.
23
23
  */
24
24
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
25
25
  export default function PostLockedModal() {
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","Modal","Button","ExternalLink","__experimentalHStack","HStack","useSelect","useDispatch","addQueryArgs","useEffect","createInterpolateElement","addAction","removeAction","useInstanceId","store","coreStore","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PostLockedModal","instanceId","hookName","autosave","updatePostLock","isLocked","isTakeover","user","postId","postLockUtils","activePostLock","postType","previewLink","select","isPostLocked","isPostLockTakeover","getPostLockUser","getCurrentPostId","getActivePostLock","getEditedPostAttribute","getEditedPostPreviewLink","getEditorSettings","getPostType","sendPostLock","data","lock","post_id","receivePostLock","received","lock_error","name","avatar","avatar_src_2x","new_lock","releasePostLock","window","FormData","append","unlockNonce","navigator","sendBeacon","ajaxUrl","xhr","XMLHttpRequest","open","send","addEventListener","removeEventListener","userDisplayName","userAvatar","unlockUrl","lockKey","post","action","_wpnonce","nonce","allPostsUrl","post_type","slug","allPostsLabel","title","focusOnMount","shouldCloseOnClickOutside","shouldCloseOnEsc","isDismissible","className","size","children","alignment","spacing","src","alt","width","height","strong","PreviewLink","href","justify","__next40pxDefaultSize","variant"],"sources":["@wordpress/editor/src/components/post-locked-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * A modal component that is displayed when a post is locked for editing by another user.\n * The modal provides information about the lock status and options to take over or exit the editor.\n *\n * @return {JSX.Element|null} The rendered PostLockedModal component.\n */\nexport default function PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\t// Do not remove this class, as this class is used by third party plugins.\n\t\t\tclassName=\"editor-post-locked-modal\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\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\t\t'Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\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\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\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</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\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\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\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\t\t'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\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\tuserDisplayName\n\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\t\t\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\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\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\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\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\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</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\thref={ unlockUrl }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\thref={ allPostsUrl }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,KAAK,EACLC,MAAM,EACNC,YAAY,EACZC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,SAAS,EAAEC,wBAAwB,QAAQ,oBAAoB;AACxE,SAASC,SAAS,EAAEC,YAAY,QAAQ,kBAAkB;AAC1D,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAMA,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAMC,UAAU,GAAGX,aAAa,CAAEU,eAAgB,CAAC;EACnD,MAAME,QAAQ,GAAG,gCAAgC,GAAGD,UAAU;EAC9D,MAAM;IAAEE,QAAQ;IAAEC;EAAe,CAAC,GAAGpB,WAAW,CAAES,WAAY,CAAC;EAC/D,MAAM;IACLY,QAAQ;IACRC,UAAU;IACVC,IAAI;IACJC,MAAM;IACNC,aAAa;IACbC,cAAc;IACdC,QAAQ;IACRC;EACD,CAAC,G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rBC,OAAO,EAAC,UAAU;YAClBH,IAAI,EAAG1B,SAAW;YAAAiB,QAAA,EAEhB3F,EAAE,CAAE,WAAY;UAAC,CACZ,CACR,eACDmB,IAAA,CAAChB,MAAM;YACNmG,qBAAqB;YACrBC,OAAO,EAAC,SAAS;YACjBH,IAAI,EAAGpB,WAAa;YAAAW,QAAA,EAElBR;UAAa,CACR,CAAC;QAAA,CACF,CAAC;MAAA,CACL,CAAC;IAAA,CACC;EAAC,CACH,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","Modal","Button","ExternalLink","__experimentalHStack","HStack","useSelect","useDispatch","addQueryArgs","useEffect","createInterpolateElement","addAction","removeAction","useInstanceId","store","coreStore","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PostLockedModal","instanceId","hookName","autosave","updatePostLock","isLocked","isTakeover","user","postId","postLockUtils","activePostLock","postType","previewLink","select","isPostLocked","isPostLockTakeover","getPostLockUser","getCurrentPostId","getActivePostLock","getEditedPostAttribute","getEditedPostPreviewLink","getEditorSettings","getPostType","sendPostLock","data","lock","post_id","receivePostLock","received","lock_error","name","avatar","avatar_src_2x","new_lock","releasePostLock","window","FormData","append","unlockNonce","navigator","sendBeacon","ajaxUrl","xhr","XMLHttpRequest","open","send","addEventListener","removeEventListener","userDisplayName","userAvatar","unlockUrl","lockKey","post","action","_wpnonce","nonce","allPostsUrl","post_type","slug","allPostsLabel","title","focusOnMount","shouldCloseOnClickOutside","shouldCloseOnEsc","isDismissible","className","size","children","alignment","spacing","src","alt","width","height","strong","PreviewLink","href","justify","__next40pxDefaultSize","variant"],"sources":["@wordpress/editor/src/components/post-locked-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * A modal component that is displayed when a post is locked for editing by another user.\n * The modal provides information about the lock status and options to take over or exit the editor.\n *\n * @return {React.ReactNode} The rendered PostLockedModal component.\n */\nexport default function PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\t// Do not remove this class, as this class is used by third party plugins.\n\t\t\tclassName=\"editor-post-locked-modal\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\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\t\t'Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\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\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\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</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\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\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\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\t\t'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\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\tuserDisplayName\n\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\t\t\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\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\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\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\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\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</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\thref={ unlockUrl }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize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;UAAC,CACZ,CACR,eACDmB,IAAA,CAAChB,MAAM;YACNmG,qBAAqB;YACrBC,OAAO,EAAC,SAAS;YACjBH,IAAI,EAAGpB,WAAa;YAAAW,QAAA,EAElBR;UAAa,CACR,CAAC;QAAA,CACF,CAAC;MAAA,CACL,CAAC;IAAA,CACC;EAAC,CACH,CAAC;AAEV","ignoreList":[]}
@@ -13,10 +13,10 @@ import { store as editorStore } from '../../store';
13
13
  * If the post is already published or the user doesn't have the
14
14
  * capability to publish, it returns null.
15
15
  *
16
- * @param {Object} props Component properties.
17
- * @param {Element} props.children Children to be rendered.
16
+ * @param {Object} props Component properties.
17
+ * @param {React.ReactElement} props.children Children to be rendered.
18
18
  *
19
- * @return {JSX.Element|null} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.
19
+ * @return {React.ReactElement} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.
20
20
  */
21
21
  export function PostPendingStatusCheck({
22
22
  children
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","editorStore","PostPendingStatusCheck","children","hasPublishAction","isPublished","select","_getCurrentPost$_link","isCurrentPostPublished","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-pending-status/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * This component checks the publishing status of the current post.\n * If the post is already published or the user doesn't have the\n * capability to publish, it returns null.\n *\n * @param {Object} props Component properties.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {JSX.Element|null} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.\n */\nexport function PostPendingStatusCheck( { children } ) {\n\tconst { hasPublishAction, isPublished } = useSelect( ( select ) => {\n\t\tconst { isCurrentPostPublished, getCurrentPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t};\n\t}, [] );\n\n\tif ( isPublished || ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostPendingStatusCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAClE,MAAM;MAAEC,sBAAsB;MAAEC;IAAe,CAAC,GAC/CH,MAAM,CAAEL,WAAY,CAAC;IACtB,OAAO;MACNG,gBAAgB,GAAAG,qBAAA,GACfE,cAAc,CAAC,CAAC,CAACC,MAAM,GAAI,mBAAmB,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;MAC1DF,WAAW,EAAEG,sBAAsB,CAAC;IACrC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKH,WAAW,IAAI,CAAED,gBAAgB,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","editorStore","PostPendingStatusCheck","children","hasPublishAction","isPublished","select","_getCurrentPost$_link","isCurrentPostPublished","getCurrentPost","_links"],"sources":["@wordpress/editor/src/components/post-pending-status/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * This component checks the publishing status of the current post.\n * If the post is already published or the user doesn't have the\n * capability to publish, it returns null.\n *\n * @param {Object} props Component properties.\n * @param {React.ReactElement} props.children Children to be rendered.\n *\n * @return {React.ReactElement} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.\n */\nexport function PostPendingStatusCheck( { children } ) {\n\tconst { hasPublishAction, isPublished } = useSelect( ( select ) => {\n\t\tconst { isCurrentPostPublished, getCurrentPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t};\n\t}, [] );\n\n\tif ( isPublished || ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostPendingStatusCheck;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAClE,MAAM;MAAEC,sBAAsB;MAAEC;IAAe,CAAC,GAC/CH,MAAM,CAAEL,WAAY,CAAC;IACtB,OAAO;MACNG,gBAAgB,GAAAG,qBAAA,GACfE,cAAc,CAAC,CAAC,CAACC,MAAM,GAAI,mBAAmB,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;MAC1DF,WAAW,EAAEG,sBAAsB,CAAC;IACrC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKH,WAAW,IAAI,CAAED,gBAAgB,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
@@ -14,7 +14,7 @@ import { store as editorStore } from '../../store';
14
14
  /**
15
15
  * A component for displaying and toggling the pending status of a post.
16
16
  *
17
- * @return {JSX.Element} The rendered component.
17
+ * @return {React.ReactNode} The rendered component.
18
18
  */
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  export function PostPendingStatus() {
@@ -1 +1 @@
1
- {"version":3,"names":["__","CheckboxControl","useDispatch","useSelect","PostPendingStatusCheck","store","editorStore","jsx","_jsx","PostPendingStatus","status","select","getEditedPostAttribute","editPost","togglePendingStatus","updatedStatus","children","__nextHasNoMarginBottom","label","checked","onChange"],"sources":["@wordpress/editor/src/components/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPendingStatusCheck from './check';\nimport { store as editorStore } from '../../store';\n\n/**\n * A component for displaying and toggling the pending status of a post.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport function PostPendingStatus() {\n\tconst status = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst togglePendingStatus = () => {\n\t\tconst updatedStatus = status === 'pending' ? 'draft' : 'pending';\n\t\teditPost( { status: updatedStatus } );\n\t};\n\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Pending review' ) }\n\t\t\t\tchecked={ status === 'pending' }\n\t\t\t\tonChange={ togglePendingStatus }\n\t\t\t/>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,SAAS;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,MAAMC,MAAM,GAAGP,SAAS,CACrBQ,MAAM,IAAMA,MAAM,CAAEL,WAAY,CAAC,CAACM,sBAAsB,CAAE,QAAS,CAAC,EACtE,EACD,CAAC;EACD,MAAM;IAAEC;EAAS,CAAC,GAAGX,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAMQ,mBAAmB,GAAGA,CAAA,KAAM;IACjC,MAAMC,aAAa,GAAGL,MAAM,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;IAChEG,QAAQ,CAAE;MAAEH,MAAM,EAAEK;IAAc,CAAE,CAAC;EACtC,CAAC;EAED,oBACCP,IAAA,CAACJ,sBAAsB;IAAAY,QAAA,eACtBR,IAAA,CAACP,eAAe;MACfgB,uBAAuB;MACvBC,KAAK,EAAGlB,EAAE,CAAE,gBAAiB,CAAG;MAChCmB,OAAO,EAAGT,MAAM,KAAK,SAAW;MAChCU,QAAQ,EAAGN;IAAqB,CAChC;EAAC,CACqB,CAAC;AAE3B;AAEA,eAAeL,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["__","CheckboxControl","useDispatch","useSelect","PostPendingStatusCheck","store","editorStore","jsx","_jsx","PostPendingStatus","status","select","getEditedPostAttribute","editPost","togglePendingStatus","updatedStatus","children","__nextHasNoMarginBottom","label","checked","onChange"],"sources":["@wordpress/editor/src/components/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPendingStatusCheck from './check';\nimport { store as editorStore } from '../../store';\n\n/**\n * A component for displaying and toggling the pending status of a post.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport function PostPendingStatus() {\n\tconst status = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst togglePendingStatus = () => {\n\t\tconst updatedStatus = status === 'pending' ? 'draft' : 'pending';\n\t\teditPost( { status: updatedStatus } );\n\t};\n\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Pending review' ) }\n\t\t\t\tchecked={ status === 'pending' }\n\t\t\t\tonChange={ togglePendingStatus }\n\t\t\t/>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,SAAS;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EACnC,MAAMC,MAAM,GAAGP,SAAS,CACrBQ,MAAM,IAAMA,MAAM,CAAEL,WAAY,CAAC,CAACM,sBAAsB,CAAE,QAAS,CAAC,EACtE,EACD,CAAC;EACD,MAAM;IAAEC;EAAS,CAAC,GAAGX,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAMQ,mBAAmB,GAAGA,CAAA,KAAM;IACjC,MAAMC,aAAa,GAAGL,MAAM,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;IAChEG,QAAQ,CAAE;MAAEH,MAAM,EAAEK;IAAc,CAAE,CAAC;EACtC,CAAC;EAED,oBACCP,IAAA,CAACJ,sBAAsB;IAAAY,QAAA,eACtBR,IAAA,CAACP,eAAe;MACfgB,uBAAuB;MACvBC,KAAK,EAAGlB,EAAE,CAAE,gBAAiB,CAAG;MAChCmB,OAAO,EAAGT,MAAM,KAAK,SAAW;MAChCU,QAAQ,EAAGN;IAAqB,CAChC;EAAC,CACqB,CAAC;AAE3B;AAEA,eAAeL,iBAAiB","ignoreList":[]}
@@ -111,7 +111,7 @@ function writeInterstitialMessage(targetDocument) {
111
111
  * @param {string} props.role The role attribute for the button.
112
112
  * @param {Function} props.onPreview The callback function for preview event.
113
113
  *
114
- * @return {JSX.Element|null} The rendered button component.
114
+ * @return {React.ReactNode} The rendered button component.
115
115
  */
116
116
  export default function PostPreviewButton({
117
117
  className,
@@ -1 +1 @@
1
- {"version":3,"names":["renderToString","Button","Path","SVG","VisuallyHidden","__","_x","useSelect","useDispatch","applyFilters","store","coreStore","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","writeInterstitialMessage","targetDocument","markup","className","children","xmlns","viewBox","d","fill","write","title","close","PostPreviewButton","textContent","forceIsAutosaveable","role","onPreview","postId","currentPostLink","previewLink","isSaveable","isViewable","select","_postType$viewable","editor","core","postType","getPostType","getCurrentPostType","getCurrentPostId","getCurrentPostAttribute","getEditedPostPreviewLink","isEditedPostSaveable","viewable","__unstableSaveForPreview","targetId","openPreviewWindow","event","preventDefault","previewWindow","window","open","focus","document","link","location","href","variant","undefined","target","accessibleWhenDisabled","disabled","onClick","size","as"],"sources":["@wordpress/editor/src/components/post-preview-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport { Button, Path, SVG, VisuallyHidden } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction writeInterstitialMessage( targetDocument ) {\n\tlet markup = renderToString(\n\t\t<div className=\"editor-post-preview-button__interstitial-message\">\n\t\t\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\">\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"outer\"\n\t\t\t\t\td=\"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"inner\"\n\t\t\t\t\td=\"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t\t<p>{ __( 'Generating preview…' ) }</p>\n\t\t</div>\n\t);\n\n\tmarkup += `\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t}\n\t\t</style>\n\t`;\n\n\t/**\n\t * Filters the interstitial message shown when generating previews.\n\t *\n\t * @param {string} markup The preview interstitial markup.\n\t */\n\tmarkup = applyFilters( 'editor.PostPreview.interstitialMarkup', markup );\n\n\ttargetDocument.write( markup );\n\ttargetDocument.title = __( 'Generating preview…' );\n\ttargetDocument.close();\n}\n\n/**\n * Renders a button that opens a new window or tab for the preview,\n * writes the interstitial message to this window, and then navigates\n * to the actual preview link. The button is not rendered if the post\n * is not viewable and disabled if the post is not saveable.\n *\n * @param {Object} props The component props.\n * @param {string} props.className The class name for the button.\n * @param {string} props.textContent The text content for the button.\n * @param {boolean} props.forceIsAutosaveable Whether to force autosave.\n * @param {string} props.role The role attribute for the button.\n * @param {Function} props.onPreview The callback function for preview event.\n *\n * @return {JSX.Element|null} The rendered button component.\n */\nexport default function PostPreviewButton( {\n\tclassName,\n\ttextContent,\n\tforceIsAutosaveable,\n\trole,\n\tonPreview,\n} ) {\n\tconst { postId, currentPostLink, previewLink, isSaveable, isViewable } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst editor = select( editorStore );\n\t\t\tconst core = select( coreStore );\n\n\t\t\tconst postType = core.getPostType(\n\t\t\t\teditor.getCurrentPostType( 'type' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tpostId: editor.getCurrentPostId(),\n\t\t\t\tcurrentPostLink: editor.getCurrentPostAttribute( 'link' ),\n\t\t\t\tpreviewLink: editor.getEditedPostPreviewLink(),\n\t\t\t\tisSaveable: editor.isEditedPostSaveable(),\n\t\t\t\tisViewable: postType?.viewable ?? false,\n\t\t\t};\n\t\t}, [] );\n\n\tconst { __unstableSaveForPreview } = useDispatch( editorStore );\n\n\tif ( ! isViewable ) {\n\t\treturn null;\n\t}\n\n\tconst targetId = `wp-preview-${ postId }`;\n\n\tconst openPreviewWindow = async ( event ) => {\n\t\t// Our Preview button has its 'href' and 'target' set correctly for a11y\n\t\t// purposes. Unfortunately, though, we can't rely on the default 'click'\n\t\t// handler since sometimes it incorrectly opens a new tab instead of reusing\n\t\t// the existing one.\n\t\t// https://github.com/WordPress/gutenberg/pull/8330\n\t\tevent.preventDefault();\n\n\t\t// Open up a Preview tab if needed. This is where we'll show the preview.\n\t\tconst previewWindow = window.open( '', targetId );\n\n\t\t// Focus the Preview tab. This might not do anything, depending on the browser's\n\t\t// and user's preferences.\n\t\t// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus\n\t\tpreviewWindow.focus();\n\n\t\twriteInterstitialMessage( previewWindow.document );\n\n\t\tconst link = await __unstableSaveForPreview( { forceIsAutosaveable } );\n\n\t\tpreviewWindow.location = link;\n\n\t\tonPreview?.();\n\t};\n\n\t// Link to the `?preview=true` URL if we have it, since this lets us see\n\t// changes that were autosaved since the post was last published. Otherwise,\n\t// just link to the post's URL.\n\tconst href = previewLink || currentPostLink;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ ! className ? 'tertiary' : undefined }\n\t\t\tclassName={ className || 'editor-post-preview' }\n\t\t\thref={ href }\n\t\t\ttarget={ targetId }\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ ! isSaveable }\n\t\t\tonClick={ openPreviewWindow }\n\t\t\trole={ role }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ textContent || (\n\t\t\t\t<>\n\t\t\t\t\t{ _x( 'Preview', 'imperative verb' ) }\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,cAAc,QAAQ,uBAAuB;AACzE,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW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AI,aAAa,CAACG,KAAK,CAAC,CAAC;IAErB1C,wBAAwB,CAAEuC,aAAa,CAACI,QAAS,CAAC;IAElD,MAAMC,IAAI,GAAG,MAAMV,wBAAwB,CAAE;MAAEpB;IAAoB,CAAE,CAAC;IAEtEyB,aAAa,CAACM,QAAQ,GAAGD,IAAI;IAE7B5B,SAAS,GAAG,CAAC;EACd,CAAC;;EAED;EACA;EACA;EACA,MAAM8B,IAAI,GAAG3B,WAAW,IAAID,eAAe;EAE3C,oBACCvB,IAAA,CAACb,MAAM;IACNiE,OAAO,EAAG,CAAE5C,SAAS,GAAG,UAAU,GAAG6C,SAAW;IAChD7C,SAAS,EAAGA,SAAS,IAAI,qBAAuB;IAChD2C,IAAI,EAAGA,IAAM;IACbG,MAAM,EAAGd,QAAU;IACnBe,sBAAsB;IACtBC,QAAQ,EAAG,CAAE/B,UAAY;IACzBgC,OAAO,EAAGhB,iBAAmB;IAC7BrB,IAAI,EAAGA,IAAM;IACbsC,IAAI,EAAC,SAAS;IAAAjD,QAAA,EAEZS,WAAW,iBACZhB,KAAA,CAAAE,SAAA;MAAAK,QAAA,GACGjB,EAAE,CAAE,SAAS,EAAE,iBAAkB,CAAC,eACpCQ,IAAA,CAACV,cAAc;QAACqE,EAAE,EAAC,MAAM;QAAAlD,QAAA,EAEvB;QACAlB,EAAE,CAAE,sBAAuB;MAAC,CAEd,CAAC;IAAA,CAChB;EACF,CACM,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["renderToString","Button","Path","SVG","VisuallyHidden","__","_x","useSelect","useDispatch","applyFilters","store","coreStore","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","writeInterstitialMessage","targetDocument","markup","className","children","xmlns","viewBox","d","fill","write","title","close","PostPreviewButton","textContent","forceIsAutosaveable","role","onPreview","postId","currentPostLink","previewLink","isSaveable","isViewable","select","_postType$viewable","editor","core","postType","getPostType","getCurrentPostType","getCurrentPostId","getCurrentPostAttribute","getEditedPostPreviewLink","isEditedPostSaveable","viewable","__unstableSaveForPreview","targetId","openPreviewWindow","event","preventDefault","previewWindow","window","open","focus","document","link","location","href","variant","undefined","target","accessibleWhenDisabled","disabled","onClick","size","as"],"sources":["@wordpress/editor/src/components/post-preview-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport { Button, Path, SVG, VisuallyHidden } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction writeInterstitialMessage( targetDocument ) {\n\tlet markup = renderToString(\n\t\t<div className=\"editor-post-preview-button__interstitial-message\">\n\t\t\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\">\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"outer\"\n\t\t\t\t\td=\"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"inner\"\n\t\t\t\t\td=\"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t\t<p>{ __( 'Generating preview…' ) }</p>\n\t\t</div>\n\t);\n\n\tmarkup += `\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t}\n\t\t</style>\n\t`;\n\n\t/**\n\t * Filters the interstitial message shown when generating previews.\n\t *\n\t * @param {string} markup The preview interstitial markup.\n\t */\n\tmarkup = applyFilters( 'editor.PostPreview.interstitialMarkup', markup );\n\n\ttargetDocument.write( markup );\n\ttargetDocument.title = __( 'Generating preview…' );\n\ttargetDocument.close();\n}\n\n/**\n * Renders a button that opens a new window or tab for the preview,\n * writes the interstitial message to this window, and then navigates\n * to the actual preview link. The button is not rendered if the post\n * is not viewable and disabled if the post is not saveable.\n *\n * @param {Object} props The component props.\n * @param {string} props.className The class name for the button.\n * @param {string} props.textContent The text content for the button.\n * @param {boolean} props.forceIsAutosaveable Whether to force autosave.\n * @param {string} props.role The role attribute for the button.\n * @param {Function} props.onPreview The callback function for preview event.\n *\n * @return {React.ReactNode} The rendered button component.\n */\nexport default function PostPreviewButton( {\n\tclassName,\n\ttextContent,\n\tforceIsAutosaveable,\n\trole,\n\tonPreview,\n} ) {\n\tconst { postId, currentPostLink, previewLink, isSaveable, isViewable } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst editor = select( editorStore );\n\t\t\tconst core = select( coreStore );\n\n\t\t\tconst postType = core.getPostType(\n\t\t\t\teditor.getCurrentPostType( 'type' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tpostId: editor.getCurrentPostId(),\n\t\t\t\tcurrentPostLink: editor.getCurrentPostAttribute( 'link' ),\n\t\t\t\tpreviewLink: editor.getEditedPostPreviewLink(),\n\t\t\t\tisSaveable: editor.isEditedPostSaveable(),\n\t\t\t\tisViewable: postType?.viewable ?? false,\n\t\t\t};\n\t\t}, [] );\n\n\tconst { __unstableSaveForPreview } = useDispatch( editorStore );\n\n\tif ( ! isViewable ) {\n\t\treturn null;\n\t}\n\n\tconst targetId = `wp-preview-${ postId }`;\n\n\tconst openPreviewWindow = async ( event ) => {\n\t\t// Our Preview button has its 'href' and 'target' set correctly for a11y\n\t\t// purposes. Unfortunately, though, we can't rely on the default 'click'\n\t\t// handler since sometimes it incorrectly opens a new tab instead of reusing\n\t\t// the existing one.\n\t\t// https://github.com/WordPress/gutenberg/pull/8330\n\t\tevent.preventDefault();\n\n\t\t// Open up a Preview tab if needed. This is where we'll show the preview.\n\t\tconst previewWindow = window.open( '', targetId );\n\n\t\t// Focus the Preview tab. This might not do anything, depending on the browser's\n\t\t// and user's preferences.\n\t\t// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus\n\t\tpreviewWindow.focus();\n\n\t\twriteInterstitialMessage( previewWindow.document );\n\n\t\tconst link = await __unstableSaveForPreview( { forceIsAutosaveable } );\n\n\t\tpreviewWindow.location = link;\n\n\t\tonPreview?.();\n\t};\n\n\t// Link to the `?preview=true` URL if we have it, since this lets us see\n\t// changes that were autosaved since the post was last published. Otherwise,\n\t// just link to the post's URL.\n\tconst href = previewLink || currentPostLink;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ ! className ? 'tertiary' : undefined }\n\t\t\tclassName={ className || 'editor-post-preview' }\n\t\t\thref={ href }\n\t\t\ttarget={ targetId }\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ ! isSaveable }\n\t\t\tonClick={ openPreviewWindow }\n\t\t\trole={ role }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ textContent || (\n\t\t\t\t<>\n\t\t\t\t\t{ _x( 'Preview', 'imperative verb' ) }\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* translators: acc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pCQ,IAAA,CAACV,cAAc;QAACqE,EAAE,EAAC,MAAM;QAAAlD,QAAA,EAEvB;QACAlB,EAAE,CAAE,sBAAuB;MAAC,CAEd,CAAC;IAAA,CAChB;EACF,CACM,CAAC;AAEX","ignoreList":[]}
@@ -37,7 +37,7 @@ export class PostPublishPanel extends Component {
37
37
  componentDidUpdate(prevProps) {
38
38
  // Automatically collapse the publish sidebar when a post
39
39
  // is published and the user makes an edit.
40
- if (prevProps.isPublished && !this.props.isSaving && this.props.isDirty) {
40
+ if (prevProps.isPublished && !this.props.isSaving && this.props.isDirty || this.props.currentPostId !== prevProps.currentPostId) {
41
41
  this.props.onClose();
42
42
  }
43
43
  }
@@ -64,6 +64,7 @@ export class PostPublishPanel extends Component {
64
64
  onTogglePublishSidebar,
65
65
  PostPublishExtension,
66
66
  PrePublishExtension,
67
+ currentPostId,
67
68
  ...additionalProps
68
69
  } = this.props;
69
70
  const {
@@ -136,6 +137,7 @@ export default compose([withSelect(select => {
136
137
  } = select(coreStore);
137
138
  const {
138
139
  getCurrentPost,
140
+ getCurrentPostId,
139
141
  getEditedPostAttribute,
140
142
  isCurrentPostPublished,
141
143
  isCurrentPostScheduled,
@@ -158,7 +160,8 @@ export default compose([withSelect(select => {
158
160
  isPublishSidebarEnabled: isPublishSidebarEnabled(),
159
161
  isSaving: isSavingPost() && !isAutosavingPost(),
160
162
  isSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),
161
- isScheduled: isCurrentPostScheduled()
163
+ isScheduled: isCurrentPostScheduled(),
164
+ currentPostId: getCurrentPostId()
162
165
  };
163
166
  }), withDispatch((dispatch, {
164
167
  isPublishSidebarEnabled