@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
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useState","RawHTML","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalConfirmDialog","ConfirmDialog","Button","DropdownMenu","TextareaControl","Tooltip","dateI18n","format","getSettings","getDateSettings","Icon","check","published","moreVertical","__","_x","useSelect","useEntityProp","store","blockEditorStore","sanitizeCommentString","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","actionState","setActionState","isConfirmDialogOpen","setIsConfirmDialogOpen","handleConfirmDelete","id","handleConfirmResolve","handleCancelDelete","blockCommentId","select","_select$getBlock$attr","clientID","getSelectedBlockClientId","getBlock","attributes","CommentBoard","thread","parentThread","_parentThread$status","children","CommentHeader","onResolve","_parentThread$id","action","onEdit","onDelete","onReply","undefined","status","alignment","spacing","justify","className","CommentForm","onSubmit","value","onCancel","content","raw","isOpen","onConfirm","confirmButtonText","cancelButtonText","Array","isArray","length","map","inputComment","reply","_thread$content$raw","setInputComment","__nextHasNoMarginBottom","onChange","__next40pxDefaultSize","accessibleWhenDisabled","variant","onClick","disabled","dateSettings","dateTimeFormat","formats","time","actions","title","moreActions","filter","item","src","author_avatar_urls","alt","width","height","author_name","dateTime","date","parent","label","icon","showTooltip","controls","text"],"sources":["@wordpress/editor/src/components/collab-sidebar/comments.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, RawHTML } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tButton,\n\tDropdownMenu,\n\tTextareaControl,\n\tTooltip,\n} from '@wordpress/components';\nimport {\n\tdateI18n,\n\tformat,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport { Icon, check, published, moreVertical } from '@wordpress/icons';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\n\n/**\n * Renders the Comments component.\n *\n * @param {Object} props - The component props.\n * @param {Array} props.threads - The array of comment threads.\n * @param {Function} props.onEditComment - The function to handle comment editing.\n * @param {Function} props.onAddReply - The function to add a reply to a comment.\n * @param {Function} props.onCommentDelete - The function to delete a comment.\n * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.\n * @return {JSX.Element} The rendered Comments component.\n */\nexport function Comments( {\n\tthreads,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n} ) {\n\tconst [ actionState, setActionState ] = useState( false );\n\tconst [ isConfirmDialogOpen, setIsConfirmDialogOpen ] = useState( false );\n\n\tconst handleConfirmDelete = () => {\n\t\tonCommentDelete( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleConfirmResolve = () => {\n\t\tonCommentResolve( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleCancelDelete = () => {\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst blockCommentId = useSelect( ( select ) => {\n\t\tconst clientID = select( blockEditorStore ).getSelectedBlockClientId();\n\t\treturn (\n\t\t\tselect( blockEditorStore ).getBlock( clientID )?.attributes\n\t\t\t\t?.blockCommentId ?? false\n\t\t);\n\t}, [] );\n\n\tconst CommentBoard = ( { thread, parentThread } ) => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<CommentHeader\n\t\t\t\t\tthread={ thread }\n\t\t\t\t\tonResolve={ () => {\n\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\taction: 'resolve',\n\t\t\t\t\t\t\tid: parentThread?.id ?? thread.id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonEdit={ () =>\n\t\t\t\t\t\tsetActionState( { action: 'edit', id: thread.id } )\n\t\t\t\t\t}\n\t\t\t\t\tonDelete={ () => {\n\t\t\t\t\t\tsetActionState( { action: 'delete', id: thread.id } );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonReply={\n\t\t\t\t\t\t! parentThread\n\t\t\t\t\t\t\t? () =>\n\t\t\t\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\t\t\t\taction: 'reply',\n\t\t\t\t\t\t\t\t\t\tid: thread.id,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tstatus={ parentThread?.status ?? thread.status }\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"left\"\n\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ 'edit' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tonEditComment( thread.id, value );\n\t\t\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonCancel={ () => setActionState( false ) }\n\t\t\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ( ! actionState ||\n\t\t\t\t\t\t\t'edit' !== actionState?.action ) && (\n\t\t\t\t\t\t\t<RawHTML>{ thread?.content?.raw }</RawHTML>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</HStack>\n\t\t\t\t{ 'resolve' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmResolve }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to mark this comment as resolved?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t\t{ 'delete' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmDelete }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to delete this comment?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{\n\t\t\t\t// If there are no comments, show a message indicating no comments are available.\n\t\t\t\t( ! Array.isArray( threads ) || threads.length === 0 ) && (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__thread\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// translators: message displayed when there are no comments available\n\t\t\t\t\t\t\t__( 'No comments available' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VStack>\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t{ Array.isArray( threads ) &&\n\t\t\t\tthreads.length > 0 &&\n\t\t\t\tthreads.map( ( thread ) => (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tkey={ thread.id }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'editor-collab-sidebar-panel__thread',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__active-thread':\n\t\t\t\t\t\t\t\t\tblockCommentId &&\n\t\t\t\t\t\t\t\t\tblockCommentId === thread.id,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tid={ thread.id }\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CommentBoard thread={ thread } />\n\t\t\t\t\t\t{ 'reply' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tonAddReply(\n\t\t\t\t\t\t\t\t\t\t\t\t\tinputComment,\n\t\t\t\t\t\t\t\t\t\t\t\t\tthread.id\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\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetActionState( false )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ 0 < thread?.reply?.length &&\n\t\t\t\t\t\t\tthread.reply.map( ( reply ) => (\n\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\tkey={ reply.id }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\t\tid={ reply.id }\n\t\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CommentBoard\n\t\t\t\t\t\t\t\t\t\tthread={ reply }\n\t\t\t\t\t\t\t\t\t\tparentThread={ thread }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</VStack>\n\t\t\t\t) ) }\n\t\t</>\n\t);\n}\n\n/**\n * EditComment component.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - The function to call when updating the comment.\n * @param {Function} props.onCancel - The function to call when canceling the comment update.\n * @param {Object} props.thread - The comment thread object.\n * @return {JSX.Element} The CommentForm component.\n */\nfunction CommentForm( { onSubmit, onCancel, thread } ) {\n\tconst [ inputComment, setInputComment ] = useState(\n\t\tthread?.content?.raw ?? ''\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TextareaControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ inputComment ?? '' }\n\t\t\t\tonChange={ setInputComment }\n\t\t\t/>\n\t\t\t<VStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ () => onSubmit( inputComment ) }\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ thread\n\t\t\t\t\t\t\t? _x( 'Update', 'verb' )\n\t\t\t\t\t\t\t: _x( 'Reply', 'Add reply comment' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button __next40pxDefaultSize onClick={ onCancel }>\n\t\t\t\t\t\t{ _x( 'Cancel', 'Cancel comment edit' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\n/**\n * Renders the header of a comment in the collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Object} props.thread - The comment thread object.\n * @param {Function} props.onResolve - The function to resolve the comment.\n * @param {Function} props.onEdit - The function to edit the comment.\n * @param {Function} props.onDelete - The function to delete the comment.\n * @param {Function} props.onReply - The function to reply to the comment.\n * @param {string} props.status - The status of the comment.\n * @return {JSX.Element} The rendered comment header.\n */\nfunction CommentHeader( {\n\tthread,\n\tonResolve,\n\tonEdit,\n\tonDelete,\n\tonReply,\n\tstatus,\n} ) {\n\tconst dateSettings = getDateSettings();\n\tconst [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\n\tconst actions = [\n\t\t{\n\t\t\ttitle: _x( 'Edit', 'Edit comment' ),\n\t\t\tonClick: onEdit,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Delete', 'Delete comment' ),\n\t\t\tonClick: onDelete,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Reply', 'Reply on a comment' ),\n\t\t\tonClick: onReply,\n\t\t},\n\t];\n\n\tconst moreActions = actions.filter( ( item ) => item.onClick );\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t<img\n\t\t\t\tsrc={ thread?.author_avatar_urls?.[ 48 ] }\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-avatar\"\n\t\t\t\t// translators: alt text for user avatar image\n\t\t\t\talt={ __( 'User avatar' ) }\n\t\t\t\twidth={ 32 }\n\t\t\t\theight={ 32 }\n\t\t\t/>\n\t\t\t<VStack spacing=\"0\">\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__user-name\">\n\t\t\t\t\t{ thread.author_name }\n\t\t\t\t</span>\n\t\t\t\t<time\n\t\t\t\t\tdateTime={ format( 'h:i A', thread.date ) }\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-time\"\n\t\t\t\t>\n\t\t\t\t\t{ dateI18n( dateTimeFormat, thread.date ) }\n\t\t\t\t</time>\n\t\t\t</VStack>\n\t\t\t<span className=\"editor-collab-sidebar-panel__comment-status\">\n\t\t\t\t{ status !== 'approved' && (\n\t\t\t\t\t<HStack alignment=\"right\" justify=\"flex-end\" spacing=\"0\">\n\t\t\t\t\t\t{ 0 === thread.parent && onResolve && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Resolve',\n\t\t\t\t\t\t\t\t\t'Mark comment as resolved'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ published }\n\t\t\t\t\t\t\t\tonClick={ onResolve }\n\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'Select an action',\n\t\t\t\t\t\t\t\t'Select comment action'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-dropdown-menu\"\n\t\t\t\t\t\t\tcontrols={ moreActions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t) }\n\t\t\t\t{ status === 'approved' && (\n\t\t\t\t\t// translators: tooltip for resolved comment\n\t\t\t\t\t<Tooltip text={ __( 'Resolved' ) }>\n\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</HStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA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__experimentalVStack","VStack","__experimentalConfirmDialog","ConfirmDialog","Button","DropdownMenu","Tooltip","Icon","check","published","moreVertical","__","_x","useSelect","store","blockEditorStore","CommentAuthorInfo","CommentForm","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","actionState","setActionState","isConfirmDialogOpen","setIsConfirmDialogOpen","handleConfirmDelete","id","handleConfirmResolve","handleCancelDelete","blockCommentId","select","_select$getBlock$attr","clientID","getSelectedBlockClientId","getBlock","attributes","CommentBoard","thread","parentThread","_parentThread$status","children","CommentHeader","onResolve","_parentThread$id","action","onEdit","onDelete","onReply","undefined","status","alignment","spacing","justify","className","onSubmit","value","onCancel","submitButtonText","content","raw","isOpen","onConfirm","confirmButtonText","cancelButtonText","Array","isArray","length","map","reply","inputComment","actions","title","onClick","moreActions","filter","item","avatar","author_avatar_urls","name","author_name","date","parent","label","__next40pxDefaultSize","icon","showTooltip","controls","text"],"sources":["@wordpress/editor/src/components/collab-sidebar/comments.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, RawHTML } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tButton,\n\tDropdownMenu,\n\tTooltip,\n} from '@wordpress/components';\nimport { Icon, check, published, moreVertical } from '@wordpress/icons';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\n\n/**\n * Renders the Comments component.\n *\n * @param {Object} props - The component props.\n * @param {Array} props.threads - The array of comment threads.\n * @param {Function} props.onEditComment - The function to handle comment editing.\n * @param {Function} props.onAddReply - The function to add a reply to a comment.\n * @param {Function} props.onCommentDelete - The function to delete a comment.\n * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.\n * @return {React.ReactNode} The rendered Comments component.\n */\nexport function Comments( {\n\tthreads,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n} ) {\n\tconst [ actionState, setActionState ] = useState( false );\n\tconst [ isConfirmDialogOpen, setIsConfirmDialogOpen ] = useState( false );\n\n\tconst handleConfirmDelete = () => {\n\t\tonCommentDelete( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleConfirmResolve = () => {\n\t\tonCommentResolve( actionState.id );\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst handleCancelDelete = () => {\n\t\tsetActionState( false );\n\t\tsetIsConfirmDialogOpen( false );\n\t};\n\n\tconst blockCommentId = useSelect( ( select ) => {\n\t\tconst clientID = select( blockEditorStore ).getSelectedBlockClientId();\n\t\treturn (\n\t\t\tselect( blockEditorStore ).getBlock( clientID )?.attributes\n\t\t\t\t?.blockCommentId ?? false\n\t\t);\n\t}, [] );\n\n\tconst CommentBoard = ( { thread, parentThread } ) => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<CommentHeader\n\t\t\t\t\tthread={ thread }\n\t\t\t\t\tonResolve={ () => {\n\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\taction: 'resolve',\n\t\t\t\t\t\t\tid: parentThread?.id ?? thread.id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonEdit={ () =>\n\t\t\t\t\t\tsetActionState( { action: 'edit', id: thread.id } )\n\t\t\t\t\t}\n\t\t\t\t\tonDelete={ () => {\n\t\t\t\t\t\tsetActionState( { action: 'delete', id: thread.id } );\n\t\t\t\t\t\tsetIsConfirmDialogOpen( true );\n\t\t\t\t\t} }\n\t\t\t\t\tonReply={\n\t\t\t\t\t\t! parentThread\n\t\t\t\t\t\t\t? () =>\n\t\t\t\t\t\t\t\t\tsetActionState( {\n\t\t\t\t\t\t\t\t\t\taction: 'reply',\n\t\t\t\t\t\t\t\t\t\tid: thread.id,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tstatus={ parentThread?.status ?? thread.status }\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"left\"\n\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t\t>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ 'edit' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t\t\t\t\t\tonEditComment( thread.id, value );\n\t\t\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tonCancel={ () => setActionState( false ) }\n\t\t\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\t\t\tsubmitButtonText={ _x( 'Update', 'verb' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ( ! actionState ||\n\t\t\t\t\t\t\t'edit' !== actionState?.action ) && (\n\t\t\t\t\t\t\t<RawHTML>{ thread?.content?.raw }</RawHTML>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t</HStack>\n\t\t\t\t{ 'resolve' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmResolve }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to mark this comment as resolved?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t\t{ 'delete' === actionState?.action &&\n\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\tisOpen={ isConfirmDialogOpen }\n\t\t\t\t\t\t\tonConfirm={ handleConfirmDelete }\n\t\t\t\t\t\t\tonCancel={ handleCancelDelete }\n\t\t\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to delete this comment?'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{\n\t\t\t\t// If there are no comments, show a message indicating no comments are available.\n\t\t\t\t( ! Array.isArray( threads ) || threads.length === 0 ) && (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__thread\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// translators: message displayed when there are no comments available\n\t\t\t\t\t\t\t__( 'No comments available' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VStack>\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t{ Array.isArray( threads ) &&\n\t\t\t\tthreads.length > 0 &&\n\t\t\t\tthreads.map( ( thread ) => (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tkey={ thread.id }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'editor-collab-sidebar-panel__thread',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__active-thread':\n\t\t\t\t\t\t\t\t\tblockCommentId &&\n\t\t\t\t\t\t\t\t\tblockCommentId === thread.id,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tid={ thread.id }\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CommentBoard thread={ thread } />\n\t\t\t\t\t\t{ 0 < thread?.reply?.length &&\n\t\t\t\t\t\t\tthread.reply.map( ( reply ) => (\n\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\tkey={ reply.id }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\t\tid={ reply.id }\n\t\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<CommentBoard\n\t\t\t\t\t\t\t\t\t\tthread={ reply }\n\t\t\t\t\t\t\t\t\t\tparentThread={ thread }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t{ 'reply' === actionState?.action &&\n\t\t\t\t\t\t\tthread.id === actionState?.id && (\n\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<CommentAuthorInfo />\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\t\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tonAddReply(\n\t\t\t\t\t\t\t\t\t\t\t\t\tinputComment,\n\t\t\t\t\t\t\t\t\t\t\t\t\tthread.id\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\tsetActionState( false );\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetActionState( false )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsubmitButtonText={ _x(\n\t\t\t\t\t\t\t\t\t\t\t\t'Reply',\n\t\t\t\t\t\t\t\t\t\t\t\t'Add reply comment'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</VStack>\n\t\t\t\t) ) }\n\t\t</>\n\t);\n}\n\n/**\n * Renders the header of a comment in the collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Object} props.thread - The comment thread object.\n * @param {Function} props.onResolve - The function to resolve the comment.\n * @param {Function} props.onEdit - The function to edit the comment.\n * @param {Function} props.onDelete - The function to delete the comment.\n * @param {Function} props.onReply - The function to reply to the comment.\n * @param {string} props.status - The status of the comment.\n * @return {React.ReactNode} The rendered comment header.\n */\nfunction CommentHeader( {\n\tthread,\n\tonResolve,\n\tonEdit,\n\tonDelete,\n\tonReply,\n\tstatus,\n} ) {\n\tconst actions = [\n\t\t{\n\t\t\ttitle: _x( 'Edit', 'Edit comment' ),\n\t\t\tonClick: onEdit,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Delete', 'Delete comment' ),\n\t\t\tonClick: onDelete,\n\t\t},\n\t\t{\n\t\t\ttitle: _x( 'Reply', 'Reply on a comment' ),\n\t\t\tonClick: onReply,\n\t\t},\n\t];\n\n\tconst moreActions = actions.filter( ( item ) => item.onClick );\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t<CommentAuthorInfo\n\t\t\t\tavatar={ thread?.author_avatar_urls?.[ 48 ] }\n\t\t\t\tname={ thread?.author_name }\n\t\t\t\tdate={ thread?.date }\n\t\t\t/>\n\t\t\t<span className=\"editor-collab-sidebar-panel__comment-status\">\n\t\t\t\t{ status !== 'approved' && (\n\t\t\t\t\t<HStack alignment=\"right\" justify=\"flex-end\" spacing=\"0\">\n\t\t\t\t\t\t{ 0 === thread?.parent && onResolve && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Resolve',\n\t\t\t\t\t\t\t\t\t'Mark comment as resolved'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ published }\n\t\t\t\t\t\t\t\tonClick={ onResolve }\n\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'Select an action',\n\t\t\t\t\t\t\t\t'Select comment action'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-dropdown-menu\"\n\t\t\t\t\t\t\tcontrols={ moreActions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t) }\n\t\t\t\t{ status === 'approved' && (\n\t\t\t\t\t// translators: tooltip for resolved comment\n\t\t\t\t\t<Tooltip text={ __( 'Resolved' ) }>\n\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</HStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,2BAA2B,IAAIC,aAAa,EAC5CC,MAAM,EACNC,YAAY,EACZC,OAAO,QACD,uBAAuB;AAC9B,SAASC,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,YAAY,QAAQ,kBAAkB;AACvE,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,WAAW,MAAM,gBAAgB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAWA,OAAO,SAASC,QAAQA,CAAE;E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[]}
@@ -14,7 +14,6 @@ import { serialize } from '@wordpress/blocks';
14
14
  /**
15
15
  * Internal dependencies
16
16
  */
17
- import { store as editorStore } from '../../store';
18
17
  import { TEMPLATE_PART_POST_TYPE, TEMPLATE_PART_AREA_DEFAULT_CATEGORY } from '../../store/constants';
19
18
  import { useExistingTemplateParts, getUniqueTemplatePartTitle, getCleanTemplatePartSlug } from './utils';
20
19
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -54,7 +53,7 @@ export function CreateTemplatePartModalContents({
54
53
  const [area, setArea] = useState(defaultArea);
55
54
  const [isSubmitting, setIsSubmitting] = useState(false);
56
55
  const instanceId = useInstanceId(CreateTemplatePartModal);
57
- const templatePartAreas = useSelect(select => select(editorStore).__experimentalGetDefaultTemplatePartAreas(), []);
56
+ const templatePartAreas = useSelect(select => select(coreStore).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || [], []);
58
57
  async function createTemplatePart() {
59
58
  if (!title || isSubmitting) {
60
59
  return;
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","Icon","BaseControl","TextControl","Flex","FlexItem","FlexBlock","Button","Modal","__experimentalRadioGroup","RadioGroup","__experimentalRadio","Radio","__experimentalHStack","HStack","__experimentalVStack","VStack","__","useState","useInstanceId","store","noticesStore","coreStore","check","serialize","editorStore","TEMPLATE_PART_POST_TYPE","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","useExistingTemplateParts","getUniqueTemplatePartTitle","getCleanTemplatePartSlug","jsx","_jsx","jsxs","_jsxs","CreateTemplatePartModal","modalTitle","restProps","defaultModalTitle","select","getPostType","labels","add_new_item","title","onRequestClose","closeModal","overlayClassName","focusOnMount","size","children","CreateTemplatePartModalContents","defaultArea","blocks","confirmLabel","onCreate","onError","defaultTitle","createErrorNotice","saveEntityRecord","existingTemplateParts","setTitle","area","setArea","isSubmitting","setIsSubmitting","instanceId","templatePartAreas","__experimentalGetDefaultTemplatePartAreas","createTemplatePart","uniqueTitle","cleanSlug","templatePart","slug","content","throwOnError","error","errorMessage","message","code","type","onSubmit","event","preventDefault","spacing","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","required","id","className","checked","map","icon","description","align","justify","variant","onClick","isBusy"],"sources":["@wordpress/editor/src/components/create-template-part-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tIcon,\n\tBaseControl,\n\tTextControl,\n\tFlex,\n\tFlexItem,\n\tFlexBlock,\n\tButton,\n\tModal,\n\t__experimentalRadioGroup as RadioGroup,\n\t__experimentalRadio as Radio,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../store/constants';\nimport {\n\tuseExistingTemplateParts,\n\tgetUniqueTemplatePartTitle,\n\tgetCleanTemplatePartSlug,\n} from './utils';\n\nexport default function CreateTemplatePartModal( {\n\tmodalTitle,\n\t...restProps\n} ) {\n\tconst defaultModalTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getPostType( TEMPLATE_PART_POST_TYPE )?.labels\n\t\t\t\t?.add_new_item,\n\t\t[]\n\t);\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ modalTitle || defaultModalTitle }\n\t\t\tonRequestClose={ restProps.closeModal }\n\t\t\toverlayClassName=\"editor-create-template-part-modal\"\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<CreateTemplatePartModalContents { ...restProps } />\n\t\t</Modal>\n\t);\n}\n\nexport function CreateTemplatePartModalContents( {\n\tdefaultArea = TEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\tblocks = [],\n\tconfirmLabel = __( 'Add' ),\n\tcloseModal,\n\tonCreate,\n\tonError,\n\tdefaultTitle = '',\n} ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst existingTemplateParts = useExistingTemplateParts();\n\n\tconst [ title, setTitle ] = useState( defaultTitle );\n\tconst [ area, setArea ] = useState( defaultArea );\n\tconst [ isSubmitting, setIsSubmitting ] = useState( false );\n\tconst instanceId = useInstanceId( CreateTemplatePartModal );\n\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tasync function createTemplatePart() {\n\t\tif ( ! title || isSubmitting ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSubmitting( true );\n\t\t\tconst uniqueTitle = getUniqueTemplatePartTitle(\n\t\t\t\ttitle,\n\t\t\t\texistingTemplateParts\n\t\t\t);\n\t\t\tconst cleanSlug = getCleanTemplatePartSlug( uniqueTitle );\n\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tslug: cleanSlug,\n\t\t\t\t\ttitle: uniqueTitle,\n\t\t\t\t\tcontent: serialize( blocks ),\n\t\t\t\t\tarea,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t\tawait onCreate( templatePart );\n\n\t\t\t// TODO: Add a success notice?\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'An error occurred while creating the template part.'\n\t\t\t\t\t );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\n\t\t\tonError?.();\n\t\t} finally {\n\t\t\tsetIsSubmitting( false );\n\t\t}\n\t}\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tawait createTemplatePart();\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"4\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t\t<BaseControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-base-control\"\n\t\t\t\t>\n\t\t\t\t\t<RadioGroup\n\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-radio-group\"\n\t\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\t\tonChange={ setArea }\n\t\t\t\t\t\tchecked={ area }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ templatePartAreas.map(\n\t\t\t\t\t\t\t( { icon, label, area: value, description } ) => (\n\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-radio\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Flex align=\"start\" justify=\"start\">\n\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t<FlexBlock className=\"editor-create-template-part-modal__option-label\">\n\t\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t\t\t<div>{ description }</div>\n\t\t\t\t\t\t\t\t\t\t</FlexBlock>\n\n\t\t\t\t\t\t\t\t\t\t<FlexItem className=\"editor-create-template-part-modal__checkbox\">\n\t\t\t\t\t\t\t\t\t\t\t{ area === value && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t\t\t</Radio>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RadioGroup>\n\t\t\t\t</BaseControl>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tcloseModal();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSubmitting }\n\t\t\t\t\t\tisBusy={ isSubmitting }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ confirmLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,IAAI,EACJC,WAAW,EACX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E,qBAAqB;UACrBc,OAAO,EAAC,SAAS;UACjBnB,IAAI,EAAC,QAAQ;UACb,iBAAgB,CAAEpC,KAAK,IAAIoB,YAAc;UACzCqC,MAAM,EAAGrC,YAAc;UAAAd,QAAA,EAErBI;QAAY,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useDispatch","Icon","BaseControl","TextControl","Flex","FlexItem","FlexBlock","Button","Modal","__experimentalRadioGroup","RadioGroup","__experimentalRadio","Radio","__experimentalHStack","HStack","__experimentalVStack","VStack","__","useState","useInstanceId","store","noticesStore","coreStore","check","serialize","TEMPLATE_PART_POST_TYPE","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","useExistingTemplateParts","getUniqueTemplatePartTitle","getCleanTemplatePartSlug","jsx","_jsx","jsxs","_jsxs","CreateTemplatePartModal","modalTitle","restProps","defaultModalTitle","select","getPostType","labels","add_new_item","title","onRequestClose","closeModal","overlayClassName","focusOnMount","size","children","CreateTemplatePartModalContents","defaultArea","blocks","confirmLabel","onCreate","onError","defaultTitle","createErrorNotice","saveEntityRecord","existingTemplateParts","setTitle","area","setArea","isSubmitting","setIsSubmitting","instanceId","templatePartAreas","getEntityRecord","default_template_part_areas","createTemplatePart","uniqueTitle","cleanSlug","templatePart","slug","content","throwOnError","error","errorMessage","message","code","type","onSubmit","event","preventDefault","spacing","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","required","id","className","checked","map","icon","description","align","justify","variant","onClick","isBusy"],"sources":["@wordpress/editor/src/components/create-template-part-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tIcon,\n\tBaseControl,\n\tTextControl,\n\tFlex,\n\tFlexItem,\n\tFlexBlock,\n\tButton,\n\tModal,\n\t__experimentalRadioGroup as RadioGroup,\n\t__experimentalRadio as Radio,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../store/constants';\nimport {\n\tuseExistingTemplateParts,\n\tgetUniqueTemplatePartTitle,\n\tgetCleanTemplatePartSlug,\n} from './utils';\n\nexport default function CreateTemplatePartModal( {\n\tmodalTitle,\n\t...restProps\n} ) {\n\tconst defaultModalTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getPostType( TEMPLATE_PART_POST_TYPE )?.labels\n\t\t\t\t?.add_new_item,\n\t\t[]\n\t);\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ modalTitle || defaultModalTitle }\n\t\t\tonRequestClose={ restProps.closeModal }\n\t\t\toverlayClassName=\"editor-create-template-part-modal\"\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t<CreateTemplatePartModalContents { ...restProps } />\n\t\t</Modal>\n\t);\n}\n\nexport function CreateTemplatePartModalContents( {\n\tdefaultArea = TEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\tblocks = [],\n\tconfirmLabel = __( 'Add' ),\n\tcloseModal,\n\tonCreate,\n\tonError,\n\tdefaultTitle = '',\n} ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst existingTemplateParts = useExistingTemplateParts();\n\n\tconst [ title, setTitle ] = useState( defaultTitle );\n\tconst [ area, setArea ] = useState( defaultArea );\n\tconst [ isSubmitting, setIsSubmitting ] = useState( false );\n\tconst instanceId = useInstanceId( CreateTemplatePartModal );\n\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t\t?.default_template_part_areas || [],\n\t\t[]\n\t);\n\n\tasync function createTemplatePart() {\n\t\tif ( ! title || isSubmitting ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSubmitting( true );\n\t\t\tconst uniqueTitle = getUniqueTemplatePartTitle(\n\t\t\t\ttitle,\n\t\t\t\texistingTemplateParts\n\t\t\t);\n\t\t\tconst cleanSlug = getCleanTemplatePartSlug( uniqueTitle );\n\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tslug: cleanSlug,\n\t\t\t\t\ttitle: uniqueTitle,\n\t\t\t\t\tcontent: serialize( blocks ),\n\t\t\t\t\tarea,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t\tawait onCreate( templatePart );\n\n\t\t\t// TODO: Add a success notice?\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'An error occurred while creating the template part.'\n\t\t\t\t\t );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\n\t\t\tonError?.();\n\t\t} finally {\n\t\t\tsetIsSubmitting( false );\n\t\t}\n\t}\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tawait createTemplatePart();\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"4\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t\t<BaseControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-base-control\"\n\t\t\t\t>\n\t\t\t\t\t<RadioGroup\n\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-radio-group\"\n\t\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\t\tonChange={ setArea }\n\t\t\t\t\t\tchecked={ area }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ templatePartAreas.map(\n\t\t\t\t\t\t\t( { icon, label, area: value, description } ) => (\n\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-create-template-part-modal__area-radio\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Flex align=\"start\" justify=\"start\">\n\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t<FlexBlock className=\"editor-create-template-part-modal__option-label\">\n\t\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t\t\t<div>{ description }</div>\n\t\t\t\t\t\t\t\t\t\t</FlexBlock>\n\n\t\t\t\t\t\t\t\t\t\t<FlexItem className=\"editor-create-template-part-modal__checkbox\">\n\t\t\t\t\t\t\t\t\t\t\t{ area === value && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t\t\t</Radio>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RadioGroup>\n\t\t\t\t</BaseControl>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tcloseModal();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSubmitting }\n\t\t\t\t\t\tisBusy={ isSubmitting }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ confirmLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,IAAI,EACJC,WAAW,EACXC,WAAW,EACXC,IAAI,EACJC,QAAQ,EACRC,SAAS,EACTC,MAAM,EACNC,KAAK,EACLC,wBAAwB,IAAIC,UAAU,EACtCC,mBAAmB,IAAIC,KAAK,EAC5BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,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,IAAA,CAAC1B,QAAQ;gBAAA2C,QAAA,eACRjB,IAAA,CAAC9B,IAAI;kBAAC6F,IAAI,EAAGA;gBAAM,CAAE;cAAC,CACb,CAAC,eACX7D,KAAA,CAAC3B,SAAS;gBAACqF,SAAS,EAAC,iDAAiD;gBAAA3C,QAAA,GACnEsC,KAAK,eACPvD,IAAA;kBAAAiB,QAAA,EAAO+C;gBAAW,CAAO,CAAC;cAAA,CAChB,CAAC,eAEZhE,IAAA,CAAC1B,QAAQ;gBAACsF,SAAS,EAAC,6CAA6C;gBAAA3C,QAAA,EAC9DY,IAAI,KAAK2B,KAAK,iBACfxD,IAAA,CAAC9B,IAAI;kBAAC6F,IAAI,EAAGvE;gBAAO,CAAE;cACtB,CACQ,CAAC;YAAA,CACN;UAAC,GAlBD+D,KAmBA,CAET;QAAC,CACU;MAAC,CACD,CAAC,eACdrD,KAAA,CAACnB,MAAM;QAACmF,OAAO,EAAC,OAAO;QAAAjD,QAAA,gBACtBjB,IAAA,CAACxB,MAAM;UACN6E,qBAAqB;UACrBc,OAAO,EAAC,UAAU;UAClBC,OAAO,EAAGA,CAAA,KAAM;YACfvD,UAAU,CAAC,CAAC;UACb,CAAG;UAAAI,QAAA,EAED/B,EAAE,CAAE,QAAS;QAAC,CACT,CAAC,eACTc,IAAA,CAACxB,MAAM;UACN6E,qBAAqB;UACrBc,OAAO,EAAC,SAAS;UACjBnB,IAAI,EAAC,QAAQ;UACb,iBAAgB,CAAErC,KAAK,IAAIoB,YAAc;UACzCsC,MAAM,EAAGtC,YAAc;UAAAd,QAAA,EAErBI;QAAY,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
@@ -24,6 +24,7 @@ import { decodeEntities } from '@wordpress/html-entities';
24
24
  import { TEMPLATE_POST_TYPES } from '../../store/constants';
25
25
  import { store as editorStore } from '../../store';
26
26
  import usePageTypeBadge from '../../utils/pageTypeBadge';
27
+ import { getTemplateInfo } from '../../utils/get-template-info';
27
28
 
28
29
  /** @typedef {import("@wordpress/components").IconType} IconType */
29
30
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -44,7 +45,7 @@ const MotionButton = motion(Button);
44
45
  * @param {IconType} props.icon An icon for the document, no default.
45
46
  * (A default icon indicating the document post type is no longer used.)
46
47
  *
47
- * @return {JSX.Element} The rendered DocumentBar component.
48
+ * @return {React.ReactNode} The rendered DocumentBar component.
48
49
  */
49
50
  export default function DocumentBar(props) {
50
51
  const {
@@ -56,11 +57,11 @@ export default function DocumentBar(props) {
56
57
  onNavigateToPreviousEntityRecord,
57
58
  isTemplatePreview
58
59
  } = useSelect(select => {
60
+ var _select$getEntityReco;
59
61
  const {
60
62
  getCurrentPostType,
61
63
  getCurrentPostId,
62
64
  getEditorSettings,
63
- __experimentalGetTemplateInfo: getTemplateInfo,
64
65
  getRenderingMode
65
66
  } = select(editorStore);
66
67
  const {
@@ -71,7 +72,13 @@ export default function DocumentBar(props) {
71
72
  const _postType = getCurrentPostType();
72
73
  const _postId = getCurrentPostId();
73
74
  const _document = getEditedEntityRecord('postType', _postType, _postId);
74
- const _templateInfo = getTemplateInfo(_document);
75
+ const {
76
+ default_template_types: templateTypes = []
77
+ } = (_select$getEntityReco = select(coreStore).getEntityRecord('root', '__unstableBase')) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : {};
78
+ const _templateInfo = getTemplateInfo({
79
+ templateTypes,
80
+ template: _document
81
+ });
75
82
  const _postTypeLabel = getPostType(_postType)?.labels?.singular_name;
76
83
  return {
77
84
  postType: _postType,
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__","isRTL","useSelect","useDispatch","Button","__experimentalText","Text","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","BlockIcon","chevronLeftSmall","chevronRightSmall","layout","displayShortcut","store","coreStore","commandsStore","useRef","useEffect","useReducedMotion","decodeEntities","TEMPLATE_POST_TYPES","editorStore","usePageTypeBadge","jsx","_jsx","jsxs","_jsxs","MotionButton","DocumentBar","props","postType","postTypeLabel","documentTitle","isNotFound","templateTitle","onNavigateToPreviousEntityRecord","isTemplatePreview","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","getRenderingMode","getEditedEntityRecord","getPostType","isResolving","isResolvingSelector","_postType","_postId","_document","_templateInfo","_postTypeLabel","labels","singular_name","title","open","openCommandCenter","isReducedMotion","isTemplate","includes","hasBackButton","entityTitle","icon","pageTypeBadge","mountedRef","current","className","children","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","div","as","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall, layout } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\n\n/** @typedef {import(\"@wordpress/components\").IconType} IconType */\n\nconst MotionButton = motion( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n * @param {Object} props The component props.\n * @param {string} props.title A title for the document, defaulting to the document or\n * template title currently being edited.\n * @param {IconType} props.icon An icon for the document, no default.\n * (A default icon indicating the document post type is no longer used.)\n *\n * @return {JSX.Element} The rendered DocumentBar component.\n */\nexport default function DocumentBar( props ) {\n\tconst {\n\t\tpostType,\n\t\tpostTypeLabel,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t\tisTemplatePreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t\tgetRenderingMode,\n\t\t} = select( editorStore );\n\t\tconst {\n\t\t\tgetEditedEntityRecord,\n\t\t\tgetPostType,\n\t\t\tisResolving: isResolvingSelector,\n\t\t} = select( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\t\tconst _templateInfo = getTemplateInfo( _document );\n\t\tconst _postTypeLabel = getPostType( _postType )?.labels?.singular_name;\n\n\t\treturn {\n\t\t\tpostType: _postType,\n\t\t\tpostTypeLabel: _postTypeLabel,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisTemplatePreview: getRenderingMode() === 'template-locked',\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst entityTitle = isTemplate ? templateTitle : documentTitle;\n\tconst title = props.title || entityTitle;\n\tconst icon = props.icon;\n\n\tconst pageTypeBadge = usePageTypeBadge();\n\n\tconst mountedRef = useRef( false );\n\tuseEffect( () => {\n\t\tmountedRef.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ ! isTemplate && isTemplatePreview && (\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ layout }\n\t\t\t\t\tclassName=\"editor-document-bar__icon-layout\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ icon && <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-title\">\n\t\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t\t? decodeEntities( title )\n\t\t\t\t\t\t\t\t\t: __( 'No title' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{ pageTypeBadge && (\n\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t{ `· ${ pageTypeBadge }` }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ postTypeLabel &&\n\t\t\t\t\t\t\t\t! props.title &&\n\t\t\t\t\t\t\t\t! pageTypeBadge && (\n\t\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t\t{ `· ${ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\tpostTypeLabel\n\t\t\t\t\t\t\t\t\t\t) }` }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,EAC1BC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,yBAAyB;AACnD,SAASC,gBAAgB,EAAEC,iBAAiB,EAAEC,MAAM,QAAQ,kBAAkB;AAC9E,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,mBAAm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AAZ,QAAA,GAECL,IAAI,iBAAIvC,IAAA,CAAChB,SAAS;UAACuD,IAAI,EAAGA;QAAM,CAAE,CAAC,eACrCrC,KAAA,CAACvB,IAAI;UAACqE,IAAI,EAAC,MAAM;UAACU,EAAE,EAAC,IAAI;UAAAd,QAAA,gBACxB5C,IAAA;YAAM2C,SAAS,EAAC,iCAAiC;YAAAC,QAAA,EAC9Cb,KAAK,GACJpC,cAAc,CAAEoC,KAAM,CAAC,GACvB1D,EAAE,CAAE,UAAW;UAAC,CACd,CAAC,EACLmE,aAAa,iBACdxC,IAAA;YAAM2C,SAAS,EAAC,sCAAsC;YAAAC,QAAA,EACnD,KAAMJ,aAAa;UAAG,CACnB,CACN,EACCjC,aAAa,IACd,CAAEF,KAAK,CAAC0B,KAAK,IACb,CAAES,aAAa,iBACdxC,IAAA;YAAM2C,SAAS,EAAC,sCAAsC;YAAAC,QAAA,EACnD,KAAMjD,cAAc,CACrBY,aACD,CAAC;UAAG,CACC,CACN;QAAA,CACG,CAAC;MAAA,GAxCD8B,aAyCK,CAAC,eACbrC,IAAA;QAAM2C,SAAS,EAAC,+BAA+B;QAAAC,QAAA,EAC5CxD,eAAe,CAACuE,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","isRTL","useSelect","useDispatch","Button","__experimentalText","Text","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","BlockIcon","chevronLeftSmall","chevronRightSmall","layout","displayShortcut","store","coreStore","commandsStore","useRef","useEffect","useReducedMotion","decodeEntities","TEMPLATE_POST_TYPES","editorStore","usePageTypeBadge","getTemplateInfo","jsx","_jsx","jsxs","_jsxs","MotionButton","DocumentBar","props","postType","postTypeLabel","documentTitle","isNotFound","templateTitle","onNavigateToPreviousEntityRecord","isTemplatePreview","select","_select$getEntityReco","getCurrentPostType","getCurrentPostId","getEditorSettings","getRenderingMode","getEditedEntityRecord","getPostType","isResolving","isResolvingSelector","_postType","_postId","_document","default_template_types","templateTypes","getEntityRecord","_templateInfo","template","_postTypeLabel","labels","singular_name","title","open","openCommandCenter","isReducedMotion","isTemplate","includes","hasBackButton","entityTitle","icon","pageTypeBadge","mountedRef","current","className","children","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","div","as","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall, layout } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\n\n/** @typedef {import(\"@wordpress/components\").IconType} IconType */\n\nconst MotionButton = motion( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n * @param {Object} props The component props.\n * @param {string} props.title A title for the document, defaulting to the document or\n * template title currently being edited.\n * @param {IconType} props.icon An icon for the document, no default.\n * (A default icon indicating the document post type is no longer used.)\n *\n * @return {React.ReactNode} The rendered DocumentBar component.\n */\nexport default function DocumentBar( props ) {\n\tconst {\n\t\tpostType,\n\t\tpostTypeLabel,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t\tisTemplatePreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t} = select( editorStore );\n\n\t\tconst {\n\t\t\tgetEditedEntityRecord,\n\t\t\tgetPostType,\n\t\t\tisResolving: isResolvingSelector,\n\t\t} = select( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\n\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\tselect( coreStore ).getEntityRecord( 'root', '__unstableBase' ) ??\n\t\t\t{};\n\n\t\tconst _templateInfo = getTemplateInfo( {\n\t\t\ttemplateTypes,\n\t\t\ttemplate: _document,\n\t\t} );\n\t\tconst _postTypeLabel = getPostType( _postType )?.labels?.singular_name;\n\n\t\treturn {\n\t\t\tpostType: _postType,\n\t\t\tpostTypeLabel: _postTypeLabel,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisTemplatePreview: getRenderingMode() === 'template-locked',\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst entityTitle = isTemplate ? templateTitle : documentTitle;\n\tconst title = props.title || entityTitle;\n\tconst icon = props.icon;\n\n\tconst pageTypeBadge = usePageTypeBadge();\n\n\tconst mountedRef = useRef( false );\n\tuseEffect( () => {\n\t\tmountedRef.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ ! isTemplate && isTemplatePreview && (\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ layout }\n\t\t\t\t\tclassName=\"editor-document-bar__icon-layout\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ icon && <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-title\">\n\t\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t\t? decodeEntities( title )\n\t\t\t\t\t\t\t\t\t: __( 'No title' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{ pageTypeBadge && (\n\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t{ `· ${ pageTypeBadge }` }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ postTypeLabel &&\n\t\t\t\t\t\t\t\t! props.title &&\n\t\t\t\t\t\t\t\t! pageTypeBadge && (\n\t\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t\t{ `· ${ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\tpostTypeLabel\n\t\t\t\t\t\t\t\t\t\t) }` }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,EAC1BC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,yBAAyB;AACnD,SAASC,gBAAgB,EAAEC,iBAAiB,EAAEC,MAAM,QAAQ,kBAAkB;AAC9E,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,u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f;UACAQ,OAAO,EAAE,CAAC;UACVC,SAAS,EAAEd,aAAa,GACrB,iBAAiB,GACjB;QACH,CAAC,GACD,KAAK,CAAC;QACT;QACDe,OAAO,EAAG;UACTF,OAAO,EAAE,CAAC;UACVC,SAAS,EAAE;QACZ,CAAG;QACHG,UAAU,EACTpB,eAAe,GAAG;UAAEqB,QAAQ,EAAE;QAAE,CAAC,GAAGC,SACpC;QAAAZ,QAAA,GAECL,IAAI,iBAAI1C,IAAA,CAACjB,SAAS;UAAC2D,IAAI,EAAGA;QAAM,CAAE,CAAC,eACrCxC,KAAA,CAACxB,IAAI;UAACyE,IAAI,EAAC,MAAM;UAACU,EAAE,EAAC,IAAI;UAAAd,QAAA,gBACxB/C,IAAA;YAAM8C,SAAS,EAAC,iCAAiC;YAAAC,QAAA,EAC9Cb,KAAK,GACJxC,cAAc,CAAEwC,KAAM,CAAC,GACvB9D,EAAE,CAAE,UAAW;UAAC,CACd,CAAC,EACLuE,aAAa,iBACd3C,IAAA;YAAM8C,SAAS,EAAC,sCAAsC;YAAAC,QAAA,EACnD,KAAMJ,aAAa;UAAG,CACnB,CACN,EACCpC,aAAa,IACd,CAAEF,KAAK,CAAC6B,KAAK,IACb,CAAES,aAAa,iBACd3C,IAAA;YAAM8C,SAAS,EAAC,sCAAsC;YAAAC,QAAA,EACnD,KAAMrD,cAAc,CACrBa,aACD,CAAC;UAAG,CACC,CACN;QAAA,CACG,CAAC;MAAA,GAxCDiC,aAyCK,CAAC,eACbxC,IAAA;QAAM8C,SAAS,EAAC,+BAA+B;QAAAC,QAAA,EAC5C5D,eAAe,CAAC2E,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
@@ -7,10 +7,10 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
7
7
  /**
8
8
  * Component check if there are any headings (core/heading blocks) present in the document.
9
9
  *
10
- * @param {Object} props Props.
11
- * @param {Element} props.children Children to be rendered.
10
+ * @param {Object} props Props.
11
+ * @param {React.ReactElement} props.children Children to be rendered.
12
12
  *
13
- * @return {Component|null} The component to be rendered or null if there are headings.
13
+ * @return {React.ReactElement} The component to be rendered or null if there are headings.
14
14
  */
15
15
  export default function DocumentOutlineCheck({
16
16
  children
@@ -21,7 +21,7 @@ export default function DocumentOutlineCheck({
21
21
  } = select(blockEditorStore);
22
22
  return getGlobalBlockCount('core/heading') > 0;
23
23
  });
24
- if (hasHeadings) {
24
+ if (!hasHeadings) {
25
25
  return null;
26
26
  }
27
27
  return children;
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","blockEditorStore","DocumentOutlineCheck","children","hasHeadings","select","getGlobalBlockCount"],"sources":["@wordpress/editor/src/components/document-outline/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Component check if there are any headings (core/heading blocks) present in the document.\n *\n * @param {Object} props Props.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {Component|null} The component to be rendered or null if there are headings.\n */\nexport default function DocumentOutlineCheck( { children } ) {\n\tconst hasHeadings = useSelect( ( select ) => {\n\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\n\t\treturn getGlobalBlockCount( 'core/heading' ) > 0;\n\t} );\n\n\tif ( hasHeadings ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,WAAW,GAAGL,SAAS,CAAIM,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEJ,gBAAiB,CAAC;IAE1D,OAAOK,mBAAmB,CAAE,cAAe,CAAC,GAAG,CAAC;EACjD,CAAE,CAAC;EAEH,IAAKF,WAAW,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","blockEditorStore","DocumentOutlineCheck","children","hasHeadings","select","getGlobalBlockCount"],"sources":["@wordpress/editor/src/components/document-outline/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Component check if there are any headings (core/heading blocks) present in the document.\n *\n * @param {Object} props Props.\n * @param {React.ReactElement} props.children Children to be rendered.\n *\n * @return {React.ReactElement} The component to be rendered or null if there are headings.\n */\nexport default function DocumentOutlineCheck( { children } ) {\n\tconst hasHeadings = useSelect( ( select ) => {\n\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\n\t\treturn getGlobalBlockCount( 'core/heading' ) > 0;\n\t} );\n\n\tif ( ! hasHeadings ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,WAAW,GAAGL,SAAS,CAAIM,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEJ,gBAAiB,CAAC;IAE1D,OAAOK,mBAAmB,CAAE,cAAe,CAAC,GAAG,CAAC;EACjD,CAAE,CAAC;EAEH,IAAK,CAAEF,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { useDispatch, useSelect } from '@wordpress/data';
6
+ import { useRef } from '@wordpress/element';
6
7
  import { create, getTextContent } from '@wordpress/rich-text';
7
8
  import { store as blockEditorStore } from '@wordpress/block-editor';
8
9
  import { store as coreStore } from '@wordpress/core-data';
@@ -137,15 +138,13 @@ const isEmptyHeading = heading => !heading.attributes.content || heading.attribu
137
138
  * Renders a document outline component.
138
139
  *
139
140
  * @param {Object} props Props.
140
- * @param {Function} props.onSelect Function to be called when an outline item is selected.
141
- * @param {boolean} props.isTitleSupported Indicates whether the title is supported.
141
+ * @param {Function} props.onSelect Function to be called when an outline item is selected
142
142
  * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.
143
143
  *
144
- * @return {Component} The component to be rendered.
144
+ * @return {React.ReactNode} The rendered component.
145
145
  */
146
146
  export default function DocumentOutline({
147
147
  onSelect,
148
- isTitleSupported,
149
148
  hasOutlineItemsDisabled
150
149
  }) {
151
150
  const {
@@ -153,7 +152,8 @@ export default function DocumentOutline({
153
152
  } = useDispatch(blockEditorStore);
154
153
  const {
155
154
  blocks,
156
- title
155
+ title,
156
+ isTitleSupported
157
157
  } = useSelect(select => {
158
158
  var _postType$supports$ti;
159
159
  const {
@@ -172,6 +172,7 @@ export default function DocumentOutline({
172
172
  isTitleSupported: (_postType$supports$ti = postType?.supports?.title) !== null && _postType$supports$ti !== void 0 ? _postType$supports$ti : false
173
173
  };
174
174
  });
175
+ const prevHeadingLevelRef = useRef(1);
175
176
  const headings = computeOutlineHeadings(blocks);
176
177
  if (headings.length < 1) {
177
178
  return /*#__PURE__*/_jsxs("div", {
@@ -181,7 +182,6 @@ export default function DocumentOutline({
181
182
  })]
182
183
  });
183
184
  }
184
- let prevHeadingLevel = 1;
185
185
 
186
186
  // Not great but it's the simplest way to locate the title right now.
187
187
  const titleNode = document.querySelector('.editor-post-title__input');
@@ -204,9 +204,9 @@ export default function DocumentOutline({
204
204
  }), headings.map((item, index) => {
205
205
  // Headings remain the same, go up by one, or down by any amount.
206
206
  // Otherwise there are missing levels.
207
- const isIncorrectLevel = item.level > prevHeadingLevel + 1;
207
+ const isIncorrectLevel = item.level > prevHeadingLevelRef.current + 1;
208
208
  const isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle);
209
- prevHeadingLevel = item.level;
209
+ prevHeadingLevelRef.current = item.level;
210
210
  return /*#__PURE__*/_jsxs(DocumentOutlineItem, {
211
211
  level: `H${item.level}`,
212
212
  isValid: isValid,
@@ -1 +1 @@
1
- {"version":3,"names":["__","useDispatch","useSelect","create","getTextContent","store","blockEditorStore","coreStore","Path","SVG","Line","Rect","DocumentOutlineItem","editorStore","jsx","_jsx","jsxs","_jsxs","emptyHeadingContent","children","incorrectLevelContent","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","width","height","viewBox","fill","xmlns","rx","x1","y1","x2","y2","stroke","x","y","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","title","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","getPostType","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\n/**\n * Renders a document outline component.\n *\n * @param {Object} props Props.\n * @param {Function} props.onSelect Function to be called when an outline item is selected.\n * @param {boolean} props.isTitleSupported Indicates whether the title is supported.\n * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function DocumentOutline( {\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\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{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ,sBAAsB;AAC7D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;;AAE7D;AACA;AACA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mBAAmB,GACnBd,cAAc,CACdD,MAAM,CAAE;YACPkF,IAAI,EAAEJ,IAAI,CAACrC,UAAU,CAACK;UACvB,CAAE,CACF,CAAC,EACFkC,gBAAgB,IAAI/D,qBAAqB,EACzC6D,IAAI,CAACtC,KAAK,KAAK,CAAC,IACjBgC,aAAa,IACbrD,kBAAkB,EACjBiD,QAAQ,IACTU,IAAI,CAACtC,KAAK,KAAK,CAAC,IAChB,CAAEgC,aAAa,IACftD,gBAAgB;QAAA,GAxBX6D,KAyBc,CAAC;MAExB,CAAE,CAAC;IAAA,CACA;EAAC,CACD,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["__","useDispatch","useSelect","useRef","create","getTextContent","store","blockEditorStore","coreStore","Path","SVG","Line","Rect","DocumentOutlineItem","editorStore","jsx","_jsx","jsxs","_jsxs","emptyHeadingContent","children","incorrectLevelContent","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","width","height","viewBox","fill","xmlns","rx","x1","y1","x2","y2","stroke","x","y","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","hasOutlineItemsDisabled","selectBlock","title","isTitleSupported","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","getPostType","postType","supports","prevHeadingLevelRef","headings","className","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","current","clientId","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\n/**\n * Renders a document outline component.\n *\n * @param {Object} props Props.\n * @param {Function} props.onSelect Function to be called when an outline item is selected\n * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport default function DocumentOutline( {\n\tonSelect,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title, isTitleSupported } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst prevHeadingLevelRef = useRef( 1 );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel =\n\t\t\t\t\t\titem.level > prevHeadingLevelRef.current + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevelRef.current = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\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{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,SAASC,MAAM,EAAEC,cAAc,QAAQ,sBAAsB;AAC7D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,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ACpChC,QAAQ,EAAGA,CAAA,KAAM;YAChBE,WAAW,CAAE0B,IAAI,CAACI,QAAS,CAAC;YAC5BhC,QAAQ,GAAG,CAAC;UACb,CAAG;UAAAlC,QAAA,GAED8D,IAAI,CAACpC,OAAO,GACX3B,mBAAmB,GACnBd,cAAc,CACdD,MAAM,CAAE;YACPmF,IAAI,EAAEL,IAAI,CAACrC,UAAU,CAACK;UACvB,CAAE,CACF,CAAC,EACFkC,gBAAgB,IAAI/D,qBAAqB,EACzC6D,IAAI,CAACtC,KAAK,KAAK,CAAC,IACjBgC,aAAa,IACbrD,kBAAkB,EACjBiD,QAAQ,IACTU,IAAI,CAACtC,KAAK,KAAK,CAAC,IAChB,CAAEgC,aAAa,IACftD,gBAAgB;QAAA,GAxBX6D,KAyBc,CAAC;MAExB,CAAE,CAAC;IAAA,CACA;EAAC,CACD,CAAC;AAER","ignoreList":[]}
@@ -65,7 +65,7 @@ function DocumentTools({
65
65
  showIconLabels: get('core', 'showIconLabels'),
66
66
  isDistractionFree: get('core', 'distractionFree'),
67
67
  isVisualMode: getEditorMode() === 'visual',
68
- showTools: getRenderingMode() !== 'post-only' || getCurrentPostType() === 'wp_template'
68
+ showTools: !!window?.__experimentalEditorWriteMode && (getRenderingMode() !== 'post-only' || getCurrentPostType() === 'wp_template')
69
69
  };
70
70
  }, []);
71
71
  const preventDefault = event => {
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","Button","ToolbarItem","listView","plus","useCallback","store","keyboardShortcutsStore","preferencesStore","unlock","editorStore","EditorHistoryRedo","EditorHistoryUndo","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","showTools","select","get","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","getRenderingMode","getCurrentPostType","getShortcutRepresentation","isVisualMode","preventDefault","event","isLargeViewport","isWideViewport","toolbarAriaLabel","toggleListView","toggleInserter","longLabel","shortLabel","variant","children","ref","as","isPressed","onMouseDown","onClick","disabled","icon","label","showTooltip","undefined","size","shortcut"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { NavigableToolbar, ToolSelector } from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\tshowIconLabels,\n\t\tshowTools,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t\tgetRenderingMode,\n\t\t\tgetCurrentPostType,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tshowTools:\n\t\t\t\tgetRenderingMode() !== 'post-only' ||\n\t\t\t\tgetCurrentPostType() === 'wp_template',\n\t\t};\n\t}, [] );\n\n\tconst preventDefault = ( event ) => {\n\t\t// Because the inserter behaves like a dialog,\n\t\t// if the inserter is opened already then when we click on the toggle button\n\t\t// then the initial click event will close the inserter and then be propagated\n\t\t// to the inserter toggle and it will open it again.\n\t\t// To prevent this we need to stop the propagation of the event.\n\t\t// This won't be necessary when the inserter no longer behaves like a dialog.\n\n\t\tif ( isInserterOpened ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Block Inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ showTools && isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,S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/B,cAAgB;YAChCqB,OAAO,EAAGrB,cAAc,GAAG,UAAU,GAAGgC,SAAW;YACnDC,IAAI,EAAC;UAAS,CACd,CAAC,eACFjD,IAAA,CAACZ,WAAW;YACXoD,EAAE,EAAG3C,iBAAmB;YACxBkD,WAAW,EAAG,CAAE/B,cAAgB;YAChCqB,OAAO,EAAGrB,cAAc,GAAG,UAAU,GAAGgC,SAAW;YACnDC,IAAI,EAAC;UAAS,CACd,CAAC,EACA,CAAEvC,iBAAiB,iBACpBV,IAAA,CAACZ,WAAW;YACXoD,EAAE,EAAGrD,MAAQ;YACbmB,SAAS,EAAC,iDAAiD;YAC3DuC,IAAI,EAAGxD,QAAU;YACjBuD,QAAQ,EAAGrC,iBAAmB;YAC9BkC,SAAS,EAAG7B;YACZ;YACAkC,KAAK,EAAG/D,EAAE,CAAE,mBAAoB,CAAG;YACnC4D,OAAO,EAAGV,cAAgB;YAC1BiB,QAAQ,EAAGrC,gBAAkB;YAC7BkC,WAAW,EAAG,CAAE/B,cAAgB;YAChCqB,OAAO,EACNrB,cAAc,GAAG,UAAU,GAAGgC,SAC9B;YACD,iBAAgBpC,cAAgB;YAChC2B,GAAG,EAAGxB,iBAAmB;YACzBkC,IAAI,EAAC;UAAS,CACd,CACD;QAAA,CACA,CACF;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAEA,eAAe5C,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","Button","ToolbarItem","listView","plus","useCallback","store","keyboardShortcutsStore","preferencesStore","unlock","editorStore","EditorHistoryRedo","EditorHistoryUndo","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","showTools","select","get","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","getRenderingMode","getCurrentPostType","getShortcutRepresentation","isVisualMode","window","__experimentalEditorWriteMode","preventDefault","event","isLargeViewport","isWideViewport","toolbarAriaLabel","toggleListView","toggleInserter","longLabel","shortLabel","variant","children","ref","as","isPressed","onMouseDown","onClick","disabled","icon","label","showTooltip","undefined","size","shortcut"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { NavigableToolbar, ToolSelector } from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\tshowIconLabels,\n\t\tshowTools,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t\tgetRenderingMode,\n\t\t\tgetCurrentPostType,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tshowTools:\n\t\t\t\t!! window?.__experimentalEditorWriteMode &&\n\t\t\t\t( getRenderingMode() !== 'post-only' ||\n\t\t\t\t\tgetCurrentPostType() === 'wp_template' ),\n\t\t};\n\t}, [] );\n\n\tconst preventDefault = ( event ) => {\n\t\t// Because the inserter behaves like a dialog,\n\t\t// if the inserter is opened already then when we click on the toggle button\n\t\t// then the initial click event will close the inserter and then be propagated\n\t\t// to the inserter toggle and it will open it again.\n\t\t// To prevent this we need to stop the propagation of the event.\n\t\t// This won't be necessary when the inserter no longer behaves like a dialog.\n\n\t\tif ( isInserterOpened ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Block Inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ showTools && isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;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I,EAAC;UAAS,CACd,CACD,eACDnD,IAAA,CAACZ,WAAW;YACXsD,EAAE,EAAG5C,iBAAmB;YACxBmD,WAAW,EAAG,CAAEjC,cAAgB;YAChCuB,OAAO,EAAGvB,cAAc,GAAG,UAAU,GAAGkC,SAAW;YACnDC,IAAI,EAAC;UAAS,CACd,CAAC,eACFnD,IAAA,CAACZ,WAAW;YACXsD,EAAE,EAAG7C,iBAAmB;YACxBoD,WAAW,EAAG,CAAEjC,cAAgB;YAChCuB,OAAO,EAAGvB,cAAc,GAAG,UAAU,GAAGkC,SAAW;YACnDC,IAAI,EAAC;UAAS,CACd,CAAC,EACA,CAAEzC,iBAAiB,iBACpBV,IAAA,CAACZ,WAAW;YACXsD,EAAE,EAAGvD,MAAQ;YACbmB,SAAS,EAAC,iDAAiD;YAC3DyC,IAAI,EAAG1D,QAAU;YACjByD,QAAQ,EAAGvC,iBAAmB;YAC9BoC,SAAS,EAAG/B;YACZ;YACAoC,KAAK,EAAGjE,EAAE,CAAE,mBAAoB,CAAG;YACnC8D,OAAO,EAAGV,cAAgB;YAC1BiB,QAAQ,EAAGvC,gBAAkB;YAC7BoC,WAAW,EAAG,CAAEjC,cAAgB;YAChCuB,OAAO,EACNvB,cAAc,GAAG,UAAU,GAAGkC,SAC9B;YACD,iBAAgBtC,cAAgB;YAChC6B,GAAG,EAAG1B,iBAAmB;YACzBoC,IAAI,EAAC;UAAS,CACd,CACD;QAAA,CACA,CACF;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAEA,eAAe9C,aAAa","ignoreList":[]}
@@ -45,7 +45,7 @@ function EditorHistoryRedo(props, ref) {
45
45
  * @param {Object} props - Props.
46
46
  * @param {Ref} ref - Forwarded ref.
47
47
  *
48
- * @return {Component} The component to be rendered.
48
+ * @return {React.ReactNode} The rendered component.
49
49
  */
50
50
  export default forwardRef(EditorHistoryRedo);
51
51
  //# sourceMappingURL=redo.js.map