@wordpress/editor 13.35.0 → 14.0.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 (924) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +333 -39
  3. package/build/bindings/index.js +1 -3
  4. package/build/bindings/index.js.map +1 -1
  5. package/build/bindings/pattern-overrides.js +1 -1
  6. package/build/bindings/pattern-overrides.js.map +1 -1
  7. package/build/bindings/post-meta.js +38 -2
  8. package/build/bindings/post-meta.js.map +1 -1
  9. package/build/components/autocompleters/user.js +12 -8
  10. package/build/components/autocompleters/user.js.map +1 -1
  11. package/build/components/block-manager/category.js +19 -17
  12. package/build/components/block-manager/category.js.map +1 -1
  13. package/build/components/block-manager/checklist.js +15 -14
  14. package/build/components/block-manager/checklist.js.map +1 -1
  15. package/build/components/block-manager/index.js +37 -33
  16. package/build/components/block-manager/index.js.map +1 -1
  17. package/build/components/block-removal-warnings/index.js +2 -2
  18. package/build/components/block-removal-warnings/index.js.map +1 -1
  19. package/build/components/block-settings-menu/content-only-settings-menu.js +46 -32
  20. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  21. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  22. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  23. package/build/components/blog-title/index.js +116 -0
  24. package/build/components/blog-title/index.js.map +1 -0
  25. package/build/components/collapsible-block-toolbar/index.js +21 -18
  26. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  27. package/build/components/commands/index.js +109 -3
  28. package/build/components/commands/index.js.map +1 -1
  29. package/build/components/create-template-part-modal/index.js +167 -0
  30. package/build/components/create-template-part-modal/index.js.map +1 -0
  31. package/build/components/create-template-part-modal/utils.js +64 -0
  32. package/build/components/create-template-part-modal/utils.js.map +1 -0
  33. package/build/components/deprecated.js +2 -2
  34. package/build/components/deprecated.js.map +1 -1
  35. package/build/components/document-bar/index.js +94 -70
  36. package/build/components/document-bar/index.js.map +1 -1
  37. package/build/components/document-outline/index.js +124 -121
  38. package/build/components/document-outline/index.js.map +1 -1
  39. package/build/components/document-outline/item.js +18 -14
  40. package/build/components/document-outline/item.js.map +1 -1
  41. package/build/components/document-tools/index.js +56 -53
  42. package/build/components/document-tools/index.js.map +1 -1
  43. package/build/components/editor-help/add-blocks.native.js +14 -11
  44. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  45. package/build/components/editor-help/customize-blocks.native.js +14 -11
  46. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  47. package/build/components/editor-help/help-detail-navigation-screen.native.js +32 -22
  48. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  49. package/build/components/editor-help/help-get-support-button.native.js +8 -6
  50. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  51. package/build/components/editor-help/help-section-title.native.js +8 -6
  52. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  53. package/build/components/editor-help/help-topic-row.native.js +7 -6
  54. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  55. package/build/components/editor-help/icon-move-blocks.native.js +7 -6
  56. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  57. package/build/components/editor-help/index.native.js +94 -76
  58. package/build/components/editor-help/index.native.js.map +1 -1
  59. package/build/components/editor-help/intro-to-blocks.native.js +41 -37
  60. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  61. package/build/components/editor-help/move-blocks.native.js +25 -21
  62. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  63. package/build/components/editor-help/remove-blocks.native.js +12 -9
  64. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  65. package/build/components/editor-help/view-sections.native.js +24 -19
  66. package/build/components/editor-help/view-sections.native.js.map +1 -1
  67. package/build/components/editor-history/redo.js +2 -2
  68. package/build/components/editor-history/redo.js.map +1 -1
  69. package/build/components/editor-history/undo.js +2 -2
  70. package/build/components/editor-history/undo.js.map +1 -1
  71. package/build/components/editor-interface/content-slot-fill.js +23 -0
  72. package/build/components/editor-interface/content-slot-fill.js.map +1 -0
  73. package/build/components/editor-interface/index.js +178 -0
  74. package/build/components/editor-interface/index.js.map +1 -0
  75. package/build/components/editor-notices/index.js +22 -9
  76. package/build/components/editor-notices/index.js.map +1 -1
  77. package/build/components/editor-snackbars/index.js +2 -2
  78. package/build/components/editor-snackbars/index.js.map +1 -1
  79. package/build/components/entities-saved-states/entity-record-item.js +37 -10
  80. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  81. package/build/components/entities-saved-states/entity-type-list.js +25 -22
  82. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  83. package/build/components/entities-saved-states/index.js +53 -46
  84. package/build/components/entities-saved-states/index.js.map +1 -1
  85. package/build/components/error-boundary/index.js +27 -14
  86. package/build/components/error-boundary/index.js.map +1 -1
  87. package/build/components/error-boundary/index.native.js +45 -35
  88. package/build/components/error-boundary/index.native.js.map +1 -1
  89. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -4
  90. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  91. package/build/components/global-styles-provider/index.js +81 -16
  92. package/build/components/global-styles-provider/index.js.map +1 -1
  93. package/build/components/header/back-button.js +34 -0
  94. package/build/components/header/back-button.js.map +1 -0
  95. package/build/components/header/index.js +88 -59
  96. package/build/components/header/index.js.map +1 -1
  97. package/build/components/inserter-sidebar/index.js +45 -19
  98. package/build/components/inserter-sidebar/index.js.map +1 -1
  99. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  100. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  101. package/build/components/keyboard-shortcut-help-modal/index.js +53 -48
  102. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  103. package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
  104. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  105. package/build/components/list-view-sidebar/index.js +59 -47
  106. package/build/components/list-view-sidebar/index.js.map +1 -1
  107. package/build/components/list-view-sidebar/list-view-outline.js +21 -4
  108. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  109. package/build/components/local-autosave-monitor/index.js +15 -2
  110. package/build/components/local-autosave-monitor/index.js.map +1 -1
  111. package/build/components/mode-switcher/index.js +10 -10
  112. package/build/components/mode-switcher/index.js.map +1 -1
  113. package/build/components/more-menu/copy-content-menu-item.js +5 -4
  114. package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
  115. package/build/components/more-menu/index.js +89 -76
  116. package/build/components/more-menu/index.js.map +1 -1
  117. package/build/components/more-menu/tools-more-menu-group.js +2 -2
  118. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  119. package/build/components/more-menu/view-more-menu-group.js +2 -2
  120. package/build/components/more-menu/view-more-menu-group.js.map +1 -1
  121. package/build/components/offline-status/index.native.js +12 -11
  122. package/build/components/offline-status/index.native.js.map +1 -1
  123. package/build/components/page-attributes/order.js +87 -14
  124. package/build/components/page-attributes/order.js.map +1 -1
  125. package/build/components/page-attributes/panel.js +10 -19
  126. package/build/components/page-attributes/panel.js.map +1 -1
  127. package/build/components/page-attributes/parent.js +86 -3
  128. package/build/components/page-attributes/parent.js.map +1 -1
  129. package/build/components/pattern-duplicate-modal/index.js +59 -0
  130. package/build/components/pattern-duplicate-modal/index.js.map +1 -0
  131. package/build/components/pattern-overrides-panel/index.js +2 -2
  132. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  133. package/build/components/pattern-rename-modal/index.js +58 -0
  134. package/build/components/pattern-rename-modal/index.js.map +1 -0
  135. package/build/components/plugin-document-setting-panel/index.js +17 -12
  136. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  137. package/build/components/plugin-post-publish-panel/index.js +10 -7
  138. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  139. package/build/components/plugin-post-status-info/index.js +7 -4
  140. package/build/components/plugin-post-status-info/index.js.map +1 -1
  141. package/build/components/plugin-pre-publish-panel/index.js +10 -7
  142. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  143. package/build/components/plugin-sidebar/index.js +3 -4
  144. package/build/components/plugin-sidebar/index.js.map +1 -1
  145. package/build/components/plugin-sidebar-more-menu-item/index.js +3 -5
  146. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  147. package/build/components/post-actions/actions.js +378 -309
  148. package/build/components/post-actions/actions.js.map +1 -1
  149. package/build/components/post-actions/export-pattern-action.js +64 -0
  150. package/build/components/post-actions/export-pattern-action.js.map +1 -0
  151. package/build/components/post-actions/export-pattern-action.native.js +11 -0
  152. package/build/components/post-actions/export-pattern-action.native.js.map +1 -0
  153. package/build/components/post-actions/index.js +66 -50
  154. package/build/components/post-actions/index.js.map +1 -1
  155. package/build/components/post-author/check.js +6 -6
  156. package/build/components/post-author/check.js.map +1 -1
  157. package/build/components/post-author/combobox.js +4 -3
  158. package/build/components/post-author/combobox.js.map +1 -1
  159. package/build/components/post-author/hook.js +2 -1
  160. package/build/components/post-author/hook.js.map +1 -1
  161. package/build/components/post-author/index.js +3 -3
  162. package/build/components/post-author/index.js.map +1 -1
  163. package/build/components/post-author/panel.js +72 -4
  164. package/build/components/post-author/panel.js.map +1 -1
  165. package/build/components/post-author/select.js +4 -3
  166. package/build/components/post-author/select.js.map +1 -1
  167. package/build/components/post-card-panel/index.js +54 -19
  168. package/build/components/post-card-panel/index.js.map +1 -1
  169. package/build/components/post-comments/index.js +38 -22
  170. package/build/components/post-comments/index.js.map +1 -1
  171. package/build/components/post-content-information/index.js +8 -5
  172. package/build/components/post-content-information/index.js.map +1 -1
  173. package/build/components/post-discussion/panel.js +54 -38
  174. package/build/components/post-discussion/panel.js.map +1 -1
  175. package/build/components/post-excerpt/check.js +6 -6
  176. package/build/components/post-excerpt/check.js.map +1 -1
  177. package/build/components/post-excerpt/index.js +18 -17
  178. package/build/components/post-excerpt/index.js.map +1 -1
  179. package/build/components/post-excerpt/panel.js +59 -42
  180. package/build/components/post-excerpt/panel.js.map +1 -1
  181. package/build/components/post-excerpt/plugin.js +7 -4
  182. package/build/components/post-excerpt/plugin.js.map +1 -1
  183. package/build/components/post-featured-image/check.js +17 -7
  184. package/build/components/post-featured-image/check.js.map +1 -1
  185. package/build/components/post-featured-image/index.js +77 -49
  186. package/build/components/post-featured-image/index.js.map +1 -1
  187. package/build/components/post-featured-image/panel.js +22 -7
  188. package/build/components/post-featured-image/panel.js.map +1 -1
  189. package/build/components/post-format/check.js +14 -4
  190. package/build/components/post-format/check.js.map +1 -1
  191. package/build/components/post-format/index.js +37 -20
  192. package/build/components/post-format/index.js.map +1 -1
  193. package/build/components/post-format/panel.js +73 -7
  194. package/build/components/post-format/panel.js.map +1 -1
  195. package/build/components/post-last-edited-panel/index.js +7 -4
  196. package/build/components/post-last-edited-panel/index.js.map +1 -1
  197. package/build/components/post-last-revision/check.js +13 -5
  198. package/build/components/post-last-revision/check.js.map +1 -1
  199. package/build/components/post-last-revision/index.js +19 -13
  200. package/build/components/post-last-revision/index.js.map +1 -1
  201. package/build/components/post-last-revision/panel.js +12 -5
  202. package/build/components/post-last-revision/panel.js.map +1 -1
  203. package/build/components/post-locked-modal/index.js +57 -35
  204. package/build/components/post-locked-modal/index.js.map +1 -1
  205. package/build/components/post-panel-row/index.js +11 -8
  206. package/build/components/post-panel-row/index.js.map +1 -1
  207. package/build/components/post-panel-section/index.js +5 -4
  208. package/build/components/post-panel-section/index.js.map +1 -1
  209. package/build/components/post-pending-status/check.js +10 -0
  210. package/build/components/post-pending-status/check.js.map +1 -1
  211. package/build/components/post-pending-status/index.js +14 -7
  212. package/build/components/post-pending-status/index.js.map +1 -1
  213. package/build/components/post-pingbacks/index.js +13 -5
  214. package/build/components/post-pingbacks/index.js.map +1 -1
  215. package/build/components/post-preview-button/index.js +45 -21
  216. package/build/components/post-preview-button/index.js.map +1 -1
  217. package/build/components/post-publish-button/index.js +21 -11
  218. package/build/components/post-publish-button/index.js.map +1 -1
  219. package/build/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  220. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  221. package/build/components/post-publish-panel/index.js +46 -33
  222. package/build/components/post-publish-panel/index.js.map +1 -1
  223. package/build/components/post-publish-panel/maybe-category-panel.js +12 -9
  224. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  225. package/build/components/post-publish-panel/maybe-post-format-panel.js +21 -15
  226. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  227. package/build/components/post-publish-panel/maybe-tags-panel.js +13 -10
  228. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  229. package/build/components/post-publish-panel/maybe-upload-media.js +29 -24
  230. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  231. package/build/components/post-publish-panel/postpublish.js +55 -38
  232. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  233. package/build/components/post-publish-panel/prepublish.js +41 -26
  234. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  235. package/build/components/post-saved-state/index.js +8 -8
  236. package/build/components/post-saved-state/index.js.map +1 -1
  237. package/build/components/post-schedule/check.js +8 -0
  238. package/build/components/post-schedule/check.js.map +1 -1
  239. package/build/components/post-schedule/index.js +30 -5
  240. package/build/components/post-schedule/index.js.map +1 -1
  241. package/build/components/post-schedule/label.js +16 -0
  242. package/build/components/post-schedule/label.js.map +1 -1
  243. package/build/components/post-schedule/panel.js +43 -30
  244. package/build/components/post-schedule/panel.js.map +1 -1
  245. package/build/components/post-slug/check.js +5 -4
  246. package/build/components/post-slug/check.js.map +1 -1
  247. package/build/components/post-slug/index.js +5 -3
  248. package/build/components/post-slug/index.js.map +1 -1
  249. package/build/components/post-slug/panel.js +7 -4
  250. package/build/components/post-slug/panel.js.map +1 -1
  251. package/build/components/post-status/index.js +118 -119
  252. package/build/components/post-status/index.js.map +1 -1
  253. package/build/components/post-sticky/index.js +16 -8
  254. package/build/components/post-sticky/index.js.map +1 -1
  255. package/build/components/post-sticky/panel.js +6 -2
  256. package/build/components/post-sticky/panel.js.map +1 -1
  257. package/build/components/post-switch-to-draft-button/index.js +25 -21
  258. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  259. package/build/components/post-sync-status/index.js +8 -6
  260. package/build/components/post-sync-status/index.js.map +1 -1
  261. package/build/components/post-taxonomies/flat-term-selector.js +21 -20
  262. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  263. package/build/components/post-taxonomies/hierarchical-term-selector.js +71 -61
  264. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  265. package/build/components/post-taxonomies/index.js +6 -6
  266. package/build/components/post-taxonomies/index.js.map +1 -1
  267. package/build/components/post-taxonomies/most-used-terms.js +19 -15
  268. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  269. package/build/components/post-taxonomies/panel.js +15 -11
  270. package/build/components/post-taxonomies/panel.js.map +1 -1
  271. package/build/components/post-template/block-theme.js +42 -32
  272. package/build/components/post-template/block-theme.js.map +1 -1
  273. package/build/components/post-template/classic-theme.js +73 -50
  274. package/build/components/post-template/classic-theme.js.map +1 -1
  275. package/build/components/post-template/create-new-template-modal.js +33 -27
  276. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  277. package/build/components/post-template/create-new-template.js +14 -11
  278. package/build/components/post-template/create-new-template.js.map +1 -1
  279. package/build/components/post-template/panel.js +16 -10
  280. package/build/components/post-template/panel.js.map +1 -1
  281. package/build/components/post-template/reset-default-template.js +5 -4
  282. package/build/components/post-template/reset-default-template.js.map +1 -1
  283. package/build/components/post-template/swap-template-button.js +20 -15
  284. package/build/components/post-template/swap-template-button.js.map +1 -1
  285. package/build/components/post-text-editor/index.js +27 -20
  286. package/build/components/post-text-editor/index.js.map +1 -1
  287. package/build/components/post-title/index.js +29 -17
  288. package/build/components/post-title/index.js.map +1 -1
  289. package/build/components/post-title/index.native.js +81 -57
  290. package/build/components/post-title/index.native.js.map +1 -1
  291. package/build/components/post-title/post-title-raw.js +10 -3
  292. package/build/components/post-title/post-title-raw.js.map +1 -1
  293. package/build/components/post-title/use-post-title-focus.js +7 -0
  294. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  295. package/build/components/post-title/use-post-title.js +5 -0
  296. package/build/components/post-title/use-post-title.js.map +1 -1
  297. package/build/components/post-transform-panel/index.js +11 -11
  298. package/build/components/post-transform-panel/index.js.map +1 -1
  299. package/build/components/post-trash/index.js +19 -15
  300. package/build/components/post-trash/index.js.map +1 -1
  301. package/build/components/post-url/check.js +8 -0
  302. package/build/components/post-url/check.js.map +1 -1
  303. package/build/components/post-url/index.js +98 -73
  304. package/build/components/post-url/index.js.map +1 -1
  305. package/build/components/post-url/label.js +11 -0
  306. package/build/components/post-url/label.js.map +1 -1
  307. package/build/components/post-url/panel.js +33 -25
  308. package/build/components/post-url/panel.js.map +1 -1
  309. package/build/components/post-view-link/index.js +2 -2
  310. package/build/components/post-view-link/index.js.map +1 -1
  311. package/build/components/post-visibility/check.js +9 -0
  312. package/build/components/post-visibility/check.js.map +1 -1
  313. package/build/components/post-visibility/index.js +83 -68
  314. package/build/components/post-visibility/index.js.map +1 -1
  315. package/build/components/post-visibility/label.js +11 -0
  316. package/build/components/post-visibility/label.js.map +1 -1
  317. package/build/components/posts-per-page/index.js +109 -0
  318. package/build/components/posts-per-page/index.js.map +1 -0
  319. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  320. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  321. package/build/components/preferences-modal/index.js +124 -102
  322. package/build/components/preferences-modal/index.js.map +1 -1
  323. package/build/components/preview-dropdown/index.js +47 -31
  324. package/build/components/preview-dropdown/index.js.map +1 -1
  325. package/build/components/provider/index.js +94 -20
  326. package/build/components/provider/index.js.map +1 -1
  327. package/build/components/provider/index.native.js +55 -19
  328. package/build/components/provider/index.native.js.map +1 -1
  329. package/build/components/provider/use-block-editor-settings.js +7 -6
  330. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  331. package/build/components/provider/with-registry-provider.js +31 -24
  332. package/build/components/provider/with-registry-provider.js.map +1 -1
  333. package/build/components/resizable-editor/index.js +96 -0
  334. package/build/components/resizable-editor/index.js.map +1 -0
  335. package/build/components/resizable-editor/resize-handle.js +59 -0
  336. package/build/components/resizable-editor/resize-handle.js.map +1 -0
  337. package/build/components/save-publish-panels/index.js +35 -26
  338. package/build/components/save-publish-panels/index.js.map +1 -1
  339. package/build/components/sidebar/header.js +17 -14
  340. package/build/components/sidebar/header.js.map +1 -1
  341. package/build/components/sidebar/index.js +36 -32
  342. package/build/components/sidebar/index.js.map +1 -1
  343. package/build/components/sidebar/post-summary.js +38 -33
  344. package/build/components/sidebar/post-summary.js.map +1 -1
  345. package/build/components/site-discussion/index.js +133 -0
  346. package/build/components/site-discussion/index.js.map +1 -0
  347. package/build/components/start-page-options/index.js +13 -11
  348. package/build/components/start-page-options/index.js.map +1 -1
  349. package/build/components/start-template-options/index.js +29 -23
  350. package/build/components/start-template-options/index.js.map +1 -1
  351. package/build/components/table-of-contents/index.js +4 -4
  352. package/build/components/table-of-contents/index.js.map +1 -1
  353. package/build/components/table-of-contents/panel.js +53 -35
  354. package/build/components/table-of-contents/panel.js.map +1 -1
  355. package/build/components/template-areas/index.js +36 -22
  356. package/build/components/template-areas/index.js.map +1 -1
  357. package/build/components/template-content-panel/index.js +7 -6
  358. package/build/components/template-content-panel/index.js.map +1 -1
  359. package/build/components/template-validation-notice/index.js +25 -21
  360. package/build/components/template-validation-notice/index.js.map +1 -1
  361. package/build/components/text-editor/index.js +73 -0
  362. package/build/components/text-editor/index.js.map +1 -0
  363. package/build/components/time-to-read/index.js +8 -8
  364. package/build/components/time-to-read/index.js.map +1 -1
  365. package/build/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +6 -6
  366. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  367. package/build/components/{editor-canvas → visual-editor}/index.js +115 -74
  368. package/build/components/visual-editor/index.js.map +1 -0
  369. package/build/components/word-count/index.js +5 -4
  370. package/build/components/word-count/index.js.map +1 -1
  371. package/build/hooks/custom-sources-backwards-compatibility.js +3 -4
  372. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  373. package/build/hooks/index.js +1 -0
  374. package/build/hooks/index.js.map +1 -1
  375. package/build/hooks/media-upload.js +10 -0
  376. package/build/hooks/media-upload.js.map +1 -0
  377. package/build/hooks/pattern-overrides.js +15 -11
  378. package/build/hooks/pattern-overrides.js.map +1 -1
  379. package/build/private-apis.js +10 -28
  380. package/build/private-apis.js.map +1 -1
  381. package/build/private-apis.native.js +2 -26
  382. package/build/private-apis.native.js.map +1 -1
  383. package/build/store/constants.js +4 -1
  384. package/build/store/constants.js.map +1 -1
  385. package/build/store/private-actions.js +10 -14
  386. package/build/store/private-actions.js.map +1 -1
  387. package/build/store/private-selectors.js +39 -1
  388. package/build/store/private-selectors.js.map +1 -1
  389. package/build/store/selectors.js +1 -1
  390. package/build/store/selectors.js.map +1 -1
  391. package/build/utils/set-nested-value.js +44 -0
  392. package/build/utils/set-nested-value.js.map +1 -0
  393. package/build-module/bindings/index.js +1 -3
  394. package/build-module/bindings/index.js.map +1 -1
  395. package/build-module/bindings/pattern-overrides.js +1 -1
  396. package/build-module/bindings/pattern-overrides.js.map +1 -1
  397. package/build-module/bindings/post-meta.js +38 -2
  398. package/build-module/bindings/post-meta.js.map +1 -1
  399. package/build-module/components/autocompleters/user.js +14 -9
  400. package/build-module/components/autocompleters/user.js.map +1 -1
  401. package/build-module/components/block-manager/category.js +20 -17
  402. package/build-module/components/block-manager/category.js.map +1 -1
  403. package/build-module/components/block-manager/checklist.js +16 -14
  404. package/build-module/components/block-manager/checklist.js.map +1 -1
  405. package/build-module/components/block-manager/index.js +38 -33
  406. package/build-module/components/block-manager/index.js.map +1 -1
  407. package/build-module/components/block-removal-warnings/index.js +2 -2
  408. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  409. package/build-module/components/block-settings-menu/content-only-settings-menu.js +48 -32
  410. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  411. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
  412. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  413. package/build-module/components/blog-title/index.js +110 -0
  414. package/build-module/components/blog-title/index.js.map +1 -0
  415. package/build-module/components/collapsible-block-toolbar/index.js +23 -18
  416. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  417. package/build-module/components/commands/index.js +111 -5
  418. package/build-module/components/commands/index.js.map +1 -1
  419. package/build-module/components/create-template-part-modal/index.js +160 -0
  420. package/build-module/components/create-template-part-modal/index.js.map +1 -0
  421. package/build-module/components/create-template-part-modal/utils.js +54 -0
  422. package/build-module/components/create-template-part-modal/utils.js.map +1 -0
  423. package/build-module/components/deprecated.js +2 -2
  424. package/build-module/components/deprecated.js.map +1 -1
  425. package/build-module/components/document-bar/index.js +93 -68
  426. package/build-module/components/document-bar/index.js.map +1 -1
  427. package/build-module/components/document-outline/index.js +125 -120
  428. package/build-module/components/document-outline/index.js.map +1 -1
  429. package/build-module/components/document-outline/item.js +19 -14
  430. package/build-module/components/document-outline/item.js.map +1 -1
  431. package/build-module/components/document-tools/index.js +58 -53
  432. package/build-module/components/document-tools/index.js.map +1 -1
  433. package/build-module/components/editor-help/add-blocks.native.js +16 -11
  434. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  435. package/build-module/components/editor-help/customize-blocks.native.js +16 -11
  436. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  437. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +33 -22
  438. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  439. package/build-module/components/editor-help/help-get-support-button.native.js +8 -6
  440. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  441. package/build-module/components/editor-help/help-section-title.native.js +8 -6
  442. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  443. package/build-module/components/editor-help/help-topic-row.native.js +7 -6
  444. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  445. package/build-module/components/editor-help/icon-move-blocks.native.js +7 -6
  446. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  447. package/build-module/components/editor-help/index.native.js +96 -76
  448. package/build-module/components/editor-help/index.native.js.map +1 -1
  449. package/build-module/components/editor-help/intro-to-blocks.native.js +43 -37
  450. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  451. package/build-module/components/editor-help/move-blocks.native.js +27 -21
  452. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  453. package/build-module/components/editor-help/remove-blocks.native.js +14 -9
  454. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  455. package/build-module/components/editor-help/view-sections.native.js +25 -19
  456. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  457. package/build-module/components/editor-history/redo.js +2 -2
  458. package/build-module/components/editor-history/redo.js.map +1 -1
  459. package/build-module/components/editor-history/undo.js +2 -2
  460. package/build-module/components/editor-history/undo.js.map +1 -1
  461. package/build-module/components/editor-interface/content-slot-fill.js +16 -0
  462. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -0
  463. package/build-module/components/editor-interface/index.js +172 -0
  464. package/build-module/components/editor-interface/index.js.map +1 -0
  465. package/build-module/components/editor-notices/index.js +25 -9
  466. package/build-module/components/editor-notices/index.js.map +1 -1
  467. package/build-module/components/editor-snackbars/index.js +2 -2
  468. package/build-module/components/editor-snackbars/index.js.map +1 -1
  469. package/build-module/components/entities-saved-states/entity-record-item.js +40 -11
  470. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  471. package/build-module/components/entities-saved-states/entity-type-list.js +26 -22
  472. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  473. package/build-module/components/entities-saved-states/index.js +54 -46
  474. package/build-module/components/entities-saved-states/index.js.map +1 -1
  475. package/build-module/components/error-boundary/index.js +27 -14
  476. package/build-module/components/error-boundary/index.js.map +1 -1
  477. package/build-module/components/error-boundary/index.native.js +46 -35
  478. package/build-module/components/error-boundary/index.native.js.map +1 -1
  479. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +2 -2
  480. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  481. package/build-module/components/global-styles-provider/index.js +82 -17
  482. package/build-module/components/global-styles-provider/index.js.map +1 -1
  483. package/build-module/components/header/back-button.js +28 -0
  484. package/build-module/components/header/back-button.js.map +1 -0
  485. package/build-module/components/header/index.js +89 -59
  486. package/build-module/components/header/index.js.map +1 -1
  487. package/build-module/components/inserter-sidebar/index.js +47 -21
  488. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  489. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  490. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  491. package/build-module/components/keyboard-shortcut-help-modal/index.js +54 -48
  492. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  493. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
  494. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  495. package/build-module/components/list-view-sidebar/index.js +60 -47
  496. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  497. package/build-module/components/list-view-sidebar/list-view-outline.js +23 -4
  498. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  499. package/build-module/components/local-autosave-monitor/index.js +15 -2
  500. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  501. package/build-module/components/mode-switcher/index.js +9 -8
  502. package/build-module/components/mode-switcher/index.js.map +1 -1
  503. package/build-module/components/more-menu/copy-content-menu-item.js +5 -4
  504. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
  505. package/build-module/components/more-menu/index.js +91 -76
  506. package/build-module/components/more-menu/index.js.map +1 -1
  507. package/build-module/components/more-menu/tools-more-menu-group.js +2 -2
  508. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  509. package/build-module/components/more-menu/view-more-menu-group.js +2 -2
  510. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
  511. package/build-module/components/offline-status/index.native.js +12 -9
  512. package/build-module/components/offline-status/index.native.js.map +1 -1
  513. package/build-module/components/page-attributes/order.js +90 -17
  514. package/build-module/components/page-attributes/order.js.map +1 -1
  515. package/build-module/components/page-attributes/panel.js +13 -21
  516. package/build-module/components/page-attributes/panel.js.map +1 -1
  517. package/build-module/components/page-attributes/parent.js +88 -5
  518. package/build-module/components/page-attributes/parent.js.map +1 -1
  519. package/build-module/components/pattern-duplicate-modal/index.js +51 -0
  520. package/build-module/components/pattern-duplicate-modal/index.js.map +1 -0
  521. package/build-module/components/pattern-overrides-panel/index.js +2 -2
  522. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  523. package/build-module/components/pattern-rename-modal/index.js +50 -0
  524. package/build-module/components/pattern-rename-modal/index.js.map +1 -0
  525. package/build-module/components/plugin-document-setting-panel/index.js +19 -12
  526. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  527. package/build-module/components/plugin-post-publish-panel/index.js +10 -7
  528. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  529. package/build-module/components/plugin-post-status-info/index.js +7 -4
  530. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  531. package/build-module/components/plugin-pre-publish-panel/index.js +10 -7
  532. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  533. package/build-module/components/plugin-sidebar/index.js +2 -2
  534. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  535. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -3
  536. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  537. package/build-module/components/post-actions/actions.js +379 -309
  538. package/build-module/components/post-actions/actions.js.map +1 -1
  539. package/build-module/components/post-actions/export-pattern-action.js +58 -0
  540. package/build-module/components/post-actions/export-pattern-action.js.map +1 -0
  541. package/build-module/components/post-actions/export-pattern-action.native.js +5 -0
  542. package/build-module/components/post-actions/export-pattern-action.native.js.map +1 -0
  543. package/build-module/components/post-actions/index.js +68 -50
  544. package/build-module/components/post-actions/index.js.map +1 -1
  545. package/build-module/components/post-author/check.js +5 -4
  546. package/build-module/components/post-author/check.js.map +1 -1
  547. package/build-module/components/post-author/combobox.js +4 -3
  548. package/build-module/components/post-author/combobox.js.map +1 -1
  549. package/build-module/components/post-author/hook.js +2 -1
  550. package/build-module/components/post-author/hook.js.map +1 -1
  551. package/build-module/components/post-author/index.js +3 -3
  552. package/build-module/components/post-author/index.js.map +1 -1
  553. package/build-module/components/post-author/panel.js +72 -4
  554. package/build-module/components/post-author/panel.js.map +1 -1
  555. package/build-module/components/post-author/select.js +4 -3
  556. package/build-module/components/post-author/select.js.map +1 -1
  557. package/build-module/components/post-card-panel/index.js +54 -20
  558. package/build-module/components/post-card-panel/index.js.map +1 -1
  559. package/build-module/components/post-comments/index.js +40 -22
  560. package/build-module/components/post-comments/index.js.map +1 -1
  561. package/build-module/components/post-content-information/index.js +8 -5
  562. package/build-module/components/post-content-information/index.js.map +1 -1
  563. package/build-module/components/post-discussion/panel.js +56 -39
  564. package/build-module/components/post-discussion/panel.js.map +1 -1
  565. package/build-module/components/post-excerpt/check.js +5 -4
  566. package/build-module/components/post-excerpt/check.js.map +1 -1
  567. package/build-module/components/post-excerpt/index.js +17 -15
  568. package/build-module/components/post-excerpt/index.js.map +1 -1
  569. package/build-module/components/post-excerpt/panel.js +60 -40
  570. package/build-module/components/post-excerpt/panel.js.map +1 -1
  571. package/build-module/components/post-excerpt/plugin.js +7 -4
  572. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  573. package/build-module/components/post-featured-image/check.js +18 -6
  574. package/build-module/components/post-featured-image/check.js.map +1 -1
  575. package/build-module/components/post-featured-image/index.js +78 -49
  576. package/build-module/components/post-featured-image/index.js.map +1 -1
  577. package/build-module/components/post-featured-image/panel.js +22 -7
  578. package/build-module/components/post-featured-image/panel.js.map +1 -1
  579. package/build-module/components/post-format/check.js +14 -4
  580. package/build-module/components/post-format/check.js.map +1 -1
  581. package/build-module/components/post-format/index.js +39 -21
  582. package/build-module/components/post-format/index.js.map +1 -1
  583. package/build-module/components/post-format/panel.js +75 -7
  584. package/build-module/components/post-format/panel.js.map +1 -1
  585. package/build-module/components/post-last-edited-panel/index.js +7 -4
  586. package/build-module/components/post-last-edited-panel/index.js.map +1 -1
  587. package/build-module/components/post-last-revision/check.js +14 -4
  588. package/build-module/components/post-last-revision/check.js.map +1 -1
  589. package/build-module/components/post-last-revision/index.js +21 -13
  590. package/build-module/components/post-last-revision/index.js.map +1 -1
  591. package/build-module/components/post-last-revision/panel.js +13 -4
  592. package/build-module/components/post-last-revision/panel.js.map +1 -1
  593. package/build-module/components/post-locked-modal/index.js +60 -34
  594. package/build-module/components/post-locked-modal/index.js.map +1 -1
  595. package/build-module/components/post-panel-row/index.js +12 -8
  596. package/build-module/components/post-panel-row/index.js.map +1 -1
  597. package/build-module/components/post-panel-section/index.js +5 -4
  598. package/build-module/components/post-panel-section/index.js.map +1 -1
  599. package/build-module/components/post-pending-status/check.js +11 -0
  600. package/build-module/components/post-pending-status/check.js.map +1 -1
  601. package/build-module/components/post-pending-status/index.js +15 -7
  602. package/build-module/components/post-pending-status/index.js.map +1 -1
  603. package/build-module/components/post-pingbacks/index.js +13 -5
  604. package/build-module/components/post-pingbacks/index.js.map +1 -1
  605. package/build-module/components/post-preview-button/index.js +47 -21
  606. package/build-module/components/post-preview-button/index.js.map +1 -1
  607. package/build-module/components/post-publish-button/index.js +22 -11
  608. package/build-module/components/post-publish-button/index.js.map +1 -1
  609. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
  610. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  611. package/build-module/components/post-publish-panel/index.js +48 -33
  612. package/build-module/components/post-publish-panel/index.js.map +1 -1
  613. package/build-module/components/post-publish-panel/maybe-category-panel.js +13 -9
  614. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  615. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +22 -15
  616. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  617. package/build-module/components/post-publish-panel/maybe-tags-panel.js +14 -10
  618. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  619. package/build-module/components/post-publish-panel/maybe-upload-media.js +30 -24
  620. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  621. package/build-module/components/post-publish-panel/postpublish.js +57 -38
  622. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  623. package/build-module/components/post-publish-panel/prepublish.js +43 -26
  624. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  625. package/build-module/components/post-saved-state/index.js +8 -6
  626. package/build-module/components/post-saved-state/index.js.map +1 -1
  627. package/build-module/components/post-schedule/check.js +9 -0
  628. package/build-module/components/post-schedule/check.js.map +1 -1
  629. package/build-module/components/post-schedule/index.js +30 -6
  630. package/build-module/components/post-schedule/index.js.map +1 -1
  631. package/build-module/components/post-schedule/label.js +17 -0
  632. package/build-module/components/post-schedule/label.js.map +1 -1
  633. package/build-module/components/post-schedule/panel.js +43 -30
  634. package/build-module/components/post-schedule/panel.js.map +1 -1
  635. package/build-module/components/post-slug/check.js +5 -4
  636. package/build-module/components/post-slug/check.js.map +1 -1
  637. package/build-module/components/post-slug/index.js +5 -3
  638. package/build-module/components/post-slug/index.js.map +1 -1
  639. package/build-module/components/post-slug/panel.js +7 -4
  640. package/build-module/components/post-slug/panel.js.map +1 -1
  641. package/build-module/components/post-status/index.js +121 -120
  642. package/build-module/components/post-status/index.js.map +1 -1
  643. package/build-module/components/post-sticky/index.js +17 -9
  644. package/build-module/components/post-sticky/index.js.map +1 -1
  645. package/build-module/components/post-sticky/panel.js +6 -2
  646. package/build-module/components/post-sticky/panel.js.map +1 -1
  647. package/build-module/components/post-switch-to-draft-button/index.js +27 -21
  648. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  649. package/build-module/components/post-sync-status/index.js +8 -6
  650. package/build-module/components/post-sync-status/index.js.map +1 -1
  651. package/build-module/components/post-taxonomies/flat-term-selector.js +22 -18
  652. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  653. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +71 -59
  654. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  655. package/build-module/components/post-taxonomies/index.js +6 -6
  656. package/build-module/components/post-taxonomies/index.js.map +1 -1
  657. package/build-module/components/post-taxonomies/most-used-terms.js +20 -15
  658. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  659. package/build-module/components/post-taxonomies/panel.js +15 -11
  660. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  661. package/build-module/components/post-template/block-theme.js +44 -32
  662. package/build-module/components/post-template/block-theme.js.map +1 -1
  663. package/build-module/components/post-template/classic-theme.js +74 -50
  664. package/build-module/components/post-template/classic-theme.js.map +1 -1
  665. package/build-module/components/post-template/create-new-template-modal.js +34 -27
  666. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  667. package/build-module/components/post-template/create-new-template.js +16 -11
  668. package/build-module/components/post-template/create-new-template.js.map +1 -1
  669. package/build-module/components/post-template/panel.js +17 -9
  670. package/build-module/components/post-template/panel.js.map +1 -1
  671. package/build-module/components/post-template/reset-default-template.js +5 -4
  672. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  673. package/build-module/components/post-template/swap-template-button.js +22 -15
  674. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  675. package/build-module/components/post-text-editor/index.js +30 -19
  676. package/build-module/components/post-text-editor/index.js.map +1 -1
  677. package/build-module/components/post-title/index.js +29 -18
  678. package/build-module/components/post-title/index.js.map +1 -1
  679. package/build-module/components/post-title/index.native.js +81 -57
  680. package/build-module/components/post-title/index.native.js.map +1 -1
  681. package/build-module/components/post-title/post-title-raw.js +11 -2
  682. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  683. package/build-module/components/post-title/use-post-title-focus.js +8 -0
  684. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  685. package/build-module/components/post-title/use-post-title.js +6 -0
  686. package/build-module/components/post-title/use-post-title.js.map +1 -1
  687. package/build-module/components/post-transform-panel/index.js +12 -12
  688. package/build-module/components/post-transform-panel/index.js.map +1 -1
  689. package/build-module/components/post-trash/index.js +21 -15
  690. package/build-module/components/post-trash/index.js.map +1 -1
  691. package/build-module/components/post-url/check.js +9 -0
  692. package/build-module/components/post-url/check.js.map +1 -1
  693. package/build-module/components/post-url/index.js +100 -72
  694. package/build-module/components/post-url/index.js.map +1 -1
  695. package/build-module/components/post-url/label.js +12 -0
  696. package/build-module/components/post-url/label.js.map +1 -1
  697. package/build-module/components/post-url/panel.js +35 -24
  698. package/build-module/components/post-url/panel.js.map +1 -1
  699. package/build-module/components/post-view-link/index.js +2 -2
  700. package/build-module/components/post-view-link/index.js.map +1 -1
  701. package/build-module/components/post-visibility/check.js +10 -0
  702. package/build-module/components/post-visibility/check.js.map +1 -1
  703. package/build-module/components/post-visibility/index.js +85 -67
  704. package/build-module/components/post-visibility/index.js.map +1 -1
  705. package/build-module/components/post-visibility/label.js +12 -0
  706. package/build-module/components/post-visibility/label.js.map +1 -1
  707. package/build-module/components/posts-per-page/index.js +103 -0
  708. package/build-module/components/posts-per-page/index.js.map +1 -0
  709. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
  710. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  711. package/build-module/components/preferences-modal/index.js +126 -102
  712. package/build-module/components/preferences-modal/index.js.map +1 -1
  713. package/build-module/components/preview-dropdown/index.js +49 -31
  714. package/build-module/components/preview-dropdown/index.js.map +1 -1
  715. package/build-module/components/provider/index.js +96 -20
  716. package/build-module/components/provider/index.js.map +1 -1
  717. package/build-module/components/provider/index.native.js +58 -20
  718. package/build-module/components/provider/index.native.js.map +1 -1
  719. package/build-module/components/provider/use-block-editor-settings.js +7 -6
  720. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  721. package/build-module/components/provider/with-registry-provider.js +33 -26
  722. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  723. package/build-module/components/resizable-editor/index.js +89 -0
  724. package/build-module/components/resizable-editor/index.js.map +1 -0
  725. package/build-module/components/resizable-editor/resize-handle.js +54 -0
  726. package/build-module/components/resizable-editor/resize-handle.js.map +1 -0
  727. package/build-module/components/save-publish-panels/index.js +37 -26
  728. package/build-module/components/save-publish-panels/index.js.map +1 -1
  729. package/build-module/components/sidebar/header.js +18 -14
  730. package/build-module/components/sidebar/header.js.map +1 -1
  731. package/build-module/components/sidebar/index.js +36 -31
  732. package/build-module/components/sidebar/index.js.map +1 -1
  733. package/build-module/components/sidebar/post-summary.js +33 -25
  734. package/build-module/components/sidebar/post-summary.js.map +1 -1
  735. package/build-module/components/site-discussion/index.js +127 -0
  736. package/build-module/components/site-discussion/index.js.map +1 -0
  737. package/build-module/components/start-page-options/index.js +13 -11
  738. package/build-module/components/start-page-options/index.js.map +1 -1
  739. package/build-module/components/start-template-options/index.js +30 -23
  740. package/build-module/components/start-template-options/index.js.map +1 -1
  741. package/build-module/components/table-of-contents/index.js +4 -4
  742. package/build-module/components/table-of-contents/index.js.map +1 -1
  743. package/build-module/components/table-of-contents/panel.js +55 -35
  744. package/build-module/components/table-of-contents/panel.js.map +1 -1
  745. package/build-module/components/template-areas/index.js +37 -22
  746. package/build-module/components/template-areas/index.js.map +1 -1
  747. package/build-module/components/template-content-panel/index.js +7 -6
  748. package/build-module/components/template-content-panel/index.js.map +1 -1
  749. package/build-module/components/template-validation-notice/index.js +27 -21
  750. package/build-module/components/template-validation-notice/index.js.map +1 -1
  751. package/build-module/components/text-editor/index.js +66 -0
  752. package/build-module/components/text-editor/index.js.map +1 -0
  753. package/build-module/components/time-to-read/index.js +7 -6
  754. package/build-module/components/time-to-read/index.js.map +1 -1
  755. package/build-module/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +5 -4
  756. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
  757. package/build-module/components/{editor-canvas → visual-editor}/index.js +118 -75
  758. package/build-module/components/visual-editor/index.js.map +1 -0
  759. package/build-module/components/word-count/index.js +5 -4
  760. package/build-module/components/word-count/index.js.map +1 -1
  761. package/build-module/hooks/custom-sources-backwards-compatibility.js +2 -2
  762. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  763. package/build-module/hooks/index.js +1 -0
  764. package/build-module/hooks/index.js.map +1 -1
  765. package/build-module/hooks/media-upload.js +7 -0
  766. package/build-module/hooks/media-upload.js.map +1 -0
  767. package/build-module/hooks/pattern-overrides.js +17 -11
  768. package/build-module/hooks/pattern-overrides.js.map +1 -1
  769. package/build-module/private-apis.js +10 -28
  770. package/build-module/private-apis.js.map +1 -1
  771. package/build-module/private-apis.native.js +2 -26
  772. package/build-module/private-apis.native.js.map +1 -1
  773. package/build-module/store/constants.js +3 -0
  774. package/build-module/store/constants.js.map +1 -1
  775. package/build-module/store/private-actions.js +10 -14
  776. package/build-module/store/private-actions.js.map +1 -1
  777. package/build-module/store/private-selectors.js +38 -1
  778. package/build-module/store/private-selectors.js.map +1 -1
  779. package/build-module/store/selectors.js +1 -1
  780. package/build-module/store/selectors.js.map +1 -1
  781. package/build-module/utils/set-nested-value.js +38 -0
  782. package/build-module/utils/set-nested-value.js.map +1 -0
  783. package/build-style/style-rtl.css +318 -90
  784. package/build-style/style.css +318 -90
  785. package/package.json +40 -36
  786. package/src/bindings/index.js +1 -4
  787. package/src/bindings/pattern-overrides.js +1 -1
  788. package/src/bindings/post-meta.js +46 -6
  789. package/src/components/blog-title/index.js +124 -0
  790. package/src/components/blog-title/style.scss +4 -0
  791. package/src/components/commands/index.js +113 -3
  792. package/src/components/create-template-part-modal/index.js +205 -0
  793. package/src/components/create-template-part-modal/style.scss +69 -0
  794. package/src/components/create-template-part-modal/test/utils.js +60 -0
  795. package/src/components/create-template-part-modal/utils.js +67 -0
  796. package/src/components/document-bar/index.js +32 -21
  797. package/src/components/document-tools/index.js +2 -7
  798. package/src/components/editor-help/help-get-support-button.native.js +1 -1
  799. package/src/components/editor-interface/content-slot-fill.js +15 -0
  800. package/src/components/editor-interface/index.js +230 -0
  801. package/src/components/editor-notices/index.js +10 -0
  802. package/src/components/entities-saved-states/entity-record-item.js +45 -16
  803. package/src/components/entities-saved-states/style.scss +13 -0
  804. package/src/components/error-boundary/index.js +10 -0
  805. package/src/components/error-boundary/index.native.js +1 -1
  806. package/src/components/global-styles-provider/index.js +100 -8
  807. package/src/components/header/back-button.js +27 -0
  808. package/src/components/header/index.js +25 -10
  809. package/src/components/header/style.scss +5 -0
  810. package/src/components/inserter-sidebar/index.js +65 -32
  811. package/src/components/inserter-sidebar/style.scss +0 -13
  812. package/src/components/local-autosave-monitor/index.js +12 -0
  813. package/src/components/page-attributes/order.js +79 -3
  814. package/src/components/page-attributes/panel.js +10 -26
  815. package/src/components/page-attributes/parent.js +98 -2
  816. package/src/components/page-attributes/style.scss +19 -0
  817. package/src/components/pattern-duplicate-modal/index.js +50 -0
  818. package/src/components/pattern-rename-modal/index.js +44 -0
  819. package/src/components/post-actions/actions.js +306 -261
  820. package/src/components/post-actions/export-pattern-action.js +74 -0
  821. package/src/components/post-actions/export-pattern-action.native.js +4 -0
  822. package/src/components/post-actions/index.js +16 -5
  823. package/src/components/post-author/combobox.js +1 -0
  824. package/src/components/post-author/hook.js +1 -1
  825. package/src/components/post-author/panel.js +63 -2
  826. package/src/components/post-author/select.js +1 -0
  827. package/src/components/post-author/style.scss +6 -0
  828. package/src/components/post-card-panel/index.js +69 -22
  829. package/src/components/post-card-panel/style.scss +23 -1
  830. package/src/components/post-comments/index.js +5 -0
  831. package/src/components/post-discussion/panel.js +9 -2
  832. package/src/components/post-discussion/style.scss +1 -3
  833. package/src/components/post-excerpt/panel.js +45 -48
  834. package/src/components/post-excerpt/style.scss +0 -17
  835. package/src/components/post-featured-image/check.js +9 -0
  836. package/src/components/post-featured-image/index.js +15 -0
  837. package/src/components/post-featured-image/panel.js +9 -0
  838. package/src/components/post-format/check.js +8 -0
  839. package/src/components/post-format/index.js +15 -4
  840. package/src/components/post-format/panel.js +71 -6
  841. package/src/components/post-format/style.scss +10 -4
  842. package/src/components/post-last-revision/check.js +8 -0
  843. package/src/components/post-last-revision/index.js +7 -2
  844. package/src/components/post-last-revision/panel.js +5 -0
  845. package/src/components/post-locked-modal/index.js +6 -0
  846. package/src/components/post-panel-row/style.scss +15 -0
  847. package/src/components/post-pending-status/check.js +10 -0
  848. package/src/components/post-pending-status/index.js +5 -0
  849. package/src/components/post-pingbacks/index.js +6 -0
  850. package/src/components/post-preview-button/index.js +15 -0
  851. package/src/components/post-publish-button/index.js +17 -4
  852. package/src/components/post-publish-panel/index.js +1 -0
  853. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  854. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +3 -3
  855. package/src/components/post-schedule/check.js +8 -0
  856. package/src/components/post-schedule/index.js +30 -3
  857. package/src/components/post-schedule/label.js +15 -0
  858. package/src/components/post-schedule/panel.js +9 -1
  859. package/src/components/post-schedule/style.scss +0 -11
  860. package/src/components/post-status/index.js +30 -52
  861. package/src/components/post-status/style.scss +4 -34
  862. package/src/components/post-sticky/index.js +12 -7
  863. package/src/components/post-sticky/style.scss +3 -0
  864. package/src/components/post-template/block-theme.js +1 -0
  865. package/src/components/post-template/classic-theme.js +15 -0
  866. package/src/components/post-template/panel.js +5 -0
  867. package/src/components/post-template/style.scss +0 -8
  868. package/src/components/post-text-editor/index.js +5 -0
  869. package/src/components/post-title/index.js +8 -1
  870. package/src/components/post-title/index.native.js +70 -35
  871. package/src/components/post-title/post-title-raw.js +8 -0
  872. package/src/components/post-title/use-post-title-focus.js +7 -0
  873. package/src/components/post-title/use-post-title.js +5 -0
  874. package/src/components/post-transform-panel/index.js +2 -10
  875. package/src/components/post-url/check.js +8 -0
  876. package/src/components/post-url/index.js +41 -24
  877. package/src/components/post-url/label.js +10 -0
  878. package/src/components/post-url/panel.js +6 -1
  879. package/src/components/post-url/style.scss +0 -9
  880. package/src/components/post-visibility/check.js +9 -0
  881. package/src/components/post-visibility/index.js +7 -0
  882. package/src/components/post-visibility/label.js +10 -0
  883. package/src/components/posts-per-page/index.js +101 -0
  884. package/src/components/posts-per-page/style.scss +4 -0
  885. package/src/components/provider/index.js +68 -0
  886. package/src/components/provider/index.native.js +43 -2
  887. package/src/components/provider/use-block-editor-settings.js +4 -6
  888. package/src/components/provider/with-registry-provider.js +32 -31
  889. package/src/components/resizable-editor/index.js +90 -0
  890. package/src/components/resizable-editor/resize-handle.js +62 -0
  891. package/src/components/resizable-editor/style.scss +53 -0
  892. package/src/components/save-publish-panels/index.js +10 -2
  893. package/src/components/sidebar/index.js +0 -4
  894. package/src/components/sidebar/post-summary.js +14 -21
  895. package/src/components/sidebar/style.scss +1 -1
  896. package/src/components/site-discussion/index.js +138 -0
  897. package/src/components/site-discussion/style.scss +19 -0
  898. package/src/components/start-template-options/style.scss +0 -8
  899. package/src/components/template-areas/index.js +15 -6
  900. package/src/components/text-editor/index.js +57 -0
  901. package/src/components/text-editor/style.scss +71 -0
  902. package/src/components/{editor-canvas → visual-editor}/index.js +177 -108
  903. package/src/components/visual-editor/style.scss +37 -0
  904. package/src/hooks/index.js +1 -0
  905. package/src/hooks/media-upload.js +11 -0
  906. package/src/private-apis.js +10 -28
  907. package/src/private-apis.native.js +2 -26
  908. package/src/store/constants.js +7 -0
  909. package/src/store/private-actions.js +22 -50
  910. package/src/store/private-selectors.js +45 -0
  911. package/src/store/selectors.js +1 -1
  912. package/src/style.scss +9 -0
  913. package/src/utils/set-nested-value.js +39 -0
  914. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  915. package/build/components/editor-canvas/index.js.map +0 -1
  916. package/build/components/post-trash/panel.js +0 -18
  917. package/build/components/post-trash/panel.js.map +0 -1
  918. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
  919. package/build-module/components/editor-canvas/index.js.map +0 -1
  920. package/build-module/components/post-trash/panel.js +0 -10
  921. package/build-module/components/post-trash/panel.js.map +0 -1
  922. package/src/components/post-trash/panel.js +0 -13
  923. package/src/components/provider/README.md +0 -37
  924. /package/src/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_store","_lockUnlock","TYPE_LABELS","wp_pattern","__","wp_navigation","wp_template","wp_template_part","TEMPLATE_POST_TYPES","GLOBAL_POST_TYPES","MotionButton","motion","Button","DocumentBar","postType","document","isResolving","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","useSelect","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","getEditedEntityRecord","isResolvingSelector","coreStore","_postType","_postId","_document","_templateInfo","unlock","getPostIcon","area","title","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isNotFound","isTemplate","includes","isGlobalEntity","hasBackButton","mounted","useRef","useEffect","current","_react","createElement","className","clsx","__unstableAnimatePresence","icon","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__experimentalText","__unstableMotion","div","key","BlockIcon","as","sprintf","displayShortcut","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, 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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAKA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AA5BA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA;AACA;AACA;;AAIA,MAAMa,WAAW,GAAG;EACnB;EACAC,UAAU,EAAE,IAAAC,QAAE,EAAE,qBAAsB,CAAC;EACvC;EACAC,aAAa,EAAE,IAAAD,QAAE,EAAE,6BAA8B,CAAC;EAClD;EACAE,WAAW,EAAE,IAAAF,QAAE,EAAE,sBAAuB,CAAC;EACzC;EACAG,gBAAgB,EAAE,IAAAH,QAAE,EAAE,2BAA4B;AACnD,CAAC;AAED,MAAMI,mBAAmB,GAAG,CAAE,aAAa,EAAE,kBAAkB,CAAE;AAEjE,MAAMC,iBAAiB,GAAG,CACzB,G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AO,EAAE/E,WAAW,CAAEY,QAAQ,CAAE,EAAEwB,KAAM,CAAC,GACzCoC;EACH,GAECpC,KACG,CACK,CAAC,EACb,IAAAgB,MAAA,CAAAC,aAAA;IAAMC,SAAS,EAAC;EAA+B,GAC5C0B,yBAAe,CAACC,OAAO,CAAE,GAAI,CAC1B,CACC,CAEL,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_htmlEntities","_constants","_store","_lockUnlock","_jsxRuntime","TYPE_LABELS","wp_pattern","__","wp_navigation","wp_template","wp_template_part","MotionButton","motion","Button","DocumentBar","postType","documentTitle","isNotFound","isUnsyncedPattern","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","useSelect","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","getEditedEntityRecord","isResolving","isResolvingSelector","coreStore","_postType","_postId","_document","_templateInfo","title","wp_pattern_sync_status","unlock","getPostIcon","area","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isTemplate","TEMPLATE_POST_TYPES","includes","isGlobalEntity","GLOBAL_POST_TYPES","hasBackButton","mounted","useRef","useEffect","current","jsxs","className","clsx","children","jsx","__unstableAnimatePresence","icon","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__experimentalText","__unstableMotion","div","BlockIcon","as","sprintf","decodeEntities","displayShortcut","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, 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';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants';\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 MotionButton = motion( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n *\n * @return {JSX.Element} The rendered DocumentBar component.\n */\nexport default function DocumentBar() {\n\tconst {\n\t\tpostType,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\tisUnsyncedPattern,\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\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\tisUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',\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 isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst title = isTemplate ? templateTitle : documentTitle;\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 && ! isUnsyncedPattern,\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\t\t? decodeEntities( title )\n\t\t\t\t\t\t\t\t: __( 'No 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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAKA,IAA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V;QAAA;;QAEAa,OAAO,EACNlB,OAAO,CAACG,OAAO,GACZ;UACAgB,OAAO,EAAE,CAAC;UACVC,SAAS,EAAErB,aAAa,GACrB,iBAAiB,GACjB;QACH,CAAC,GACD,KAAK,CAAC;QACT;QACDsB,OAAO,EAAG;UACTF,OAAO,EAAE,CAAC;UACVC,SAAS,EAAE;QACZ,CAAG;QACHG,UAAU,EACT/B,eAAe,GAAG;UAAEgC,QAAQ,EAAE;QAAE,CAAC,GAAGC,SACpC;QAAAlB,QAAA,gBAED,IAAA1D,WAAA,CAAA2D,GAAA,EAACtE,YAAA,CAAA2F,SAAS;UAACnB,IAAI,EAAG9C;QAAc,CAAE,CAAC,eACnC,IAAAf,WAAA,CAAA2D,GAAA,EAACvE,WAAA,CAAAyF,kBAAI;UACJT,IAAI,EAAC,MAAM;UACXa,EAAE,EAAC,IAAI;UACP,cACChF,WAAW,CAAEU,QAAQ,CAAE;UACpB;UACA,IAAAuE,aAAO,EAAEjF,WAAW,CAAEU,QAAQ,CAAE,EAAEuB,KAAM,CAAC,GACzC0C,SACH;UAAAlB,QAAA,EAECxB,KAAK,GACJ,IAAAiD,4BAAc,EAAEjD,KAAM,CAAC,GACvB,IAAA/B,QAAE,EAAE,UAAW;QAAC,CACd,CAAC;MAAA,GAjCD+C,aAkCK,CAAC,eACb,IAAAlD,WAAA,CAAA2D,GAAA;QAAMH,SAAS,EAAC,+BAA+B;QAAAE,QAAA,EAC5C0B,yBAAe,CAACC,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = DocumentOutline;
8
- var _react = require("react");
9
8
  var _i18n = require("@wordpress/i18n");
10
9
  var _data = require("@wordpress/data");
11
10
  var _richText = require("@wordpress/rich-text");
@@ -14,6 +13,7 @@ var _coreData = require("@wordpress/core-data");
14
13
  var _components = require("@wordpress/components");
15
14
  var _item = _interopRequireDefault(require("./item"));
16
15
  var _store = require("../../store");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
17
  /**
18
18
  * WordPress dependencies
19
19
  */
@@ -24,100 +24,96 @@ var _store = require("../../store");
24
24
 
25
25
  /**
26
26
  * Module constants
27
- */
28
- const emptyHeadingContent = (0, _react.createElement)("em", null, (0, _i18n.__)('(Empty heading)'));
29
- const incorrectLevelContent = [(0, _react.createElement)("br", {
30
- key: "incorrect-break"
31
- }), (0, _react.createElement)("em", {
32
- key: "incorrect-message"
33
- }, (0, _i18n.__)('(Incorrect heading level)'))];
34
- const singleH1Headings = [(0, _react.createElement)("br", {
35
- key: "incorrect-break-h1"
36
- }), (0, _react.createElement)("em", {
37
- key: "incorrect-message-h1"
38
- }, (0, _i18n.__)('(Your theme may already use a H1 for the post title)'))];
39
- const multipleH1Headings = [(0, _react.createElement)("br", {
40
- key: "incorrect-break-multiple-h1"
41
- }), (0, _react.createElement)("em", {
42
- key: "incorrect-message-multiple-h1"
43
- }, (0, _i18n.__)('(Multiple H1 headings are not recommended)'))];
27
+ */const emptyHeadingContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("em", {
28
+ children: (0, _i18n.__)('(Empty heading)')
29
+ });
30
+ const incorrectLevelContent = [/*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}, "incorrect-break"), /*#__PURE__*/(0, _jsxRuntime.jsx)("em", {
31
+ children: (0, _i18n.__)('(Incorrect heading level)')
32
+ }, "incorrect-message")];
33
+ const singleH1Headings = [/*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}, "incorrect-break-h1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("em", {
34
+ children: (0, _i18n.__)('(Your theme may already use a H1 for the post title)')
35
+ }, "incorrect-message-h1")];
36
+ const multipleH1Headings = [/*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}, "incorrect-break-multiple-h1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("em", {
37
+ children: (0, _i18n.__)('(Multiple H1 headings are not recommended)')
38
+ }, "incorrect-message-multiple-h1")];
44
39
  function EmptyOutlineIllustration() {
45
- return (0, _react.createElement)(_components.SVG, {
40
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.SVG, {
46
41
  width: "138",
47
42
  height: "148",
48
43
  viewBox: "0 0 138 148",
49
44
  fill: "none",
50
- xmlns: "http://www.w3.org/2000/svg"
51
- }, (0, _react.createElement)(_components.Rect, {
52
- width: "138",
53
- height: "148",
54
- rx: "4",
55
- fill: "#F0F6FC"
56
- }), (0, _react.createElement)(_components.Line, {
57
- x1: "44",
58
- y1: "28",
59
- x2: "24",
60
- y2: "28",
61
- stroke: "#DDDDDD"
62
- }), (0, _react.createElement)(_components.Rect, {
63
- x: "48",
64
- y: "16",
65
- width: "27",
66
- height: "23",
67
- rx: "4",
68
- fill: "#DDDDDD"
69
- }), (0, _react.createElement)(_components.Path, {
70
- d: "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",
71
- fill: "black"
72
- }), (0, _react.createElement)(_components.Line, {
73
- x1: "55",
74
- y1: "59",
75
- x2: "24",
76
- y2: "59",
77
- stroke: "#DDDDDD"
78
- }), (0, _react.createElement)(_components.Rect, {
79
- x: "59",
80
- y: "47",
81
- width: "29",
82
- height: "23",
83
- rx: "4",
84
- fill: "#DDDDDD"
85
- }), (0, _react.createElement)(_components.Path, {
86
- d: "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",
87
- fill: "black"
88
- }), (0, _react.createElement)(_components.Line, {
89
- x1: "80",
90
- y1: "90",
91
- x2: "24",
92
- y2: "90",
93
- stroke: "#DDDDDD"
94
- }), (0, _react.createElement)(_components.Rect, {
95
- x: "84",
96
- y: "78",
97
- width: "30",
98
- height: "23",
99
- rx: "4",
100
- fill: "#F0B849"
101
- }), (0, _react.createElement)(_components.Path, {
102
- d: "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",
103
- fill: "black"
104
- }), (0, _react.createElement)(_components.Line, {
105
- x1: "66",
106
- y1: "121",
107
- x2: "24",
108
- y2: "121",
109
- stroke: "#DDDDDD"
110
- }), (0, _react.createElement)(_components.Rect, {
111
- x: "70",
112
- y: "109",
113
- width: "29",
114
- height: "23",
115
- rx: "4",
116
- fill: "#DDDDDD"
117
- }), (0, _react.createElement)(_components.Path, {
118
- d: "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",
119
- fill: "black"
120
- }));
45
+ xmlns: "http://www.w3.org/2000/svg",
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Rect, {
47
+ width: "138",
48
+ height: "148",
49
+ rx: "4",
50
+ fill: "#F0F6FC"
51
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Line, {
52
+ x1: "44",
53
+ y1: "28",
54
+ x2: "24",
55
+ y2: "28",
56
+ stroke: "#DDDDDD"
57
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Rect, {
58
+ x: "48",
59
+ y: "16",
60
+ width: "27",
61
+ height: "23",
62
+ rx: "4",
63
+ fill: "#DDDDDD"
64
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Path, {
65
+ d: "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",
66
+ fill: "black"
67
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Line, {
68
+ x1: "55",
69
+ y1: "59",
70
+ x2: "24",
71
+ y2: "59",
72
+ stroke: "#DDDDDD"
73
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Rect, {
74
+ x: "59",
75
+ y: "47",
76
+ width: "29",
77
+ height: "23",
78
+ rx: "4",
79
+ fill: "#DDDDDD"
80
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Path, {
81
+ d: "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",
82
+ fill: "black"
83
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Line, {
84
+ x1: "80",
85
+ y1: "90",
86
+ x2: "24",
87
+ y2: "90",
88
+ stroke: "#DDDDDD"
89
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Rect, {
90
+ x: "84",
91
+ y: "78",
92
+ width: "30",
93
+ height: "23",
94
+ rx: "4",
95
+ fill: "#F0B849"
96
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Path, {
97
+ d: "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",
98
+ fill: "black"
99
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Line, {
100
+ x1: "66",
101
+ y1: "121",
102
+ x2: "24",
103
+ y2: "121",
104
+ stroke: "#DDDDDD"
105
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Rect, {
106
+ x: "70",
107
+ y: "109",
108
+ width: "29",
109
+ height: "23",
110
+ rx: "4",
111
+ fill: "#DDDDDD"
112
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Path, {
113
+ d: "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",
114
+ fill: "black"
115
+ })]
116
+ });
121
117
  }
122
118
 
123
119
  /**
@@ -184,9 +180,12 @@ function DocumentOutline({
184
180
  });
185
181
  const headings = computeOutlineHeadings(blocks);
186
182
  if (headings.length < 1) {
187
- return (0, _react.createElement)("div", {
188
- className: "editor-document-outline has-no-headings"
189
- }, (0, _react.createElement)(EmptyOutlineIllustration, null), (0, _react.createElement)("p", null, (0, _i18n.__)('Navigate the structure of your document and address issues like empty or incorrect heading levels.')));
183
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
184
+ className: "editor-document-outline has-no-headings",
185
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(EmptyOutlineIllustration, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
186
+ children: (0, _i18n.__)('Navigate the structure of your document and address issues like empty or incorrect heading levels.')
187
+ })]
188
+ });
190
189
  }
191
190
  let prevHeadingLevel = 1;
192
191
 
@@ -198,33 +197,37 @@ function DocumentOutline({
198
197
  [heading.level]: (acc[heading.level] || 0) + 1
199
198
  }), {});
200
199
  const hasMultipleH1 = countByLevel[1] > 1;
201
- return (0, _react.createElement)("div", {
202
- className: "document-outline"
203
- }, (0, _react.createElement)("ul", null, hasTitle && (0, _react.createElement)(_item.default, {
204
- level: (0, _i18n.__)('Title'),
205
- isValid: true,
206
- onSelect: onSelect,
207
- href: `#${titleNode.id}`,
208
- isDisabled: hasOutlineItemsDisabled
209
- }, title), headings.map((item, index) => {
210
- // Headings remain the same, go up by one, or down by any amount.
211
- // Otherwise there are missing levels.
212
- const isIncorrectLevel = item.level > prevHeadingLevel + 1;
213
- const isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle);
214
- prevHeadingLevel = item.level;
215
- return (0, _react.createElement)(_item.default, {
216
- key: index,
217
- level: `H${item.level}`,
218
- isValid: isValid,
219
- isDisabled: hasOutlineItemsDisabled,
220
- href: `#block-${item.clientId}`,
221
- onSelect: () => {
222
- selectBlock(item.clientId);
223
- onSelect?.();
224
- }
225
- }, item.isEmpty ? emptyHeadingContent : (0, _richText.getTextContent)((0, _richText.create)({
226
- html: item.attributes.content
227
- })), isIncorrectLevel && incorrectLevelContent, item.level === 1 && hasMultipleH1 && multipleH1Headings, hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings);
228
- })));
200
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
201
+ className: "document-outline",
202
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("ul", {
203
+ children: [hasTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_item.default, {
204
+ level: (0, _i18n.__)('Title'),
205
+ isValid: true,
206
+ onSelect: onSelect,
207
+ href: `#${titleNode.id}`,
208
+ isDisabled: hasOutlineItemsDisabled,
209
+ children: title
210
+ }), headings.map((item, index) => {
211
+ // Headings remain the same, go up by one, or down by any amount.
212
+ // Otherwise there are missing levels.
213
+ const isIncorrectLevel = item.level > prevHeadingLevel + 1;
214
+ const isValid = !item.isEmpty && !isIncorrectLevel && !!item.level && (item.level !== 1 || !hasMultipleH1 && !hasTitle);
215
+ prevHeadingLevel = item.level;
216
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_item.default, {
217
+ level: `H${item.level}`,
218
+ isValid: isValid,
219
+ isDisabled: hasOutlineItemsDisabled,
220
+ href: `#block-${item.clientId}`,
221
+ onSelect: () => {
222
+ selectBlock(item.clientId);
223
+ onSelect?.();
224
+ },
225
+ children: [item.isEmpty ? emptyHeadingContent : (0, _richText.getTextContent)((0, _richText.create)({
226
+ html: item.attributes.content
227
+ })), isIncorrectLevel && incorrectLevelContent, item.level === 1 && hasMultipleH1 && multipleH1Headings, hasTitle && item.level === 1 && !hasMultipleH1 && singleH1Headings]
228
+ }, index);
229
+ })]
230
+ })
231
+ });
229
232
  }
230
233
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_data","_richText","_blockEditor","_coreData","_components","_item","_interopRequireDefault","_store","emptyHeadingContent","_react","createElement","__","incorrectLevelContent","key","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","SVG","width","height","viewBox","fill","xmlns","Rect","rx","Line","x1","y1","x2","y2","stroke","x","y","Path","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","useDispatch","blockEditorStore","title","useSelect","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","default","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","getTextContent","create","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\n/**\n * Renders a document outline component.\n *\n * @param {Object} props Props.\n * @param {Function} props.onSelect Function to be called when an outline item is selected.\n * @param {boolean} props.isTitleSupported Indicates whether the title is supported.\n * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function DocumentOutline( {\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAKA,IAAAM,KAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAdA;AACA;AACA;;AAQA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAMS,mBAAmB,GAAG,IAAAC,MAAA,CAAAC,aAAA,cAAM,IAAAC,QAAE,EAAE,iBAAkB,CAAO,CAAC;AAChE,MAAMC,qBAAqB,GAAG,CAC7B,IAAAH,MAAA,CAAAC,aAAA;EAAIG,GAAG,EAAC;AAAiB,CAAE,CAAC,EAC5B,IAAAJ,MAAA,CAAAC,aAAA;EAAIG,GAAG,EAAC;AAAmB,GAAG,IAAA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O,EAAGA,OAAS;MACnBG,UAAU,EAAG9B,uBAAyB;MACtC4B,IAAI,EAAI,UAAUI,IAAI,CAACG,QAAU,EAAG;MACpCrC,QAAQ,EAAGA,CAAA,KAAM;QAChBG,WAAW,CAAE+B,IAAI,CAACG,QAAS,CAAC;QAC5BrC,QAAQ,GAAG,CAAC;MACb;IAAG,GAEDkC,IAAI,CAAC1C,OAAO,GACXlC,mBAAmB,GACnB,IAAAgF,wBAAc,EACd,IAAAC,gBAAM,EAAE;MACPC,IAAI,EAAEN,IAAI,CAAC3C,UAAU,CAACK;IACvB,CAAE,CACF,CAAC,EACFwC,gBAAgB,IAAI1E,qBAAqB,EACzCwE,IAAI,CAAC5C,KAAK,KAAK,CAAC,IACjBqC,aAAa,IACb9D,kBAAkB,EACjB0D,QAAQ,IACTW,IAAI,CAAC5C,KAAK,KAAK,CAAC,IAChB,CAAEqC,aAAa,IACf/D,gBACmB,CAAC;EAExB,CAAE,CACC,CACA,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_data","_richText","_blockEditor","_coreData","_components","_item","_interopRequireDefault","_store","_jsxRuntime","emptyHeadingContent","jsx","children","__","incorrectLevelContent","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","jsxs","SVG","width","height","viewBox","fill","xmlns","Rect","rx","Line","x1","y1","x2","y2","stroke","x","y","Path","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","useDispatch","blockEditorStore","title","useSelect","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","default","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","getTextContent","create","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\n/**\n * Renders a document outline component.\n *\n * @param {Object} props Props.\n * @param {Function} props.onSelect Function to be called when an outline item is selected.\n * @param {boolean} props.isTitleSupported Indicates whether the title is supported.\n * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function DocumentOutline( {\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\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"],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AC5C,KAAK,KAAK,CAAC,IAChB,CAAEqC,aAAa,IACfhE,gBAAgB;QAAA,GAxBXwE,KAyBc,CAAC;MAExB,CAAE,CAAC;IAAA,CACA;EAAC,CACD,CAAC;AAER","ignoreList":[]}
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
9
8
  var _clsx = _interopRequireDefault(require("clsx"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
10
  /**
11
11
  * External dependencies
12
12
  */
@@ -17,21 +17,25 @@ const TableOfContentsItem = ({
17
17
  level,
18
18
  href,
19
19
  onSelect
20
- }) => (0, _react.createElement)("li", {
20
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
21
21
  className: (0, _clsx.default)('document-outline__item', `is-${level.toLowerCase()}`, {
22
22
  'is-invalid': !isValid
23
+ }),
24
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("a", {
25
+ href: href,
26
+ className: "document-outline__button",
27
+ onClick: onSelect,
28
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
29
+ className: "document-outline__emdash",
30
+ "aria-hidden": "true"
31
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
32
+ className: "document-outline__level",
33
+ children: level
34
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
35
+ className: "document-outline__item-content",
36
+ children: children
37
+ })]
23
38
  })
24
- }, (0, _react.createElement)("a", {
25
- href: href,
26
- className: "document-outline__button",
27
- onClick: onSelect
28
- }, (0, _react.createElement)("span", {
29
- className: "document-outline__emdash",
30
- "aria-hidden": "true"
31
- }), (0, _react.createElement)("strong", {
32
- className: "document-outline__level"
33
- }, level), (0, _react.createElement)("span", {
34
- className: "document-outline__item-content"
35
- }, children)));
39
+ });
36
40
  var _default = exports.default = TableOfContentsItem;
37
41
  //# sourceMappingURL=item.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","TableOfContentsItem","children","isValid","level","href","onSelect","_react","createElement","className","clsx","toLowerCase","onClick","_default","exports","default"],"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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KACA,IAAAC,MAAA,CAAAC,aAAA;EACCC,SAAS,EAAG,IAAAC,aAAI,EACf,wBAAwB,EACvB,MAAMN,KAAK,CAACO,WAAW,CAAC,CAAG,EAAC,EAC7B;IACC,YAAY,EAAE,CAAER;EACjB,CACD;AAAG,GAEH,IAAAI,MAAA,CAAAC,aAAA;EACCH,IAAI,EAAGA,IAAM;EACbI,SAAS,EAAC,0BAA0B;EACpCG,OAAO,EAAGN;AAAU,GAEpB,IAAAC,MAAA,CAAAC,aAAA;EACCC,SAAS,EAAC,0BAA0B;EACpC,eAAY;AAAM,CACZ,CAAC,EACR,IAAAF,MAAA,CAAAC,aAAA;EAAQC,SAAS,EAAC;AAAyB,GAAGL,KAAe,CAAC,EAC9D,IAAAG,MAAA,CAAAC,aAAA;EAAMC,SAAS,EAAC;AAAgC,GAAGP,QAAgB,CACjE,CACA,CACJ;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_jsxRuntime","TableOfContentsItem","children","isValid","level","href","onSelect","jsx","className","clsx","toLowerCase","jsxs","onClick","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwB,IAAAC,WAAA,GAAAD,OAAA;AAHxB;AACA;AACA;;AAGA,MAAME,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,kBACA,IAAAN,WAAA,CAAAO,GAAA;EACCC,SAAS,EAAG,IAAAC,aAAI,EACf,wBAAwB,EACvB,MAAML,KAAK,CAACM,WAAW,CAAC,CAAG,EAAC,EAC7B;IACC,YAAY,EAAE,CAAEP;EACjB,CACD,CAAG;EAAAD,QAAA,eAEH,IAAAF,WAAA,CAAAW,IAAA;IACCN,IAAI,EAAGA,IAAM;IACbG,SAAS,EAAC,0BAA0B;IACpCI,OAAO,EAAGN,QAAU;IAAAJ,QAAA,gBAEpB,IAAAF,WAAA,CAAAO,GAAA;MACCC,SAAS,EAAC,0BAA0B;MACpC,eAAY;IAAM,CACZ,CAAC,eACR,IAAAR,WAAA,CAAAO,GAAA;MAAQC,SAAS,EAAC,yBAAyB;MAAAN,QAAA,EAAGE;IAAK,CAAU,CAAC,eAC9D,IAAAJ,WAAA,CAAAO,GAAA;MAAMC,SAAS,EAAC,gCAAgC;MAAAN,QAAA,EAAGA;IAAQ,CAAQ,CAAC;EAAA,CAClE;AAAC,CACD,CACJ;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,mBAAmB","ignoreList":[]}