@wordpress/editor 14.34.0 → 14.34.1-next.2f1c7c01b.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 (1133) hide show
  1. package/build/bindings/api.js +2 -0
  2. package/build/bindings/api.js.map +1 -1
  3. package/build/bindings/pattern-overrides.js +3 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-data.js +50 -64
  6. package/build/bindings/post-data.js.map +3 -3
  7. package/build/bindings/post-meta.js +47 -39
  8. package/build/bindings/post-meta.js.map +2 -2
  9. package/build/bindings/term-data.js +3 -1
  10. package/build/bindings/term-data.js.map +1 -1
  11. package/build/components/autocompleters/index.js +2 -0
  12. package/build/components/autocompleters/index.js.map +1 -1
  13. package/build/components/autocompleters/user.js +3 -1
  14. package/build/components/autocompleters/user.js.map +1 -1
  15. package/build/components/autosave-monitor/index.js +4 -2
  16. package/build/components/autosave-monitor/index.js.map +1 -1
  17. package/build/components/block-removal-warnings/index.js +6 -4
  18. package/build/components/block-removal-warnings/index.js.map +1 -1
  19. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +6 -4
  20. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  21. package/build/components/block-visibility/index.js +5 -3
  22. package/build/components/block-visibility/index.js.map +1 -1
  23. package/build/components/blog-title/index.js +4 -2
  24. package/build/components/blog-title/index.js.map +1 -1
  25. package/build/components/character-count/index.js +2 -0
  26. package/build/components/character-count/index.js.map +1 -1
  27. package/build/components/collab-sidebar/add-comment.js +18 -12
  28. package/build/components/collab-sidebar/add-comment.js.map +2 -2
  29. package/build/components/collab-sidebar/comment-author-info.js +4 -2
  30. package/build/components/collab-sidebar/comment-author-info.js.map +2 -2
  31. package/build/components/collab-sidebar/comment-form.js +3 -1
  32. package/build/components/collab-sidebar/comment-form.js.map +1 -1
  33. package/build/components/collab-sidebar/comment-indicator-toolbar.js +14 -26
  34. package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +3 -3
  35. package/build/components/collab-sidebar/comment-menu-item.js +40 -8
  36. package/build/components/collab-sidebar/comment-menu-item.js.map +3 -3
  37. package/build/components/collab-sidebar/comments.js +348 -323
  38. package/build/components/collab-sidebar/comments.js.map +3 -3
  39. package/build/components/collab-sidebar/constants.js +5 -3
  40. package/build/components/collab-sidebar/constants.js.map +1 -1
  41. package/build/components/collab-sidebar/hooks.js +8 -4
  42. package/build/components/collab-sidebar/hooks.js.map +2 -2
  43. package/build/components/collab-sidebar/index.js +50 -24
  44. package/build/components/collab-sidebar/index.js.map +3 -3
  45. package/build/components/collab-sidebar/utils.js +4 -2
  46. package/build/components/collab-sidebar/utils.js.map +2 -2
  47. package/build/components/collapsible-block-toolbar/index.js +4 -2
  48. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  49. package/build/components/commands/index.js +6 -4
  50. package/build/components/commands/index.js.map +1 -1
  51. package/build/components/deprecated.js +55 -53
  52. package/build/components/deprecated.js.map +1 -1
  53. package/build/components/document-bar/index.js +4 -2
  54. package/build/components/document-bar/index.js.map +1 -1
  55. package/build/components/document-outline/check.js +2 -0
  56. package/build/components/document-outline/check.js.map +1 -1
  57. package/build/components/document-outline/index.js +9 -7
  58. package/build/components/document-outline/index.js.map +1 -1
  59. package/build/components/document-outline/item.js +4 -2
  60. package/build/components/document-outline/item.js.map +1 -1
  61. package/build/components/document-tools/index.js +3 -1
  62. package/build/components/document-tools/index.js.map +1 -1
  63. package/build/components/editor/index.js +4 -2
  64. package/build/components/editor/index.js.map +3 -3
  65. package/build/components/editor-history/redo.js +3 -1
  66. package/build/components/editor-history/redo.js.map +1 -1
  67. package/build/components/editor-history/undo.js +3 -1
  68. package/build/components/editor-history/undo.js.map +1 -1
  69. package/build/components/editor-interface/index.js +4 -2
  70. package/build/components/editor-interface/index.js.map +1 -1
  71. package/build/components/editor-notices/index.js +3 -1
  72. package/build/components/editor-notices/index.js.map +1 -1
  73. package/build/components/editor-snackbars/index.js +4 -2
  74. package/build/components/editor-snackbars/index.js.map +1 -1
  75. package/build/components/entities-saved-states/entity-record-item.js +3 -1
  76. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  77. package/build/components/entities-saved-states/entity-type-list.js +3 -1
  78. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  79. package/build/components/entities-saved-states/hooks/use-is-dirty.js +3 -1
  80. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  81. package/build/components/entities-saved-states/index.js +3 -1
  82. package/build/components/entities-saved-states/index.js.map +1 -1
  83. package/build/components/error-boundary/index.js +5 -3
  84. package/build/components/error-boundary/index.js.map +1 -1
  85. package/build/components/global-keyboard-shortcuts/index.js +2 -0
  86. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  87. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -1
  88. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  89. package/build/components/global-styles/block-link.js +2 -0
  90. package/build/components/global-styles/block-link.js.map +1 -1
  91. package/build/components/global-styles/header.js +3 -1
  92. package/build/components/global-styles/header.js.map +1 -1
  93. package/build/components/global-styles/hooks.js +3 -1
  94. package/build/components/global-styles/hooks.js.map +1 -1
  95. package/build/components/global-styles/index.js +3 -1
  96. package/build/components/global-styles/index.js.map +1 -1
  97. package/build/components/global-styles/menu.js +3 -1
  98. package/build/components/global-styles/menu.js.map +1 -1
  99. package/build/components/global-styles-provider/index.js +3 -1
  100. package/build/components/global-styles-provider/index.js.map +1 -1
  101. package/build/components/global-styles-renderer/index.js +2 -0
  102. package/build/components/global-styles-renderer/index.js.map +1 -1
  103. package/build/components/global-styles-sidebar/default-sidebar.js +3 -1
  104. package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  105. package/build/components/global-styles-sidebar/index.js +3 -1
  106. package/build/components/global-styles-sidebar/index.js.map +1 -1
  107. package/build/components/global-styles-sidebar/welcome-guide-image.js +2 -0
  108. package/build/components/global-styles-sidebar/welcome-guide-image.js.map +1 -1
  109. package/build/components/global-styles-sidebar/welcome-guide.js +3 -1
  110. package/build/components/global-styles-sidebar/welcome-guide.js.map +1 -1
  111. package/build/components/header/back-button.js +8 -6
  112. package/build/components/header/back-button.js.map +1 -1
  113. package/build/components/header/index.js +5 -3
  114. package/build/components/header/index.js.map +1 -1
  115. package/build/components/index.js +4 -2
  116. package/build/components/index.js.map +2 -2
  117. package/build/components/inserter-sidebar/index.js +4 -2
  118. package/build/components/inserter-sidebar/index.js.map +1 -1
  119. package/build/components/keyboard-shortcut-help-modal/config.js +3 -1
  120. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  121. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -1
  122. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  123. package/build/components/keyboard-shortcut-help-modal/index.js +7 -5
  124. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  125. package/build/components/keyboard-shortcut-help-modal/shortcut.js +3 -1
  126. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  127. package/build/components/list-view-sidebar/index.js +4 -2
  128. package/build/components/list-view-sidebar/index.js.map +1 -1
  129. package/build/components/list-view-sidebar/list-view-outline.js +3 -1
  130. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  131. package/build/components/local-autosave-monitor/index.js +6 -4
  132. package/build/components/local-autosave-monitor/index.js.map +1 -1
  133. package/build/components/media-categories/index.js +8 -6
  134. package/build/components/media-categories/index.js.map +1 -1
  135. package/build/components/mode-switcher/index.js +4 -2
  136. package/build/components/mode-switcher/index.js.map +1 -1
  137. package/build/components/more-menu/copy-content-menu-item.js +3 -1
  138. package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
  139. package/build/components/more-menu/index.js +4 -2
  140. package/build/components/more-menu/index.js.map +2 -2
  141. package/build/components/more-menu/tools-more-menu-group.js +4 -2
  142. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  143. package/build/components/more-menu/view-more-menu-group.js +4 -2
  144. package/build/components/more-menu/view-more-menu-group.js.map +1 -1
  145. package/build/components/page-attributes/check.js +2 -0
  146. package/build/components/page-attributes/check.js.map +1 -1
  147. package/build/components/page-attributes/order.js +3 -1
  148. package/build/components/page-attributes/order.js.map +1 -1
  149. package/build/components/page-attributes/panel.js +4 -2
  150. package/build/components/page-attributes/panel.js.map +1 -1
  151. package/build/components/page-attributes/parent.js +4 -2
  152. package/build/components/page-attributes/parent.js.map +1 -1
  153. package/build/components/pattern-duplicate-modal/index.js +5 -3
  154. package/build/components/pattern-duplicate-modal/index.js.map +1 -1
  155. package/build/components/pattern-overrides-panel/index.js +4 -2
  156. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  157. package/build/components/pattern-rename-modal/index.js +5 -3
  158. package/build/components/pattern-rename-modal/index.js.map +1 -1
  159. package/build/components/plugin-document-setting-panel/index.js +5 -3
  160. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  161. package/build/components/plugin-more-menu-item/index.js +3 -1
  162. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  163. package/build/components/plugin-post-publish-panel/index.js +5 -3
  164. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  165. package/build/components/plugin-post-status-info/index.js +5 -3
  166. package/build/components/plugin-post-status-info/index.js.map +1 -1
  167. package/build/components/plugin-pre-publish-panel/index.js +5 -3
  168. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  169. package/build/components/plugin-preview-menu-item/index.js +3 -1
  170. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  171. package/build/components/plugin-sidebar/index.js +3 -1
  172. package/build/components/plugin-sidebar/index.js.map +1 -1
  173. package/build/components/plugin-sidebar-more-menu-item/index.js +3 -1
  174. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  175. package/build/components/post-actions/actions.js +3 -1
  176. package/build/components/post-actions/actions.js.map +1 -1
  177. package/build/components/post-actions/index.js +4 -2
  178. package/build/components/post-actions/index.js.map +1 -1
  179. package/build/components/post-actions/set-as-homepage.js +5 -3
  180. package/build/components/post-actions/set-as-homepage.js.map +1 -1
  181. package/build/components/post-actions/set-as-posts-page.js +5 -3
  182. package/build/components/post-actions/set-as-posts-page.js.map +1 -1
  183. package/build/components/post-author/check.js +3 -1
  184. package/build/components/post-author/check.js.map +1 -1
  185. package/build/components/post-author/combobox.js +3 -1
  186. package/build/components/post-author/combobox.js.map +1 -1
  187. package/build/components/post-author/constants.js +4 -2
  188. package/build/components/post-author/constants.js.map +1 -1
  189. package/build/components/post-author/hook.js +2 -0
  190. package/build/components/post-author/hook.js.map +1 -1
  191. package/build/components/post-author/index.js +4 -2
  192. package/build/components/post-author/index.js.map +1 -1
  193. package/build/components/post-author/panel.js +3 -1
  194. package/build/components/post-author/panel.js.map +1 -1
  195. package/build/components/post-author/select.js +3 -1
  196. package/build/components/post-author/select.js.map +1 -1
  197. package/build/components/post-card-panel/index.js +4 -2
  198. package/build/components/post-card-panel/index.js.map +1 -1
  199. package/build/components/post-comments/index.js +4 -2
  200. package/build/components/post-comments/index.js.map +1 -1
  201. package/build/components/post-content-information/index.js +4 -2
  202. package/build/components/post-content-information/index.js.map +1 -1
  203. package/build/components/post-discussion/panel.js +4 -2
  204. package/build/components/post-discussion/panel.js.map +1 -1
  205. package/build/components/post-excerpt/check.js +3 -1
  206. package/build/components/post-excerpt/check.js.map +1 -1
  207. package/build/components/post-excerpt/index.js +3 -1
  208. package/build/components/post-excerpt/index.js.map +1 -1
  209. package/build/components/post-excerpt/panel.js +4 -2
  210. package/build/components/post-excerpt/panel.js.map +1 -1
  211. package/build/components/post-excerpt/plugin.js +5 -3
  212. package/build/components/post-excerpt/plugin.js.map +1 -1
  213. package/build/components/post-featured-image/check.js +3 -1
  214. package/build/components/post-featured-image/check.js.map +1 -1
  215. package/build/components/post-featured-image/index.js +10 -8
  216. package/build/components/post-featured-image/index.js.map +1 -1
  217. package/build/components/post-featured-image/panel.js +4 -2
  218. package/build/components/post-featured-image/panel.js.map +1 -1
  219. package/build/components/post-fields/index.js +2 -0
  220. package/build/components/post-fields/index.js.map +1 -1
  221. package/build/components/post-format/check.js +3 -1
  222. package/build/components/post-format/check.js.map +1 -1
  223. package/build/components/post-format/index.js +4 -2
  224. package/build/components/post-format/index.js.map +1 -1
  225. package/build/components/post-format/panel.js +3 -1
  226. package/build/components/post-format/panel.js.map +1 -1
  227. package/build/components/post-last-edited-panel/index.js +3 -1
  228. package/build/components/post-last-edited-panel/index.js.map +1 -1
  229. package/build/components/post-last-revision/check.js +3 -1
  230. package/build/components/post-last-revision/check.js.map +1 -1
  231. package/build/components/post-last-revision/index.js +3 -1
  232. package/build/components/post-last-revision/index.js.map +1 -1
  233. package/build/components/post-last-revision/panel.js +3 -1
  234. package/build/components/post-last-revision/panel.js.map +1 -1
  235. package/build/components/post-locked-modal/index.js +3 -1
  236. package/build/components/post-locked-modal/index.js.map +1 -1
  237. package/build/components/post-panel-row/index.js +4 -2
  238. package/build/components/post-panel-row/index.js.map +1 -1
  239. package/build/components/post-panel-section/index.js +3 -1
  240. package/build/components/post-panel-section/index.js.map +1 -1
  241. package/build/components/post-pending-status/check.js +2 -0
  242. package/build/components/post-pending-status/check.js.map +1 -1
  243. package/build/components/post-pending-status/index.js +3 -1
  244. package/build/components/post-pending-status/index.js.map +1 -1
  245. package/build/components/post-pingbacks/index.js +3 -1
  246. package/build/components/post-pingbacks/index.js.map +1 -1
  247. package/build/components/post-preview-button/index.js +3 -1
  248. package/build/components/post-preview-button/index.js.map +1 -1
  249. package/build/components/post-publish-button/index.js +6 -4
  250. package/build/components/post-publish-button/index.js.map +1 -1
  251. package/build/components/post-publish-button/label.js +2 -0
  252. package/build/components/post-publish-button/label.js.map +1 -1
  253. package/build/components/post-publish-button/post-publish-button-or-toggle.js +5 -3
  254. package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  255. package/build/components/post-publish-panel/index.js +5 -3
  256. package/build/components/post-publish-panel/index.js.map +1 -1
  257. package/build/components/post-publish-panel/maybe-category-panel.js +3 -1
  258. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  259. package/build/components/post-publish-panel/maybe-post-format-panel.js +5 -3
  260. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  261. package/build/components/post-publish-panel/maybe-tags-panel.js +5 -3
  262. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  263. package/build/components/post-publish-panel/maybe-upload-media.js +3 -1
  264. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  265. package/build/components/post-publish-panel/media-util.js +2 -0
  266. package/build/components/post-publish-panel/media-util.js.map +1 -1
  267. package/build/components/post-publish-panel/postpublish.js +6 -4
  268. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  269. package/build/components/post-publish-panel/prepublish.js +3 -1
  270. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  271. package/build/components/post-saved-state/index.js +3 -1
  272. package/build/components/post-saved-state/index.js.map +1 -1
  273. package/build/components/post-schedule/check.js +2 -0
  274. package/build/components/post-schedule/check.js.map +1 -1
  275. package/build/components/post-schedule/index.js +4 -2
  276. package/build/components/post-schedule/index.js.map +1 -1
  277. package/build/components/post-schedule/label.js +2 -0
  278. package/build/components/post-schedule/label.js.map +1 -1
  279. package/build/components/post-schedule/panel.js +4 -2
  280. package/build/components/post-schedule/panel.js.map +1 -1
  281. package/build/components/post-status/index.js +6 -4
  282. package/build/components/post-status/index.js.map +1 -1
  283. package/build/components/post-sticky/check.js +2 -0
  284. package/build/components/post-sticky/check.js.map +1 -1
  285. package/build/components/post-sticky/index.js +3 -1
  286. package/build/components/post-sticky/index.js.map +1 -1
  287. package/build/components/post-sticky/panel.js +3 -1
  288. package/build/components/post-sticky/panel.js.map +1 -1
  289. package/build/components/post-switch-to-draft-button/index.js +3 -1
  290. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  291. package/build/components/post-sync-status/index.js +3 -1
  292. package/build/components/post-sync-status/index.js.map +1 -1
  293. package/build/components/post-taxonomies/check.js +2 -0
  294. package/build/components/post-taxonomies/check.js.map +1 -1
  295. package/build/components/post-taxonomies/flat-term-selector.js +9 -7
  296. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  297. package/build/components/post-taxonomies/hierarchical-term-selector.js +8 -6
  298. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  299. package/build/components/post-taxonomies/index.js +4 -2
  300. package/build/components/post-taxonomies/index.js.map +1 -1
  301. package/build/components/post-taxonomies/most-used-terms.js +5 -3
  302. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  303. package/build/components/post-taxonomies/panel.js +3 -1
  304. package/build/components/post-taxonomies/panel.js.map +1 -1
  305. package/build/components/post-template/block-theme.js +3 -1
  306. package/build/components/post-template/block-theme.js.map +1 -1
  307. package/build/components/post-template/classic-theme.js +3 -1
  308. package/build/components/post-template/classic-theme.js.map +1 -1
  309. package/build/components/post-template/create-new-template-modal.js +4 -2
  310. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  311. package/build/components/post-template/create-new-template.js +3 -1
  312. package/build/components/post-template/create-new-template.js.map +1 -1
  313. package/build/components/post-template/hooks.js +2 -0
  314. package/build/components/post-template/hooks.js.map +1 -1
  315. package/build/components/post-template/panel.js +3 -1
  316. package/build/components/post-template/panel.js.map +1 -1
  317. package/build/components/post-template/reset-default-template.js +3 -1
  318. package/build/components/post-template/reset-default-template.js.map +1 -1
  319. package/build/components/post-template/swap-template-button.js +3 -1
  320. package/build/components/post-template/swap-template-button.js.map +1 -1
  321. package/build/components/post-text-editor/index.js +3 -1
  322. package/build/components/post-text-editor/index.js.map +1 -1
  323. package/build/components/post-title/constants.js +4 -2
  324. package/build/components/post-title/constants.js.map +1 -1
  325. package/build/components/post-title/index.js +7 -5
  326. package/build/components/post-title/index.js.map +1 -1
  327. package/build/components/post-title/post-title-raw.js +3 -1
  328. package/build/components/post-title/post-title-raw.js.map +1 -1
  329. package/build/components/post-title/use-post-title-focus.js +2 -0
  330. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  331. package/build/components/post-title/use-post-title.js +2 -0
  332. package/build/components/post-title/use-post-title.js.map +1 -1
  333. package/build/components/post-transform-panel/hooks.js +3 -1
  334. package/build/components/post-transform-panel/hooks.js.map +1 -1
  335. package/build/components/post-transform-panel/index.js +3 -1
  336. package/build/components/post-transform-panel/index.js.map +1 -1
  337. package/build/components/post-trash/check.js +2 -0
  338. package/build/components/post-trash/check.js.map +1 -1
  339. package/build/components/post-trash/index.js +3 -1
  340. package/build/components/post-trash/index.js.map +1 -1
  341. package/build/components/post-type-support-check/index.js +2 -0
  342. package/build/components/post-type-support-check/index.js.map +1 -1
  343. package/build/components/post-url/check.js +2 -0
  344. package/build/components/post-url/check.js.map +1 -1
  345. package/build/components/post-url/index.js +3 -1
  346. package/build/components/post-url/index.js.map +1 -1
  347. package/build/components/post-url/label.js +2 -0
  348. package/build/components/post-url/label.js.map +1 -1
  349. package/build/components/post-url/panel.js +3 -1
  350. package/build/components/post-url/panel.js.map +1 -1
  351. package/build/components/post-view-link/index.js +3 -1
  352. package/build/components/post-view-link/index.js.map +1 -1
  353. package/build/components/post-visibility/check.js +2 -0
  354. package/build/components/post-visibility/check.js.map +1 -1
  355. package/build/components/post-visibility/index.js +3 -1
  356. package/build/components/post-visibility/index.js.map +1 -1
  357. package/build/components/post-visibility/label.js +2 -0
  358. package/build/components/post-visibility/label.js.map +1 -1
  359. package/build/components/post-visibility/utils.js +3 -1
  360. package/build/components/post-visibility/utils.js.map +1 -1
  361. package/build/components/posts-per-page/index.js +3 -1
  362. package/build/components/posts-per-page/index.js.map +1 -1
  363. package/build/components/preferences-modal/enable-panel.js +4 -2
  364. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  365. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +5 -3
  366. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  367. package/build/components/preferences-modal/enable-publish-sidebar.js +4 -2
  368. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  369. package/build/components/preferences-modal/index.js +5 -3
  370. package/build/components/preferences-modal/index.js.map +2 -2
  371. package/build/components/preview-dropdown/index.js +3 -1
  372. package/build/components/preview-dropdown/index.js.map +1 -1
  373. package/build/components/provider/disable-non-page-content-blocks.js +2 -0
  374. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  375. package/build/components/provider/index.js +8 -6
  376. package/build/components/provider/index.js.map +1 -1
  377. package/build/components/provider/navigation-block-editing-mode.js +2 -0
  378. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  379. package/build/components/provider/use-auto-switch-editor-sidebars.js +2 -0
  380. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -1
  381. package/build/components/provider/use-block-editor-settings.js +5 -3
  382. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  383. package/build/components/provider/use-hide-blocks-from-inserter.js +3 -1
  384. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  385. package/build/components/provider/use-post-content-blocks.js +3 -1
  386. package/build/components/provider/use-post-content-blocks.js.map +1 -1
  387. package/build/components/provider/with-registry-provider.js +4 -2
  388. package/build/components/provider/with-registry-provider.js.map +1 -1
  389. package/build/components/resizable-editor/index.js +4 -2
  390. package/build/components/resizable-editor/index.js.map +1 -1
  391. package/build/components/resizable-editor/resize-handle.js +4 -2
  392. package/build/components/resizable-editor/resize-handle.js.map +1 -1
  393. package/build/components/save-publish-panels/index.js +5 -3
  394. package/build/components/save-publish-panels/index.js.map +1 -1
  395. package/build/components/sidebar/constants.js +3 -1
  396. package/build/components/sidebar/constants.js.map +1 -1
  397. package/build/components/sidebar/header.js +5 -3
  398. package/build/components/sidebar/header.js.map +1 -1
  399. package/build/components/sidebar/index.js +7 -5
  400. package/build/components/sidebar/index.js.map +1 -1
  401. package/build/components/sidebar/post-summary.js +4 -2
  402. package/build/components/sidebar/post-summary.js.map +1 -1
  403. package/build/components/site-discussion/index.js +4 -2
  404. package/build/components/site-discussion/index.js.map +1 -1
  405. package/build/components/start-page-options/index.js +7 -6
  406. package/build/components/start-page-options/index.js.map +2 -2
  407. package/build/components/start-template-options/index.js +3 -1
  408. package/build/components/start-template-options/index.js.map +1 -1
  409. package/build/components/style-book/categories.js +2 -0
  410. package/build/components/style-book/categories.js.map +1 -1
  411. package/build/components/style-book/color-examples.js +4 -2
  412. package/build/components/style-book/color-examples.js.map +1 -1
  413. package/build/components/style-book/constants.js +9 -7
  414. package/build/components/style-book/constants.js.map +1 -1
  415. package/build/components/style-book/duotone-examples.js +4 -2
  416. package/build/components/style-book/duotone-examples.js.map +1 -1
  417. package/build/components/style-book/examples.js +3 -1
  418. package/build/components/style-book/examples.js.map +1 -1
  419. package/build/components/style-book/index.js +13 -11
  420. package/build/components/style-book/index.js.map +1 -1
  421. package/build/components/style-book/types.js +2 -0
  422. package/build/components/style-book/types.js.map +1 -1
  423. package/build/components/styles-canvas/index.js +3 -1
  424. package/build/components/styles-canvas/index.js.map +1 -1
  425. package/build/components/styles-canvas/revisions.js +4 -2
  426. package/build/components/styles-canvas/revisions.js.map +1 -1
  427. package/build/components/styles-canvas/style-book.js +3 -1
  428. package/build/components/styles-canvas/style-book.js.map +1 -1
  429. package/build/components/table-of-contents/index.js +3 -1
  430. package/build/components/table-of-contents/index.js.map +1 -1
  431. package/build/components/table-of-contents/panel.js +3 -1
  432. package/build/components/table-of-contents/panel.js.map +1 -1
  433. package/build/components/template-content-panel/index.js +6 -4
  434. package/build/components/template-content-panel/index.js.map +1 -1
  435. package/build/components/template-part-content-panel/index.js +4 -2
  436. package/build/components/template-part-content-panel/index.js.map +1 -1
  437. package/build/components/template-part-menu-items/convert-to-regular.js +3 -1
  438. package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -1
  439. package/build/components/template-part-menu-items/convert-to-template-part.js +3 -1
  440. package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
  441. package/build/components/template-part-menu-items/index.js +3 -1
  442. package/build/components/template-part-menu-items/index.js.map +1 -1
  443. package/build/components/template-validation-notice/index.js +3 -1
  444. package/build/components/template-validation-notice/index.js.map +1 -1
  445. package/build/components/text-editor/index.js +3 -1
  446. package/build/components/text-editor/index.js.map +1 -1
  447. package/build/components/theme-support-check/index.js +2 -0
  448. package/build/components/theme-support-check/index.js.map +1 -1
  449. package/build/components/time-to-read/index.js +4 -2
  450. package/build/components/time-to-read/index.js.map +1 -1
  451. package/build/components/unsaved-changes-warning/index.js +2 -0
  452. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  453. package/build/components/visual-editor/edit-template-blocks-notification.js +3 -1
  454. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  455. package/build/components/visual-editor/index.js +25 -12
  456. package/build/components/visual-editor/index.js.map +2 -2
  457. package/build/components/visual-editor/use-select-nearest-editable-block.js +3 -1
  458. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  459. package/build/components/visual-editor/use-zoom-out-mode-exit.js +2 -0
  460. package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -1
  461. package/build/components/word-count/index.js +3 -1
  462. package/build/components/word-count/index.js.map +1 -1
  463. package/build/components/zoom-out-toggle/index.js +4 -2
  464. package/build/components/zoom-out-toggle/index.js.map +1 -1
  465. package/build/dataviews/api.js +2 -0
  466. package/build/dataviews/api.js.map +1 -1
  467. package/build/dataviews/fields/content-preview/content-preview-view.js +4 -2
  468. package/build/dataviews/fields/content-preview/content-preview-view.js.map +1 -1
  469. package/build/dataviews/fields/content-preview/index.js +3 -1
  470. package/build/dataviews/fields/content-preview/index.js.map +1 -1
  471. package/build/dataviews/store/private-actions.js +3 -1
  472. package/build/dataviews/store/private-actions.js.map +1 -1
  473. package/build/dataviews/store/private-selectors.js +3 -1
  474. package/build/dataviews/store/private-selectors.js.map +1 -1
  475. package/build/dataviews/store/reducer.js +2 -0
  476. package/build/dataviews/store/reducer.js.map +1 -1
  477. package/build/hooks/custom-sources-backwards-compatibility.js +4 -2
  478. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  479. package/build/hooks/default-autocompleters.js +2 -0
  480. package/build/hooks/default-autocompleters.js.map +1 -1
  481. package/build/hooks/index.js +2 -0
  482. package/build/hooks/index.js.map +1 -1
  483. package/build/hooks/media-upload.js +3 -1
  484. package/build/hooks/media-upload.js.map +1 -1
  485. package/build/hooks/navigation-link-view-button.js +5 -3
  486. package/build/hooks/navigation-link-view-button.js.map +1 -1
  487. package/build/hooks/pattern-overrides.js +5 -3
  488. package/build/hooks/pattern-overrides.js.map +1 -1
  489. package/build/hooks/push-changes-to-global-styles/index.js +12 -10
  490. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  491. package/build/hooks/template-part-navigation-edit-button.js +7 -5
  492. package/build/hooks/template-part-navigation-edit-button.js.map +1 -1
  493. package/build/hooks/use-global-styles-output.js +2 -0
  494. package/build/hooks/use-global-styles-output.js.map +1 -1
  495. package/build/index.js +2 -0
  496. package/build/index.js.map +1 -1
  497. package/build/lock-unlock.js +3 -1
  498. package/build/lock-unlock.js.map +1 -1
  499. package/build/private-apis.js +4 -2
  500. package/build/private-apis.js.map +1 -1
  501. package/build/store/actions.js +53 -51
  502. package/build/store/actions.js.map +1 -1
  503. package/build/store/constants.js +15 -13
  504. package/build/store/constants.js.map +1 -1
  505. package/build/store/defaults.js +3 -1
  506. package/build/store/defaults.js.map +1 -1
  507. package/build/store/index.js +4 -2
  508. package/build/store/index.js.map +1 -1
  509. package/build/store/local-autosave.js +2 -0
  510. package/build/store/local-autosave.js.map +1 -1
  511. package/build/store/private-actions.js +17 -7
  512. package/build/store/private-actions.js.map +2 -2
  513. package/build/store/private-selectors.js +15 -8
  514. package/build/store/private-selectors.js.map +2 -2
  515. package/build/store/reducer.js +12 -0
  516. package/build/store/reducer.js.map +2 -2
  517. package/build/store/selectors.js +80 -78
  518. package/build/store/selectors.js.map +2 -2
  519. package/build/store/utils/is-template-revertable.js +2 -0
  520. package/build/store/utils/is-template-revertable.js.map +1 -1
  521. package/build/store/utils/notice-builder.js +2 -0
  522. package/build/store/utils/notice-builder.js.map +1 -1
  523. package/build/utils/get-item-title.js +2 -0
  524. package/build/utils/get-item-title.js.map +1 -1
  525. package/build/utils/get-template-info.js +4 -2
  526. package/build/utils/get-template-info.js.map +1 -1
  527. package/build/utils/get-template-part-icon.js +2 -0
  528. package/build/utils/get-template-part-icon.js.map +1 -1
  529. package/build/utils/index.js +2 -0
  530. package/build/utils/index.js.map +1 -1
  531. package/build/utils/media-sideload/index.js +3 -1
  532. package/build/utils/media-sideload/index.js.map +1 -1
  533. package/build/utils/media-upload/index.js +3 -1
  534. package/build/utils/media-upload/index.js.map +1 -1
  535. package/build/utils/pageTypeBadge.js +2 -0
  536. package/build/utils/pageTypeBadge.js.map +1 -1
  537. package/build/utils/search-templates.js +2 -0
  538. package/build/utils/search-templates.js.map +1 -1
  539. package/build/utils/set-nested-value.js +2 -0
  540. package/build/utils/set-nested-value.js.map +1 -1
  541. package/build/utils/terms.js +5 -3
  542. package/build/utils/terms.js.map +1 -1
  543. package/build/utils/url.js +2 -0
  544. package/build/utils/url.js.map +1 -1
  545. package/build-module/bindings/api.js +1 -0
  546. package/build-module/bindings/api.js.map +1 -1
  547. package/build-module/bindings/pattern-overrides.js +2 -1
  548. package/build-module/bindings/pattern-overrides.js.map +1 -1
  549. package/build-module/bindings/post-data.js +49 -64
  550. package/build-module/bindings/post-data.js.map +2 -2
  551. package/build-module/bindings/post-meta.js +46 -39
  552. package/build-module/bindings/post-meta.js.map +2 -2
  553. package/build-module/bindings/term-data.js +2 -1
  554. package/build-module/bindings/term-data.js.map +1 -1
  555. package/build-module/components/autocompleters/index.js +1 -0
  556. package/build-module/components/autocompleters/index.js.map +1 -1
  557. package/build-module/components/autocompleters/user.js +2 -1
  558. package/build-module/components/autocompleters/user.js.map +1 -1
  559. package/build-module/components/autosave-monitor/index.js +3 -2
  560. package/build-module/components/autosave-monitor/index.js.map +1 -1
  561. package/build-module/components/block-removal-warnings/index.js +5 -4
  562. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  563. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +5 -4
  564. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  565. package/build-module/components/block-visibility/index.js +4 -3
  566. package/build-module/components/block-visibility/index.js.map +1 -1
  567. package/build-module/components/blog-title/index.js +3 -2
  568. package/build-module/components/blog-title/index.js.map +1 -1
  569. package/build-module/components/character-count/index.js +1 -0
  570. package/build-module/components/character-count/index.js.map +1 -1
  571. package/build-module/components/collab-sidebar/add-comment.js +18 -13
  572. package/build-module/components/collab-sidebar/add-comment.js.map +2 -2
  573. package/build-module/components/collab-sidebar/comment-author-info.js +3 -2
  574. package/build-module/components/collab-sidebar/comment-author-info.js.map +2 -2
  575. package/build-module/components/collab-sidebar/comment-form.js +2 -1
  576. package/build-module/components/collab-sidebar/comment-form.js.map +1 -1
  577. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js +19 -28
  578. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +2 -2
  579. package/build-module/components/collab-sidebar/comment-menu-item.js +43 -9
  580. package/build-module/components/collab-sidebar/comment-menu-item.js.map +2 -2
  581. package/build-module/components/collab-sidebar/comments.js +349 -324
  582. package/build-module/components/collab-sidebar/comments.js.map +2 -2
  583. package/build-module/components/collab-sidebar/constants.js +4 -3
  584. package/build-module/components/collab-sidebar/constants.js.map +1 -1
  585. package/build-module/components/collab-sidebar/hooks.js +7 -4
  586. package/build-module/components/collab-sidebar/hooks.js.map +2 -2
  587. package/build-module/components/collab-sidebar/index.js +49 -24
  588. package/build-module/components/collab-sidebar/index.js.map +2 -2
  589. package/build-module/components/collab-sidebar/utils.js +3 -2
  590. package/build-module/components/collab-sidebar/utils.js.map +2 -2
  591. package/build-module/components/collapsible-block-toolbar/index.js +3 -2
  592. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  593. package/build-module/components/commands/index.js +5 -4
  594. package/build-module/components/commands/index.js.map +1 -1
  595. package/build-module/components/deprecated.js +54 -53
  596. package/build-module/components/deprecated.js.map +1 -1
  597. package/build-module/components/document-bar/index.js +3 -2
  598. package/build-module/components/document-bar/index.js.map +1 -1
  599. package/build-module/components/document-outline/check.js +1 -0
  600. package/build-module/components/document-outline/check.js.map +1 -1
  601. package/build-module/components/document-outline/index.js +8 -7
  602. package/build-module/components/document-outline/index.js.map +1 -1
  603. package/build-module/components/document-outline/item.js +3 -2
  604. package/build-module/components/document-outline/item.js.map +1 -1
  605. package/build-module/components/document-tools/index.js +2 -1
  606. package/build-module/components/document-tools/index.js.map +1 -1
  607. package/build-module/components/editor/index.js +3 -2
  608. package/build-module/components/editor/index.js.map +2 -2
  609. package/build-module/components/editor-history/redo.js +2 -1
  610. package/build-module/components/editor-history/redo.js.map +1 -1
  611. package/build-module/components/editor-history/undo.js +2 -1
  612. package/build-module/components/editor-history/undo.js.map +1 -1
  613. package/build-module/components/editor-interface/index.js +3 -2
  614. package/build-module/components/editor-interface/index.js.map +1 -1
  615. package/build-module/components/editor-notices/index.js +2 -1
  616. package/build-module/components/editor-notices/index.js.map +1 -1
  617. package/build-module/components/editor-snackbars/index.js +3 -2
  618. package/build-module/components/editor-snackbars/index.js.map +1 -1
  619. package/build-module/components/entities-saved-states/entity-record-item.js +2 -1
  620. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  621. package/build-module/components/entities-saved-states/entity-type-list.js +2 -1
  622. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  623. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +2 -1
  624. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  625. package/build-module/components/entities-saved-states/index.js +2 -1
  626. package/build-module/components/entities-saved-states/index.js.map +1 -1
  627. package/build-module/components/error-boundary/index.js +4 -3
  628. package/build-module/components/error-boundary/index.js.map +1 -1
  629. package/build-module/components/global-keyboard-shortcuts/index.js +1 -0
  630. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  631. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +2 -1
  632. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  633. package/build-module/components/global-styles/block-link.js +1 -0
  634. package/build-module/components/global-styles/block-link.js.map +1 -1
  635. package/build-module/components/global-styles/header.js +2 -1
  636. package/build-module/components/global-styles/header.js.map +1 -1
  637. package/build-module/components/global-styles/hooks.js +2 -1
  638. package/build-module/components/global-styles/hooks.js.map +1 -1
  639. package/build-module/components/global-styles/index.js +3 -2
  640. package/build-module/components/global-styles/index.js.map +1 -1
  641. package/build-module/components/global-styles/menu.js +2 -1
  642. package/build-module/components/global-styles/menu.js.map +1 -1
  643. package/build-module/components/global-styles-provider/index.js +2 -1
  644. package/build-module/components/global-styles-provider/index.js.map +1 -1
  645. package/build-module/components/global-styles-renderer/index.js +1 -0
  646. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  647. package/build-module/components/global-styles-sidebar/default-sidebar.js +2 -1
  648. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
  649. package/build-module/components/global-styles-sidebar/index.js +2 -1
  650. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  651. package/build-module/components/global-styles-sidebar/welcome-guide-image.js +1 -0
  652. package/build-module/components/global-styles-sidebar/welcome-guide-image.js.map +1 -1
  653. package/build-module/components/global-styles-sidebar/welcome-guide.js +2 -1
  654. package/build-module/components/global-styles-sidebar/welcome-guide.js.map +1 -1
  655. package/build-module/components/header/back-button.js +7 -6
  656. package/build-module/components/header/back-button.js.map +1 -1
  657. package/build-module/components/header/index.js +4 -3
  658. package/build-module/components/header/index.js.map +1 -1
  659. package/build-module/components/index.js +3 -2
  660. package/build-module/components/index.js.map +1 -1
  661. package/build-module/components/inserter-sidebar/index.js +3 -2
  662. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  663. package/build-module/components/keyboard-shortcut-help-modal/config.js +2 -1
  664. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  665. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -1
  666. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  667. package/build-module/components/keyboard-shortcut-help-modal/index.js +6 -5
  668. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  669. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +5 -4
  670. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  671. package/build-module/components/list-view-sidebar/index.js +3 -2
  672. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  673. package/build-module/components/list-view-sidebar/list-view-outline.js +2 -1
  674. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  675. package/build-module/components/local-autosave-monitor/index.js +5 -4
  676. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  677. package/build-module/components/media-categories/index.js +7 -6
  678. package/build-module/components/media-categories/index.js.map +1 -1
  679. package/build-module/components/mode-switcher/index.js +3 -2
  680. package/build-module/components/mode-switcher/index.js.map +1 -1
  681. package/build-module/components/more-menu/copy-content-menu-item.js +2 -1
  682. package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
  683. package/build-module/components/more-menu/index.js +3 -2
  684. package/build-module/components/more-menu/index.js.map +2 -2
  685. package/build-module/components/more-menu/tools-more-menu-group.js +3 -2
  686. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  687. package/build-module/components/more-menu/view-more-menu-group.js +3 -2
  688. package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
  689. package/build-module/components/page-attributes/check.js +1 -0
  690. package/build-module/components/page-attributes/check.js.map +1 -1
  691. package/build-module/components/page-attributes/order.js +2 -1
  692. package/build-module/components/page-attributes/order.js.map +1 -1
  693. package/build-module/components/page-attributes/panel.js +3 -2
  694. package/build-module/components/page-attributes/panel.js.map +1 -1
  695. package/build-module/components/page-attributes/parent.js +3 -2
  696. package/build-module/components/page-attributes/parent.js.map +1 -1
  697. package/build-module/components/pattern-duplicate-modal/index.js +4 -3
  698. package/build-module/components/pattern-duplicate-modal/index.js.map +1 -1
  699. package/build-module/components/pattern-overrides-panel/index.js +3 -2
  700. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  701. package/build-module/components/pattern-rename-modal/index.js +4 -3
  702. package/build-module/components/pattern-rename-modal/index.js.map +1 -1
  703. package/build-module/components/plugin-document-setting-panel/index.js +4 -3
  704. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  705. package/build-module/components/plugin-more-menu-item/index.js +2 -1
  706. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  707. package/build-module/components/plugin-post-publish-panel/index.js +4 -3
  708. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  709. package/build-module/components/plugin-post-status-info/index.js +4 -3
  710. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  711. package/build-module/components/plugin-pre-publish-panel/index.js +4 -3
  712. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  713. package/build-module/components/plugin-preview-menu-item/index.js +2 -1
  714. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  715. package/build-module/components/plugin-sidebar/index.js +2 -1
  716. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  717. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -1
  718. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  719. package/build-module/components/post-actions/actions.js +2 -1
  720. package/build-module/components/post-actions/actions.js.map +1 -1
  721. package/build-module/components/post-actions/index.js +3 -2
  722. package/build-module/components/post-actions/index.js.map +1 -1
  723. package/build-module/components/post-actions/set-as-homepage.js +4 -3
  724. package/build-module/components/post-actions/set-as-homepage.js.map +1 -1
  725. package/build-module/components/post-actions/set-as-posts-page.js +4 -3
  726. package/build-module/components/post-actions/set-as-posts-page.js.map +1 -1
  727. package/build-module/components/post-author/check.js +2 -1
  728. package/build-module/components/post-author/check.js.map +1 -1
  729. package/build-module/components/post-author/combobox.js +2 -1
  730. package/build-module/components/post-author/combobox.js.map +1 -1
  731. package/build-module/components/post-author/constants.js +3 -2
  732. package/build-module/components/post-author/constants.js.map +1 -1
  733. package/build-module/components/post-author/hook.js +1 -0
  734. package/build-module/components/post-author/hook.js.map +1 -1
  735. package/build-module/components/post-author/index.js +3 -2
  736. package/build-module/components/post-author/index.js.map +1 -1
  737. package/build-module/components/post-author/panel.js +2 -1
  738. package/build-module/components/post-author/panel.js.map +1 -1
  739. package/build-module/components/post-author/select.js +2 -1
  740. package/build-module/components/post-author/select.js.map +1 -1
  741. package/build-module/components/post-card-panel/index.js +3 -2
  742. package/build-module/components/post-card-panel/index.js.map +1 -1
  743. package/build-module/components/post-comments/index.js +3 -2
  744. package/build-module/components/post-comments/index.js.map +1 -1
  745. package/build-module/components/post-content-information/index.js +3 -2
  746. package/build-module/components/post-content-information/index.js.map +1 -1
  747. package/build-module/components/post-discussion/panel.js +3 -2
  748. package/build-module/components/post-discussion/panel.js.map +1 -1
  749. package/build-module/components/post-excerpt/check.js +2 -1
  750. package/build-module/components/post-excerpt/check.js.map +1 -1
  751. package/build-module/components/post-excerpt/index.js +2 -1
  752. package/build-module/components/post-excerpt/index.js.map +1 -1
  753. package/build-module/components/post-excerpt/panel.js +3 -2
  754. package/build-module/components/post-excerpt/panel.js.map +1 -1
  755. package/build-module/components/post-excerpt/plugin.js +4 -3
  756. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  757. package/build-module/components/post-featured-image/check.js +2 -1
  758. package/build-module/components/post-featured-image/check.js.map +1 -1
  759. package/build-module/components/post-featured-image/index.js +9 -8
  760. package/build-module/components/post-featured-image/index.js.map +1 -1
  761. package/build-module/components/post-featured-image/panel.js +3 -2
  762. package/build-module/components/post-featured-image/panel.js.map +1 -1
  763. package/build-module/components/post-fields/index.js +1 -0
  764. package/build-module/components/post-fields/index.js.map +1 -1
  765. package/build-module/components/post-format/check.js +2 -1
  766. package/build-module/components/post-format/check.js.map +1 -1
  767. package/build-module/components/post-format/index.js +3 -2
  768. package/build-module/components/post-format/index.js.map +1 -1
  769. package/build-module/components/post-format/panel.js +2 -1
  770. package/build-module/components/post-format/panel.js.map +1 -1
  771. package/build-module/components/post-last-edited-panel/index.js +2 -1
  772. package/build-module/components/post-last-edited-panel/index.js.map +1 -1
  773. package/build-module/components/post-last-revision/check.js +2 -1
  774. package/build-module/components/post-last-revision/check.js.map +1 -1
  775. package/build-module/components/post-last-revision/index.js +2 -1
  776. package/build-module/components/post-last-revision/index.js.map +1 -1
  777. package/build-module/components/post-last-revision/panel.js +2 -1
  778. package/build-module/components/post-last-revision/panel.js.map +1 -1
  779. package/build-module/components/post-locked-modal/index.js +2 -1
  780. package/build-module/components/post-locked-modal/index.js.map +1 -1
  781. package/build-module/components/post-panel-row/index.js +3 -2
  782. package/build-module/components/post-panel-row/index.js.map +1 -1
  783. package/build-module/components/post-panel-section/index.js +2 -1
  784. package/build-module/components/post-panel-section/index.js.map +1 -1
  785. package/build-module/components/post-pending-status/check.js +1 -0
  786. package/build-module/components/post-pending-status/check.js.map +1 -1
  787. package/build-module/components/post-pending-status/index.js +2 -1
  788. package/build-module/components/post-pending-status/index.js.map +1 -1
  789. package/build-module/components/post-pingbacks/index.js +2 -1
  790. package/build-module/components/post-pingbacks/index.js.map +1 -1
  791. package/build-module/components/post-preview-button/index.js +2 -1
  792. package/build-module/components/post-preview-button/index.js.map +1 -1
  793. package/build-module/components/post-publish-button/index.js +5 -4
  794. package/build-module/components/post-publish-button/index.js.map +1 -1
  795. package/build-module/components/post-publish-button/label.js +1 -0
  796. package/build-module/components/post-publish-button/label.js.map +1 -1
  797. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +4 -3
  798. package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
  799. package/build-module/components/post-publish-panel/index.js +4 -3
  800. package/build-module/components/post-publish-panel/index.js.map +1 -1
  801. package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -1
  802. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  803. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +4 -3
  804. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  805. package/build-module/components/post-publish-panel/maybe-tags-panel.js +4 -3
  806. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  807. package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -1
  808. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  809. package/build-module/components/post-publish-panel/media-util.js +1 -0
  810. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  811. package/build-module/components/post-publish-panel/postpublish.js +5 -4
  812. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  813. package/build-module/components/post-publish-panel/prepublish.js +2 -1
  814. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  815. package/build-module/components/post-saved-state/index.js +2 -1
  816. package/build-module/components/post-saved-state/index.js.map +1 -1
  817. package/build-module/components/post-schedule/check.js +1 -0
  818. package/build-module/components/post-schedule/check.js.map +1 -1
  819. package/build-module/components/post-schedule/index.js +3 -2
  820. package/build-module/components/post-schedule/index.js.map +1 -1
  821. package/build-module/components/post-schedule/label.js +1 -0
  822. package/build-module/components/post-schedule/label.js.map +1 -1
  823. package/build-module/components/post-schedule/panel.js +3 -2
  824. package/build-module/components/post-schedule/panel.js.map +1 -1
  825. package/build-module/components/post-status/index.js +5 -4
  826. package/build-module/components/post-status/index.js.map +1 -1
  827. package/build-module/components/post-sticky/check.js +1 -0
  828. package/build-module/components/post-sticky/check.js.map +1 -1
  829. package/build-module/components/post-sticky/index.js +2 -1
  830. package/build-module/components/post-sticky/index.js.map +1 -1
  831. package/build-module/components/post-sticky/panel.js +2 -1
  832. package/build-module/components/post-sticky/panel.js.map +1 -1
  833. package/build-module/components/post-switch-to-draft-button/index.js +2 -1
  834. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  835. package/build-module/components/post-sync-status/index.js +2 -1
  836. package/build-module/components/post-sync-status/index.js.map +1 -1
  837. package/build-module/components/post-taxonomies/check.js +1 -0
  838. package/build-module/components/post-taxonomies/check.js.map +1 -1
  839. package/build-module/components/post-taxonomies/flat-term-selector.js +8 -7
  840. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  841. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +7 -6
  842. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  843. package/build-module/components/post-taxonomies/index.js +3 -2
  844. package/build-module/components/post-taxonomies/index.js.map +1 -1
  845. package/build-module/components/post-taxonomies/most-used-terms.js +4 -3
  846. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  847. package/build-module/components/post-taxonomies/panel.js +2 -1
  848. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  849. package/build-module/components/post-template/block-theme.js +2 -1
  850. package/build-module/components/post-template/block-theme.js.map +1 -1
  851. package/build-module/components/post-template/classic-theme.js +2 -1
  852. package/build-module/components/post-template/classic-theme.js.map +1 -1
  853. package/build-module/components/post-template/create-new-template-modal.js +3 -2
  854. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  855. package/build-module/components/post-template/create-new-template.js +2 -1
  856. package/build-module/components/post-template/create-new-template.js.map +1 -1
  857. package/build-module/components/post-template/hooks.js +1 -0
  858. package/build-module/components/post-template/hooks.js.map +1 -1
  859. package/build-module/components/post-template/panel.js +2 -1
  860. package/build-module/components/post-template/panel.js.map +1 -1
  861. package/build-module/components/post-template/reset-default-template.js +2 -1
  862. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  863. package/build-module/components/post-template/swap-template-button.js +2 -1
  864. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  865. package/build-module/components/post-text-editor/index.js +2 -1
  866. package/build-module/components/post-text-editor/index.js.map +1 -1
  867. package/build-module/components/post-title/constants.js +3 -2
  868. package/build-module/components/post-title/constants.js.map +1 -1
  869. package/build-module/components/post-title/index.js +3 -2
  870. package/build-module/components/post-title/index.js.map +1 -1
  871. package/build-module/components/post-title/post-title-raw.js +2 -1
  872. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  873. package/build-module/components/post-title/use-post-title-focus.js +1 -0
  874. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  875. package/build-module/components/post-title/use-post-title.js +1 -0
  876. package/build-module/components/post-title/use-post-title.js.map +1 -1
  877. package/build-module/components/post-transform-panel/hooks.js +2 -1
  878. package/build-module/components/post-transform-panel/hooks.js.map +1 -1
  879. package/build-module/components/post-transform-panel/index.js +2 -1
  880. package/build-module/components/post-transform-panel/index.js.map +1 -1
  881. package/build-module/components/post-trash/check.js +1 -0
  882. package/build-module/components/post-trash/check.js.map +1 -1
  883. package/build-module/components/post-trash/index.js +2 -1
  884. package/build-module/components/post-trash/index.js.map +1 -1
  885. package/build-module/components/post-type-support-check/index.js +1 -0
  886. package/build-module/components/post-type-support-check/index.js.map +1 -1
  887. package/build-module/components/post-url/check.js +1 -0
  888. package/build-module/components/post-url/check.js.map +1 -1
  889. package/build-module/components/post-url/index.js +2 -1
  890. package/build-module/components/post-url/index.js.map +1 -1
  891. package/build-module/components/post-url/label.js +1 -0
  892. package/build-module/components/post-url/label.js.map +1 -1
  893. package/build-module/components/post-url/panel.js +2 -1
  894. package/build-module/components/post-url/panel.js.map +1 -1
  895. package/build-module/components/post-view-link/index.js +2 -1
  896. package/build-module/components/post-view-link/index.js.map +1 -1
  897. package/build-module/components/post-visibility/check.js +1 -0
  898. package/build-module/components/post-visibility/check.js.map +1 -1
  899. package/build-module/components/post-visibility/index.js +2 -1
  900. package/build-module/components/post-visibility/index.js.map +1 -1
  901. package/build-module/components/post-visibility/label.js +1 -0
  902. package/build-module/components/post-visibility/label.js.map +1 -1
  903. package/build-module/components/post-visibility/utils.js +2 -1
  904. package/build-module/components/post-visibility/utils.js.map +1 -1
  905. package/build-module/components/posts-per-page/index.js +2 -1
  906. package/build-module/components/posts-per-page/index.js.map +1 -1
  907. package/build-module/components/preferences-modal/enable-panel.js +3 -2
  908. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  909. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +4 -3
  910. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  911. package/build-module/components/preferences-modal/enable-publish-sidebar.js +3 -2
  912. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  913. package/build-module/components/preferences-modal/index.js +4 -3
  914. package/build-module/components/preferences-modal/index.js.map +2 -2
  915. package/build-module/components/preview-dropdown/index.js +2 -1
  916. package/build-module/components/preview-dropdown/index.js.map +1 -1
  917. package/build-module/components/provider/disable-non-page-content-blocks.js +1 -0
  918. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  919. package/build-module/components/provider/index.js +7 -6
  920. package/build-module/components/provider/index.js.map +1 -1
  921. package/build-module/components/provider/navigation-block-editing-mode.js +1 -0
  922. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  923. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +1 -0
  924. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -1
  925. package/build-module/components/provider/use-block-editor-settings.js +4 -3
  926. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  927. package/build-module/components/provider/use-hide-blocks-from-inserter.js +2 -1
  928. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  929. package/build-module/components/provider/use-post-content-blocks.js +2 -1
  930. package/build-module/components/provider/use-post-content-blocks.js.map +1 -1
  931. package/build-module/components/provider/with-registry-provider.js +3 -2
  932. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  933. package/build-module/components/resizable-editor/index.js +3 -2
  934. package/build-module/components/resizable-editor/index.js.map +1 -1
  935. package/build-module/components/resizable-editor/resize-handle.js +3 -2
  936. package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
  937. package/build-module/components/save-publish-panels/index.js +4 -3
  938. package/build-module/components/save-publish-panels/index.js.map +1 -1
  939. package/build-module/components/sidebar/constants.js +2 -1
  940. package/build-module/components/sidebar/constants.js.map +1 -1
  941. package/build-module/components/sidebar/header.js +4 -3
  942. package/build-module/components/sidebar/header.js.map +1 -1
  943. package/build-module/components/sidebar/index.js +6 -5
  944. package/build-module/components/sidebar/index.js.map +1 -1
  945. package/build-module/components/sidebar/post-summary.js +3 -2
  946. package/build-module/components/sidebar/post-summary.js.map +1 -1
  947. package/build-module/components/site-discussion/index.js +3 -2
  948. package/build-module/components/site-discussion/index.js.map +1 -1
  949. package/build-module/components/start-page-options/index.js +7 -7
  950. package/build-module/components/start-page-options/index.js.map +2 -2
  951. package/build-module/components/start-template-options/index.js +2 -1
  952. package/build-module/components/start-template-options/index.js.map +1 -1
  953. package/build-module/components/style-book/categories.js +1 -0
  954. package/build-module/components/style-book/categories.js.map +1 -1
  955. package/build-module/components/style-book/color-examples.js +3 -2
  956. package/build-module/components/style-book/color-examples.js.map +1 -1
  957. package/build-module/components/style-book/constants.js +8 -7
  958. package/build-module/components/style-book/constants.js.map +1 -1
  959. package/build-module/components/style-book/duotone-examples.js +3 -2
  960. package/build-module/components/style-book/duotone-examples.js.map +1 -1
  961. package/build-module/components/style-book/examples.js +2 -1
  962. package/build-module/components/style-book/examples.js.map +1 -1
  963. package/build-module/components/style-book/index.js +12 -11
  964. package/build-module/components/style-book/index.js.map +1 -1
  965. package/build-module/components/styles-canvas/index.js +2 -1
  966. package/build-module/components/styles-canvas/index.js.map +1 -1
  967. package/build-module/components/styles-canvas/revisions.js +3 -2
  968. package/build-module/components/styles-canvas/revisions.js.map +1 -1
  969. package/build-module/components/styles-canvas/style-book.js +2 -1
  970. package/build-module/components/styles-canvas/style-book.js.map +1 -1
  971. package/build-module/components/table-of-contents/index.js +2 -1
  972. package/build-module/components/table-of-contents/index.js.map +1 -1
  973. package/build-module/components/table-of-contents/panel.js +2 -1
  974. package/build-module/components/table-of-contents/panel.js.map +1 -1
  975. package/build-module/components/template-content-panel/index.js +5 -4
  976. package/build-module/components/template-content-panel/index.js.map +1 -1
  977. package/build-module/components/template-part-content-panel/index.js +3 -2
  978. package/build-module/components/template-part-content-panel/index.js.map +1 -1
  979. package/build-module/components/template-part-menu-items/convert-to-regular.js +2 -1
  980. package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -1
  981. package/build-module/components/template-part-menu-items/convert-to-template-part.js +2 -1
  982. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
  983. package/build-module/components/template-part-menu-items/index.js +2 -1
  984. package/build-module/components/template-part-menu-items/index.js.map +1 -1
  985. package/build-module/components/template-validation-notice/index.js +2 -1
  986. package/build-module/components/template-validation-notice/index.js.map +1 -1
  987. package/build-module/components/text-editor/index.js +2 -1
  988. package/build-module/components/text-editor/index.js.map +1 -1
  989. package/build-module/components/theme-support-check/index.js +1 -0
  990. package/build-module/components/theme-support-check/index.js.map +1 -1
  991. package/build-module/components/time-to-read/index.js +3 -2
  992. package/build-module/components/time-to-read/index.js.map +1 -1
  993. package/build-module/components/unsaved-changes-warning/index.js +1 -0
  994. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  995. package/build-module/components/visual-editor/edit-template-blocks-notification.js +2 -1
  996. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  997. package/build-module/components/visual-editor/index.js +24 -12
  998. package/build-module/components/visual-editor/index.js.map +2 -2
  999. package/build-module/components/visual-editor/use-select-nearest-editable-block.js +2 -1
  1000. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  1001. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +1 -0
  1002. package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -1
  1003. package/build-module/components/word-count/index.js +2 -1
  1004. package/build-module/components/word-count/index.js.map +1 -1
  1005. package/build-module/components/zoom-out-toggle/index.js +3 -2
  1006. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  1007. package/build-module/dataviews/api.js +1 -0
  1008. package/build-module/dataviews/api.js.map +1 -1
  1009. package/build-module/dataviews/fields/content-preview/content-preview-view.js +3 -2
  1010. package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +1 -1
  1011. package/build-module/dataviews/fields/content-preview/index.js +2 -1
  1012. package/build-module/dataviews/fields/content-preview/index.js.map +1 -1
  1013. package/build-module/dataviews/store/private-actions.js +2 -1
  1014. package/build-module/dataviews/store/private-actions.js.map +1 -1
  1015. package/build-module/dataviews/store/private-selectors.js +2 -1
  1016. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  1017. package/build-module/dataviews/store/reducer.js +1 -0
  1018. package/build-module/dataviews/store/reducer.js.map +1 -1
  1019. package/build-module/hooks/custom-sources-backwards-compatibility.js +3 -2
  1020. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  1021. package/build-module/hooks/default-autocompleters.js +1 -0
  1022. package/build-module/hooks/default-autocompleters.js.map +1 -1
  1023. package/build-module/hooks/index.js +1 -0
  1024. package/build-module/hooks/index.js.map +1 -1
  1025. package/build-module/hooks/media-upload.js +2 -1
  1026. package/build-module/hooks/media-upload.js.map +1 -1
  1027. package/build-module/hooks/navigation-link-view-button.js +4 -3
  1028. package/build-module/hooks/navigation-link-view-button.js.map +1 -1
  1029. package/build-module/hooks/pattern-overrides.js +4 -3
  1030. package/build-module/hooks/pattern-overrides.js.map +1 -1
  1031. package/build-module/hooks/push-changes-to-global-styles/index.js +11 -10
  1032. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  1033. package/build-module/hooks/template-part-navigation-edit-button.js +6 -5
  1034. package/build-module/hooks/template-part-navigation-edit-button.js.map +1 -1
  1035. package/build-module/hooks/use-global-styles-output.js +1 -0
  1036. package/build-module/hooks/use-global-styles-output.js.map +1 -1
  1037. package/build-module/index.js +1 -0
  1038. package/build-module/index.js.map +1 -1
  1039. package/build-module/lock-unlock.js +2 -1
  1040. package/build-module/lock-unlock.js.map +1 -1
  1041. package/build-module/private-apis.js +3 -2
  1042. package/build-module/private-apis.js.map +1 -1
  1043. package/build-module/store/actions.js +52 -51
  1044. package/build-module/store/actions.js.map +1 -1
  1045. package/build-module/store/constants.js +14 -13
  1046. package/build-module/store/constants.js.map +1 -1
  1047. package/build-module/store/defaults.js +2 -1
  1048. package/build-module/store/defaults.js.map +1 -1
  1049. package/build-module/store/index.js +3 -2
  1050. package/build-module/store/index.js.map +1 -1
  1051. package/build-module/store/local-autosave.js +1 -0
  1052. package/build-module/store/local-autosave.js.map +1 -1
  1053. package/build-module/store/private-actions.js +15 -7
  1054. package/build-module/store/private-actions.js.map +2 -2
  1055. package/build-module/store/private-selectors.js +13 -8
  1056. package/build-module/store/private-selectors.js.map +2 -2
  1057. package/build-module/store/reducer.js +10 -0
  1058. package/build-module/store/reducer.js.map +2 -2
  1059. package/build-module/store/selectors.js +79 -78
  1060. package/build-module/store/selectors.js.map +2 -2
  1061. package/build-module/store/utils/is-template-revertable.js +1 -0
  1062. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  1063. package/build-module/store/utils/notice-builder.js +1 -0
  1064. package/build-module/store/utils/notice-builder.js.map +1 -1
  1065. package/build-module/utils/get-item-title.js +1 -0
  1066. package/build-module/utils/get-item-title.js.map +1 -1
  1067. package/build-module/utils/get-template-info.js +3 -2
  1068. package/build-module/utils/get-template-info.js.map +1 -1
  1069. package/build-module/utils/get-template-part-icon.js +1 -0
  1070. package/build-module/utils/get-template-part-icon.js.map +1 -1
  1071. package/build-module/utils/index.js +1 -0
  1072. package/build-module/utils/index.js.map +1 -1
  1073. package/build-module/utils/media-sideload/index.js +2 -1
  1074. package/build-module/utils/media-sideload/index.js.map +1 -1
  1075. package/build-module/utils/media-upload/index.js +2 -1
  1076. package/build-module/utils/media-upload/index.js.map +1 -1
  1077. package/build-module/utils/pageTypeBadge.js +1 -0
  1078. package/build-module/utils/pageTypeBadge.js.map +1 -1
  1079. package/build-module/utils/search-templates.js +1 -0
  1080. package/build-module/utils/search-templates.js.map +1 -1
  1081. package/build-module/utils/set-nested-value.js +1 -0
  1082. package/build-module/utils/set-nested-value.js.map +1 -1
  1083. package/build-module/utils/terms.js +4 -3
  1084. package/build-module/utils/terms.js.map +1 -1
  1085. package/build-module/utils/url.js +1 -0
  1086. package/build-module/utils/url.js.map +1 -1
  1087. package/build-style/style-rtl.css +9 -45
  1088. package/build-style/style.css +9 -45
  1089. package/build-types/bindings/post-data.d.ts +18 -8
  1090. package/build-types/bindings/post-meta.d.ts +1 -7
  1091. package/build-types/components/collab-sidebar/add-comment.d.ts +3 -3
  1092. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  1093. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +1 -1
  1094. package/build-types/components/collab-sidebar/comment-menu-item.d.ts +3 -2
  1095. package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +1 -1
  1096. package/build-types/components/collab-sidebar/comments.d.ts +4 -4
  1097. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  1098. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  1099. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  1100. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  1101. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  1102. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  1103. package/build-types/store/private-actions.d.ts +7 -0
  1104. package/build-types/store/private-actions.d.ts.map +1 -1
  1105. package/build-types/store/private-selectors.d.ts +7 -0
  1106. package/build-types/store/private-selectors.d.ts.map +1 -1
  1107. package/build-types/store/reducer.d.ts +10 -0
  1108. package/build-types/store/reducer.d.ts.map +1 -1
  1109. package/build-types/store/selectors.d.ts.map +1 -1
  1110. package/package.json +40 -40
  1111. package/src/bindings/post-data.js +63 -111
  1112. package/src/bindings/post-meta.js +55 -46
  1113. package/src/bindings/test/post-meta.js +211 -0
  1114. package/src/components/collab-sidebar/add-comment.js +20 -11
  1115. package/src/components/collab-sidebar/comment-author-info.js +1 -1
  1116. package/src/components/collab-sidebar/comment-indicator-toolbar.js +19 -29
  1117. package/src/components/collab-sidebar/comment-menu-item.js +51 -11
  1118. package/src/components/collab-sidebar/comments.js +87 -53
  1119. package/src/components/collab-sidebar/hooks.js +6 -4
  1120. package/src/components/collab-sidebar/index.js +75 -37
  1121. package/src/components/collab-sidebar/style.scss +7 -46
  1122. package/src/components/collab-sidebar/utils.js +3 -2
  1123. package/src/components/editor/index.js +1 -1
  1124. package/src/components/more-menu/index.js +1 -1
  1125. package/src/components/preferences-modal/index.js +1 -1
  1126. package/src/components/start-page-options/index.js +5 -6
  1127. package/src/components/start-page-options/style.scss +1 -1
  1128. package/src/components/visual-editor/index.js +27 -6
  1129. package/src/store/private-actions.js +13 -0
  1130. package/src/store/private-selectors.js +10 -0
  1131. package/src/store/reducer.js +16 -0
  1132. package/src/store/selectors.js +0 -2
  1133. package/tsconfig.tsbuildinfo +1 -1
@@ -1,4 +1,4 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-text-editor/index.js
2
2
  import Textarea from "react-autosize-textarea";
3
3
  import { __ } from "@wordpress/i18n";
4
4
  import { store as coreStore } from "@wordpress/core-data";
@@ -8,6 +8,7 @@ import { useDispatch, useSelect } from "@wordpress/data";
8
8
  import { useInstanceId } from "@wordpress/compose";
9
9
  import { VisuallyHidden } from "@wordpress/components";
10
10
  import { store as editorStore } from "../../store";
11
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
12
  function PostTextEditor() {
12
13
  const instanceId = useInstanceId(PostTextEditor);
13
14
  const { content, blocks, type, id } = useSelect((select) => {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-text-editor/index.js"],
4
4
  "sourcesContent": ["/**\n * External dependencies\n */\nimport Textarea from 'react-autosize-textarea';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Displays the Post Text Editor along with content in Visual and Text mode.\n *\n * @return {React.ReactNode} The rendered PostTextEditor component.\n */\nexport default function PostTextEditor() {\n\tconst instanceId = useInstanceId( PostTextEditor );\n\tconst { content, blocks, type, id } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst _type = getCurrentPostType();\n\t\tconst _id = getCurrentPostId();\n\t\tconst editedRecord = getEditedEntityRecord( 'postType', _type, _id );\n\n\t\treturn {\n\t\t\tcontent: editedRecord?.content,\n\t\t\tblocks: editedRecord?.blocks,\n\t\t\ttype: _type,\n\t\t\tid: _id,\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\t// Replicates the logic found in getEditedPostContent().\n\tconst value = useMemo( () => {\n\t\tif ( content instanceof Function ) {\n\t\t\treturn content( { blocks } );\n\t\t} else if ( blocks ) {\n\t\t\t// If we have parsed blocks already, they should be our source of truth.\n\t\t\t// Parsing applies block deprecations and legacy block conversions that\n\t\t\t// unparsed content will not have.\n\t\t\treturn __unstableSerializeAndClean( blocks );\n\t\t}\n\t\treturn content;\n\t}, [ content, blocks ] );\n\n\treturn (\n\t\t<>\n\t\t\t<VisuallyHidden\n\t\t\t\tas=\"label\"\n\t\t\t\thtmlFor={ `post-content-${ instanceId }` }\n\t\t\t>\n\t\t\t\t{ __( 'Type text or HTML' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t<Textarea\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tdir=\"auto\"\n\t\t\t\tvalue={ value }\n\t\t\t\tonChange={ ( event ) => {\n\t\t\t\t\teditEntityRecord( 'postType', type, id, {\n\t\t\t\t\t\tcontent: event.target.value,\n\t\t\t\t\t\tblocks: undefined,\n\t\t\t\t\t\tselection: undefined,\n\t\t\t\t\t} );\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AAO;AAAA,IAC5C;AACA,WAAO;AAAA,EACR,GAAG,CAAE,SAAS,MAAO,CAAE;AAEvB,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,IAAG;AAAA,QACH,SAAU,gBAAiB,UAAW;AAAA,QAEpC,aAAI,mBAAoB;AAAA;AAAA,IAC3B;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,cAAa;AAAA,QACb,KAAI;AAAA,QACJ;AAAA,QACA,UAAW,CAAE,UAAW;AACvB,2BAAkB,YAAY,MAAM,IAAI;AAAA,YACvC,SAAS,MAAM,OAAO;AAAA,YACtB,QAAQ;AAAA,YACR,WAAW;AAAA,UACZ,CAAE;AAAA,QACH;AAAA,QACA,WAAU;AAAA,QACV,IAAK,gBAAiB,UAAW;AAAA,QACjC,aAAc,GAAI,iCAAkC;AAAA;AAAA,IACrD;AAAA,KACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,6 @@
1
- const DEFAULT_CLASSNAMES = "wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text";
2
- const REGEXP_NEWLINES = /[\r\n]+/g;
1
+ // packages/editor/src/components/post-title/constants.js
2
+ var DEFAULT_CLASSNAMES = "wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text";
3
+ var REGEXP_NEWLINES = /[\r\n]+/g;
3
4
  export {
4
5
  DEFAULT_CLASSNAMES,
5
6
  REGEXP_NEWLINES
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-title/constants.js"],
4
4
  "sourcesContent": ["export const DEFAULT_CLASSNAMES =\n\t'wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text';\n\nexport const REGEXP_NEWLINES = /[\\r\\n]+/g;\n"],
5
- "mappings": "AAAO,MAAM,qBACZ;AAEM,MAAM,kBAAkB;",
5
+ "mappings": ";AAAO,IAAM,qBACZ;AAEM,IAAM,kBAAkB;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-title/index.js
2
2
  import clsx from "clsx";
3
3
  import { __ } from "@wordpress/i18n";
4
4
  import { forwardRef, useState } from "@wordpress/element";
@@ -18,7 +18,8 @@ import { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from "./constants";
18
18
  import usePostTitleFocus from "./use-post-title-focus";
19
19
  import usePostTitle from "./use-post-title";
20
20
  import PostTypeSupportCheck from "../post-type-support-check";
21
- const PostTitle = forwardRef((_, forwardedRef) => {
21
+ import { jsx } from "react/jsx-runtime";
22
+ var PostTitle = forwardRef((_, forwardedRef) => {
22
23
  const { placeholder } = useSelect((select) => {
23
24
  const { getSettings } = select(blockEditorStore);
24
25
  const { titlePlaceholder } = getSettings();
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-title/index.js"],
4
4
  "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nconst PostTitle = forwardRef( ( _, forwardedRef ) => {\n\tconst { placeholder } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder } = getSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst {\n\t\tvalue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: title,\n\t\tonChange( newValue ) {\n\t\t\tonUpdate( newValue.replace( REGEXP_NEWLINES, ' ' ) );\n\t\t},\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error ) {\n\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t// behaviour.\n\t\t\treturn;\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\t\t\tonChange( insert( value, create( { html: contentNoHTML } ) ) );\n\t\t}\n\t}\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t} );\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<h1\n\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\tcontentEditable\n\t\t\tclassName={ className }\n\t\t\taria-label={ decodedPlaceholder }\n\t\t\trole=\"textbox\"\n\t\t\taria-multiline=\"true\"\n\t\t\tonFocus={ onSelect }\n\t\t\tonBlur={ onUnselect }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonPaste={ onPaste }\n\t\t/>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n} );\n\n/**\n * Renders the `PostTitle` component.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Forwarded ref for the component.\n *\n * @return {React.ReactNode} The rendered PostTitle component.\n */\nexport default forwardRef( ( _, forwardedRef ) => (\n\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t<PostTitle ref={ forwardedRef } />\n\t</PostTypeSupportCheck>\n) );\n"],
5
- "mappings": "AA6KE;AA1KF,OAAO,UAAU;AAIjB,SAAS,UAAU;AACnB,SAAS,YAAY,gBAAgB;AACrC,SAAS,sBAAsB;AAC/B,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,aAAa;AACtB,SAAS,oBAAoB;AAC7B;AAAA,EACC,yBAAyB;AAAA,EACzB;AAAA,EACA;AAAA,OACM;AACP,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB,iBAAiB;AAKjD,SAAS,oBAAoB,uBAAuB;AACpD,OAAO,uBAAuB;AAC9B,OAAO,kBAAkB;AACzB,OAAO,0BAA0B;AAEjC,MAAM,YAAY,WAAY,CAAE,GAAG,iBAAkB;AACpD,QAAM,EAAE,YAAY,IAAI,UAAW,CAAE,WAAY;AAChD,UAAM,EAAE,YAAY,IAAI,OAAQ,gBAA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AAO,YAAY,UAAW;AAClC,YAAM,CAAE,UAAW,IAAI;AAEvB,UACC,CAAE,UACA,WAAW,SAAS,kBACrB,WAAW,SAAS,mBACpB;AAID,cAAM,gBAAgB;AAAA,UACrB,WAAW,WAAW;AAAA,QACvB;AACA,iBAAU,aAAc;AACxB,2BAAoB,QAAQ,MAAO,CAAE,CAAE;AAAA,MACxC,OAAO;AACN,2BAAoB,OAAQ;AAAA,MAC7B;AAAA,IACD,OAAO;AAIN,YAAM,gBAAgB,UAAW,OAAQ;AACzC,eAAU,OAAQ,OAAO,OAAQ,EAAE,MAAM,cAAc,CAAE,CAAE,CAAE;AAAA,IAC9D;AAAA,EACD;AAIA,QAAM,YAAY,KAAM,oBAAoB;AAAA,IAC3C,eAAe;AAAA,EAChB,CAAE;AAEF;AAAA;AAAA,IAEC;AAAA,MAAC;AAAA;AAAA,QACA,KAAM,aAAc,CAAE,aAAa,QAAS,CAAE;AAAA,QAC9C,iBAAe;AAAA,QACf;AAAA,QACA,cAAa;AAAA,QACb,MAAK;AAAA,QACL,kBAAe;AAAA,QACf,SAAU;AAAA,QACV,QAAS;AAAA,QACT;AAAA,QACA;AAAA;AAAA,IACD;AAAA;AAGF,CAAE;AAUF,IAAO,qBAAQ,WAAY,CAAE,GAAG,iBAC/B,oBAAC,wBAAqB,aAAY,SACjC,8BAAC,aAAU,KAAM,cAAe,GACjC,CACC;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-title/post-title-raw.js
2
2
  import clsx from "clsx";
3
3
  import { TextareaControl } from "@wordpress/components";
4
4
  import { __ } from "@wordpress/i18n";
@@ -9,6 +9,7 @@ import { useState, forwardRef } from "@wordpress/element";
9
9
  import { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from "./constants";
10
10
  import usePostTitleFocus from "./use-post-title-focus";
11
11
  import usePostTitle from "./use-post-title";
12
+ import { jsx } from "react/jsx-runtime";
12
13
  function PostTitleRaw(_, forwardedRef) {
13
14
  const { placeholder } = useSelect((select) => {
14
15
  const { getSettings } = select(blockEditorStore);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-title/post-title-raw.js"],
4
4
  "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { TextareaControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\n\n/**\n * Renders a raw post title input field.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Reference to the component's DOM node.\n *\n * @return {React.ReactNode} The rendered component.\n */\nfunction PostTitleRaw( _, forwardedRef ) {\n\tconst { placeholder } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder } = getSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t}\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'is-raw-text': true,\n\t} );\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\treturn (\n\t\t<TextareaControl\n\t\t\tref={ focusRef }\n\t\t\tvalue={ title }\n\t\t\tonChange={ onChange }\n\t\t\tonFocus={ onSelect }\n\t\t\tonBlur={ onUnselect }\n\t\t\tlabel={ placeholder }\n\t\t\tclassName={ className }\n\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\thideLabelFromVision\n\t\t\tautoComplete=\"off\"\n\t\t\tdir=\"auto\"\n\t\t\trows={ 1 }\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n}\n\nexport default forwardRef( PostTitleRaw );\n"],
5
- "mappings": "AAoEE;AAjEF,OAAO,UAAU;AAKjB,SAAS,uBAAuB;AAChC,SAAS,UAAU;AACnB,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,UAAU,kBAAkB;AAKrC,SAAS,oBAAoB,uBAAuB;AACpD,OAAO,uBAAuB;AAC9B,OAAO,kBAAkB;AAUzB,SAAS,aAAc,GAAG,cAAe;AACxC,QAAM,EAAE,YAAY,IAAI,UAAW,CAAE,WAAY;AAChD,UAAM,EAAE,YAAY,IAAI,OAAQ,gBAAiB;AACjD,UAAM,EAAE,iBAAiB,IAAI,YAAY;AAEzC,WAAO;AAAA,MACN,aAAa;AAAA,IACd;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,CAAE,YAAY,aAAc,IAAI,SAAU,KAAM;AAEtD,QAAM,EAAE,OAAO,UAAU,SAAS,IAAI,aAAa;AACnD,QAAM,EAAE,KAAK,SAAS,IAAI,kBAAmB,YAAa;AAE1D,WAAS,SAAU,OAAQ;AAC1B,aAAU,MAAM,QAAS,iBAAiB,GAAI,CAAE;AAAA,EACjD;AAEA,WAAS,WAAW;AACnB,kBAAe,IAAK;AAAA,EACrB;AAEA,WAAS,aAAa;AACrB,kBAAe,KAAM;AAAA,EACtB;AAIA,QAAM,YAAY,KAAM,oBA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QAAM,YAAY,KAAM,oBAAoB;AAAA,IAC3C,eAAe;AAAA,IACf,eAAe;AAAA,EAChB,CAAE;AAEF,QAAM,qBACL,eAAgB,WAAY,KAAK,GAAI,WAAY;AAElD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,KAAM;AAAA,MACN,OAAQ;AAAA,MACR;AAAA,MACA,SAAU;AAAA,MACV,QAAS;AAAA,MACT,OAAQ;AAAA,MACR;AAAA,MACA,aAAc;AAAA,MACd,qBAAmB;AAAA,MACnB,cAAa;AAAA,MACb,KAAI;AAAA,MACJ,MAAO;AAAA,MACP,yBAAuB;AAAA;AAAA,EACxB;AAEF;AAEA,IAAO,yBAAQ,WAAY,YAAa;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-title/use-post-title-focus.js
1
2
  import { useEffect, useImperativeHandle, useRef } from "@wordpress/element";
2
3
  import { useSelect } from "@wordpress/data";
3
4
  import { store as editorStore } from "../../store";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-title/use-post-title-focus.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useImperativeHandle, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Custom hook that manages the focus behavior of the post title input field.\n *\n * @param {Element} forwardedRef - The forwarded ref for the input field.\n *\n * @return {Object} - The ref object.\n */\nexport default function usePostTitleFocus( forwardedRef ) {\n\tconst ref = useRef();\n\n\tconst { isCleanNewPost } = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost: _isCleanNewPost } = select( editorStore );\n\n\t\treturn {\n\t\t\tisCleanNewPost: _isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseImperativeHandle( forwardedRef, () => ( {\n\t\tfocus: () => {\n\t\t\tref?.current?.focus();\n\t\t},\n\t} ) );\n\n\tuseEffect( () => {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = ref.current.ownerDocument;\n\t\tconst { name, parent } = defaultView;\n\t\tconst ownerDocument =\n\t\t\tname === 'editor-canvas' ? parent.document : defaultView.document;\n\t\tconst { activeElement, body } = ownerDocument;\n\n\t\t// Only autofocus the title when the post is entirely empty. This should\n\t\t// only happen for a new post, which means we focus the title on new\n\t\t// post so the author can start typing right away, without needing to\n\t\t// click anything.\n\t\tif ( isCleanNewPost && ( ! activeElement || body === activeElement ) ) {\n\t\t\tref.current.focus();\n\t\t}\n\t}, [ isCleanNewPost ] );\n\n\treturn { ref };\n}\n"],
5
- "mappings": "AAGA,SAAS,WAAW,qBAAqB,cAAc;AACvD,SAAS,iBAAiB;AAK1B,SAAS,SAAS,mBAAmB;AAStB,SAAR,kBAAoC,cAAe;AACzD,QAAM,MAAM,OAAO;AAEnB,QAAM,EAAE,eAAe,IAAI,UAAW,CAAE,WAAY;AACnD,UAAM,EAAE,gBAAgB,gBAAgB,IAAI,OAAQ,WAAY;AAEhE,WAAO;AAAA,MACN,gBAAgB,gBAAgB;AAAA,IACjC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,sBAAqB,cAAc,OAAQ;AAAA,IAC1C,OAAO,MAAM;AACZ,WAAK,SAAS,MAAM;AAAA,IACrB;AAAA,EACD,EAAI;AAEJ,YAAW,MAAM;AAChB,QAAK,CAAE,IAAI,SAAU;AACpB;AAAA,IACD;AAEA,UAAM,EAAE,YAAY,IAAI,IAAI,QAAQ;AACpC,UAAM,EAAE,MAAM,OAAO,IAAI;AACzB,UAAM,gBACL,SAAS,kBAAkB,OAAO,WAAW,YAAY;AAC1D,UAAM,EAAE,eAAe,KAAK,IAAI;AAMhC,QAAK,mBAAoB,CAAE,iBAAiB,SAAS,gBAAkB;AACtE,UAAI,QAAQ,MAAM;AAAA,IACnB;AAAA,EACD,GAAG,CAAE,cAAe,CAAE;AAEtB,SAAO,EAAE,IAAI;AACd;",
5
+ "mappings": ";AAGA,SAAS,WAAW,qBAAqB,cAAc;AACvD,SAAS,iBAAiB;AAK1B,SAAS,SAAS,mBAAmB;AAStB,SAAR,kBAAoC,cAAe;AACzD,QAAM,MAAM,OAAO;AAEnB,QAAM,EAAE,eAAe,IAAI,UAAW,CAAE,WAAY;AACnD,UAAM,EAAE,gBAAgB,gBAAgB,IAAI,OAAQ,WAAY;AAEhE,WAAO;AAAA,MACN,gBAAgB,gBAAgB;AAAA,IACjC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,sBAAqB,cAAc,OAAQ;AAAA,IAC1C,OAAO,MAAM;AACZ,WAAK,SAAS,MAAM;AAAA,IACrB;AAAA,EACD,EAAI;AAEJ,YAAW,MAAM;AAChB,QAAK,CAAE,IAAI,SAAU;AACpB;AAAA,IACD;AAEA,UAAM,EAAE,YAAY,IAAI,IAAI,QAAQ;AACpC,UAAM,EAAE,MAAM,OAAO,IAAI;AACzB,UAAM,gBACL,SAAS,kBAAkB,OAAO,WAAW,YAAY;AAC1D,UAAM,EAAE,eAAe,KAAK,IAAI;AAMhC,QAAK,mBAAoB,CAAE,iBAAiB,SAAS,gBAAkB;AACtE,UAAI,QAAQ,MAAM;AAAA,IACnB;AAAA,EACD,GAAG,CAAE,cAAe,CAAE;AAEtB,SAAO,EAAE,IAAI;AACd;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-title/use-post-title.js
1
2
  import { useSelect, useDispatch } from "@wordpress/data";
2
3
  import { store as editorStore } from "../../store";
3
4
  function usePostTitle() {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-title/use-post-title.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Custom hook for managing the post title in the editor.\n *\n * @return {Object} An object containing the current title and a function to update the title.\n */\nexport default function usePostTitle() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { title } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t}, [] );\n\n\tfunction updateTitle( newTitle ) {\n\t\teditPost( { title: newTitle } );\n\t}\n\n\treturn { title, setTitle: updateTitle };\n}\n"],
5
- "mappings": "AAGA,SAAS,WAAW,mBAAmB;AAIvC,SAAS,SAAS,mBAAmB;AAOtB,SAAR,eAAgC;AACtC,QAAM,EAAE,SAAS,IAAI,YAAa,WAAY;AAC9C,QAAM,EAAE,MAAM,IAAI,UAAW,CAAE,WAAY;AAC1C,UAAM,EAAE,uBAAuB,IAAI,OAAQ,WAAY;AAEvD,WAAO;AAAA,MACN,OAAO,uBAAwB,OAAQ;AAAA,IACxC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,WAAS,YAAa,UAAW;AAChC,aAAU,EAAE,OAAO,SAAS,CAAE;AAAA,EAC/B;AAEA,SAAO,EAAE,OAAO,UAAU,YAAY;AACvC;",
5
+ "mappings": ";AAGA,SAAS,WAAW,mBAAmB;AAIvC,SAAS,SAAS,mBAAmB;AAOtB,SAAR,eAAgC;AACtC,QAAM,EAAE,SAAS,IAAI,YAAa,WAAY;AAC9C,QAAM,EAAE,MAAM,IAAI,UAAW,CAAE,WAAY;AAC1C,UAAM,EAAE,uBAAuB,IAAI,OAAQ,WAAY;AAEvD,WAAO;AAAA,MACN,OAAO,uBAAwB,OAAQ;AAAA,IACxC;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,WAAS,YAAa,UAAW;AAChC,aAAU,EAAE,OAAO,SAAS,CAAE;AAAA,EAC/B;AAEA,SAAO,EAAE,OAAO,UAAU,YAAY;AACvC;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-transform-panel/hooks.js
1
2
  import { useSelect } from "@wordpress/data";
2
3
  import { useMemo } from "@wordpress/element";
3
4
  import { store as coreStore } from "@wordpress/core-data";
@@ -5,7 +6,7 @@ import { parse } from "@wordpress/blocks";
5
6
  import { privateApis as patternsPrivateApis } from "@wordpress/patterns";
6
7
  import { unlock } from "../../lock-unlock";
7
8
  import { store as editorStore } from "../../store";
8
- const { EXCLUDED_PATTERN_SOURCES, PATTERN_TYPES } = unlock(patternsPrivateApis);
9
+ var { EXCLUDED_PATTERN_SOURCES, PATTERN_TYPES } = unlock(patternsPrivateApis);
9
10
  function injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet) {
10
11
  block.innerBlocks = block.innerBlocks.map((innerBlock) => {
11
12
  return injectThemeAttributeInBlockTemplateContent(
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-transform-panel/hooks.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { parse } from '@wordpress/blocks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { EXCLUDED_PATTERN_SOURCES, PATTERN_TYPES } =\n\tunlock( patternsPrivateApis );\n\nfunction injectThemeAttributeInBlockTemplateContent(\n\tblock,\n\tcurrentThemeStylesheet\n) {\n\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\treturn injectThemeAttributeInBlockTemplateContent(\n\t\t\tinnerBlock,\n\t\t\tcurrentThemeStylesheet\n\t\t);\n\t} );\n\n\tif (\n\t\tblock.name === 'core/template-part' &&\n\t\tblock.attributes.theme === undefined\n\t) {\n\t\tblock.attributes.theme = currentThemeStylesheet;\n\t}\n\treturn block;\n}\n\n/**\n * Filter all patterns and return only the ones that are compatible with the current template.\n *\n * @param {Array} patterns An array of patterns.\n * @param {Object} template The current template. Required values are `area`, `name`, and `slug`.\n * @return {Array} Array of patterns that are compatible with the current template.\n */\nfunction filterPatterns( patterns, template ) {\n\t// Filter out duplicates.\n\tconst filterOutDuplicatesByName = ( currentItem, index, items ) =>\n\t\tindex === items.findIndex( ( item ) => currentItem.name === item.name );\n\n\t// Filter out core/directory patterns not included in theme.json.\n\tconst filterOutExcludedPatternSources = ( pattern ) =>\n\t\t! EXCLUDED_PATTERN_SOURCES.includes( pattern.source );\n\n\t// Looks for patterns that have the same template type as the current template,\n\t// or have a block type that matches the current template area.\n\tconst filterCompatiblePatterns = ( pattern ) =>\n\t\tpattern.templateTypes?.includes( template.slug ) ||\n\t\tpattern.blockTypes?.includes( 'core/template-part/' + template.area );\n\n\treturn patterns.filter( ( pattern, index, items ) => {\n\t\treturn (\n\t\t\tfilterOutDuplicatesByName( pattern, index, items ) &&\n\t\t\tfilterOutExcludedPatternSources( pattern ) &&\n\t\t\tfilterCompatiblePatterns( pattern )\n\t\t);\n\t} );\n}\n\nfunction preparePatterns( patterns, currentThemeStylesheet ) {\n\treturn patterns.map( ( pattern ) => ( {\n\t\t...pattern,\n\t\tkeywords: pattern.keywords || [],\n\t\ttype: PATTERN_TYPES.theme,\n\t\tblocks: parse( pattern.content, {\n\t\t\t__unstableSkipMigrationLogs: true,\n\t\t} ).map( ( block ) =>\n\t\t\tinjectThemeAttributeInBlockTemplateContent(\n\t\t\t\tblock,\n\t\t\t\tcurrentThemeStylesheet\n\t\t\t)\n\t\t),\n\t} ) );\n}\n\nexport function useAvailablePatterns( { area, name, slug } ) {\n\tconst { blockPatterns, restBlockPatterns, currentThemeStylesheet } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst settings = getEditorSettings();\n\n\t\t\treturn {\n\t\t\t\tblockPatterns:\n\t\t\t\t\tsettings.__experimentalAdditionalBlockPatterns ??\n\t\t\t\t\tsettings.__experimentalBlockPatterns,\n\t\t\t\trestBlockPatterns: select( coreStore ).getBlockPatterns(),\n\t\t\t\tcurrentThemeStylesheet:\n\t\t\t\t\tselect( coreStore ).getCurrentTheme().stylesheet,\n\t\t\t};\n\t\t}, [] );\n\n\treturn useMemo( () => {\n\t\tconst mergedPatterns = [\n\t\t\t...( blockPatterns || [] ),\n\t\t\t...( restBlockPatterns || [] ),\n\t\t];\n\t\tconst filteredPatterns = filterPatterns( mergedPatterns, {\n\t\t\tarea,\n\t\t\tname,\n\t\t\tslug,\n\t\t} );\n\t\treturn preparePatterns( filteredPatterns, currentThemeStylesheet );\n\t}, [\n\t\tarea,\n\t\tname,\n\t\tslug,\n\t\tblockPatterns,\n\t\trestBlockPatterns,\n\t\tcurrentThemeStylesheet,\n\t] );\n}\n"],
5
- "mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,SAAS,iBAAiB;AACnC,SAAS,aAAa;AACtB,SAAS,eAAe,2BAA2B;AAKnD,SAAS,cAAc;AACvB,SAAS,SAAS,mBAAmB;AAErC,MAAM,EAAE,0BAA0B,cAAc,IAC/C,OAAQ,mBAAoB;AAE7B,SAAS,2CACR,OACA,wBACC;AACD,QAAM,cAAc,MAAM,YAAY,IAAK,CAAE,eAAgB;AAC5D,WAAO;AAAA,MACN;AAAA,MACA;AAAA,IACD;AAAA,EACD,CAAE;AAEF,MACC,MAAM,SAAS,wBACf,MAAM,WAAW,UAAU,QAC1B;AACD,UAAM,WAAW,QAAQ;AAAA,EAC1B;AACA,SAAO;AACR;AASA,SAAS,eAAgB,UAAU,UAAW;AAE7C,QAAM,4BAA4B,CAAE,aAAa,OAAO,UACvD,UAAU,MAAM,UAAW,CAAE,SAAU,YAAY,SAAS,KAAK,IAAK;AAGvE,QAAM,kCAAkC,CAAE,YACzC,CAAE,yBAAyB,SAAU,QAAQ,MAAO;AAIrD,QAAM,2BAA2B,CAAE,YAClC,QAAQ,eAAe,SAAU,SAAS,IAAK,KAC/C,QAAQ,YAAY,SAAU,wBAAwB,SAAS,IAAK;AAErE,SAAO,SAAS,OAAQ,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AE,MAAM,MAAM,KAAK,GAAI;AAC5D,QAAM,EAAE,eAAe,mBAAmB,uBAAuB,IAChE,UAAW,CAAE,WAAY;AACxB,UAAM,EAAE,kBAAkB,IAAI,OAAQ,WAAY;AAClD,UAAM,WAAW,kBAAkB;AAEnC,WAAO;AAAA,MACN,eACC,SAAS,yCACT,SAAS;AAAA,MACV,mBAAmB,OAAQ,SAAU,EAAE,iBAAiB;AAAA,MACxD,wBACC,OAAQ,SAAU,EAAE,gBAAgB,EAAE;AAAA,IACxC;AAAA,EACD,GAAG,CAAC,CAAE;AAEP,SAAO,QAAS,MAAM;AACrB,UAAM,iBAAiB;AAAA,MACtB,GAAK,iBAAiB,CAAC;AAAA,MACvB,GAAK,qBAAqB,CAAC;AAAA,IAC5B;AACA,UAAM,mBAAmB,eAAgB,gBAAgB;AAAA,MACxD;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAE;AACF,WAAO,gBAAiB,kBAAkB,sBAAuB;AAAA,EAClE,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-transform-panel/index.js
2
2
  import { useSelect, useDispatch } from "@wordpress/data";
3
3
  import { store as coreStore } from "@wordpress/core-data";
4
4
  import { PanelBody } from "@wordpress/components";
@@ -11,6 +11,7 @@ import {
11
11
  TEMPLATE_POST_TYPE,
12
12
  TEMPLATE_PART_POST_TYPE
13
13
  } from "../../store/constants";
14
+ import { jsx } from "react/jsx-runtime";
14
15
  function TemplatesList({ availableTemplates, onSelect }) {
15
16
  if (!availableTemplates || availableTemplates?.length === 0) {
16
17
  return null;
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-transform-panel/index.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAvailablePatterns } from './hooks';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\n\nfunction TemplatesList( { availableTemplates, onSelect } ) {\n\tif ( ! availableTemplates || availableTemplates?.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ availableTemplates }\n\t\t\tonClickPattern={ onSelect }\n\t\t\tshowTitlesAsTooltip\n\t\t/>\n\t);\n}\n\nfunction PostTransform() {\n\tconst { area, name, slug, postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst type = getCurrentPostType();\n\t\tconst id = getCurrentPostId();\n\t\tconst record = getEditedEntityRecord( 'postType', type, id );\n\n\t\treturn {\n\t\t\tarea: record?.area,\n\t\t\tname: record?.name,\n\t\t\tslug: record?.slug,\n\t\t\tpostType: type,\n\t\t\tpostId: id,\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst availablePatterns = useAvailablePatterns( { area, name, slug } );\n\tconst onTemplateSelect = async ( selectedTemplate ) => {\n\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\tblocks: selectedTemplate.blocks,\n\t\t\tcontent: serialize( selectedTemplate.blocks ),\n\t\t} );\n\t};\n\tif ( ! availablePatterns?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tinitialOpen={ postType === TEMPLATE_PART_POST_TYPE }\n\t\t>\n\t\t\t<TemplatesList\n\t\t\t\tavailableTemplates={ availablePatterns }\n\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function PostTransformPanel() {\n\tconst { postType } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tif (\n\t\t! [ TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE ].includes( postType )\n\t) {\n\t\treturn null;\n\t}\n\n\treturn <PostTransform />;\n}\n"],
5
- "mappings": "AA0BE;AAvBF,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,iBAAiB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AACnB,SAAS,mCAAmC,yBAAyB;AACrE,SAAS,iBAAiB;AAK1B,SAAS,SAAS,mBAAmB;AACrC,SAAS,4BAA4B;AACrC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAEP,SAAS,cAAe,EAAE,oBAAoB,SAAS,GAAI;AAC1D,MAAK,CAAE,sBAAsB,oBAAoB,WAAW,GAAI;AAC/D,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ,GAAI,WAAY;AAAA,MACxB,eAAgB;AAAA,MAChB,gBAAiB;AAAA,MACjB,qBAAmB;AAAA;AAAA,EACpB;AAEF;AAEA,SAAS,gBAAgB;AACxB,QAAM,EAAE,MAAM,MAAM,MAAM,UAAU,OAAO,IAAI,UAAW,CAAE,WAAY;AACvE,UAAM,EAAE,oBAAoB,iBAAiB,IAAI,OAAQ,WAAY;AACrE,UAAM,EAAE,sBAAsB,IAAI,OAAQ,SAAU;AACpD,UAAM,OAAO,mBAAmB;AAChC,UAAM,KAAK,iBAAiB;AAC5B,UAAM,SAAS,sBAAuB,YAAY,MAAM,EAAG;AAE3D,WAAO;AAAA,MACN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,qBAAsC;AAC5C,QAAM,EAAE,SAAS,IAAI,UAAW,CAAE,WAAY;AAC7C,UAAM,EAAE,mBAAmB,IAAI,OAAQ,WAAY;AACnD,WAAO;AAAA,MACN,UAAU,mBAAmB;AAAA,IAC9B;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,MACC,CAAE,CAAE,yBAAyB,kBAAmB,EAAE,SAAU,QAAS,GACpE;AACD,WAAO;AAAA,EACR;AAEA,SAAO,oBAAC,iBAAc;AACvB;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-trash/check.js
1
2
  import { useSelect } from "@wordpress/data";
2
3
  import { store as coreStore } from "@wordpress/core-data";
3
4
  import { store as editorStore } from "../../store";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-trash/check.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { GLOBAL_POST_TYPES } from '../../store/constants';\n\n/**\n * Wrapper component that renders its children only if the post can be trashed.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children The child components.\n *\n * @return {React.ReactNode} The rendered child components or null if the post can't be trashed.\n */\nexport default function PostTrashCheck( { children } ) {\n\tconst { canTrashPost } = useSelect( ( select ) => {\n\t\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst { canUser } = select( coreStore );\n\t\tconst postType = getCurrentPostType();\n\t\tconst postId = getCurrentPostId();\n\t\tconst isNew = isEditedPostNew();\n\t\tconst canUserDelete = !! postId\n\t\t\t? canUser( 'delete', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t\tid: postId,\n\t\t\t } )\n\t\t\t: false;\n\n\t\treturn {\n\t\t\tcanTrashPost:\n\t\t\t\t( ! isNew || postId ) &&\n\t\t\t\tcanUserDelete &&\n\t\t\t\t! GLOBAL_POST_TYPES.includes( postType ),\n\t\t};\n\t}, [] );\n\tif ( ! canTrashPost ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],
5
- "mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,SAAS,mBAAmB;AACrC,SAAS,yBAAyB;AAUnB,SAAR,eAAiC,EAAE,SAAS,GAAI;AACtD,QAAM,EAAE,aAAa,IAAI,UAAW,CAAE,WAAY;AACjD,UAAM,EAAE,iBAAiB,kBAAkB,mBAAmB,IAC7D,OAAQ,WAAY;AACrB,UAAM,EAAE,QAAQ,IAAI,OAAQ,SAAU;AACtC,UAAM,WAAW,mBAAmB;AACpC,UAAM,SAAS,iBAAiB;AAChC,UAAM,QAAQ,gBAAgB;AAC9B,UAAM,gBAAgB,CAAC,CAAE,SACtB,QAAS,UAAU;AAAA,MACnB,MAAM;AAAA,MACN,MAAM;AAAA,MACN,IAAI;AAAA,IACJ,CAAE,IACF;AAEH,WAAO;AAAA,MACN,eACG,CAAE,SAAS,WACb,iBACA,CAAE,kBAAkB,SAAU,QAAS;AAAA,IACzC;AAAA,EACD,GAAG,CAAC,CAAE;AACN,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,SAAS,mBAAmB;AACrC,SAAS,yBAAyB;AAUnB,SAAR,eAAiC,EAAE,SAAS,GAAI;AACtD,QAAM,EAAE,aAAa,IAAI,UAAW,CAAE,WAAY;AACjD,UAAM,EAAE,iBAAiB,kBAAkB,mBAAmB,IAC7D,OAAQ,WAAY;AACrB,UAAM,EAAE,QAAQ,IAAI,OAAQ,SAAU;AACtC,UAAM,WAAW,mBAAmB;AACpC,UAAM,SAAS,iBAAiB;AAChC,UAAM,QAAQ,gBAAgB;AAC9B,UAAM,gBAAgB,CAAC,CAAE,SACtB,QAAS,UAAU;AAAA,MACnB,MAAM;AAAA,MACN,MAAM;AAAA,MACN,IAAI;AAAA,IACJ,CAAE,IACF;AAEH,WAAO;AAAA,MACN,eACG,CAAE,SAAS,WACb,iBACA,CAAE,kBAAkB,SAAU,QAAS;AAAA,IACzC;AAAA,EACD,GAAG,CAAC,CAAE;AACN,MAAK,CAAE,cAAe;AACrB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-trash/index.js
2
2
  import { __, sprintf } from "@wordpress/i18n";
3
3
  import {
4
4
  Button,
@@ -8,6 +8,7 @@ import { useSelect, useDispatch, useRegistry } from "@wordpress/data";
8
8
  import { useState } from "@wordpress/element";
9
9
  import { store as editorStore } from "../../store";
10
10
  import PostTrashCheck from "./check";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
11
12
  function PostTrash({ onActionPerformed }) {
12
13
  const registry = useRegistry();
13
14
  const { isNew, isDeleting, postId, title } = useSelect((select) => {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-trash/index.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostTrashCheck from './check';\n\n/**\n * Displays the Post Trash Button and Confirm Dialog in the Editor.\n *\n * @param {?{onActionPerformed: Object}} An object containing the onActionPerformed function.\n * @return {React.ReactNode} The rendered PostTrash component.\n */\nexport default function PostTrash( { onActionPerformed } ) {\n\tconst registry = useRegistry();\n\tconst { isNew, isDeleting, postId, title } = useSelect( ( select ) => {\n\t\tconst store = select( editorStore );\n\t\treturn {\n\t\t\tisNew: store.isEditedPostNew(),\n\t\t\tisDeleting: store.isDeletingPost(),\n\t\t\tpostId: store.getCurrentPostId(),\n\t\t\ttitle: store.getCurrentPostAttribute( 'title' ),\n\t\t};\n\t}, [] );\n\tconst { trashPost } = useDispatch( editorStore );\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tif ( isNew || ! postId ) {\n\t\treturn null;\n\t}\n\n\tconst handleConfirm = async () => {\n\t\tsetShowConfirmDialog( false );\n\t\tawait trashPost();\n\t\tconst item = await registry\n\t\t\t.resolveSelect( editorStore )\n\t\t\t.getCurrentPost();\n\t\t// After the post is trashed, we want to trigger the onActionPerformed callback, so the user is redirect\n\t\t// to the post view depending on if the user is on post editor or site editor.\n\t\tonActionPerformed?.( 'move-to-trash', [ item ] );\n\t};\n\treturn (\n\t\t<PostTrashCheck>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName=\"editor-post-trash\"\n\t\t\t\tisDestructive\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isDeleting }\n\t\t\t\taria-disabled={ isDeleting }\n\t\t\t\tonClick={\n\t\t\t\t\tisDeleting ? undefined : () => setShowConfirmDialog( true )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ __( 'Move to trash' ) }\n\t\t\t</Button>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tonConfirm={ handleConfirm }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t\tconfirmButtonText={ __( 'Move to trash' ) }\n\t\t\t\tsize=\"small\"\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: The item's title.\n\t\t\t\t\t__( 'Are you sure you want to move \"%s\" to the trash?' ),\n\t\t\t\t\ttitle\n\t\t\t\t) }\n\t\t\t</ConfirmDialog>\n\t\t</PostTrashCheck>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ACC,aAAa,SAAY,MAAM,qBAAsB,IAAK;AAAA,QAGzD,aAAI,eAAgB;AAAA;AAAA,IACvB;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,QAAS;AAAA,QACT,WAAY;AAAA,QACZ,UAAW,MAAM,qBAAsB,KAAM;AAAA,QAC7C,mBAAoB,GAAI,eAAgB;AAAA,QACxC,MAAK;AAAA,QAEH;AAAA;AAAA,UAED,GAAI,kDAAmD;AAAA,UACvD;AAAA,QACD;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-type-support-check/index.js
1
2
  import { useSelect } from "@wordpress/data";
2
3
  import { store as coreStore } from "@wordpress/core-data";
3
4
  import { store as editorStore } from "../../store";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-type-support-check/index.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction checkSupport( supports = {}, key ) {\n\t// Check for top-level support keys.\n\tif ( supports[ key ] !== undefined ) {\n\t\treturn !! supports[ key ];\n\t}\n\n\tconst [ topKey, subKey ] = key.split( '.' );\n\t// Try to unwrap sub-properties from the superfluous array.\n\tconst [ subProperties ] = Array.isArray( supports[ topKey ] )\n\t\t? supports[ topKey ]\n\t\t: [];\n\n\treturn Array.isArray( subProperties )\n\t\t? subProperties.includes( subKey )\n\t\t: !! subProperties?.[ subKey ];\n}\n\n/**\n * A component which renders its own children only if the current editor post\n * type supports one of the given `supportKeys` prop.\n *\n * @param {Object} props Props.\n * @param {React.ReactNode} props.children Children to be rendered if post\n * type supports.\n * @param {(string|string[])} props.supportKeys String or string array of keys\n * to test.\n *\n * @return {React.ReactNode} The component to be rendered.\n */\nfunction PostTypeSupportCheck( { children, supportKeys } ) {\n\tconst postType = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn getPostType( getEditedPostAttribute( 'type' ) );\n\t}, [] );\n\tlet isSupported = !! postType;\n\tif ( postType ) {\n\t\tisSupported = (\n\t\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t\t).some( ( key ) => checkSupport( postType.supports, key ) );\n\t}\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostTypeSupportCheck;\n"],
5
- "mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,SAAS,mBAAmB;AAErC,SAAS,aAAc,WAAW,CAAC,GAAG,KAAM;AAE3C,MAAK,SAAU,GAAI,MAAM,QAAY;AACpC,WAAO,CAAC,CAAE,SAAU,GAAI;AAAA,EACzB;AAEA,QAAM,CAAE,QAAQ,MAAO,IAAI,IAAI,MAAO,GAAI;AAE1C,QAAM,CAAE,aAAc,IAAI,MAAM,QAAS,SAAU,MAAO,CAAE,IACzD,SAAU,MAAO,IACjB,CAAC;AAEJ,SAAO,MAAM,QAAS,aAAc,IACjC,cAAc,SAAU,MAAO,IAC/B,CAAC,CAAE,gBAAiB,MAAO;AAC/B;AAcA,SAAS,qBAAsB,EAAE,UAAU,YAAY,GAAI;AAC1D,QAAM,WAAW,UAAW,CAAE,WAAY;AACzC,UAAM,EAAE,uBAAuB,IAAI,OAAQ,WAAY;AACvD,UAAM,EAAE,YAAY,IAAI,OAAQ,SAAU;AAC1C,WAAO,YAAa,uBAAwB,MAAO,CAAE;AAAA,EACtD,GAAG,CAAC,CAAE;AACN,MAAI,cAAc,CAAC,CAAE;AACrB,MAAK,UAAW;AACf,mBACC,MAAM,QAAS,WAAY,IAAI,cAAc,CAAE,WAAY,GAC1D,KAAM,CAAE,QAAS,aAAc,SAAS,UAAU,GAAI,CAAE;AAAA,EAC3D;AAEA,MAAK,CAAE,aAAc;AACpB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAEA,IAAO,kCAAQ;",
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,SAAS,mBAAmB;AAErC,SAAS,aAAc,WAAW,CAAC,GAAG,KAAM;AAE3C,MAAK,SAAU,GAAI,MAAM,QAAY;AACpC,WAAO,CAAC,CAAE,SAAU,GAAI;AAAA,EACzB;AAEA,QAAM,CAAE,QAAQ,MAAO,IAAI,IAAI,MAAO,GAAI;AAE1C,QAAM,CAAE,aAAc,IAAI,MAAM,QAAS,SAAU,MAAO,CAAE,IACzD,SAAU,MAAO,IACjB,CAAC;AAEJ,SAAO,MAAM,QAAS,aAAc,IACjC,cAAc,SAAU,MAAO,IAC/B,CAAC,CAAE,gBAAiB,MAAO;AAC/B;AAcA,SAAS,qBAAsB,EAAE,UAAU,YAAY,GAAI;AAC1D,QAAM,WAAW,UAAW,CAAE,WAAY;AACzC,UAAM,EAAE,uBAAuB,IAAI,OAAQ,WAAY;AACvD,UAAM,EAAE,YAAY,IAAI,OAAQ,SAAU;AAC1C,WAAO,YAAa,uBAAwB,MAAO,CAAE;AAAA,EACtD,GAAG,CAAC,CAAE;AACN,MAAI,cAAc,CAAC,CAAE;AACrB,MAAK,UAAW;AACf,mBACC,MAAM,QAAS,WAAY,IAAI,cAAc,CAAE,WAAY,GAC1D,KAAM,CAAE,QAAS,aAAc,SAAS,UAAU,GAAI,CAAE;AAAA,EAC3D;AAEA,MAAK,CAAE,aAAc;AACpB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAEA,IAAO,kCAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-url/check.js
1
2
  import { useSelect } from "@wordpress/data";
2
3
  import { store as coreStore } from "@wordpress/core-data";
3
4
  import { store as editorStore } from "../../store";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-url/check.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Check if the post URL is valid and visible.\n *\n * @param {Object} props The component props.\n * @param {React.ReactNode} props.children The child components.\n *\n * @return {React.ReactNode} The child components if the post URL is valid and visible, otherwise null.\n */\nexport default function PostURLCheck( { children } ) {\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( ! post.link ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst permalinkParts = select( editorStore ).getPermalinkParts();\n\t\tif ( ! permalinkParts ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],
5
- "mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,SAAS,mBAAmB;AAUtB,SAAR,aAA+B,EAAE,SAAS,GAAI;AACpD,QAAM,YAAY,UAAW,CAAE,WAAY;AAC1C,UAAM,eAAe,OAAQ,WAAY,EAAE,mBAAmB;AAC9D,UAAM,WAAW,OAAQ,SAAU,EAAE,YAAa,YAAa;AAC/D,QAAK,CAAE,UAAU,UAAW;AAC3B,aAAO;AAAA,IACR;AAEA,UAAM,OAAO,OAAQ,WAAY,EAAE,eAAe;AAClD,QAAK,CAAE,KAAK,MAAO;AAClB,aAAO;AAAA,IACR;AAEA,UAAM,iBAAiB,OAAQ,WAAY,EAAE,kBAAkB;AAC/D,QAAK,CAAE,gBAAiB;AACvB,aAAO;AAAA,IACR;AAEA,WAAO;AAAA,EACR,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,SAAS,mBAAmB;AAUtB,SAAR,aAA+B,EAAE,SAAS,GAAI;AACpD,QAAM,YAAY,UAAW,CAAE,WAAY;AAC1C,UAAM,eAAe,OAAQ,WAAY,EAAE,mBAAmB;AAC9D,UAAM,WAAW,OAAQ,SAAU,EAAE,YAAa,YAAa;AAC/D,QAAK,CAAE,UAAU,UAAW;AAC3B,aAAO;AAAA,IACR;AAEA,UAAM,OAAO,OAAQ,WAAY,EAAE,eAAe;AAClD,QAAK,CAAE,KAAK,MAAO;AAClB,aAAO;AAAA,IACR;AAEA,UAAM,iBAAiB,OAAQ,WAAY,EAAE,kBAAkB;AAC/D,QAAK,CAAE,gBAAiB;AACvB,aAAO;AAAA,IACR;AAEA,WAAO;AAAA,EACR,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-url/index.js
2
2
  import { useSelect, useDispatch } from "@wordpress/data";
3
3
  import { safeDecodeURIComponent, cleanForSlug } from "@wordpress/url";
4
4
  import { useState, createInterpolateElement } from "@wordpress/element";
@@ -17,6 +17,7 @@ import { copySmall } from "@wordpress/icons";
17
17
  import { store as coreStore } from "@wordpress/core-data";
18
18
  import { useCopyToClipboard, useInstanceId } from "@wordpress/compose";
19
19
  import { store as editorStore } from "../../store";
20
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
20
21
  function PostURL({ onClose }) {
21
22
  const {
22
23
  isEditable,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-url/index.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { useState, createInterpolateElement } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tExternalLink,\n\tButton,\n\t__experimentalInputControl as InputControl,\n\t__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n\t__experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { copySmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useCopyToClipboard, useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the `PostURL` component.\n *\n * @example\n * ```jsx\n * <PostURL />\n * ```\n *\n * @param {{ onClose: () => void }} props The props for the component.\n * @param {() => void} props.onClose Callback function to be executed when the popover is closed.\n *\n * @return {React.ReactNode} The rendered PostURL component.\n */\nexport default function PostURL( { onClose } ) {\n\tconst {\n\t\tisEditable,\n\t\tpostSlug,\n\t\tpostLink,\n\t\tpermalinkPrefix,\n\t\tpermalinkSuffix,\n\t\tpermalink,\n\t} = useSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tconst permalinkParts = select( editorStore ).getPermalinkParts();\n\t\tconst hasPublishAction = post?._links?.[ 'wp:action-publish' ] ?? false;\n\n\t\treturn {\n\t\t\tisEditable:\n\t\t\t\tselect( editorStore ).isPermalinkEditable() && hasPublishAction,\n\t\t\tpostSlug: safeDecodeURIComponent(\n\t\t\t\tselect( editorStore ).getEditedPostSlug()\n\t\t\t),\n\t\t\tviewPostLabel: postType?.labels.view_item,\n\t\t\tpostLink: post.link,\n\t\t\tpermalinkPrefix: permalinkParts?.prefix,\n\t\t\tpermalinkSuffix: permalinkParts?.suffix,\n\t\t\tpermalink: safeDecodeURIComponent(\n\t\t\t\tselect( editorStore ).getPermalink()\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst [ forceEmptyField, setForceEmptyField ] = useState( false );\n\tconst copyButtonRef = useCopyToClipboard( permalink, () => {\n\t\tcreateNotice( 'info', __( 'Copied Permalink to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\tconst postUrlSlugDescriptionId =\n\t\t'editor-post-url__slug-description-' + useInstanceId( PostURL );\n\n\treturn (\n\t\t<div className=\"editor-post-url\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Slug' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t{ isEditable && (\n\t\t\t\t\t<p className=\"editor-post-url__intro\">\n\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t'<span>Customize the last part of the Permalink.</span> <a>Learn more.</a>'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tspan: <span id={ postUrlSlugDescriptionId } />,\n\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ isEditable && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tprefix={\n\t\t\t\t\t\t\t\t\t<InputControlPrefixWrapper>\n\t\t\t\t\t\t\t\t\t\t/\n\t\t\t\t\t\t\t\t\t</InputControlPrefixWrapper>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsuffix={\n\t\t\t\t\t\t\t\t\t<InputControlSuffixWrapper variant=\"control\">\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\ticon={ copySmall }\n\t\t\t\t\t\t\t\t\t\t\tref={ copyButtonRef }\n\t\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\t\tlabel=\"Copy\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</InputControlSuffixWrapper>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlabel={ __( 'Slug' ) }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tvalue={ forceEmptyField ? '' : postSlug }\n\t\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\tclassName=\"editor-post-url__input\"\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\teditPost( { slug: newValue } );\n\t\t\t\t\t\t\t\t\t// When we delete the field the permalink gets\n\t\t\t\t\t\t\t\t\t// reverted to the original value.\n\t\t\t\t\t\t\t\t\t// The forceEmptyField logic allows the user to have\n\t\t\t\t\t\t\t\t\t// the field temporarily empty while typing.\n\t\t\t\t\t\t\t\t\tif ( ! newValue ) {\n\t\t\t\t\t\t\t\t\t\tif ( ! forceEmptyField ) {\n\t\t\t\t\t\t\t\t\t\t\tsetForceEmptyField( true );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\t\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonBlur={ ( event ) => {\n\t\t\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\t\t\tslug: cleanForSlug(\n\t\t\t\t\t\t\t\t\t\t\tevent.target.value\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\t\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\taria-describedby={ postUrlSlugDescriptionId }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<p className=\"editor-post-url__permalink\">\n\t\t\t\t\t\t\t\t<span className=\"editor-post-url__permalink-visual-label\">\n\t\t\t\t\t\t\t\t\t{ __( 'Permalink:' ) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\tclassName=\"editor-post-url__link\"\n\t\t\t\t\t\t\t\t\thref={ postLink }\n\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span className=\"editor-post-url__link-prefix\">\n\t\t\t\t\t\t\t\t\t\t{ permalinkPrefix }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span className=\"editor-post-url__link-slug\">\n\t\t\t\t\t\t\t\t\t\t{ postSlug }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span className=\"editor-post-url__link-suffix\">\n\t\t\t\t\t\t\t\t\t\t{ permalinkSuffix }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isEditable && (\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\tclassName=\"editor-post-url__link\"\n\t\t\t\t\t\t\thref={ postLink }\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ postLink }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n"],
5
- "mappings": "AAmFG,SA0BG,UA1BH,KAmFK,YAnFL;AAhFH,SAAS,WAAW,mBAAmB;AACvC,SAAS,wBAAwB,oBAAoB;AACrD,SAAS,UAAU,gCAAgC;AACnD,SAAS,wCAAwC,8BAA8B;AAC/E,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA,8BAA8B;AAAA,EAC9B,2CAA2C;AAAA,EAC3C,2CAA2C;AAAA,EAC3C,wBAAwB;AAAA,OAClB;AACP,SAAS,SAAS,oBAAoB;AACtC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,oBAAoB,qBAAqB;AAKlD,SAAS,SAAS,mBAAmB;AAetB,SAAR,QAA0B,EAAE,QAAQ,GAAI;AAC9C,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM,OAAO,OAAQ,WAAY,EAAE,eAAe;AAClD,UAAM,eAAe,OAAQ,WAAY,EAAE,mBAAmB;AAC9D,UAAM,WAAW,OAAQ,SAAU,EAAE,YAAa,YAAa;AAC/D,UAAM,iBAAiB,OAAQ,WAAY,EAAE,kBAAkB;AAC/D,UA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,oBAAK,CAAE,UAAW;AACjB,sBAAK,CAAE,iBAAkB;AACxB,uCAAoB,IAAK;AAAA,kBAC1B;AACA;AAAA,gBACD;AACA,oBAAK,iBAAkB;AACtB,qCAAoB,KAAM;AAAA,gBAC3B;AAAA,cACD;AAAA,cACA,QAAS,CAAE,UAAW;AACrB,yBAAU;AAAA,kBACT,MAAM;AAAA,oBACL,MAAM,OAAO;AAAA,kBACd;AAAA,gBACD,CAAE;AACF,oBAAK,iBAAkB;AACtB,qCAAoB,KAAM;AAAA,gBAC3B;AAAA,cACD;AAAA,cACA,oBAAmB;AAAA;AAAA,UACpB;AAAA,UACA,qBAAC,OAAE,WAAU,8BACZ;AAAA,gCAAC,UAAK,WAAU,2CACb,aAAI,YAAa,GACpB;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,MAAO;AAAA,gBACP,QAAO;AAAA,gBAEP;AAAA,sCAAC,UAAK,WAAU,gCACb,2BACH;AAAA,kBACA,oBAAC,UAAK,WAAU,8BACb,oBACH;AAAA,kBACA,oBAAC,UAAK,WAAU,gCACb,2BACH;AAAA;AAAA;AAAA,YACD;AAAA,aACD;AAAA,WACD;AAAA,QAEC,CAAE,cACH;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,MAAO;AAAA,YACP,QAAO;AAAA,YAEL;AAAA;AAAA,QACH;AAAA,SAEF;AAAA,OACD;AAAA,KACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-url/label.js
1
2
  import { useSelect } from "@wordpress/data";
2
3
  import { filterURLForDisplay, safeDecodeURIComponent } from "@wordpress/url";
3
4
  import { store as editorStore } from "../../store";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-url/label.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { filterURLForDisplay, safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Represents a label component for a post URL.\n *\n * @return {React.ReactNode} The PostURLLabel component.\n */\nexport default function PostURLLabel() {\n\treturn usePostURLLabel();\n}\n\n/**\n * Custom hook to get the label for the post URL.\n *\n * @return {string} The filtered and decoded post URL label.\n */\nexport function usePostURLLabel() {\n\tconst postLink = useSelect(\n\t\t( select ) => select( editorStore ).getPermalink(),\n\t\t[]\n\t);\n\treturn filterURLForDisplay( safeDecodeURIComponent( postLink ) );\n}\n"],
5
- "mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB,8BAA8B;AAK5D,SAAS,SAAS,mBAAmB;AAOtB,SAAR,eAAgC;AACtC,SAAO,gBAAgB;AACxB;AAOO,SAAS,kBAAkB;AACjC,QAAM,WAAW;AAAA,IAChB,CAAE,WAAY,OAAQ,WAAY,EAAE,aAAa;AAAA,IACjD,CAAC;AAAA,EACF;AACA,SAAO,oBAAqB,uBAAwB,QAAS,CAAE;AAChE;",
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB,8BAA8B;AAK5D,SAAS,SAAS,mBAAmB;AAOtB,SAAR,eAAgC;AACtC,SAAO,gBAAgB;AACxB;AAOO,SAAS,kBAAkB;AACjC,QAAM,WAAW;AAAA,IAChB,CAAE,WAAY,OAAQ,WAAY,EAAE,aAAa;AAAA,IACjD,CAAC;AAAA,EACF;AACA,SAAO,oBAAqB,uBAAwB,QAAS,CAAE;AAChE;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-url/panel.js
2
2
  import { useMemo, useState } from "@wordpress/element";
3
3
  import { useSelect } from "@wordpress/data";
4
4
  import { Dropdown, Button, ExternalLink } from "@wordpress/components";
@@ -9,6 +9,7 @@ import PostURLCheck from "./check";
9
9
  import PostURL from "./index";
10
10
  import PostPanelRow from "../post-panel-row";
11
11
  import { store as editorStore } from "../../store";
12
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
13
  function PostURLPanel() {
13
14
  const { isFrontPage } = useSelect((select) => {
14
15
  const { getCurrentPostId } = select(editorStore);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-url/panel.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { Dropdown, Button, ExternalLink } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { safeDecodeURIComponent } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostURLCheck from './check';\nimport PostURL from './index';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the `PostURLPanel` component.\n *\n * @return {React.ReactNode} The rendered PostURLPanel component.\n */\nexport default function PostURLPanel() {\n\tconst { isFrontPage } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId } = select( editorStore );\n\t\tconst { getEditedEntityRecord, canUser } = select( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEditedEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst _id = getCurrentPostId();\n\t\treturn {\n\t\t\tisFrontPage: siteSettings?.page_on_front === _id,\n\t\t};\n\t}, [] );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst label = isFrontPage ? __( 'Link' ) : __( 'Slug' );\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PostPanelRow label={ label } ref={ setPopoverAnchor }>\n\t\t\t\t{ ! isFrontPage && (\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\tclassName=\"editor-post-url__panel-dropdown\"\n\t\t\t\t\t\tcontentClassName=\"editor-post-url__panel-dialog\"\n\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<PostURLToggle\n\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t<PostURL onClose={ onClose } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isFrontPage && <FrontPageLink /> }\n\t\t\t</PostPanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst { slug } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tslug: select( editorStore ).getEditedPostSlug(),\n\t\t};\n\t}, [] );\n\tconst decodedSlug = safeDecodeURIComponent( slug );\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-url__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\taria-label={\n\t\t\t\t// translators: %s: Current post link.\n\t\t\t\tsprintf( __( 'Change link: %s' ), decodedSlug )\n\t\t\t}\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t<>{ decodedSlug }</>\n\t\t</Button>\n\t);\n}\n\nfunction FrontPageLink() {\n\tconst { postLink } = useSelect( ( select ) => {\n\t\tconst { getCurrentPost } = select( editorStore );\n\t\treturn {\n\t\t\tpostLink: getCurrentPost()?.link,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<ExternalLink\n\t\t\tclassName=\"editor-post-url__front-page-link\"\n\t\t\thref={ postLink }\n\t\t\ttarget=\"_blank\"\n\t\t>\n\t\t\t{ postLink }\n\t\t</ExternalLink>\n\t);\n}\n"],
5
- "mappings": "AA0DG,SA2CA,UAnCI,KARJ;AAvDH,SAAS,SAAS,gBAAgB;AAClC,SAAS,iBAAiB;AAC1B,SAAS,UAAU,QAAQ,oBAAoB;AAC/C,SAAS,IAAI,eAAe;AAC5B,SAAS,8BAA8B;AACvC,SAAS,SAAS,iBAAiB;AAKnC,OAAO,kBAAkB;AACzB,OAAO,aAAa;AACpB,OAAO,kBAAkB;AACzB,SAAS,SAAS,mBAAmB;AAOtB,SAAR,eAAgC;AACtC,QAAM,EAAE,YAAY,IAAI,UAAW,CAAE,WAAY;AAChD,UAAM,EAAE,iBAAiB,IAAI,OAAQ,WAAY;AACjD,UAAM,EAAE,uBAAuB,QAAQ,IAAI,OAAQ,SAAU;AAC7D,UAAM,eAAe,QAAS,QAAQ;AAAA,MACrC,MAAM;AAAA,MACN,MAAM;AAAA,IACP,CAAE,IACC,sBAAuB,QAAQ,MAAO,IACtC;AACH,UAAM,MAAM,iBAAiB;AAC7B,WAAO;AAAA,MACN,aAAa,cAAc,kBAAkB;AAAA,IAC9C;AAAA,EACD,GAAG,CAAC,CAAE;AAGN,QAAM,CAAE,eAAe,gBAAiB,IAAI,SAAU,IAAK;AAE3D,QAAM,eAAe;AAAA,IACpB,OAAQ;AAAA;AAAA;AAAA,MAGP,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,OAAO;AAAA,IACR;AAAA,IACA,CAAE,aAAc;AAAA,EACjB;AAEA,QAAM,QAAQ,cAAc,GAAI,MAAO,IAAI,GAAI,MAAO;AAEtD,SACC,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AA;AAAA,IAE/B;AAAA,IAEC,eAAe,oBAAC,iBAAc;AAAA,KACjC,GACD;AAEF;AAEA,SAAS,cAAe,EAAE,QAAQ,QAAQ,GAAI;AAC7C,QAAM,EAAE,KAAK,IAAI,UAAW,CAAE,WAAY;AACzC,WAAO;AAAA,MACN,MAAM,OAAQ,WAAY,EAAE,kBAAkB;AAAA,IAC/C;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,cAAc,uBAAwB,IAAK;AACjD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,WAAU;AAAA,MACV,SAAQ;AAAA,MACR,iBAAgB;AAAA,MAChB;AAAA;AAAA,QAEC,QAAS,GAAI,iBAAkB,GAAG,WAAY;AAAA;AAAA,MAE/C;AAAA,MAEA,0CAAI,uBAAa;AAAA;AAAA,EAClB;AAEF;AAEA,SAAS,gBAAgB;AACxB,QAAM,EAAE,SAAS,IAAI,UAAW,CAAE,WAAY;AAC7C,UAAM,EAAE,eAAe,IAAI,OAAQ,WAAY;AAC/C,WAAO;AAAA,MACN,UAAU,eAAe,GAAG;AAAA,IAC7B;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,MAAO;AAAA,MACP,QAAO;AAAA,MAEL;AAAA;AAAA,EACH;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-view-link/index.js
2
2
  import { __ } from "@wordpress/i18n";
3
3
  import { Button } from "@wordpress/components";
4
4
  import { external } from "@wordpress/icons";
@@ -6,6 +6,7 @@ import { store as coreStore } from "@wordpress/core-data";
6
6
  import { useSelect } from "@wordpress/data";
7
7
  import { store as preferencesStore } from "@wordpress/preferences";
8
8
  import { store as editorStore } from "../../store";
9
+ import { jsx } from "react/jsx-runtime";
9
10
  function PostViewLink() {
10
11
  const { hasLoaded, permalink, isPublished, label, showIconLabels } = useSelect((select) => {
11
12
  const postTypeSlug = select(editorStore).getCurrentPostType();
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-view-link/index.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostViewLink() {\n\tconst { hasLoaded, permalink, isPublished, label, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\t// Grab post type to retrieve the view_item label.\n\t\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\treturn {\n\t\t\t\tpermalink: select( editorStore ).getPermalink(),\n\t\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\t\tlabel: postType?.labels.view_item,\n\t\t\t\thasLoaded: !! postType,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\n\t// Only render the view button if the post is published and has a permalink.\n\tif ( ! isPublished || ! permalink || ! hasLoaded ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\ticon={ external }\n\t\t\tlabel={ label || __( 'View post' ) }\n\t\t\thref={ permalink }\n\t\t\ttarget=\"_blank\"\n\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\tsize=\"compact\"\n\t\t/>\n\t);\n}\n"],
5
- "mappings": "AAsCE;AAnCF,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,SAAS,iBAAiB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,wBAAwB;AAK1C,SAAS,SAA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aAAa,OAAQ,WAAY,EAAE,uBAAuB;AAAA,MAC1D,OAAO,UAAU,OAAO;AAAA,MACxB,WAAW,CAAC,CAAE;AAAA,MACd,gBAAgB,IAAK,QAAQ,gBAAiB;AAAA,IAC/C;AAAA,EACD,GAAG,CAAC,CAAE;AAGP,MAAK,CAAE,eAAe,CAAE,aAAa,CAAE,WAAY;AAClD,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO;AAAA,MACP,OAAQ,SAAS,GAAI,WAAY;AAAA,MACjC,MAAO;AAAA,MACP,QAAO;AAAA,MACP,aAAc,CAAE;AAAA,MAChB,MAAK;AAAA;AAAA,EACN;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-visibility/check.js
1
2
  import { useSelect } from "@wordpress/data";
2
3
  import { store as editorStore } from "../../store";
3
4
  function PostVisibilityCheck({ render }) {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-visibility/check.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Determines if the current post can be edited (published)\n * and passes this information to the provided render function.\n *\n * @param {Object} props The component props.\n * @param {Function} props.render Function to render the component.\n * Receives an object with a `canEdit` property.\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostVisibilityCheck( { render } ) {\n\tconst canEdit = useSelect( ( select ) => {\n\t\treturn (\n\t\t\tselect( editorStore ).getCurrentPost()._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false\n\t\t);\n\t} );\n\n\treturn render( { canEdit } );\n}\n"],
5
- "mappings": "AAGA,SAAS,iBAAiB;AAK1B,SAAS,SAAS,mBAAmB;AAWtB,SAAR,oBAAsC,EAAE,OAAO,GAAI;AACzD,QAAM,UAAU,UAAW,CAAE,WAAY;AACxC,WACC,OAAQ,WAAY,EAAE,eAAe,EAAE,SACtC,mBACD,KAAK;AAAA,EAEP,CAAE;AAEF,SAAO,OAAQ,EAAE,QAAQ,CAAE;AAC5B;",
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAK1B,SAAS,SAAS,mBAAmB;AAWtB,SAAR,oBAAsC,EAAE,OAAO,GAAI;AACzD,QAAM,UAAU,UAAW,CAAE,WAAY;AACxC,WACC,OAAQ,WAAY,EAAE,eAAe,EAAE,SACtC,mBACD,KAAK;AAAA,EAEP,CAAE;AAEF,SAAO,OAAQ,EAAE,QAAQ,CAAE;AAC5B;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // packages/editor/src/components/post-visibility/index.js
2
2
  import { __ } from "@wordpress/i18n";
3
3
  import { useState } from "@wordpress/element";
4
4
  import {
@@ -11,6 +11,7 @@ import { useSelect, useDispatch } from "@wordpress/data";
11
11
  import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from "@wordpress/block-editor";
12
12
  import { VISIBILITY_OPTIONS } from "./utils";
13
13
  import { store as editorStore } from "../../store";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
14
15
  function PostVisibility({ onClose }) {
15
16
  const instanceId = useInstanceId(PostVisibility);
16
17
  const { status, visibility, password } = useSelect((select) => ({
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-visibility/index.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tTextControl,\n\tRadioControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { VISIBILITY_OPTIONS } from './utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * Allows users to set the visibility of a post.\n *\n * @param {Object} props The component props.\n * @param {Function} props.onClose Function to call when the popover is closed.\n * @return {React.ReactNode} The rendered component.\n */\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\n\tfunction updateVisibility( value ) {\n\t\tconst nextValues = {\n\t\t\tpublic: {\n\t\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\t\tpassword: '',\n\t\t\t},\n\t\t\tprivate: { status: 'private', password: '' },\n\t\t\tpassword: {\n\t\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\t\tpassword: password || '',\n\t\t\t},\n\t\t};\n\n\t\teditPost( nextValues[ value ] );\n\t\tsetHasPassword( value === 'password' );\n\t}\n\n\tconst updatePassword = ( value ) => {\n\t\teditPost( { password: value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<RadioControl\n\t\t\t\t\tlabel={ __( 'Visibility' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\toptions={ VISIBILITY_OPTIONS }\n\t\t\t\t\tselected={ hasPassword ? 'password' : visibility }\n\t\t\t\t\tonChange={ updateVisibility }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tlabel={ __( 'Password' ) }\n\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tmaxLength={ 255 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n"],
5
- "mappings": "AA+DG,cAKA,YALA;AA5DH,SAAS,UAAU;AACnB,SAAS,gBAAgB;AACzB;AAAA,EACC;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,OAClB;AACP,SAAS,qBAAqB;AAC9B,SAAS,WAAW,mBAAmB;AACvC,SAAS,wCAAwC,8BAA8B;AAK/E,SAAS,0BAA0B;AACnC,SAAS,SAAS,mBAAmB;AAStB,SAAR,eAAiC,EAAE,QAAQ,GAAI;AACrD,QAAM,aAAa,cAAe,cAAe;AAEjD,QAAM,EAAE,QAAQ,YAAY,SAAS,IAAI,UAAW,CAAE,YAAc;AAAA,IACnE,QAAQ,OAAQ,WAAY,EAAE,uBAAwB,QAAS;AAAA,IAC/D,YAAY,OAAQ,WAAY,EAAE,wBAAwB;AAAA,IAC1D,UAAU,OAAQ,WAAY,EAAE,uBAAwB,UAAW;AAAA,EACpE,EAAI;AAEJ,QAAM,EAAE,SAAS,IAAI,YAAa,WAAY;AAE9C,QAAM,CAAE,aAAa,cAAe,IAAI,SAAU,CAAC,CAAE,QAAS;AAE9D,WAAS,iBAAkB,OAAQ;AAClC,UAAM,aAAa;AAAA,MAClB,QAAQ;AAAA,QACP,QAAQ,eAAe,YAAY,UAAU;AAAA,QAC7C,UAAU;AAAA,MACX;AAAA,MACA,SAAS,EAAE,QAAQ,WAAW,UAAU,GAAG;AAAA,MAC3C,UAAU;AAAA,QACT,QAAQ,eAAe,YAAY,UAA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AAA,UAC3D,uBAAqB;AAAA,UACrB,yBAAuB;AAAA,UACvB,WAAY;AAAA;AAAA,MACb;AAAA,OAEF;AAAA,KACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/editor/src/components/post-visibility/label.js
1
2
  import { useSelect } from "@wordpress/data";
2
3
  import { VISIBILITY_OPTIONS } from "./utils";
3
4
  import { store as editorStore } from "../../store";
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/post-visibility/label.js"],
4
4
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { VISIBILITY_OPTIONS } from './utils';\nimport { store as editorStore } from '../../store';\n\n/**\n * Returns the label for the current post visibility setting.\n *\n * @return {string} Post visibility label.\n */\nexport default function PostVisibilityLabel() {\n\treturn usePostVisibilityLabel();\n}\n\n/**\n * Get the label for the current post visibility setting.\n *\n * @return {string} Post visibility label.\n */\nexport function usePostVisibilityLabel() {\n\tconst visibility = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostVisibility(),\n\t\t[]\n\t);\n\n\treturn VISIBILITY_OPTIONS.find( ( option ) => option.value === visibility )\n\t\t?.label;\n}\n"],
5
- "mappings": "AAGA,SAAS,iBAAiB;AAK1B,SAAS,0BAA0B;AACnC,SAAS,SAAS,mBAAmB;AAOtB,SAAR,sBAAuC;AAC7C,SAAO,uBAAuB;AAC/B;AAOO,SAAS,yBAAyB;AACxC,QAAM,aAAa;AAAA,IAClB,CAAE,WAAY,OAAQ,WAAY,EAAE,wBAAwB;AAAA,IAC5D,CAAC;AAAA,EACF;AAEA,SAAO,mBAAmB,KAAM,CAAE,WAAY,OAAO,UAAU,UAAW,GACvE;AACJ;",
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAK1B,SAAS,0BAA0B;AACnC,SAAS,SAAS,mBAAmB;AAOtB,SAAR,sBAAuC;AAC7C,SAAO,uBAAuB;AAC/B;AAOO,SAAS,yBAAyB;AACxC,QAAM,aAAa;AAAA,IAClB,CAAE,WAAY,OAAQ,WAAY,EAAE,wBAAwB;AAAA,IAC5D,CAAC;AAAA,EACF;AAEA,SAAO,mBAAmB,KAAM,CAAE,WAAY,OAAO,UAAU,UAAW,GACvE;AACJ;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,6 @@
1
+ // packages/editor/src/components/post-visibility/utils.js
1
2
  import { __ } from "@wordpress/i18n";
2
- const VISIBILITY_OPTIONS = [
3
+ var VISIBILITY_OPTIONS = [
3
4
  {
4
5
  label: __("Public"),
5
6
  value: "public",