@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","_interopRequireDefault","require","_element","_components","_date","_icons","_i18n","_data","_coreData","_blockEditor","_utils","_jsxRuntime","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","actionState","setActionState","useState","isConfirmDialogOpen","setIsConfirmDialogOpen","handleConfirmDelete","id","handleConfirmResolve","handleCancelDelete","blockCommentId","useSelect","select","_select$getBlock$attr","clientID","blockEditorStore","getSelectedBlockClientId","getBlock","attributes","CommentBoard","thread","parentThread","_parentThread$status","jsxs","Fragment","children","jsx","CommentHeader","onResolve","_parentThread$id","action","onEdit","onDelete","onReply","undefined","status","__experimentalHStack","alignment","spacing","justify","className","__experimentalVStack","CommentForm","onSubmit","value","onCancel","RawHTML","content","raw","__experimentalConfirmDialog","isOpen","onConfirm","confirmButtonText","cancelButtonText","__","Array","isArray","length","map","clsx","inputComment","reply","_thread$content$raw","setInputComment","TextareaControl","__nextHasNoMarginBottom","onChange","Button","__next40pxDefaultSize","accessibleWhenDisabled","variant","onClick","disabled","sanitizeCommentString","_x","dateSettings","getDateSettings","dateTimeFormat","formats","time","useEntityProp","actions","title","moreActions","filter","item","src","author_avatar_urls","alt","width","height","author_name","dateTime","format","date","dateI18n","parent","label","icon","published","showTooltip","DropdownMenu","moreVertical","controls","Tooltip","text","Icon","check"],"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":";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AAC4E,MAAM,IAAIpE,SAAS,iBACjC,IAAAlC,WAAA,CAAAgC,GAAA,EAACxC,WAAA,CAAAiF,MAAM;UACN8B,KAAK,EAAG,IAAAvB,QAAE,EACT,SAAS,EACT,0BACD,CAAG;UACHN,qBAAqB;UACrB8B,IAAI,EAAGC,gBAAW;UAClB5B,OAAO,EAAG3C,SAAW;UACrBwE,WAAW;QAAA,CACX,CACD,eACD,IAAA1G,WAAA,CAAAgC,GAAA,EAACxC,WAAA,CAAAmH,YAAY;UACZH,IAAI,EAAGI,mBAAc;UACrBL,KAAK,EAAG,IAAAvB,QAAE,EACT,kBAAkB,EAClB,uBACD,CAAG;UACHlC,SAAS,EAAC,oDAAoD;UAC9D+D,QAAQ,EAAGpB;QAAa,CACxB,CAAC;MAAA,CACK,CACR,EACChD,MAAM,KAAK,UAAU;MAAA;MACtB;MACA,IAAAzC,WAAA,CAAAgC,GAAA,EAACxC,WAAA,CAAAsH,OAAO;QAACC,IAAI,EAAG,IAAAnD,QAAE,EAAE,UAAW,CAAG;QAAA7B,QAAA,eACjC,IAAA/B,WAAA,CAAAgC,GAAA,EAACtC,MAAA,CAAAsH,IAAI;UAACR,IAAI,EAAGS;QAAO,CAAE;MAAC,CACf,CACT;IAAA,CACI,CAAC;EAAA,CACA,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_icons","_i18n","_data","_blockEditor","_commentAuthorInfo","_commentForm","_jsxRuntime","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","actionState","setActionState","useState","isConfirmDialogOpen","setIsConfirmDialogOpen","handleConfirmDelete","id","handleConfirmResolve","handleCancelDelete","blockCommentId","useSelect","select","_select$getBlock$attr","clientID","blockEditorStore","getSelectedBlockClientId","getBlock","attributes","CommentBoard","thread","parentThread","_parentThread$status","jsxs","Fragment","children","jsx","CommentHeader","onResolve","_parentThread$id","action","onEdit","onDelete","onReply","undefined","status","__experimentalHStack","alignment","spacing","justify","className","__experimentalVStack","default","onSubmit","value","onCancel","submitButtonText","_x","RawHTML","content","raw","__experimentalConfirmDialog","isOpen","onConfirm","confirmButtonText","cancelButtonText","__","Array","isArray","length","map","clsx","reply","inputComment","actions","title","onClick","moreActions","filter","item","avatar","author_avatar_urls","name","author_name","date","parent","Button","label","__next40pxDefaultSize","icon","published","showTooltip","DropdownMenu","moreVertical","controls","Tooltip","text","Icon","check"],"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: toolt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D;UAC9D4C,QAAQ,EAAGjB;QAAa,CACxB,CAAC;MAAA,CACK,CACR,EACChC,MAAM,KAAK,UAAU;MAAA;MACtB;MACA,IAAAzC,WAAA,CAAAgC,GAAA,EAACvC,WAAA,CAAAkG,OAAO;QAACC,IAAI,EAAG,IAAA9B,QAAE,EAAE,UAAW,CAAG;QAAA/B,QAAA,eACjC,IAAA/B,WAAA,CAAAgC,GAAA,EAACtC,MAAA,CAAAmG,IAAI;UAACR,IAAI,EAAGS;QAAO,CAAE;MAAC,CACf,CACT;IAAA,CACI,CAAC;EAAA,CACA,CAAC;AAEX","ignoreList":[]}
@@ -14,7 +14,6 @@ var _notices = require("@wordpress/notices");
14
14
  var _coreData = require("@wordpress/core-data");
15
15
  var _icons = require("@wordpress/icons");
16
16
  var _blocks = require("@wordpress/blocks");
17
- var _store = require("../../store");
18
17
  var _constants = require("../../store/constants");
19
18
  var _utils = require("./utils");
20
19
  var _jsxRuntime = require("react/jsx-runtime");
@@ -62,7 +61,7 @@ function CreateTemplatePartModalContents({
62
61
  const [area, setArea] = (0, _element.useState)(defaultArea);
63
62
  const [isSubmitting, setIsSubmitting] = (0, _element.useState)(false);
64
63
  const instanceId = (0, _compose.useInstanceId)(CreateTemplatePartModal);
65
- const templatePartAreas = (0, _data.useSelect)(select => select(_store.store).__experimentalGetDefaultTemplatePartAreas(), []);
64
+ const templatePartAreas = (0, _data.useSelect)(select => select(_coreData.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || [], []);
66
65
  async function createTemplatePart() {
67
66
  if (!title || isSubmitting) {
68
67
  return;
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_element","_compose","_notices","_coreData","_icons","_blocks","_store","_constants","_utils","_jsxRuntime","CreateTemplatePartModal","modalTitle","restProps","defaultModalTitle","useSelect","select","coreStore","getPostType","TEMPLATE_PART_POST_TYPE","labels","add_new_item","jsx","Modal","title","onRequestClose","closeModal","overlayClassName","focusOnMount","size","children","CreateTemplatePartModalContents","defaultArea","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","blocks","confirmLabel","__","onCreate","onError","defaultTitle","createErrorNotice","useDispatch","noticesStore","saveEntityRecord","existingTemplateParts","useExistingTemplateParts","setTitle","useState","area","setArea","isSubmitting","setIsSubmitting","instanceId","useInstanceId","templatePartAreas","editorStore","__experimentalGetDefaultTemplatePartAreas","createTemplatePart","uniqueTitle","getUniqueTemplatePartTitle","cleanSlug","getCleanTemplatePartSlug","templatePart","slug","content","serialize","throwOnError","error","errorMessage","message","code","type","onSubmit","event","preventDefault","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","required","BaseControl","id","className","__experimentalRadioGroup","checked","map","icon","description","__experimentalRadio","Flex","align","justify","FlexItem","Icon","FlexBlock","check","__experimentalHStack","Button","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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAcA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAIA,IAAAW,MAAA,GAAAX,OAAA;AAIiB,IAAAY,WAAA,GAAAZ,OAAA;AAtCjB;AACA;AACA;;AAwBA;AACA;AACA;;AAYe,SAASa,uBAAuBA,CAAE;EAChDC,UAAU;EACV,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,eAAU,CAAC,CAACC,WAAW,CAAEC,kCAAwB,CAAC,EAAEC,MAAM,EAC/DC,YAAY,EAChB,EACD,CAAC;EACD,oBACC,IAAAX,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAwB,KAAK;IACLC,KAAK,EAAGZ,UAAU,IAAIE,iBAAmB;IACzCW,cAAc,EAAGZ,SAAS,CAACa,UAAY;IACvCC,gBAAgB,EAAC,mCAAmC;IACpDC,YAAY,EAAC,qBAAqB;IAClCC,IAAI,EAAC,QAAQ;IAAAC,QAAA,eA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A,CAAAkG,QAAQ;gBAACV,SAAS,EAAC,6CAA6C;gBAAAzD,QAAA,EAC9DkB,IAAI,KAAKkC,KAAK,iBACf,IAAAxE,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAmG,IAAI;kBAACP,IAAI,EAAGS;gBAAO,CAAE;cACtB,CACQ,CAAC;YAAA,CACN;UAAC,GAlBDnB,KAmBA,CAET;QAAC,CACU;MAAC,CACD,CAAC,eACd,IAAAvE,WAAA,CAAAiE,IAAA,EAAC5E,WAAA,CAAAsG,oBAAM;QAACL,OAAO,EAAC,OAAO;QAAAlE,QAAA,gBACtB,IAAApB,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAuG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,UAAU;UAClBC,OAAO,EAAGA,CAAA,KAAM;YACf9E,UAAU,CAAC,CAAC;UACb,CAAG;UAAAI,QAAA,EAED,IAAAM,QAAE,EAAE,QAAS;QAAC,CACT,CAAC,eACT,IAAA1B,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAuG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,SAAS;UACjBhC,IAAI,EAAC,QAAQ;UACb,iBAAgB,CAAE/C,KAAK,IAAI0B,YAAc;UACzCuD,MAAM,EAAGvD,YAAc;UAAApB,QAAA,EAErBK;QAAY,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_components","_i18n","_element","_compose","_notices","_coreData","_icons","_blocks","_constants","_utils","_jsxRuntime","CreateTemplatePartModal","modalTitle","restProps","defaultModalTitle","useSelect","select","coreStore","getPostType","TEMPLATE_PART_POST_TYPE","labels","add_new_item","jsx","Modal","title","onRequestClose","closeModal","overlayClassName","focusOnMount","size","children","CreateTemplatePartModalContents","defaultArea","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","blocks","confirmLabel","__","onCreate","onError","defaultTitle","createErrorNotice","useDispatch","noticesStore","saveEntityRecord","existingTemplateParts","useExistingTemplateParts","setTitle","useState","area","setArea","isSubmitting","setIsSubmitting","instanceId","useInstanceId","templatePartAreas","getEntityRecord","default_template_part_areas","createTemplatePart","uniqueTitle","getUniqueTemplatePartTitle","cleanSlug","getCleanTemplatePartSlug","templatePart","slug","content","serialize","throwOnError","error","errorMessage","message","code","type","onSubmit","event","preventDefault","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","required","BaseControl","id","className","__experimentalRadioGroup","checked","map","icon","description","__experimentalRadio","Flex","align","justify","FlexItem","Icon","FlexBlock","check","__experimentalHStack","Button","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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AKkC,KAAK,iBACf,IAAAxE,WAAA,CAAAY,GAAA,EAACtB,WAAA,CAAAkG,IAAI;kBAACP,IAAI,EAAGS;gBAAO,CAAE;cACtB,CACQ,CAAC;YAAA,CACN;UAAC,GAlBDnB,KAmBA,CAET;QAAC,CACU;MAAC,CACD,CAAC,eACd,IAAAvE,WAAA,CAAAiE,IAAA,EAAC3E,WAAA,CAAAqG,oBAAM;QAACL,OAAO,EAAC,OAAO;QAAAlE,QAAA,gBACtB,IAAApB,WAAA,CAAAY,GAAA,EAACtB,WAAA,CAAAsG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,UAAU;UAClBC,OAAO,EAAGA,CAAA,KAAM;YACf9E,UAAU,CAAC,CAAC;UACb,CAAG;UAAAI,QAAA,EAED,IAAAM,QAAE,EAAE,QAAS;QAAC,CACT,CAAC,eACT,IAAA1B,WAAA,CAAAY,GAAA,EAACtB,WAAA,CAAAsG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,SAAS;UACjBhC,IAAI,EAAC,QAAQ;UACb,iBAAgB,CAAE/C,KAAK,IAAI0B,YAAc;UACzCuD,MAAM,EAAGvD,YAAc;UAAApB,QAAA,EAErBK;QAAY,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
@@ -20,6 +20,7 @@ var _htmlEntities = require("@wordpress/html-entities");
20
20
  var _constants = require("../../store/constants");
21
21
  var _store = require("../../store");
22
22
  var _pageTypeBadge = _interopRequireDefault(require("../../utils/pageTypeBadge"));
23
+ var _getTemplateInfo = require("../../utils/get-template-info");
23
24
  var _jsxRuntime = require("react/jsx-runtime");
24
25
  /**
25
26
  * External dependencies
@@ -50,7 +51,7 @@ var _jsxRuntime = require("react/jsx-runtime");
50
51
  * @param {IconType} props.icon An icon for the document, no default.
51
52
  * (A default icon indicating the document post type is no longer used.)
52
53
  *
53
- * @return {JSX.Element} The rendered DocumentBar component.
54
+ * @return {React.ReactNode} The rendered DocumentBar component.
54
55
  */
55
56
  function DocumentBar(props) {
56
57
  const {
@@ -62,11 +63,11 @@ function DocumentBar(props) {
62
63
  onNavigateToPreviousEntityRecord,
63
64
  isTemplatePreview
64
65
  } = (0, _data.useSelect)(select => {
66
+ var _select$getEntityReco;
65
67
  const {
66
68
  getCurrentPostType,
67
69
  getCurrentPostId,
68
70
  getEditorSettings,
69
- __experimentalGetTemplateInfo: getTemplateInfo,
70
71
  getRenderingMode
71
72
  } = select(_store.store);
72
73
  const {
@@ -77,7 +78,13 @@ function DocumentBar(props) {
77
78
  const _postType = getCurrentPostType();
78
79
  const _postId = getCurrentPostId();
79
80
  const _document = getEditedEntityRecord('postType', _postType, _postId);
80
- const _templateInfo = getTemplateInfo(_document);
81
+ const {
82
+ default_template_types: templateTypes = []
83
+ } = (_select$getEntityReco = select(_coreData.store).getEntityRecord('root', '__unstableBase')) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : {};
84
+ const _templateInfo = (0, _getTemplateInfo.getTemplateInfo)({
85
+ templateTypes,
86
+ template: _document
87
+ });
81
88
  const _postTypeLabel = getPostType(_postType)?.labels?.singular_name;
82
89
  return {
83
90
  postType: _postType,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_htmlEntities","_constants","_store","_pageTypeBadge","_jsxRuntime","MotionButton","motion","Button","DocumentBar","props","postType","postTypeLabel","documentTitle","isNotFound","templateTitle","onNavigateToPreviousEntityRecord","isTemplatePreview","useSelect","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","getRenderingMode","editorStore","getEditedEntityRecord","getPostType","isResolving","isResolvingSelector","coreStore","_postType","_postId","_document","_templateInfo","_postTypeLabel","labels","singular_name","title","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isTemplate","TEMPLATE_POST_TYPES","includes","hasBackButton","entityTitle","icon","pageTypeBadge","usePageTypeBadge","mountedRef","useRef","useEffect","current","jsxs","className","clsx","children","jsx","__unstableAnimatePresence","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__","BlockIcon","layout","__experimentalText","__unstableMotion","div","as","decodeEntities","displayShortcut","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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAKA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,cAAA,GAAAf,sBAAA,CAAAC,OAAA;AAAyD,IAAAe,WAAA,GAAAf,OAAA;AA9BzD;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAKA,mEAEA,MAAMgB,YAAY,GAAG,IAAAC,4BAAM,EAAEC,kBAAO,CAAC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,WAAWA,CAAEC,KAAK,EAAG;EAC5C,MAAM;IACLC,QAAQ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AE,CAAC,eACrC,IAAA9C,WAAA,CAAAqD,IAAA,EAACjE,WAAA,CAAAyF,kBAAI;UAACZ,IAAI,EAAC,MAAM;UAACe,EAAE,EAAC,IAAI;UAAAxB,QAAA,gBACxB,IAAAxD,WAAA,CAAAyD,GAAA;YAAMH,SAAS,EAAC,iCAAiC;YAAAE,QAAA,EAC9CtB,KAAK,GACJ,IAAA+C,4BAAc,EAAE/C,KAAM,CAAC,GACvB,IAAAwC,QAAE,EAAE,UAAW;UAAC,CACd,CAAC,EACL3B,aAAa,iBACd,IAAA/C,WAAA,CAAAyD,GAAA;YAAMH,SAAS,EAAC,sCAAsC;YAAAE,QAAA,EACnD,KAAMT,aAAa;UAAG,CACnB,CACN,EACCxC,aAAa,IACd,CAAEF,KAAK,CAAC6B,KAAK,IACb,CAAEa,aAAa,iBACd,IAAA/C,WAAA,CAAAyD,GAAA;YAAMH,SAAS,EAAC,sCAAsC;YAAAE,QAAA,EACnD,KAAM,IAAAyB,4BAAc,EACrB1E,aACD,CAAC;UAAG,CACC,CACN;QAAA,CACG,CAAC;MAAA,GAxCDqC,aAyCK,CAAC,eACb,IAAA5C,WAAA,CAAAyD,GAAA;QAAMH,SAAS,EAAC,+BAA+B;QAAAE,QAAA,EAC5C0B,yBAAe,CAACC,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_htmlEntities","_constants","_store","_pageTypeBadge","_getTemplateInfo","_jsxRuntime","MotionButton","motion","Button","DocumentBar","props","postType","postTypeLabel","documentTitle","isNotFound","templateTitle","onNavigateToPreviousEntityRecord","isTemplatePreview","useSelect","select","_select$getEntityReco","getCurrentPostType","getCurrentPostId","getEditorSettings","getRenderingMode","editorStore","getEditedEntityRecord","getPostType","isResolving","isResolvingSelector","coreStore","_postType","_postId","_document","default_template_types","templateTypes","getEntityRecord","_templateInfo","getTemplateInfo","template","_postTypeLabel","labels","singular_name","title","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isTemplate","TEMPLATE_POST_TYPES","includes","hasBackButton","entityTitle","icon","pageTypeBadge","usePageTypeBadge","mountedRef","useRef","useEffect","current","jsxs","className","clsx","children","jsx","__unstableAnimatePresence","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__","BlockIcon","layout","__experimentalText","__unstableMotion","div","as","decodeEntities","displayShortcut","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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAKA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,cAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA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,CAAC;MAAA,GAxCDyC,aAyCK,CAAC,eACb,IAAAhD,WAAA,CAAA6D,GAAA;QAAMH,SAAS,EAAC,+BAA+B;QAAAE,QAAA,EAC5C0B,yBAAe,CAACC,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
@@ -13,10 +13,10 @@ var _blockEditor = require("@wordpress/block-editor");
13
13
  /**
14
14
  * Component check if there are any headings (core/heading blocks) present in the document.
15
15
  *
16
- * @param {Object} props Props.
17
- * @param {Element} props.children Children to be rendered.
16
+ * @param {Object} props Props.
17
+ * @param {React.ReactElement} props.children Children to be rendered.
18
18
  *
19
- * @return {Component|null} The component to be rendered or null if there are headings.
19
+ * @return {React.ReactElement} The component to be rendered or null if there are headings.
20
20
  */
21
21
  function DocumentOutlineCheck({
22
22
  children
@@ -27,7 +27,7 @@ function DocumentOutlineCheck({
27
27
  } = select(_blockEditor.store);
28
28
  return getGlobalBlockCount('core/heading') > 0;
29
29
  });
30
- if (hasHeadings) {
30
+ if (!hasHeadings) {
31
31
  return null;
32
32
  }
33
33
  return children;
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_blockEditor","DocumentOutlineCheck","children","hasHeadings","useSelect","select","getGlobalBlockCount","blockEditorStore"],"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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,WAAW,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAE1D,OAAOD,mBAAmB,CAAE,cAAe,CAAC,GAAG,CAAC;EACjD,CAAE,CAAC;EAEH,IAAKH,WAAW,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_blockEditor","DocumentOutlineCheck","children","hasHeadings","useSelect","select","getGlobalBlockCount","blockEditorStore"],"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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,WAAW,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAE1D,OAAOD,mBAAmB,CAAE,cAAe,CAAC,GAAG,CAAC;EACjD,CAAE,CAAC;EAEH,IAAK,CAAEH,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = DocumentOutline;
8
8
  var _i18n = require("@wordpress/i18n");
9
9
  var _data = require("@wordpress/data");
10
+ var _element = require("@wordpress/element");
10
11
  var _richText = require("@wordpress/rich-text");
11
12
  var _blockEditor = require("@wordpress/block-editor");
12
13
  var _coreData = require("@wordpress/core-data");
@@ -143,15 +144,13 @@ const isEmptyHeading = heading => !heading.attributes.content || heading.attribu
143
144
  * Renders a document outline component.
144
145
  *
145
146
  * @param {Object} props Props.
146
- * @param {Function} props.onSelect Function to be called when an outline item is selected.
147
- * @param {boolean} props.isTitleSupported Indicates whether the title is supported.
147
+ * @param {Function} props.onSelect Function to be called when an outline item is selected
148
148
  * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.
149
149
  *
150
- * @return {Component} The component to be rendered.
150
+ * @return {React.ReactNode} The rendered component.
151
151
  */
152
152
  function DocumentOutline({
153
153
  onSelect,
154
- isTitleSupported,
155
154
  hasOutlineItemsDisabled
156
155
  }) {
157
156
  const {
@@ -159,7 +158,8 @@ function DocumentOutline({
159
158
  } = (0, _data.useDispatch)(_blockEditor.store);
160
159
  const {
161
160
  blocks,
162
- title
161
+ title,
162
+ isTitleSupported
163
163
  } = (0, _data.useSelect)(select => {
164
164
  var _postType$supports$ti;
165
165
  const {
@@ -178,6 +178,7 @@ function DocumentOutline({
178
178
  isTitleSupported: (_postType$supports$ti = postType?.supports?.title) !== null && _postType$supports$ti !== void 0 ? _postType$supports$ti : false
179
179
  };
180
180
  });
181
+ const prevHeadingLevelRef = (0, _element.useRef)(1);
181
182
  const headings = computeOutlineHeadings(blocks);
182
183
  if (headings.length < 1) {
183
184
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -187,7 +188,6 @@ function DocumentOutline({
187
188
  })]
188
189
  });
189
190
  }
190
- let prevHeadingLevel = 1;
191
191
 
192
192
  // Not great but it's the simplest way to locate the title right now.
193
193
  const titleNode = document.querySelector('.editor-post-title__input');
@@ -210,9 +210,9 @@ function DocumentOutline({
210
210
  }), headings.map((item, index) => {
211
211
  // Headings remain the same, go up by one, or down by any amount.
212
212
  // Otherwise there are missing levels.
213
- const isIncorrectLevel = item.level > prevHeadingLevel + 1;
213
+ const isIncorrectLevel = item.level > prevHeadingLevelRef.current + 1;
214
214
  const isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle);
215
- prevHeadingLevel = item.level;
215
+ prevHeadingLevelRef.current = item.level;
216
216
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_item.default, {
217
217
  level: `H${item.level}`,
218
218
  isValid: isValid,
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_data","_richText","_blockEditor","_coreData","_components","_item","_interopRequireDefault","_store","_jsxRuntime","emptyHeadingContent","jsx","children","__","incorrectLevelContent","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","jsxs","SVG","width","height","viewBox","fill","xmlns","Rect","rx","Line","x1","y1","x2","y2","stroke","x","y","Path","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","useDispatch","blockEditorStore","title","useSelect","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","default","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","getTextContent","create","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 }\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B,EACzCwE,IAAI,CAAC5C,KAAK,KAAK,CAAC,IACjBqC,aAAa,IACb/D,kBAAkB,EACjB2D,QAAQ,IACTW,IAAI,CAAC5C,KAAK,KAAK,CAAC,IAChB,CAAEqC,aAAa,IACfhE,gBAAgB;QAAA,GAxBXwE,KAyBc,CAAC;MAExB,CAAE,CAAC;IAAA,CACA;EAAC,CACD,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_data","_element","_richText","_blockEditor","_coreData","_components","_item","_interopRequireDefault","_store","_jsxRuntime","emptyHeadingContent","jsx","children","__","incorrectLevelContent","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","jsxs","SVG","width","height","viewBox","fill","xmlns","Rect","rx","Line","x1","y1","x2","y2","stroke","x","y","Path","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","hasOutlineItemsDisabled","selectBlock","useDispatch","blockEditorStore","title","isTitleSupported","useSelect","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports","prevHeadingLevelRef","useRef","headings","className","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","default","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","current","clientId","getTextContent","create","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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAKA,IAAAO,KAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAAmD,IAAAU,WAAA,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AAK,GAAG2B,mBAAmB,CAACqB,OAAO,GAAG,CAAC;QAE7C,MAAMR,OAAO,GACZ,CAAEK,IAAI,CAAC3C,OAAO,IACd,CAAE6C,gBAAgB,IAClB,CAAC,CAAEF,IAAI,CAAC7C,KAAK,KACX6C,IAAI,CAAC7C,KAAK,KAAK,CAAC,IACf,CAAEsC,aAAa,IAAI,CAAEJ,QAAU,CAAE;QACrCP,mBAAmB,CAACqB,OAAO,GAAGH,IAAI,CAAC7C,KAAK;QAExC,oBACC,IAAAjC,WAAA,CAAAS,IAAA,EAACZ,KAAA,CAAA2E,OAAmB;UAEnBvC,KAAK,EAAG,IAAK6C,IAAI,CAAC7C,KAAK,EAAK;UAC5BwC,OAAO,EAAGA,OAAS;UACnBG,UAAU,EAAGhC,uBAAyB;UACtC8B,IAAI,EAAG,UAAWI,IAAI,CAACI,QAAQ,EAAK;UACpCvC,QAAQ,EAAGA,CAAA,KAAM;YAChBE,WAAW,CAAEiC,IAAI,CAACI,QAAS,CAAC;YAC5BvC,QAAQ,GAAG,CAAC;UACb,CAAG;UAAAxC,QAAA,GAED2E,IAAI,CAAC3C,OAAO,GACXlC,mBAAmB,GACnB,IAAAkF,wBAAc,EACd,IAAAC,gBAAM,EAAE;YACPC,IAAI,EAAEP,IAAI,CAAC5C,UAAU,CAACK;UACvB,CAAE,CACF,CAAC,EACFyC,gBAAgB,IAAI3E,qBAAqB,EACzCyE,IAAI,CAAC7C,KAAK,KAAK,CAAC,IACjBsC,aAAa,IACbhE,kBAAkB,EACjB4D,QAAQ,IACTW,IAAI,CAAC7C,KAAK,KAAK,CAAC,IAChB,CAAEsC,aAAa,IACfjE,gBAAgB;QAAA,GAxBXyE,KAyBc,CAAC;MAExB,CAAE,CAAC;IAAA,CACA;EAAC,CACD,CAAC;AAER","ignoreList":[]}
@@ -73,7 +73,7 @@ function DocumentTools({
73
73
  showIconLabels: get('core', 'showIconLabels'),
74
74
  isDistractionFree: get('core', 'distractionFree'),
75
75
  isVisualMode: getEditorMode() === 'visual',
76
- showTools: getRenderingMode() !== 'post-only' || getCurrentPostType() === 'wp_template'
76
+ showTools: !!window?.__experimentalEditorWriteMode && (getRenderingMode() !== 'post-only' || getCurrentPostType() === 'wp_template')
77
77
  };
78
78
  }, []);
79
79
  const preventDefault = event => {
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","_jsxRuntime","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","showTools","useSelect","select","get","preferencesStore","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","getRenderingMode","getCurrentPostType","unlock","getShortcutRepresentation","keyboardShortcutsStore","isVisualMode","preventDefault","event","isLargeViewport","useViewportMatch","isWideViewport","toolbarAriaLabel","__","toggleListView","useCallback","toggleInserter","longLabel","_x","shortLabel","jsx","NavigableToolbar","clsx","variant","children","jsxs","ToolbarItem","ref","as","Button","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,KAAA,GAAAd,sBAAA,CAAAC,OAAA;AAAuD,IAAAc,WAAA,GAAAd,OAAA;AAxBvD;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAMA,SAASe,aAAaA,CAAE;EAAEC,SAAS;EAAEC,iBAAiB,GAAG;AAAM,CAAC,EAAG;EAClE,MAAM;IAAEC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AAU;YACjBX,QAAQ,EAAGrD,iBAAmB;YAC9BkD,SAAS,EAAG3C;YACZ;YACAiD,KAAK,EAAG,IAAAvB,QAAE,EAAE,mBAAoB,CAAG;YACnCmB,OAAO,EAAGlB,cAAgB;YAC1B+B,QAAQ,EAAGzD,gBAAkB;YAC7BiD,WAAW,EAAG,CAAE9C,cAAgB;YAChCgC,OAAO,EACNhC,cAAc,GAAG,UAAU,GAAGiD,SAC9B;YACD,iBAAgBrD,cAAgB;YAChCwC,GAAG,EAAGrC,iBAAmB;YACzBmD,IAAI,EAAC;UAAS,CACd,CACD;QAAA,CACA,CACF;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctE,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","_jsxRuntime","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","showTools","useSelect","select","get","preferencesStore","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","getRenderingMode","getCurrentPostType","unlock","getShortcutRepresentation","keyboardShortcutsStore","isVisualMode","window","__experimentalEditorWriteMode","preventDefault","event","isLargeViewport","useViewportMatch","isWideViewport","toolbarAriaLabel","__","toggleListView","useCallback","toggleInserter","longLabel","_x","shortLabel","jsx","NavigableToolbar","clsx","variant","children","jsxs","ToolbarItem","ref","as","Button","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,YAA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