@wordpress/editor 13.33.0 → 13.35.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 (494) hide show
  1. package/CHANGELOG.md +12 -4
  2. package/README.md +132 -20
  3. package/build/bindings/pattern-overrides.js +70 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/components/autosave-monitor/index.js +15 -12
  6. package/build/components/autosave-monitor/index.js.map +1 -1
  7. package/build/components/block-settings-menu/content-only-settings-menu.js +126 -0
  8. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
  9. package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
  10. package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
  11. package/build/components/character-count/index.js +5 -0
  12. package/build/components/character-count/index.js.map +1 -1
  13. package/build/components/collapsible-block-toolbar/index.js +73 -0
  14. package/build/components/collapsible-block-toolbar/index.js.map +1 -0
  15. package/build/components/document-bar/index.js +2 -2
  16. package/build/components/document-bar/index.js.map +1 -1
  17. package/build/components/document-outline/check.js +8 -0
  18. package/build/components/document-outline/check.js.map +1 -1
  19. package/build/components/document-outline/index.js +11 -0
  20. package/build/components/document-outline/index.js.map +1 -1
  21. package/build/components/document-outline/item.js +2 -2
  22. package/build/components/document-outline/item.js.map +1 -1
  23. package/build/components/document-tools/index.js +15 -25
  24. package/build/components/document-tools/index.js.map +1 -1
  25. package/build/components/editor-canvas/edit-template-blocks-notification.js +1 -1
  26. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  27. package/build/components/editor-canvas/index.js +19 -8
  28. package/build/components/editor-canvas/index.js.map +1 -1
  29. package/build/components/editor-history/redo.js +11 -0
  30. package/build/components/editor-history/redo.js.map +1 -1
  31. package/build/components/editor-history/undo.js +11 -0
  32. package/build/components/editor-history/undo.js.map +1 -1
  33. package/build/components/editor-snackbars/index.js +6 -0
  34. package/build/components/editor-snackbars/index.js.map +1 -1
  35. package/build/components/global-keyboard-shortcuts/index.js +7 -0
  36. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  37. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +35 -1
  38. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  39. package/build/components/global-styles-provider/index.js +130 -0
  40. package/build/components/global-styles-provider/index.js.map +1 -0
  41. package/build/components/header/index.js +147 -0
  42. package/build/components/header/index.js.map +1 -0
  43. package/build/components/inserter-sidebar/index.js +56 -34
  44. package/build/components/inserter-sidebar/index.js.map +1 -1
  45. package/build/components/keyboard-shortcut-help-modal/config.js +4 -0
  46. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  47. package/build/components/keyboard-shortcut-help-modal/index.js +2 -2
  48. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  49. package/build/components/list-view-sidebar/index.js +1 -1
  50. package/build/components/list-view-sidebar/index.js.map +1 -1
  51. package/build/components/more-menu/copy-content-menu-item.js +59 -0
  52. package/build/components/more-menu/copy-content-menu-item.js.map +1 -0
  53. package/build/components/more-menu/index.js +119 -0
  54. package/build/components/more-menu/index.js.map +1 -0
  55. package/build/components/more-menu/tools-more-menu-group.js +23 -0
  56. package/build/components/more-menu/tools-more-menu-group.js.map +1 -0
  57. package/build/components/more-menu/view-more-menu-group.js +24 -0
  58. package/build/components/more-menu/view-more-menu-group.js.map +1 -0
  59. package/build/components/page-attributes/check.js +8 -0
  60. package/build/components/page-attributes/check.js.map +1 -1
  61. package/build/components/page-attributes/order.js +7 -0
  62. package/build/components/page-attributes/order.js.map +1 -1
  63. package/build/components/page-attributes/panel.js +14 -8
  64. package/build/components/page-attributes/panel.js.map +1 -1
  65. package/build/components/page-attributes/parent.js +7 -0
  66. package/build/components/page-attributes/parent.js.map +1 -1
  67. package/build/components/plugin-post-publish-panel/index.js +1 -1
  68. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  69. package/build/components/plugin-pre-publish-panel/index.js +1 -1
  70. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  71. package/build/components/plugin-sidebar/index.js +1 -1
  72. package/build/components/plugin-sidebar/index.js.map +1 -1
  73. package/build/components/post-actions/actions.js +219 -66
  74. package/build/components/post-actions/actions.js.map +1 -1
  75. package/build/components/post-actions/index.js +32 -16
  76. package/build/components/post-actions/index.js.map +1 -1
  77. package/build/components/post-author/check.js +9 -0
  78. package/build/components/post-author/check.js.map +1 -1
  79. package/build/components/post-author/index.js +6 -0
  80. package/build/components/post-author/index.js.map +1 -1
  81. package/build/components/post-author/panel.js +5 -0
  82. package/build/components/post-author/panel.js.map +1 -1
  83. package/build/components/post-card-panel/index.js +7 -66
  84. package/build/components/post-card-panel/index.js.map +1 -1
  85. package/build/components/post-comments/index.js +28 -8
  86. package/build/components/post-comments/index.js.map +1 -1
  87. package/build/components/post-content-information/index.js +72 -0
  88. package/build/components/post-content-information/index.js.map +1 -0
  89. package/build/components/post-discussion/panel.js +104 -20
  90. package/build/components/post-discussion/panel.js.map +1 -1
  91. package/build/components/post-excerpt/check.js +0 -19
  92. package/build/components/post-excerpt/check.js.map +1 -1
  93. package/build/components/post-excerpt/index.js +52 -12
  94. package/build/components/post-excerpt/index.js.map +1 -1
  95. package/build/components/post-excerpt/panel.js +118 -7
  96. package/build/components/post-excerpt/panel.js.map +1 -1
  97. package/build/components/post-excerpt/plugin.js +2 -2
  98. package/build/components/post-excerpt/plugin.js.map +1 -1
  99. package/build/components/post-featured-image/index.js +1 -1
  100. package/build/components/post-featured-image/index.js.map +1 -1
  101. package/build/components/post-format/panel.js +27 -0
  102. package/build/components/post-format/panel.js.map +1 -0
  103. package/build/components/post-last-edited-panel/index.js +33 -0
  104. package/build/components/post-last-edited-panel/index.js.map +1 -0
  105. package/build/components/post-panel-row/index.js +2 -2
  106. package/build/components/post-panel-row/index.js.map +1 -1
  107. package/build/components/post-panel-section/index.js +28 -0
  108. package/build/components/post-panel-section/index.js.map +1 -0
  109. package/build/components/post-pingbacks/index.js +5 -2
  110. package/build/components/post-pingbacks/index.js.map +1 -1
  111. package/build/components/post-publish-button/post-publish-button-or-toggle.js +100 -0
  112. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
  113. package/build/components/post-saved-state/index.js +2 -2
  114. package/build/components/post-saved-state/index.js.map +1 -1
  115. package/build/components/post-schedule/panel.js +1 -1
  116. package/build/components/post-schedule/panel.js.map +1 -1
  117. package/build/components/post-slug/panel.js +27 -0
  118. package/build/components/post-slug/panel.js.map +1 -0
  119. package/build/components/post-status/index.js +13 -13
  120. package/build/components/post-status/index.js.map +1 -1
  121. package/build/components/post-sticky/panel.js +21 -0
  122. package/build/components/post-sticky/panel.js.map +1 -0
  123. package/build/components/post-template/block-theme.js +2 -2
  124. package/build/components/post-template/block-theme.js.map +1 -1
  125. package/build/components/post-template/classic-theme.js +0 -1
  126. package/build/components/post-template/classic-theme.js.map +1 -1
  127. package/build/components/post-template/swap-template-button.js +2 -5
  128. package/build/components/post-template/swap-template-button.js.map +1 -1
  129. package/build/components/post-title/index.js +2 -2
  130. package/build/components/post-title/index.js.map +1 -1
  131. package/build/components/post-title/post-title-raw.js +2 -2
  132. package/build/components/post-title/post-title-raw.js.map +1 -1
  133. package/build/components/post-transform-panel/hooks.js +90 -0
  134. package/build/components/post-transform-panel/hooks.js.map +1 -0
  135. package/build/components/post-transform-panel/index.js +101 -0
  136. package/build/components/post-transform-panel/index.js.map +1 -0
  137. package/build/components/post-trash/panel.js +18 -0
  138. package/build/components/post-trash/panel.js.map +1 -0
  139. package/build/components/post-type-support-check/index.js +1 -1
  140. package/build/components/post-type-support-check/index.js.map +1 -1
  141. package/build/components/post-url/index.js +2 -1
  142. package/build/components/post-url/index.js.map +1 -1
  143. package/build/components/post-url/panel.js +1 -1
  144. package/build/components/post-url/panel.js.map +1 -1
  145. package/build/components/preferences-modal/enable-publish-sidebar.js +34 -0
  146. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  147. package/build/components/preferences-modal/index.js +11 -5
  148. package/build/components/preferences-modal/index.js.map +1 -1
  149. package/build/components/preview-dropdown/index.js +3 -1
  150. package/build/components/preview-dropdown/index.js.map +1 -1
  151. package/build/components/provider/disable-non-page-content-blocks.js +23 -16
  152. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  153. package/build/components/provider/index.js +3 -1
  154. package/build/components/provider/index.js.map +1 -1
  155. package/build/components/provider/use-block-editor-settings.js +21 -3
  156. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  157. package/build/components/save-publish-panels/index.js +89 -0
  158. package/build/components/save-publish-panels/index.js.map +1 -0
  159. package/build/components/sidebar/constants.js +11 -0
  160. package/build/components/sidebar/constants.js.map +1 -0
  161. package/build/components/sidebar/header.js +53 -0
  162. package/build/components/sidebar/header.js.map +1 -0
  163. package/build/components/sidebar/index.js +157 -0
  164. package/build/components/sidebar/index.js.map +1 -0
  165. package/build/components/sidebar/post-summary.js +84 -0
  166. package/build/components/sidebar/post-summary.js.map +1 -0
  167. package/build/components/start-page-options/index.js +10 -8
  168. package/build/components/start-page-options/index.js.map +1 -1
  169. package/build/components/start-template-options/index.js +192 -0
  170. package/build/components/start-template-options/index.js.map +1 -0
  171. package/build/components/template-content-panel/index.js +38 -0
  172. package/build/components/template-content-panel/index.js.map +1 -0
  173. package/build/hooks/pattern-overrides.js +10 -5
  174. package/build/hooks/pattern-overrides.js.map +1 -1
  175. package/build/private-apis.js +19 -8
  176. package/build/private-apis.js.map +1 -1
  177. package/build/private-apis.native.js +72 -0
  178. package/build/private-apis.native.js.map +1 -0
  179. package/build/store/private-selectors.js +6 -1
  180. package/build/store/private-selectors.js.map +1 -1
  181. package/build/store/reducer.js +15 -0
  182. package/build/store/reducer.js.map +1 -1
  183. package/build/store/selectors.js +3 -1
  184. package/build/store/selectors.js.map +1 -1
  185. package/build-module/bindings/pattern-overrides.js +69 -1
  186. package/build-module/bindings/pattern-overrides.js.map +1 -1
  187. package/build-module/components/autosave-monitor/index.js +15 -13
  188. package/build-module/components/autosave-monitor/index.js.map +1 -1
  189. package/build-module/components/block-settings-menu/content-only-settings-menu.js +119 -0
  190. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
  191. package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
  192. package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
  193. package/build-module/components/character-count/index.js +6 -0
  194. package/build-module/components/character-count/index.js.map +1 -1
  195. package/build-module/components/collapsible-block-toolbar/index.js +65 -0
  196. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -0
  197. package/build-module/components/document-bar/index.js +2 -2
  198. package/build-module/components/document-bar/index.js.map +1 -1
  199. package/build-module/components/document-outline/check.js +9 -0
  200. package/build-module/components/document-outline/check.js.map +1 -1
  201. package/build-module/components/document-outline/index.js +11 -0
  202. package/build-module/components/document-outline/index.js.map +1 -1
  203. package/build-module/components/document-outline/item.js +2 -2
  204. package/build-module/components/document-outline/item.js.map +1 -1
  205. package/build-module/components/document-tools/index.js +17 -27
  206. package/build-module/components/document-tools/index.js.map +1 -1
  207. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +1 -1
  208. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  209. package/build-module/components/editor-canvas/index.js +19 -8
  210. package/build-module/components/editor-canvas/index.js.map +1 -1
  211. package/build-module/components/editor-history/redo.js +11 -0
  212. package/build-module/components/editor-history/redo.js.map +1 -1
  213. package/build-module/components/editor-history/undo.js +11 -0
  214. package/build-module/components/editor-history/undo.js.map +1 -1
  215. package/build-module/components/editor-snackbars/index.js +6 -0
  216. package/build-module/components/editor-snackbars/index.js.map +1 -1
  217. package/build-module/components/global-keyboard-shortcuts/index.js +8 -0
  218. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  219. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +36 -1
  220. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  221. package/build-module/components/global-styles-provider/index.js +120 -0
  222. package/build-module/components/global-styles-provider/index.js.map +1 -0
  223. package/build-module/components/header/index.js +139 -0
  224. package/build-module/components/header/index.js.map +1 -0
  225. package/build-module/components/inserter-sidebar/index.js +59 -37
  226. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  227. package/build-module/components/keyboard-shortcut-help-modal/config.js +4 -0
  228. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  229. package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -2
  230. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  231. package/build-module/components/list-view-sidebar/index.js +1 -1
  232. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  233. package/build-module/components/more-menu/copy-content-menu-item.js +52 -0
  234. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -0
  235. package/build-module/components/more-menu/index.js +111 -0
  236. package/build-module/components/more-menu/index.js.map +1 -0
  237. package/build-module/components/more-menu/tools-more-menu-group.js +16 -0
  238. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -0
  239. package/build-module/components/more-menu/view-more-menu-group.js +17 -0
  240. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -0
  241. package/build-module/components/page-attributes/check.js +9 -0
  242. package/build-module/components/page-attributes/check.js.map +1 -1
  243. package/build-module/components/page-attributes/order.js +7 -0
  244. package/build-module/components/page-attributes/order.js.map +1 -1
  245. package/build-module/components/page-attributes/panel.js +13 -6
  246. package/build-module/components/page-attributes/panel.js.map +1 -1
  247. package/build-module/components/page-attributes/parent.js +7 -0
  248. package/build-module/components/page-attributes/parent.js.map +1 -1
  249. package/build-module/components/plugin-post-publish-panel/index.js +1 -1
  250. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  251. package/build-module/components/plugin-pre-publish-panel/index.js +1 -1
  252. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  253. package/build-module/components/plugin-sidebar/index.js +1 -1
  254. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  255. package/build-module/components/post-actions/actions.js +223 -70
  256. package/build-module/components/post-actions/actions.js.map +1 -1
  257. package/build-module/components/post-actions/index.js +33 -17
  258. package/build-module/components/post-actions/index.js.map +1 -1
  259. package/build-module/components/post-author/check.js +10 -0
  260. package/build-module/components/post-author/check.js.map +1 -1
  261. package/build-module/components/post-author/index.js +6 -0
  262. package/build-module/components/post-author/index.js.map +1 -1
  263. package/build-module/components/post-author/panel.js +6 -0
  264. package/build-module/components/post-author/panel.js.map +1 -1
  265. package/build-module/components/post-card-panel/index.js +9 -67
  266. package/build-module/components/post-card-panel/index.js.map +1 -1
  267. package/build-module/components/post-comments/index.js +30 -10
  268. package/build-module/components/post-comments/index.js.map +1 -1
  269. package/build-module/components/post-content-information/index.js +66 -0
  270. package/build-module/components/post-content-information/index.js.map +1 -0
  271. package/build-module/components/post-discussion/panel.js +105 -21
  272. package/build-module/components/post-discussion/panel.js.map +1 -1
  273. package/build-module/components/post-excerpt/check.js +0 -19
  274. package/build-module/components/post-excerpt/check.js.map +1 -1
  275. package/build-module/components/post-excerpt/index.js +52 -11
  276. package/build-module/components/post-excerpt/index.js.map +1 -1
  277. package/build-module/components/post-excerpt/panel.js +118 -8
  278. package/build-module/components/post-excerpt/panel.js.map +1 -1
  279. package/build-module/components/post-excerpt/plugin.js +2 -2
  280. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  281. package/build-module/components/post-featured-image/index.js +1 -1
  282. package/build-module/components/post-featured-image/index.js.map +1 -1
  283. package/build-module/components/post-format/panel.js +18 -0
  284. package/build-module/components/post-format/panel.js.map +1 -0
  285. package/build-module/components/post-last-edited-panel/index.js +26 -0
  286. package/build-module/components/post-last-edited-panel/index.js.map +1 -0
  287. package/build-module/components/post-panel-row/index.js +2 -2
  288. package/build-module/components/post-panel-row/index.js.map +1 -1
  289. package/build-module/components/post-panel-section/index.js +20 -0
  290. package/build-module/components/post-panel-section/index.js.map +1 -0
  291. package/build-module/components/post-pingbacks/index.js +6 -3
  292. package/build-module/components/post-pingbacks/index.js.map +1 -1
  293. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +91 -0
  294. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -0
  295. package/build-module/components/post-saved-state/index.js +2 -2
  296. package/build-module/components/post-saved-state/index.js.map +1 -1
  297. package/build-module/components/post-schedule/panel.js +1 -1
  298. package/build-module/components/post-schedule/panel.js.map +1 -1
  299. package/build-module/components/post-slug/panel.js +18 -0
  300. package/build-module/components/post-slug/panel.js.map +1 -0
  301. package/build-module/components/post-status/index.js +13 -13
  302. package/build-module/components/post-status/index.js.map +1 -1
  303. package/build-module/components/post-sticky/panel.js +12 -0
  304. package/build-module/components/post-sticky/panel.js.map +1 -0
  305. package/build-module/components/post-template/block-theme.js +2 -2
  306. package/build-module/components/post-template/block-theme.js.map +1 -1
  307. package/build-module/components/post-template/classic-theme.js +0 -1
  308. package/build-module/components/post-template/classic-theme.js.map +1 -1
  309. package/build-module/components/post-template/swap-template-button.js +3 -6
  310. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  311. package/build-module/components/post-title/index.js +2 -2
  312. package/build-module/components/post-title/index.js.map +1 -1
  313. package/build-module/components/post-title/post-title-raw.js +2 -2
  314. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  315. package/build-module/components/post-transform-panel/hooks.js +83 -0
  316. package/build-module/components/post-transform-panel/hooks.js.map +1 -0
  317. package/build-module/components/post-transform-panel/index.js +94 -0
  318. package/build-module/components/post-transform-panel/index.js.map +1 -0
  319. package/build-module/components/post-trash/panel.js +10 -0
  320. package/build-module/components/post-trash/panel.js.map +1 -0
  321. package/build-module/components/post-type-support-check/index.js +1 -1
  322. package/build-module/components/post-type-support-check/index.js.map +1 -1
  323. package/build-module/components/post-url/index.js +2 -1
  324. package/build-module/components/post-url/index.js.map +1 -1
  325. package/build-module/components/post-url/panel.js +1 -1
  326. package/build-module/components/post-url/panel.js.map +1 -1
  327. package/build-module/components/preferences-modal/enable-publish-sidebar.js +27 -0
  328. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  329. package/build-module/components/preferences-modal/index.js +11 -5
  330. package/build-module/components/preferences-modal/index.js.map +1 -1
  331. package/build-module/components/preview-dropdown/index.js +3 -1
  332. package/build-module/components/preview-dropdown/index.js.map +1 -1
  333. package/build-module/components/provider/disable-non-page-content-blocks.js +24 -17
  334. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  335. package/build-module/components/provider/index.js +3 -1
  336. package/build-module/components/provider/index.js.map +1 -1
  337. package/build-module/components/provider/use-block-editor-settings.js +21 -3
  338. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  339. package/build-module/components/save-publish-panels/index.js +80 -0
  340. package/build-module/components/save-publish-panels/index.js.map +1 -0
  341. package/build-module/components/sidebar/constants.js +5 -0
  342. package/build-module/components/sidebar/constants.js.map +1 -0
  343. package/build-module/components/sidebar/header.js +46 -0
  344. package/build-module/components/sidebar/header.js.map +1 -0
  345. package/build-module/components/sidebar/index.js +149 -0
  346. package/build-module/components/sidebar/index.js.map +1 -0
  347. package/build-module/components/sidebar/post-summary.js +77 -0
  348. package/build-module/components/sidebar/post-summary.js.map +1 -0
  349. package/build-module/components/start-page-options/index.js +10 -8
  350. package/build-module/components/start-page-options/index.js.map +1 -1
  351. package/build-module/components/start-template-options/index.js +185 -0
  352. package/build-module/components/start-template-options/index.js.map +1 -0
  353. package/build-module/components/template-content-panel/index.js +31 -0
  354. package/build-module/components/template-content-panel/index.js.map +1 -0
  355. package/build-module/hooks/pattern-overrides.js +10 -5
  356. package/build-module/hooks/pattern-overrides.js.map +1 -1
  357. package/build-module/private-apis.js +19 -8
  358. package/build-module/private-apis.js.map +1 -1
  359. package/build-module/private-apis.native.js +62 -0
  360. package/build-module/private-apis.native.js.map +1 -0
  361. package/build-module/store/private-selectors.js +3 -0
  362. package/build-module/store/private-selectors.js.map +1 -1
  363. package/build-module/store/reducer.js +14 -0
  364. package/build-module/store/reducer.js.map +1 -1
  365. package/build-module/store/selectors.js +3 -1
  366. package/build-module/store/selectors.js.map +1 -1
  367. package/build-style/style-rtl.css +535 -48
  368. package/build-style/style.css +535 -48
  369. package/package.json +38 -36
  370. package/src/bindings/pattern-overrides.js +83 -1
  371. package/src/components/autocompleters/style.scss +1 -2
  372. package/src/components/autosave-monitor/index.js +15 -12
  373. package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
  374. package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
  375. package/src/components/block-settings-menu/style.scss +4 -0
  376. package/src/components/character-count/index.js +5 -0
  377. package/src/components/collapsible-block-toolbar/index.js +77 -0
  378. package/src/components/collapsible-block-toolbar/style.scss +80 -0
  379. package/src/components/document-bar/index.js +2 -2
  380. package/src/components/document-outline/check.js +8 -0
  381. package/src/components/document-outline/index.js +10 -0
  382. package/src/components/document-outline/item.js +2 -2
  383. package/src/components/document-tools/index.js +19 -26
  384. package/src/components/editor-canvas/edit-template-blocks-notification.js +1 -1
  385. package/src/components/editor-canvas/index.js +18 -6
  386. package/src/components/editor-history/redo.js +10 -0
  387. package/src/components/editor-history/undo.js +10 -0
  388. package/src/components/editor-snackbars/index.js +5 -0
  389. package/src/components/entities-saved-states/style.scss +7 -0
  390. package/src/components/global-keyboard-shortcuts/index.js +7 -0
  391. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +42 -1
  392. package/src/components/global-styles-provider/index.js +162 -0
  393. package/src/components/header/index.js +154 -0
  394. package/src/components/header/style.scss +231 -0
  395. package/src/components/inserter-sidebar/index.js +52 -32
  396. package/src/components/inserter-sidebar/style.scss +10 -3
  397. package/src/components/keyboard-shortcut-help-modal/config.js +10 -1
  398. package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
  399. package/src/components/list-view-sidebar/index.js +1 -1
  400. package/src/components/list-view-sidebar/style.scss +3 -2
  401. package/src/components/more-menu/copy-content-menu-item.js +51 -0
  402. package/src/components/more-menu/index.js +158 -0
  403. package/src/components/more-menu/tools-more-menu-group.js +11 -0
  404. package/src/components/more-menu/view-more-menu-group.js +13 -0
  405. package/src/components/page-attributes/check.js +8 -0
  406. package/src/components/page-attributes/order.js +6 -0
  407. package/src/components/page-attributes/panel.js +21 -17
  408. package/src/components/page-attributes/parent.js +6 -0
  409. package/src/components/page-attributes/test/order.js +5 -1
  410. package/src/components/plugin-post-publish-panel/index.js +1 -1
  411. package/src/components/plugin-pre-publish-panel/index.js +1 -1
  412. package/src/components/plugin-sidebar/index.js +1 -1
  413. package/src/components/post-actions/actions.js +373 -152
  414. package/src/components/post-actions/index.js +34 -33
  415. package/src/components/post-author/check.js +9 -0
  416. package/src/components/post-author/index.js +5 -0
  417. package/src/components/post-author/panel.js +5 -0
  418. package/src/components/post-card-panel/index.js +40 -141
  419. package/src/components/post-card-panel/style.scss +2 -6
  420. package/src/components/post-comments/index.js +47 -9
  421. package/src/components/post-content-information/index.js +83 -0
  422. package/src/components/post-content-information/style.scss +6 -0
  423. package/src/components/post-discussion/panel.js +108 -27
  424. package/src/components/post-discussion/style.scss +26 -0
  425. package/src/components/post-excerpt/check.js +0 -18
  426. package/src/components/post-excerpt/index.js +66 -15
  427. package/src/components/post-excerpt/panel.js +196 -19
  428. package/src/components/post-excerpt/plugin.js +2 -2
  429. package/src/components/post-excerpt/style.scss +24 -0
  430. package/src/components/post-featured-image/index.js +1 -1
  431. package/src/components/post-featured-image/style.scss +2 -8
  432. package/src/components/post-format/panel.js +22 -0
  433. package/src/components/post-format/style.scss +6 -0
  434. package/src/components/post-last-edited-panel/index.js +35 -0
  435. package/src/components/post-last-edited-panel/style.scss +6 -0
  436. package/src/components/post-last-revision/test/check.js +5 -1
  437. package/src/components/post-panel-row/index.js +2 -2
  438. package/src/components/post-panel-row/style.scss +3 -3
  439. package/src/components/post-panel-section/index.js +19 -0
  440. package/src/components/post-panel-section/style.scss +3 -0
  441. package/src/components/post-pingbacks/index.js +11 -2
  442. package/src/components/post-publish-button/post-publish-button-or-toggle.js +102 -0
  443. package/src/components/post-publish-button/test/post-publish-button-or-toggle.js +63 -0
  444. package/src/components/post-publish-panel/style.scss +48 -0
  445. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +225 -75
  446. package/src/components/post-saved-state/index.js +2 -2
  447. package/src/components/post-schedule/panel.js +1 -1
  448. package/src/components/post-schedule/style.scss +2 -4
  449. package/src/components/post-slug/panel.js +22 -0
  450. package/src/components/post-slug/style.scss +5 -0
  451. package/src/components/post-slug/test/index.js +5 -1
  452. package/src/components/post-status/index.js +88 -80
  453. package/src/components/post-status/style.scss +0 -1
  454. package/src/components/post-sticky/panel.js +18 -0
  455. package/src/components/post-template/block-theme.js +2 -2
  456. package/src/components/post-template/classic-theme.js +0 -1
  457. package/src/components/post-template/swap-template-button.js +3 -6
  458. package/src/components/post-text-editor/style.scss +1 -1
  459. package/src/components/post-title/index.js +2 -2
  460. package/src/components/post-title/post-title-raw.js +2 -2
  461. package/src/components/post-title/style.scss +1 -1
  462. package/src/components/post-transform-panel/hooks.js +114 -0
  463. package/src/components/post-transform-panel/index.js +99 -0
  464. package/src/components/post-trash/panel.js +13 -0
  465. package/src/components/post-type-support-check/index.js +1 -1
  466. package/src/components/post-type-support-check/test/index.js +2 -2
  467. package/src/components/post-url/index.js +1 -0
  468. package/src/components/post-url/panel.js +1 -1
  469. package/src/components/preferences-modal/enable-publish-sidebar.js +28 -0
  470. package/src/components/preferences-modal/index.js +17 -3
  471. package/src/components/preview-dropdown/index.js +3 -1
  472. package/src/components/provider/disable-non-page-content-blocks.js +23 -21
  473. package/src/components/provider/index.js +4 -0
  474. package/src/components/provider/use-block-editor-settings.js +19 -4
  475. package/src/components/save-publish-panels/index.js +96 -0
  476. package/src/components/save-publish-panels/style.scss +36 -0
  477. package/src/components/sidebar/constants.js +4 -0
  478. package/src/components/sidebar/header.js +49 -0
  479. package/src/components/sidebar/index.js +200 -0
  480. package/src/components/sidebar/post-summary.js +104 -0
  481. package/src/components/sidebar/style.scss +18 -0
  482. package/src/components/start-page-options/index.js +12 -5
  483. package/src/components/start-template-options/index.js +219 -0
  484. package/src/components/start-template-options/style.scss +55 -0
  485. package/src/components/template-areas/style.scss +0 -1
  486. package/src/components/template-content-panel/index.js +36 -0
  487. package/src/hooks/pattern-overrides.js +12 -6
  488. package/src/private-apis.js +22 -8
  489. package/src/private-apis.native.js +61 -0
  490. package/src/store/private-selectors.js +3 -0
  491. package/src/store/reducer.js +12 -0
  492. package/src/store/selectors.js +3 -1
  493. package/src/style.scss +11 -0
  494. package/src/components/post-slug/test/check.js +0 -17
@@ -1 +1 @@
1
- {"version":3,"names":["Component","compose","withSelect","withDispatch","store","coreStore","editorStore","AutosaveMonitor","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","select","ownProps","getReferenceByDistinctEdits","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","autosaveInterval","dispatch"],"sources":["@wordpress/editor/src/components/autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * AutosaveMonitor invokes `props.autosave()` within at most `interval` seconds after an unsaved change is detected.\n *\n * The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.\n * The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as\n * the specific way of detecting changes.\n *\n * There are two caveats:\n * * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.\n * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.\n */\nexport class AutosaveMonitor extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.needsAutosave = !! ( props.isDirty && props.isAutosaveable );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.props.disableIntervalChecks ) {\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.disableIntervalChecks ) {\n\t\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\t\tthis.props.autosave();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.interval !== prevProps.interval ) {\n\t\t\tclearTimeout( this.timerId );\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\n\t\tif ( ! this.props.isDirty ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.isAutosaving && ! prevProps.isAutosaving ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\tthis.needsAutosave = true;\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timerId );\n\t}\n\n\tsetAutosaveTimer( timeout = this.props.interval * 1000 ) {\n\t\tthis.timerId = setTimeout( () => {\n\t\t\tthis.autosaveTimerHandler();\n\t\t}, timeout );\n\t}\n\n\tautosaveTimerHandler() {\n\t\tif ( ! this.props.isAutosaveable ) {\n\t\t\tthis.setAutosaveTimer( 1000 );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.needsAutosave ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\tthis.props.autosave();\n\t\t}\n\n\t\tthis.setAutosaveTimer();\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\n/**\n * AutosaveMonitor component.\n * Monitors the changes made to the edited post and triggers autosave if necessary.\n *\n * @example\n * ```jsx\n * <AutosaveMonitor interval={30000} />\n * ```\n */\nexport default compose( [\n\twithSelect( ( select, ownProps ) => {\n\t\tconst { getReferenceByDistinctEdits } = select( coreStore );\n\n\t\tconst {\n\t\t\tisEditedPostDirty,\n\t\t\tisEditedPostAutosaveable,\n\t\t\tisAutosavingPost,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\n\t\tconst { interval = getEditorSettings().autosaveInterval } = ownProps;\n\n\t\treturn {\n\t\t\teditsReference: getReferenceByDistinctEdits(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisAutosaveable: isEditedPostAutosaveable(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\tinterval,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tautosave() {\n\t\t\tconst { autosave = dispatch( editorStore ).autosave } = ownProps;\n\t\t\tautosave();\n\t\t},\n\t} ) ),\n] )( AutosaveMonitor );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,SAASP,SAAS,CAAC;EAC9CQ,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,aAAa,GAAG,CAAC,EAAID,KAAK,CAACE,OAAO,IAAIF,KAAK,CAACG,cAAc,CAAE;EAClE;EAEAC,iBAAiBA,CAAA,EAAG;IACnB,IAAK,CAAE,IAAI,CAACJ,KAAK,CAACK,qBAAqB,EAAG;MACzC,IAAI,CAACC,gBAAgB,CAAC,CAAC;IACxB;EACD;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,IAAK,IAAI,CAACR,KAAK,CAACK,qBAAqB,EAAG;MACvC,IAAK,IAAI,CAACL,KAAK,CAACS,cAAc,KAAKD,SAAS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AA,EAAG;IACR,OAAO,IAAI;EACZ;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe3B,OAAO,CAAE,CACvBC,UAAU,CAAE,CAAE2B,MAAM,EAAEC,QAAQ,KAAM;EACnC,MAAM;IAAEC;EAA4B,CAAC,GAAGF,MAAM,CAAExB,SAAU,CAAC;EAE3D,MAAM;IACL2B,iBAAiB;IACjBC,wBAAwB;IACxBC,gBAAgB;IAChBC;EACD,CAAC,GAAGN,MAAM,CAAEvB,WAAY,CAAC;EAEzB,MAAM;IAAEc,QAAQ,GAAGe,iBAAiB,CAAC,CAAC,CAACC;EAAiB,CAAC,GAAGN,QAAQ;EAEpE,OAAO;IACNZ,cAAc,EAAEa,2BAA2B,CAAC,CAAC;IAC7CpB,OAAO,EAAEqB,iBAAiB,CAAC,CAAC;IAC5BpB,cAAc,EAAEqB,wBAAwB,CAAC,CAAC;IAC1CV,YAAY,EAAEW,gBAAgB,CAAC,CAAC;IAChCd;EACD,CAAC;AACF,CAAE,CAAC,EACHjB,YAAY,CAAE,CAAEkC,QAAQ,EAAEP,QAAQ,MAAQ;EACzCX,QAAQA,CAAA,EAAG;IACV,MAAM;MAAEA,QAAQ,GAAGkB,QAAQ,CAAE/B,WAAY,CAAC,CAACa;IAAS,CAAC,GAAGW,QAAQ;IAChEX,QAAQ,CAAC,CAAC;EACX;AACD,CAAC,CAAG,CAAC,CACJ,CAAC,CAAEZ,eAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Component","compose","withSelect","withDispatch","store","coreStore","editorStore","AutosaveMonitor","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","select","ownProps","getReferenceByDistinctEdits","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","autosaveInterval","dispatch"],"sources":["@wordpress/editor/src/components/autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport class AutosaveMonitor extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.needsAutosave = !! ( props.isDirty && props.isAutosaveable );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.props.disableIntervalChecks ) {\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.disableIntervalChecks ) {\n\t\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\t\tthis.props.autosave();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.interval !== prevProps.interval ) {\n\t\t\tclearTimeout( this.timerId );\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\n\t\tif ( ! this.props.isDirty ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.isAutosaving && ! prevProps.isAutosaving ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\tthis.needsAutosave = true;\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timerId );\n\t}\n\n\tsetAutosaveTimer( timeout = this.props.interval * 1000 ) {\n\t\tthis.timerId = setTimeout( () => {\n\t\t\tthis.autosaveTimerHandler();\n\t\t}, timeout );\n\t}\n\n\tautosaveTimerHandler() {\n\t\tif ( ! this.props.isAutosaveable ) {\n\t\t\tthis.setAutosaveTimer( 1000 );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.needsAutosave ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\tthis.props.autosave();\n\t\t}\n\n\t\tthis.setAutosaveTimer();\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\n/**\n * Monitors the changes made to the edited post and triggers autosave if necessary.\n *\n * The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.\n * The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as\n * the specific way of detecting changes.\n *\n * There are two caveats:\n * * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.\n * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.\n *\n * @param {Object} props - The properties passed to the component.\n * @param {Function} props.autosave - The function to call when changes need to be saved.\n * @param {number} props.interval - The maximum time in seconds between an unsaved change and an autosave.\n * @param {boolean} props.isAutosaveable - If false, the check for changes is retried every second.\n * @param {boolean} props.disableIntervalChecks - If true, disables the timer and any change will immediately trigger `props.autosave()`.\n * @param {boolean} props.isDirty - Indicates if there are unsaved changes.\n *\n * @example\n * ```jsx\n * <AutosaveMonitor interval={30000} />\n * ```\n */\nexport default compose( [\n\twithSelect( ( select, ownProps ) => {\n\t\tconst { getReferenceByDistinctEdits } = select( coreStore );\n\n\t\tconst {\n\t\t\tisEditedPostDirty,\n\t\t\tisEditedPostAutosaveable,\n\t\t\tisAutosavingPost,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\n\t\tconst { interval = getEditorSettings().autosaveInterval } = ownProps;\n\n\t\treturn {\n\t\t\teditsReference: getReferenceByDistinctEdits(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisAutosaveable: isEditedPostAutosaveable(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\tinterval,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tautosave() {\n\t\t\tconst { autosave = dispatch( editorStore ).autosave } = ownProps;\n\t\t\tautosave();\n\t\t},\n\t} ) ),\n] )( AutosaveMonit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Q;EAEpE,OAAO;IACNZ,cAAc,EAAEa,2BAA2B,CAAC,CAAC;IAC7CpB,OAAO,EAAEqB,iBAAiB,CAAC,CAAC;IAC5BpB,cAAc,EAAEqB,wBAAwB,CAAC,CAAC;IAC1CV,YAAY,EAAEW,gBAAgB,CAAC,CAAC;IAChCd;EACD,CAAC;AACF,CAAE,CAAC,EACHjB,YAAY,CAAE,CAAEkC,QAAQ,EAAEP,QAAQ,MAAQ;EACzCX,QAAQA,CAAA,EAAG;IACV,MAAM;MAAEA,QAAQ,GAAGkB,QAAQ,CAAE/B,WAAY,CAAC,CAACa;IAAS,CAAC,GAAGW,QAAQ;IAChEX,QAAQ,CAAC,CAAC;EACX;AACD,CAAC,CAAG,CAAC,CACJ,CAAC,CAAEZ,eAAgB,CAAC","ignoreList":[]}
@@ -0,0 +1,119 @@
1
+ import { createElement, Fragment } from "react";
2
+ /**
3
+ * WordPress dependencies
4
+ */
5
+ import { BlockSettingsMenuControls, __unstableBlockSettingsMenuFirstItem as BlockSettingsMenuFirstItem, store as blockEditorStore, useBlockDisplayInformation } from '@wordpress/block-editor';
6
+ import { store as coreStore } from '@wordpress/core-data';
7
+ import { __experimentalText as Text, MenuItem } from '@wordpress/components';
8
+ import { useSelect, useDispatch } from '@wordpress/data';
9
+ import { __ } from '@wordpress/i18n';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import { store as editorStore } from '../../store';
15
+ import { unlock } from '../../lock-unlock';
16
+ function ContentOnlySettingsMenuItems({
17
+ clientId,
18
+ onClose
19
+ }) {
20
+ const {
21
+ entity,
22
+ onNavigateToEntityRecord
23
+ } = useSelect(select => {
24
+ const {
25
+ getBlockEditingMode,
26
+ getBlockParentsByBlockName,
27
+ getSettings,
28
+ getBlockAttributes
29
+ } = select(blockEditorStore);
30
+ const contentOnly = getBlockEditingMode(clientId) === 'contentOnly';
31
+ if (!contentOnly) {
32
+ return {};
33
+ }
34
+ const patternParent = getBlockParentsByBlockName(clientId, 'core/block', true)[0];
35
+ let record;
36
+ if (patternParent) {
37
+ record = select(coreStore).getEntityRecord('postType', 'wp_block', getBlockAttributes(patternParent).ref);
38
+ } else {
39
+ const {
40
+ getCurrentPostType,
41
+ getCurrentTemplateId
42
+ } = select(editorStore);
43
+ const currentPostType = getCurrentPostType();
44
+ const templateId = getCurrentTemplateId();
45
+ if (currentPostType === 'page' && templateId) {
46
+ record = select(coreStore).getEntityRecord('postType', 'wp_template', templateId);
47
+ }
48
+ }
49
+ return {
50
+ entity: record,
51
+ onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord
52
+ };
53
+ }, [clientId]);
54
+ if (!entity) {
55
+ return createElement(TemplateLockContentOnlyMenuItems, {
56
+ clientId: clientId,
57
+ onClose: onClose
58
+ });
59
+ }
60
+ const isPattern = entity.type === 'wp_block';
61
+ return createElement(Fragment, null, createElement(BlockSettingsMenuFirstItem, null, createElement(MenuItem, {
62
+ onClick: () => {
63
+ onNavigateToEntityRecord({
64
+ postId: entity.id,
65
+ postType: entity.type
66
+ });
67
+ }
68
+ }, isPattern ? __('Edit pattern') : __('Edit template'))), createElement(Text, {
69
+ variant: "muted",
70
+ as: "p",
71
+ className: "editor-content-only-settings-menu__description"
72
+ }, isPattern ? __('Edit the pattern to move, delete, or make further changes to this block.') : __('Edit the template to move, delete, or make further changes to this block.')));
73
+ }
74
+ function TemplateLockContentOnlyMenuItems({
75
+ clientId,
76
+ onClose
77
+ }) {
78
+ const {
79
+ contentLockingParent
80
+ } = useSelect(select => {
81
+ const {
82
+ getContentLockingParent
83
+ } = unlock(select(blockEditorStore));
84
+ return {
85
+ contentLockingParent: getContentLockingParent(clientId)
86
+ };
87
+ }, [clientId]);
88
+ const blockDisplayInformation = useBlockDisplayInformation(contentLockingParent);
89
+ // Disable reason: We're using a hook here so it has to be on top-level.
90
+ // eslint-disable-next-line @wordpress/no-unused-vars-before-return
91
+ const {
92
+ modifyContentLockBlock,
93
+ selectBlock
94
+ } = unlock(useDispatch(blockEditorStore));
95
+ if (!blockDisplayInformation?.title) {
96
+ return null;
97
+ }
98
+ return createElement(Fragment, null, createElement(BlockSettingsMenuFirstItem, null, createElement(MenuItem, {
99
+ onClick: () => {
100
+ selectBlock(contentLockingParent);
101
+ modifyContentLockBlock(contentLockingParent);
102
+ onClose();
103
+ }
104
+ }, __('Unlock'))), createElement(Text, {
105
+ variant: "muted",
106
+ as: "p",
107
+ className: "editor-content-only-settings-menu__description"
108
+ }, __('Temporarily unlock the parent block to edit, delete or make further changes to this block.')));
109
+ }
110
+ export default function ContentOnlySettingsMenu() {
111
+ return createElement(BlockSettingsMenuControls, null, ({
112
+ selectedClientIds,
113
+ onClose
114
+ }) => selectedClientIds.length === 1 && createElement(ContentOnlySettingsMenuItems, {
115
+ clientId: selectedClientIds[0],
116
+ onClose: onClose
117
+ }));
118
+ }
119
+ //# sourceMappingURL=content-only-settings-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BlockSettingsMenuControls","__unstableBlockSettingsMenuFirstItem","BlockSettingsMenuFirstItem","store","blockEditorStore","useBlockDisplayInformation","coreStore","__experimentalText","Text","MenuItem","useSelect","useDispatch","__","editorStore","unlock","ContentOnlySettingsMenuItems","clientId","onClose","entity","onNavigateToEntityRecord","select","getBlockEditingMode","getBlockParentsByBlockName","getSettings","getBlockAttributes","contentOnly","patternParent","record","getEntityRecord","ref","getCurrentPostType","getCurrentTemplateId","currentPostType","templateId","createElement","TemplateLockContentOnlyMenuItems","isPattern","type","Fragment","onClick","postId","id","postType","variant","as","className","contentLockingParent","getContentLockingParent","blockDisplayInformation","modifyContentLockBlock","selectBlock","title","ContentOnlySettingsMenu","selectedClientIds","length"],"sources":["@wordpress/editor/src/components/block-settings-menu/content-only-settings-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockSettingsMenuControls,\n\t__unstableBlockSettingsMenuFirstItem as BlockSettingsMenuFirstItem,\n\tstore as blockEditorStore,\n\tuseBlockDisplayInformation,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalText as Text, MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction ContentOnlySettingsMenuItems( { clientId, onClose } ) {\n\tconst { entity, onNavigateToEntityRecord } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockAttributes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst contentOnly =\n\t\t\t\tgetBlockEditingMode( clientId ) === 'contentOnly';\n\t\t\tif ( ! contentOnly ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst patternParent = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/block',\n\t\t\t\ttrue\n\t\t\t)[ 0 ];\n\n\t\t\tlet record;\n\t\t\tif ( patternParent ) {\n\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_block',\n\t\t\t\t\tgetBlockAttributes( patternParent ).ref\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst { getCurrentPostType, getCurrentTemplateId } =\n\t\t\t\t\tselect( editorStore );\n\t\t\t\tconst currentPostType = getCurrentPostType();\n\t\t\t\tconst templateId = getCurrentTemplateId();\n\t\t\t\tif ( currentPostType === 'page' && templateId ) {\n\t\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_template',\n\t\t\t\t\t\ttemplateId\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tentity: record,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tif ( ! entity ) {\n\t\treturn (\n\t\t\t<TemplateLockContentOnlyMenuItems\n\t\t\t\tclientId={ clientId }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst isPattern = entity.type === 'wp_block';\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\tpostId: entity.id,\n\t\t\t\t\t\t\tpostType: entity.type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ isPattern ? __( 'Edit pattern' ) : __( 'Edit template' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ isPattern\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Edit the pattern to move, delete, or make further changes to this block.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'Edit the template to move, delete, or make further changes to this block.'\n\t\t\t\t\t ) }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nfunction TemplateLockContentOnlyMenuItems( { clientId, onClose } ) {\n\tconst { contentLockingParent } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getContentLockingParent } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tcontentLockingParent: getContentLockingParent( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst blockDisplayInformation =\n\t\tuseBlockDisplayInformation( contentLockingParent );\n\t// Disable reason: We're using a hook here so it has to be on top-level.\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst { modifyContentLockBlock, selectBlock } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tif ( ! blockDisplayInformation?.title ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tselectBlock( contentLockingParent );\n\t\t\t\t\t\tmodifyContentLockBlock( contentLockingParent );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Unlock' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Temporarily unlock the parent block to edit, delete or make further changes to this block.'\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nexport default function ContentOnlySettingsMenu() {\n\treturn (\n\t\t<BlockSettingsMenuControls>\n\t\t\t{ ( { selectedClientIds, onClose } ) =>\n\t\t\t\tselectedClientIds.length === 1 && (\n\t\t\t\t\t<ContentOnlySettingsMenuItems\n\t\t\t\t\t\tclientId={ selectedClientIds[ 0 ] }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockSettingsMenuControls>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,yBAAyB,EACzBC,oCAAoC,IAAIC,0BAA0B,EAClEC,KAAK,IAAIC,gBAAgB,EACzBC,0BAA0B,QACpB,yBAAyB;AAChC,SAASF,KAAK,IAAIG,SAAS,QAAQ,sBAAsB;AACzD,SAASC,kBAAkB,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,uBAAuB;AAC5E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;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CAAC,GAAGpC,MAAM,CACrDH,WAAW,CAAEP,gBAAiB,CAC/B,CAAC;EAED,IAAK,CAAE4C,uBAAuB,EAAEG,KAAK,EAAG;IACvC,OAAO,IAAI;EACZ;EAEA,OACCjB,aAAA,CAAAI,QAAA,QACCJ,aAAA,CAAChC,0BAA0B,QAC1BgC,aAAA,CAACzB,QAAQ;IACR8B,OAAO,EAAGA,CAAA,KAAM;MACfW,WAAW,CAAEJ,oBAAqB,CAAC;MACnCG,sBAAsB,CAAEH,oBAAqB,CAAC;MAC9C7B,OAAO,CAAC,CAAC;IACV;EAAG,GAEDL,EAAE,CAAE,QAAS,CACN,CACiB,CAAC,EAC7BsB,aAAA,CAAC1B,IAAI;IACJmC,OAAO,EAAC,OAAO;IACfC,EAAE,EAAC,GAAG;IACNC,SAAS,EAAC;EAAgD,GAExDjC,EAAE,CACH,4FACD,CACK,CACL,CAAC;AAEL;AAEA,eAAe,SAASwC,uBAAuBA,CAAA,EAAG;EACjD,OACClB,aAAA,CAAClC,yBAAyB,QACvB,CAAE;IAAEqD,iBAAiB;IAAEpC;EAAQ,CAAC,KACjCoC,iBAAiB,CAACC,MAAM,KAAK,CAAC,IAC7BpB,aAAA,CAACnB,4BAA4B;IAC5BC,QAAQ,EAAGqC,iBAAiB,CAAE,CAAC,CAAI;IACnCpC,OAAO,EAAGA;EAAS,CACnB,CAGuB,CAAC;AAE9B","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ // Render nothing in native for now.
2
+ export default function ContentOnlySettingsMenu() {
3
+ return null;
4
+ }
5
+ //# sourceMappingURL=content-only-settings-menu.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ContentOnlySettingsMenu"],"sources":["@wordpress/editor/src/components/block-settings-menu/content-only-settings-menu.native.js"],"sourcesContent":["// Render nothing in native for now.\nexport default function ContentOnlySettingsMenu() {\n\treturn null;\n}\n"],"mappings":"AAAA;AACA,eAAe,SAASA,uBAAuBA,CAAA,EAAG;EACjD,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -8,6 +8,12 @@ import { count as characterCount } from '@wordpress/wordcount';
8
8
  * Internal dependencies
9
9
  */
10
10
  import { store as editorStore } from '../../store';
11
+
12
+ /**
13
+ * Renders the character count of the post content.
14
+ *
15
+ * @return {number} The character count.
16
+ */
11
17
  export default function CharacterCount() {
12
18
  const content = useSelect(select => select(editorStore).getEditedPostAttribute('content'), []);
13
19
  return characterCount(content, 'characters_including_spaces');
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","count","characterCount","store","editorStore","CharacterCount","content","select","getEditedPostAttribute"],"sources":["@wordpress/editor/src/components/character-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { count as characterCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function CharacterCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\treturn characterCount( content, 'characters_including_spaces' );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,cAAcA,CAAA,EAAG;EACxC,MAAMC,OAAO,GAAGN,SAAS,CACtBO,MAAM,IAAMA,MAAM,CAAEH,WAAY,CAAC,CAACI,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;EAED,OAAON,cAAc,CAAEI,OAAO,EAAE,6BAA8B,CAAC;AAChE","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","count","characterCount","store","editorStore","CharacterCount","content","select","getEditedPostAttribute"],"sources":["@wordpress/editor/src/components/character-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { count as characterCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the character count of the post content.\n *\n * @return {number} The character count.\n */\nexport default function CharacterCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\treturn characterCount( content, 'characters_including_spaces' );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,cAAcA,CAAA,EAAG;EACxC,MAAMC,OAAO,GAAGN,SAAS,CACtBO,MAAM,IAAMA,MAAM,CAAEH,WAAY,CAAC,CAACI,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;EAED,OAAON,cAAc,CAAEI,OAAO,EAAE,6BAA8B,CAAC;AAChE","ignoreList":[]}
@@ -0,0 +1,65 @@
1
+ import { createElement, Fragment } from "react";
2
+ /**
3
+ * External dependencies
4
+ */
5
+ import clsx from 'clsx';
6
+
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+ import { BlockToolbar, store as blockEditorStore, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
11
+ import { useEffect } from '@wordpress/element';
12
+ import { Button, Popover } from '@wordpress/components';
13
+ import { __ } from '@wordpress/i18n';
14
+ import { next, previous } from '@wordpress/icons';
15
+ import { useSelect } from '@wordpress/data';
16
+
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+ import { unlock } from '../../lock-unlock';
21
+ const {
22
+ useHasBlockToolbar
23
+ } = unlock(blockEditorPrivateApis);
24
+ function CollapsableBlockToolbar({
25
+ isCollapsed,
26
+ onToggle
27
+ }) {
28
+ const {
29
+ blockSelectionStart
30
+ } = useSelect(select => {
31
+ return {
32
+ blockSelectionStart: select(blockEditorStore).getBlockSelectionStart()
33
+ };
34
+ }, []);
35
+ const hasBlockToolbar = useHasBlockToolbar();
36
+ const hasBlockSelection = !!blockSelectionStart;
37
+ useEffect(() => {
38
+ // If we have a new block selection, show the block tools
39
+ if (blockSelectionStart) {
40
+ onToggle(false);
41
+ }
42
+ }, [blockSelectionStart, onToggle]);
43
+ if (!hasBlockToolbar) {
44
+ return null;
45
+ }
46
+ return createElement(Fragment, null, createElement("div", {
47
+ className: clsx('editor-collapsible-block-toolbar', {
48
+ 'is-collapsed': isCollapsed || !hasBlockSelection
49
+ })
50
+ }, createElement(BlockToolbar, {
51
+ hideDragHandle: true
52
+ })), createElement(Popover.Slot, {
53
+ name: "block-toolbar"
54
+ }), createElement(Button, {
55
+ className: "editor-collapsible-block-toolbar__toggle",
56
+ icon: isCollapsed ? next : previous,
57
+ onClick: () => {
58
+ onToggle(!isCollapsed);
59
+ },
60
+ label: isCollapsed ? __('Show block tools') : __('Hide block tools'),
61
+ size: "compact"
62
+ }));
63
+ }
64
+ export default CollapsableBlockToolbar;
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["clsx","BlockToolbar","store","blockEditorStore","privateApis","blockEditorPrivateApis","useEffect","Button","Popover","__","next","previous","useSelect","unlock","useHasBlockToolbar","CollapsableBlockToolbar","isCollapsed","onToggle","blockSelectionStart","select","getBlockSelectionStart","hasBlockToolbar","hasBlockSelection","createElement","Fragment","className","hideDragHandle","Slot","name","icon","onClick","label","size"],"sources":["@wordpress/editor/src/components/collapsible-block-toolbar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { Button, Popover } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useHasBlockToolbar } = unlock( blockEditorPrivateApis );\n\nfunction CollapsableBlockToolbar( { isCollapsed, onToggle } ) {\n\tconst { blockSelectionStart } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tblockSelectionStart:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\tconst hasBlockToolbar = useHasBlockToolbar();\n\n\tconst hasBlockSelection = !! blockSelectionStart;\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( blockSelectionStart ) {\n\t\t\tonToggle( false );\n\t\t}\n\t}, [ blockSelectionStart, onToggle ] );\n\n\tif ( ! hasBlockToolbar ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'editor-collapsible-block-toolbar', {\n\t\t\t\t\t'is-collapsed': isCollapsed || ! hasBlockSelection,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t</div>\n\t\t\t<Popover.Slot name=\"block-toolbar\" />\n\n\t\t\t<Button\n\t\t\t\tclassName=\"editor-collapsible-block-toolbar__toggle\"\n\t\t\t\ticon={ isCollapsed ? next : previous }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tonToggle( ! isCollapsed );\n\t\t\t\t} }\n\t\t\t\tlabel={\n\t\t\t\t\tisCollapsed\n\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t}\n\t\t\t\tsize=\"compact\"\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default CollapsableBlockToolbar;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,s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,EAAC,0CAA0C;IACpDI,IAAI,EAAGb,WAAW,GAAGN,IAAI,GAAGC,QAAU;IACtCmB,OAAO,EAAGA,CAAA,KAAM;MACfb,QAAQ,CAAE,CAAED,WAAY,CAAC;IAC1B,CAAG;IACHe,KAAK,EACJf,WAAW,GACRP,EAAE,CAAE,kBAAmB,CAAC,GACxBA,EAAE,CAAE,kBAAmB,CAC1B;IACDuB,IAAI,EAAC;EAAS,CACd,CACA,CAAC;AAEL;AAEA,eAAejB,uBAAuB","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -84,7 +84,7 @@ export default function DocumentBar() {
84
84
  mounted.current = true;
85
85
  }, []);
86
86
  return createElement("div", {
87
- className: classnames('editor-document-bar', {
87
+ className: clsx('editor-document-bar', {
88
88
  'has-back-button': hasBackButton,
89
89
  'is-global': isGlobalEntity
90
90
  })
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__","isRTL","sprintf","useSelect","useDispatch","Button","__experimentalText","Text","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","BlockIcon","chevronLeftSmall","chevronRightSmall","displayShortcut","store","coreStore","commandsStore","useRef","useEffect","useReducedMotion","editorStore","unlock","TYPE_LABELS","wp_pattern","wp_navigation","wp_template","wp_template_part","TEMPLATE_POST_TYPES","GLOBAL_POST_TYPES","MotionButton","DocumentBar","postType","document","isResolving","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","getEditedEntityRecord","isResolvingSelector","_postType","_postId","_document","_templateInfo","getPostIcon","area","title","open","openCommandCenter","isReducedMotion","isNotFound","isTemplate","includes","isGlobalEntity","hasBackButton","mounted","current","createElement","className","icon","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","div","key","as","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, sprintf } 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 } 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';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst TYPE_LABELS = {\n\t// translators: 1: Pattern title.\n\twp_pattern: __( 'Editing pattern: %s' ),\n\t// translators: 1: Navigation menu title.\n\twp_navigation: __( 'Editing navigation menu: %s' ),\n\t// translators: 1: Template title.\n\twp_template: __( 'Editing template: %s' ),\n\t// translators: 1: Template part title.\n\twp_template_part: __( 'Editing template part: %s' ),\n};\n\nconst TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];\n\nconst GLOBAL_POST_TYPES = [\n\t...TEMPLATE_POST_TYPES,\n\t'wp_block',\n\t'wp_navigation',\n];\n\nconst MotionButton = motion( Button );\n\nexport default function DocumentBar() {\n\tconst {\n\t\tpostType,\n\t\tdocument,\n\t\tisResolving,\n\t\ttemplateIcon,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\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} = select( editorStore );\n\t\tconst { getEditedEntityRecord, isResolving: isResolvingSelector } =\n\t\t\tselect( 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\treturn {\n\t\t\tpostType: _postType,\n\t\t\tdocument: _document,\n\t\t\tisResolving: isResolvingSelector(\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\t_postId\n\t\t\t),\n\t\t\ttemplateIcon: unlock( select( editorStore ) ).getPostIcon(\n\t\t\t\t_postType,\n\t\t\t\t{\n\t\t\t\t\tarea: _document?.area,\n\t\t\t\t}\n\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isNotFound = ! document && ! isResolving;\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst title = isTemplate ? templateTitle : document.title;\n\n\tconst mounted = useRef( false );\n\tuseEffect( () => {\n\t\tmounted.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t\t'is-global': isGlobalEntity,\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\tmounted.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{ 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\tmounted.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<BlockIcon icon={ templateIcon } />\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\tTYPE_LABELS[ postType ]\n\t\t\t\t\t\t\t\t\t? // eslint-disable-next-line @wordpress/valid-sprintf\n\t\t\t\t\t\t\t\t\t sprintf( TYPE_LABELS[ postType ], title )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,EAC1BC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,yBAAyB;AACnD,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,kBAAkB;AACtE,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,s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G,UAAU,EACTpB,eAAe,GAAG;MAAEqB,QAAQ,EAAE;IAAE,CAAC,GAAGC;EACpC,GAEDd,aAAA,CAACpD,SAAS;IAACsD,IAAI,EAAG9B;EAAc,CAAE,CAAC,EACnC4B,aAAA,CAACzD,IAAI;IACJ+D,IAAI,EAAC,MAAM;IACXW,EAAE,EAAC,IAAI;IACP,cACCzD,WAAW,CAAES,QAAQ,CAAE;IACpB;IACA/B,OAAO,CAAEsB,WAAW,CAAES,QAAQ,CAAE,EAAEoB,KAAM,CAAC,GACzCyB;EACH,GAECzB,KACG,CACK,CAAC,EACbW,aAAA;IAAMC,SAAS,EAAC;EAA+B,GAC5ClD,eAAe,CAACmE,OAAO,CAAE,GAAI,CAC1B,CACC,CAEL,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__","isRTL","sprintf","useSelect","useDispatch","Button","__experimentalText","Text","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","BlockIcon","chevronLeftSmall","chevronRightSmall","displayShortcut","store","coreStore","commandsStore","useRef","useEffect","useReducedMotion","editorStore","unlock","TYPE_LABELS","wp_pattern","wp_navigation","wp_template","wp_template_part","TEMPLATE_POST_TYPES","GLOBAL_POST_TYPES","MotionButton","DocumentBar","postType","document","isResolving","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","getEditedEntityRecord","isResolvingSelector","_postType","_postId","_document","_templateInfo","getPostIcon","area","title","open","openCommandCenter","isReducedMotion","isNotFound","isTemplate","includes","isGlobalEntity","hasBackButton","mounted","current","createElement","className","icon","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","div","key","as","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, sprintf } 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 } 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';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst TYPE_LABELS = {\n\t// translators: 1: Pattern title.\n\twp_pattern: __( 'Editing pattern: %s' ),\n\t// translators: 1: Navigation menu title.\n\twp_navigation: __( 'Editing navigation menu: %s' ),\n\t// translators: 1: Template title.\n\twp_template: __( 'Editing template: %s' ),\n\t// translators: 1: Template part title.\n\twp_template_part: __( 'Editing template part: %s' ),\n};\n\nconst TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];\n\nconst GLOBAL_POST_TYPES = [\n\t...TEMPLATE_POST_TYPES,\n\t'wp_block',\n\t'wp_navigation',\n];\n\nconst MotionButton = motion( Button );\n\nexport default function DocumentBar() {\n\tconst {\n\t\tpostType,\n\t\tdocument,\n\t\tisResolving,\n\t\ttemplateIcon,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\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} = select( editorStore );\n\t\tconst { getEditedEntityRecord, isResolving: isResolvingSelector } =\n\t\t\tselect( 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\treturn {\n\t\t\tpostType: _postType,\n\t\t\tdocument: _document,\n\t\t\tisResolving: isResolvingSelector(\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\t_postId\n\t\t\t),\n\t\t\ttemplateIcon: unlock( select( editorStore ) ).getPostIcon(\n\t\t\t\t_postType,\n\t\t\t\t{\n\t\t\t\t\tarea: _document?.area,\n\t\t\t\t}\n\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isNotFound = ! document && ! isResolving;\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst title = isTemplate ? templateTitle : document.title;\n\n\tconst mounted = useRef( false );\n\tuseEffect( () => {\n\t\tmounted.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\t'is-global': isGlobalEntity,\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\tmounted.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{ 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\tmounted.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<BlockIcon icon={ templateIcon } />\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\tTYPE_LABELS[ postType ]\n\t\t\t\t\t\t\t\t\t? // eslint-disable-next-line @wordpress/valid-sprintf\n\t\t\t\t\t\t\t\t\t sprintf( TYPE_LABELS[ postType ], title )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,EAC1BC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,yBAAyB;AACnD,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,kBAAkB;AACtE,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,SAASL,KAAK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+D,IAAI,EAAC,MAAM;IACXW,EAAE,EAAC,IAAI;IACP,cACCzD,WAAW,CAAES,QAAQ,CAAE;IACpB;IACA/B,OAAO,CAAEsB,WAAW,CAAES,QAAQ,CAAE,EAAEoB,KAAM,CAAC,GACzCyB;EACH,GAECzB,KACG,CACK,CAAC,EACbW,aAAA;IAAMC,SAAS,EAAC;EAA+B,GAC5ClD,eAAe,CAACmE,OAAO,CAAE,GAAI,CAC1B,CACC,CAEL,CAAC;AAER","ignoreList":[]}
@@ -3,6 +3,15 @@
3
3
  */
4
4
  import { useSelect } from '@wordpress/data';
5
5
  import { store as blockEditorStore } from '@wordpress/block-editor';
6
+
7
+ /**
8
+ * Component check if there are any headings (core/heading blocks) present in the document.
9
+ *
10
+ * @param {Object} props Props.
11
+ * @param {Element} props.children Children to be rendered.
12
+ *
13
+ * @return {Component|null} The component to be rendered or null if there are headings.
14
+ */
6
15
  export default function DocumentOutlineCheck({
7
16
  children
8
17
  }) {
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","blockEditorStore","DocumentOutlineCheck","children","hasHeadings","select","getGlobalBlockCount"],"sources":["@wordpress/editor/src/components/document-outline/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function DocumentOutlineCheck( { children } ) {\n\tconst hasHeadings = useSelect( ( select ) => {\n\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\n\t\treturn getGlobalBlockCount( 'core/heading' ) > 0;\n\t} );\n\n\tif ( hasHeadings ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AAEnE,eAAe,SAASC,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,WAAW,GAAGL,SAAS,CAAIM,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEJ,gBAAiB,CAAC;IAE1D,OAAOK,mBAAmB,CAAE,cAAe,CAAC,GAAG,CAAC;EACjD,CAAE,CAAC;EAEH,IAAKF,WAAW,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","blockEditorStore","DocumentOutlineCheck","children","hasHeadings","select","getGlobalBlockCount"],"sources":["@wordpress/editor/src/components/document-outline/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Component check if there are any headings (core/heading blocks) present in the document.\n *\n * @param {Object} props Props.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {Component|null} The component to be rendered or null if there are headings.\n */\nexport default function DocumentOutlineCheck( { children } ) {\n\tconst hasHeadings = useSelect( ( select ) => {\n\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\n\t\treturn getGlobalBlockCount( 'core/heading' ) > 0;\n\t} );\n\n\tif ( hasHeadings ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,WAAW,GAAGL,SAAS,CAAIM,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEJ,gBAAiB,CAAC;IAE1D,OAAOK,mBAAmB,CAAE,cAAe,CAAC,GAAG,CAAC;EACjD,CAAE,CAAC;EAEH,IAAKF,WAAW,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
@@ -135,6 +135,17 @@ const computeOutlineHeadings = (blocks = []) => {
135
135
  });
136
136
  };
137
137
  const isEmptyHeading = heading => !heading.attributes.content || heading.attributes.content.trim().length === 0;
138
+
139
+ /**
140
+ * Renders a document outline component.
141
+ *
142
+ * @param {Object} props Props.
143
+ * @param {Function} props.onSelect Function to be called when an outline item is selected.
144
+ * @param {boolean} props.isTitleSupported Indicates whether the title is supported.
145
+ * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.
146
+ *
147
+ * @return {Component} The component to be rendered.
148
+ */
138
149
  export default function DocumentOutline({
139
150
  onSelect,
140
151
  isTitleSupported,
@@ -1 +1 @@
1
- {"version":3,"names":["__","useDispatch","useSelect","create","getTextContent","store","blockEditorStore","coreStore","Path","SVG","Line","Rect","DocumentOutlineItem","editorStore","emptyHeadingContent","createElement","incorrectLevelContent","key","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","width","height","viewBox","fill","xmlns","rx","x1","y1","x2","y2","stroke","x","y","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","title","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","getPostType","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\nexport default function DocumentOutline( {\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ,sBAAsB;AAC7D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;;AAE7D;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,QAAQ;AACxC,SAASP,KAAK,IAAIQ,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA,M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A,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["__","useDispatch","useSelect","create","getTextContent","store","blockEditorStore","coreStore","Path","SVG","Line","Rect","DocumentOutlineItem","editorStore","emptyHeadingContent","createElement","incorrectLevelContent","key","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","width","height","viewBox","fill","xmlns","rx","x1","y1","x2","y2","stroke","x","y","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","title","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","getPostType","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\n/**\n * Renders a document outline component.\n *\n * @param {Object} props Props.\n * @param {Function} props.onSelect Function to be called when an outline item is selected.\n * @param {boolean} props.isTitleSupported Indicates whether the title is supported.\n * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function DocumentOutline( {\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ,sBAAsB;AAC7D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;;AAE7D;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,QAAQ;AACxC,SAASP,KAAK,IAAIQ,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA,MAAMC,mBAAmB,GAAGC,aAAA,aAAMf,EAAE,CAAE,iBAAkB,CAAO,CAAC;AAChE,MAAMgB,qBAAqB,GAAG,CAC7BD,aAAA;EAAIE,GAAG,EAAC;AAAiB,CAAE,CAAC,EAC5BF,aAAA;EAAIE,GAAG,EAAC;AAAmB,GAAGjB,EAAE,CAAE,2B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AAE,CAAEC,IAAI,EAAEC,KAAK,KAAM;IAClC;IACA;IACA,MAAMC,gBAAgB,GAAGF,IAAI,CAACtC,KAAK,GAAGwB,gBAAgB,GAAG,CAAC;IAE1D,MAAMS,OAAO,GACZ,CAAEK,IAAI,CAACpC,OAAO,IACd,CAAEsC,gBAAgB,IAClB,CAAC,CAAEF,IAAI,CAACtC,KAAK,KACXsC,IAAI,CAACtC,KAAK,KAAK,CAAC,IACf,CAAEgC,aAAa,IAAI,CAAEJ,QAAU,CAAE;IACrCJ,gBAAgB,GAAGc,IAAI,CAACtC,KAAK;IAE7B,OACCzB,aAAA,CAACH,mBAAmB;MACnBK,GAAG,EAAG8D,KAAO;MACbvC,KAAK,EAAI,IAAIsC,IAAI,CAACtC,KAAO,EAAG;MAC5BiC,OAAO,EAAGA,OAAS;MACnBG,UAAU,EAAGxB,uBAAyB;MACtCsB,IAAI,EAAI,UAAUI,IAAI,CAACG,QAAU,EAAG;MACpC/B,QAAQ,EAAGA,CAAA,KAAM;QAChBG,WAAW,CAAEyB,IAAI,CAACG,QAAS,CAAC;QAC5B/B,QAAQ,GAAG,CAAC;MACb;IAAG,GAED4B,IAAI,CAACpC,OAAO,GACX5B,mBAAmB,GACnBV,cAAc,CACdD,MAAM,CAAE;MACP+E,IAAI,EAAEJ,IAAI,CAACrC,UAAU,CAACK;IACvB,CAAE,CACF,CAAC,EACFkC,gBAAgB,IAAIhE,qBAAqB,EACzC8D,IAAI,CAACtC,KAAK,KAAK,CAAC,IACjBgC,aAAa,IACbrD,kBAAkB,EACjBiD,QAAQ,IACTU,IAAI,CAACtC,KAAK,KAAK,CAAC,IAChB,CAAEgC,aAAa,IACftD,gBACmB,CAAC;EAExB,CAAE,CACC,CACA,CAAC;AAER","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  const TableOfContentsItem = ({
7
7
  children,
8
8
  isValid,
@@ -10,7 +10,7 @@ const TableOfContentsItem = ({
10
10
  href,
11
11
  onSelect
12
12
  }) => createElement("li", {
13
- className: classnames('document-outline__item', `is-${level.toLowerCase()}`, {
13
+ className: clsx('document-outline__item', `is-${level.toLowerCase()}`, {
14
14
  'is-invalid': !isValid
15
15
  })
16
16
  }, createElement("a", {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","TableOfContentsItem","children","isValid","level","href","onSelect","createElement","className","toLowerCase","onClick"],"sources":["@wordpress/editor/src/components/document-outline/item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\nconst TableOfContentsItem = ( {\n\tchildren,\n\tisValid,\n\tlevel,\n\thref,\n\tonSelect,\n} ) => (\n\t<li\n\t\tclassName={ classnames(\n\t\t\t'document-outline__item',\n\t\t\t`is-${ level.toLowerCase() }`,\n\t\t\t{\n\t\t\t\t'is-invalid': ! isValid,\n\t\t\t}\n\t\t) }\n\t>\n\t\t<a\n\t\t\thref={ href }\n\t\t\tclassName=\"document-outline__button\"\n\t\t\tonClick={ onSelect }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"document-outline__emdash\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t></span>\n\t\t\t<strong className=\"document-outline__level\">{ level }</strong>\n\t\t\t<span className=\"document-outline__item-content\">{ children }</span>\n\t\t</a>\n\t</li>\n);\n\nexport default TableOfContentsItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAEnC,MAAMC,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KACAC,aAAA;EACCC,SAAS,EAAGR,UAAU,CACrB,wBAAwB,EACvB,MAAMI,KAAK,CAACK,WAAW,CAAC,CAAG,EAAC,EAC7B;IACC,YAAY,EAAE,CAAEN;EACjB,CACD;AAAG,GAEHI,aAAA;EACCF,IAAI,EAAGA,IAAM;EACbG,SAAS,EAAC,0BAA0B;EACpCE,OAAO,EAAGJ;AAAU,GAEpBC,aAAA;EACCC,SAAS,EAAC,0BAA0B;EACpC,eAAY;AAAM,CACZ,CAAC,EACRD,aAAA;EAAQC,SAAS,EAAC;AAAyB,GAAGJ,KAAe,CAAC,EAC9DG,aAAA;EAAMC,SAAS,EAAC;AAAgC,GAAGN,QAAgB,CACjE,CACA,CACJ;AAED,eAAeD,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","TableOfContentsItem","children","isValid","level","href","onSelect","createElement","className","toLowerCase","onClick"],"sources":["@wordpress/editor/src/components/document-outline/item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\nconst TableOfContentsItem = ( {\n\tchildren,\n\tisValid,\n\tlevel,\n\thref,\n\tonSelect,\n} ) => (\n\t<li\n\t\tclassName={ clsx(\n\t\t\t'document-outline__item',\n\t\t\t`is-${ level.toLowerCase() }`,\n\t\t\t{\n\t\t\t\t'is-invalid': ! isValid,\n\t\t\t}\n\t\t) }\n\t>\n\t\t<a\n\t\t\thref={ href }\n\t\t\tclassName=\"document-outline__button\"\n\t\t\tonClick={ onSelect }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"document-outline__emdash\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t></span>\n\t\t\t<strong className=\"document-outline__level\">{ level }</strong>\n\t\t\t<span className=\"document-outline__item-content\">{ children }</span>\n\t\t</a>\n\t</li>\n);\n\nexport default TableOfContentsItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAEvB,MAAMC,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KACAC,aAAA;EACCC,SAAS,EAAGR,IAAI,CACf,wBAAwB,EACvB,MAAMI,KAAK,CAACK,WAAW,CAAC,CAAG,EAAC,EAC7B;IACC,YAAY,EAAE,CAAEN;EACjB,CACD;AAAG,GAEHI,aAAA;EACCF,IAAI,EAAGA,IAAM;EACbG,SAAS,EAAC,0BAA0B;EACpCE,OAAO,EAAGJ;AAAU,GAEpBC,aAAA;EACCC,SAAS,EAAC,0BAA0B;EACpC,eAAY;AAAM,CACZ,CAAC,EACRD,aAAA;EAAQC,SAAS,EAAC;AAAyB,GAAGJ,KAAe,CAAC,EAC9DG,aAAA;EAAMC,SAAS,EAAC;AAAgC,GAAGN,QAAgB,CACjE,CACA,CACJ;AAED,eAAeD,mBAAmB","ignoreList":[]}