@wordpress/editor 14.2.0 → 14.3.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 (695) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/pattern-overrides.js +8 -5
  3. package/build/bindings/pattern-overrides.js.map +1 -1
  4. package/build/bindings/post-meta.js +4 -0
  5. package/build/bindings/post-meta.js.map +1 -1
  6. package/build/components/editor-interface/index.js +2 -1
  7. package/build/components/editor-interface/index.js.map +1 -1
  8. package/build/components/entities-saved-states/index.js +1 -1
  9. package/build/components/entities-saved-states/index.js.map +1 -1
  10. package/build/components/inserter-sidebar/index.js +10 -21
  11. package/build/components/inserter-sidebar/index.js.map +1 -1
  12. package/build/components/list-view-sidebar/index.js +19 -47
  13. package/build/components/list-view-sidebar/index.js.map +1 -1
  14. package/build/components/page-attributes/parent.js +2 -1
  15. package/build/components/page-attributes/parent.js.map +1 -1
  16. package/build/components/post-actions/actions.js +67 -215
  17. package/build/components/post-actions/actions.js.map +1 -1
  18. package/build/components/post-actions/index.js +1 -1
  19. package/build/components/post-actions/index.js.map +1 -1
  20. package/build/components/post-excerpt/panel.js +1 -1
  21. package/build/components/post-excerpt/panel.js.map +1 -1
  22. package/build/components/post-preview-button/index.js +1 -1
  23. package/build/components/post-preview-button/index.js.map +1 -1
  24. package/build/components/post-publish-panel/index.js +1 -1
  25. package/build/components/post-publish-panel/index.js.map +1 -1
  26. package/build/components/post-saved-state/index.js +11 -1
  27. package/build/components/post-saved-state/index.js.map +1 -1
  28. package/build/components/post-schedule/index.js +3 -0
  29. package/build/components/post-schedule/index.js.map +1 -1
  30. package/build/components/post-status/index.js +2 -1
  31. package/build/components/post-status/index.js.map +1 -1
  32. package/build/components/post-title/index.js +5 -13
  33. package/build/components/post-title/index.js.map +1 -1
  34. package/build/components/preview-dropdown/index.js +1 -1
  35. package/build/components/preview-dropdown/index.js.map +1 -1
  36. package/build/components/provider/index.native.js +0 -4
  37. package/build/components/provider/index.native.js.map +1 -1
  38. package/build/components/provider/use-block-editor-settings.js +7 -4
  39. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  40. package/build/components/save-publish-panels/index.js +30 -16
  41. package/build/components/save-publish-panels/index.js.map +1 -1
  42. package/build/components/sidebar/index.js +3 -1
  43. package/build/components/sidebar/index.js.map +1 -1
  44. package/build/components/sidebar/post-summary.js +1 -2
  45. package/build/components/sidebar/post-summary.js.map +1 -1
  46. package/build/components/template-content-panel/index.js +29 -4
  47. package/build/components/template-content-panel/index.js.map +1 -1
  48. package/build/components/visual-editor/index.js +1 -1
  49. package/build/components/visual-editor/index.js.map +1 -1
  50. package/build/dataviews/actions/delete-post.js +96 -0
  51. package/build/dataviews/actions/delete-post.js.map +1 -0
  52. package/build/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +11 -20
  53. package/build/dataviews/actions/export-pattern.js.map +1 -0
  54. package/build/dataviews/actions/index.js +32 -0
  55. package/build/dataviews/actions/index.js.map +1 -0
  56. package/build/dataviews/actions/reset-post.js +111 -0
  57. package/build/dataviews/actions/reset-post.js.map +1 -0
  58. package/build/dataviews/actions/utils.js +50 -0
  59. package/build/dataviews/actions/utils.js.map +1 -0
  60. package/build/dataviews/store/private-actions.js.map +1 -1
  61. package/build/dataviews/store/private-selectors.js +6 -6
  62. package/build/dataviews/store/private-selectors.js.map +1 -1
  63. package/build/dataviews/store/reducer.js +6 -2
  64. package/build/dataviews/store/reducer.js.map +1 -1
  65. package/build/dataviews/types.js +6 -0
  66. package/build/dataviews/types.js.map +1 -0
  67. package/build/hooks/pattern-overrides.js +2 -2
  68. package/build/hooks/pattern-overrides.js.map +1 -1
  69. package/build/private-apis.js +2 -0
  70. package/build/private-apis.js.map +1 -1
  71. package/build/private-apis.native.js +0 -2
  72. package/build/private-apis.native.js.map +1 -1
  73. package/build/store/constants.js.map +1 -1
  74. package/build/store/private-actions.js +1 -1
  75. package/build/store/private-actions.js.map +1 -1
  76. package/build/store/private-selectors.js +0 -18
  77. package/build/store/private-selectors.js.map +1 -1
  78. package/build/store/utils/is-template-revertable.js +6 -8
  79. package/build/store/utils/is-template-revertable.js.map +1 -1
  80. package/build-module/bindings/pattern-overrides.js +8 -5
  81. package/build-module/bindings/pattern-overrides.js.map +1 -1
  82. package/build-module/bindings/post-meta.js +4 -0
  83. package/build-module/bindings/post-meta.js.map +1 -1
  84. package/build-module/components/editor-interface/index.js +2 -1
  85. package/build-module/components/editor-interface/index.js.map +1 -1
  86. package/build-module/components/entities-saved-states/index.js +1 -1
  87. package/build-module/components/entities-saved-states/index.js.map +1 -1
  88. package/build-module/components/inserter-sidebar/index.js +11 -22
  89. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  90. package/build-module/components/list-view-sidebar/index.js +20 -49
  91. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  92. package/build-module/components/page-attributes/parent.js +2 -1
  93. package/build-module/components/page-attributes/parent.js.map +1 -1
  94. package/build-module/components/post-actions/actions.js +63 -210
  95. package/build-module/components/post-actions/actions.js.map +1 -1
  96. package/build-module/components/post-actions/index.js +1 -1
  97. package/build-module/components/post-actions/index.js.map +1 -1
  98. package/build-module/components/post-excerpt/panel.js +1 -1
  99. package/build-module/components/post-excerpt/panel.js.map +1 -1
  100. package/build-module/components/post-preview-button/index.js +1 -1
  101. package/build-module/components/post-preview-button/index.js.map +1 -1
  102. package/build-module/components/post-publish-panel/index.js +1 -1
  103. package/build-module/components/post-publish-panel/index.js.map +1 -1
  104. package/build-module/components/post-saved-state/index.js +11 -1
  105. package/build-module/components/post-saved-state/index.js.map +1 -1
  106. package/build-module/components/post-schedule/index.js +3 -0
  107. package/build-module/components/post-schedule/index.js.map +1 -1
  108. package/build-module/components/post-status/index.js +1 -1
  109. package/build-module/components/post-status/index.js.map +1 -1
  110. package/build-module/components/post-title/index.js +5 -13
  111. package/build-module/components/post-title/index.js.map +1 -1
  112. package/build-module/components/preview-dropdown/index.js +1 -1
  113. package/build-module/components/preview-dropdown/index.js.map +1 -1
  114. package/build-module/components/provider/index.native.js +0 -4
  115. package/build-module/components/provider/index.native.js.map +1 -1
  116. package/build-module/components/provider/use-block-editor-settings.js +7 -4
  117. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  118. package/build-module/components/save-publish-panels/index.js +30 -16
  119. package/build-module/components/save-publish-panels/index.js.map +1 -1
  120. package/build-module/components/sidebar/index.js +3 -1
  121. package/build-module/components/sidebar/index.js.map +1 -1
  122. package/build-module/components/sidebar/post-summary.js +1 -2
  123. package/build-module/components/sidebar/post-summary.js.map +1 -1
  124. package/build-module/components/template-content-panel/index.js +30 -5
  125. package/build-module/components/template-content-panel/index.js.map +1 -1
  126. package/build-module/components/visual-editor/index.js +1 -1
  127. package/build-module/components/visual-editor/index.js.map +1 -1
  128. package/build-module/dataviews/actions/delete-post.js +87 -0
  129. package/build-module/dataviews/actions/delete-post.js.map +1 -0
  130. package/build-module/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +10 -19
  131. package/build-module/dataviews/actions/export-pattern.js.map +1 -0
  132. package/build-module/dataviews/actions/index.js +24 -0
  133. package/build-module/dataviews/actions/index.js.map +1 -0
  134. package/build-module/dataviews/actions/reset-post.js +104 -0
  135. package/build-module/dataviews/actions/reset-post.js.map +1 -0
  136. package/build-module/dataviews/actions/utils.js +41 -0
  137. package/build-module/dataviews/actions/utils.js.map +1 -0
  138. package/build-module/dataviews/store/private-actions.js.map +1 -1
  139. package/build-module/dataviews/store/private-selectors.js +5 -5
  140. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  141. package/build-module/dataviews/store/reducer.js +6 -2
  142. package/build-module/dataviews/store/reducer.js.map +1 -1
  143. package/build-module/dataviews/types.js +2 -0
  144. package/build-module/dataviews/types.js.map +1 -0
  145. package/build-module/hooks/pattern-overrides.js +3 -1
  146. package/build-module/hooks/pattern-overrides.js.map +1 -1
  147. package/build-module/private-apis.js +2 -0
  148. package/build-module/private-apis.js.map +1 -1
  149. package/build-module/private-apis.native.js +0 -2
  150. package/build-module/private-apis.native.js.map +1 -1
  151. package/build-module/store/constants.js.map +1 -1
  152. package/build-module/store/private-actions.js +1 -1
  153. package/build-module/store/private-actions.js.map +1 -1
  154. package/build-module/store/private-selectors.js +0 -17
  155. package/build-module/store/private-selectors.js.map +1 -1
  156. package/build-module/store/utils/is-template-revertable.js +6 -8
  157. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  158. package/build-style/style-rtl.css +15 -53
  159. package/build-style/style.css +15 -53
  160. package/build-types/bindings/index.d.ts +2 -0
  161. package/build-types/bindings/index.d.ts.map +1 -0
  162. package/build-types/bindings/pattern-overrides.d.ts +18 -0
  163. package/build-types/bindings/pattern-overrides.d.ts.map +1 -0
  164. package/build-types/bindings/post-meta.d.ts +25 -0
  165. package/build-types/bindings/post-meta.d.ts.map +1 -0
  166. package/build-types/components/autocompleters/index.d.ts +2 -0
  167. package/build-types/components/autocompleters/index.d.ts.map +1 -0
  168. package/build-types/components/autocompleters/user.d.ts +6 -0
  169. package/build-types/components/autocompleters/user.d.ts.map +1 -0
  170. package/build-types/components/autosave-monitor/index.d.ts +15 -0
  171. package/build-types/components/autosave-monitor/index.d.ts.map +1 -0
  172. package/build-types/components/block-manager/category.d.ts +6 -0
  173. package/build-types/components/block-manager/category.d.ts.map +1 -0
  174. package/build-types/components/block-manager/checklist.d.ts +7 -0
  175. package/build-types/components/block-manager/checklist.d.ts.map +1 -0
  176. package/build-types/components/block-manager/index.d.ts +3 -0
  177. package/build-types/components/block-manager/index.d.ts.map +1 -0
  178. package/build-types/components/block-removal-warnings/index.d.ts +2 -0
  179. package/build-types/components/block-removal-warnings/index.d.ts.map +1 -0
  180. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +2 -0
  181. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -0
  182. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +65 -0
  183. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -0
  184. package/build-types/components/blog-title/index.d.ts +2 -0
  185. package/build-types/components/blog-title/index.d.ts.map +1 -0
  186. package/build-types/components/character-count/index.d.ts +7 -0
  187. package/build-types/components/character-count/index.d.ts.map +1 -0
  188. package/build-types/components/collapsible-block-toolbar/index.d.ts +6 -0
  189. package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -0
  190. package/build-types/components/commands/index.d.ts +2 -0
  191. package/build-types/components/commands/index.d.ts.map +1 -0
  192. package/build-types/components/create-template-part-modal/index.d.ts +14 -0
  193. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -0
  194. package/build-types/components/create-template-part-modal/utils.d.ts +4 -0
  195. package/build-types/components/create-template-part-modal/utils.d.ts.map +1 -0
  196. package/build-types/components/deprecated.d.ts +182 -0
  197. package/build-types/components/deprecated.d.ts.map +1 -0
  198. package/build-types/components/document-bar/index.d.ts +22 -0
  199. package/build-types/components/document-bar/index.d.ts.map +1 -0
  200. package/build-types/components/document-outline/check.d.ts +12 -0
  201. package/build-types/components/document-outline/check.d.ts.map +1 -0
  202. package/build-types/components/document-outline/index.d.ts +16 -0
  203. package/build-types/components/document-outline/index.d.ts.map +1 -0
  204. package/build-types/components/document-outline/item.d.ts +9 -0
  205. package/build-types/components/document-outline/item.d.ts.map +1 -0
  206. package/build-types/components/document-tools/index.d.ts +6 -0
  207. package/build-types/components/document-tools/index.d.ts.map +1 -0
  208. package/build-types/components/editor/index.d.ts +14 -0
  209. package/build-types/components/editor/index.d.ts.map +1 -0
  210. package/build-types/components/editor-history/redo.d.ts +4 -0
  211. package/build-types/components/editor-history/redo.d.ts.map +1 -0
  212. package/build-types/components/editor-history/undo.d.ts +4 -0
  213. package/build-types/components/editor-history/undo.d.ts.map +1 -0
  214. package/build-types/components/editor-interface/content-slot-fill.d.ts +3 -0
  215. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -0
  216. package/build-types/components/editor-interface/index.d.ts +17 -0
  217. package/build-types/components/editor-interface/index.d.ts.map +1 -0
  218. package/build-types/components/editor-notices/index.d.ts +13 -0
  219. package/build-types/components/editor-notices/index.d.ts.map +1 -0
  220. package/build-types/components/editor-snackbars/index.d.ts +7 -0
  221. package/build-types/components/editor-snackbars/index.d.ts.map +1 -0
  222. package/build-types/components/entities-saved-states/entity-record-item.d.ts +6 -0
  223. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -0
  224. package/build-types/components/entities-saved-states/entity-type-list.d.ts +6 -0
  225. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -0
  226. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts +2 -0
  227. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -0
  228. package/build-types/components/entities-saved-states/index.d.ts +43 -0
  229. package/build-types/components/entities-saved-states/index.d.ts.map +1 -0
  230. package/build-types/components/error-boundary/index.d.ts +14 -0
  231. package/build-types/components/error-boundary/index.d.ts.map +1 -0
  232. package/build-types/components/global-keyboard-shortcuts/index.d.ts +9 -0
  233. package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -0
  234. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts +8 -0
  235. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts.map +1 -0
  236. package/build-types/components/global-styles-provider/index.d.ts +20 -0
  237. package/build-types/components/global-styles-provider/index.d.ts.map +1 -0
  238. package/build-types/components/header/back-button.d.ts +6 -0
  239. package/build-types/components/header/back-button.d.ts.map +1 -0
  240. package/build-types/components/header/index.d.ts +10 -0
  241. package/build-types/components/header/index.d.ts.map +1 -0
  242. package/build-types/components/index.d.ts +108 -0
  243. package/build-types/components/index.d.ts.map +1 -0
  244. package/build-types/components/inserter-sidebar/index.d.ts +2 -0
  245. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -0
  246. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +26 -0
  247. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -0
  248. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +5 -0
  249. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -0
  250. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +3 -0
  251. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -0
  252. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +8 -0
  253. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -0
  254. package/build-types/components/list-view-sidebar/index.d.ts +2 -0
  255. package/build-types/components/list-view-sidebar/index.d.ts.map +1 -0
  256. package/build-types/components/list-view-sidebar/list-view-outline.d.ts +2 -0
  257. package/build-types/components/list-view-sidebar/list-view-outline.d.ts.map +1 -0
  258. package/build-types/components/local-autosave-monitor/index.d.ts +3 -0
  259. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -0
  260. package/build-types/components/media-categories/index.d.ts +7 -0
  261. package/build-types/components/media-categories/index.d.ts.map +1 -0
  262. package/build-types/components/mode-switcher/index.d.ts +3 -0
  263. package/build-types/components/mode-switcher/index.d.ts.map +1 -0
  264. package/build-types/components/more-menu/copy-content-menu-item.d.ts +2 -0
  265. package/build-types/components/more-menu/copy-content-menu-item.d.ts.map +1 -0
  266. package/build-types/components/more-menu/index.d.ts +2 -0
  267. package/build-types/components/more-menu/index.d.ts.map +1 -0
  268. package/build-types/components/more-menu/tools-more-menu-group.d.ts +6 -0
  269. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -0
  270. package/build-types/components/more-menu/view-more-menu-group.d.ts +6 -0
  271. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -0
  272. package/build-types/components/page-attributes/check.d.ts +13 -0
  273. package/build-types/components/page-attributes/check.d.ts.map +1 -0
  274. package/build-types/components/page-attributes/order.d.ts +9 -0
  275. package/build-types/components/page-attributes/order.d.ts.map +1 -0
  276. package/build-types/components/page-attributes/panel.d.ts +7 -0
  277. package/build-types/components/page-attributes/panel.d.ts.map +1 -0
  278. package/build-types/components/page-attributes/parent.d.ts +11 -0
  279. package/build-types/components/page-attributes/parent.d.ts.map +1 -0
  280. package/build-types/components/pattern-duplicate-modal/index.d.ts +3 -0
  281. package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -0
  282. package/build-types/components/pattern-overrides-panel/index.d.ts +2 -0
  283. package/build-types/components/pattern-overrides-panel/index.d.ts.map +1 -0
  284. package/build-types/components/pattern-rename-modal/index.d.ts +3 -0
  285. package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -0
  286. package/build-types/components/plugin-document-setting-panel/index.d.ts +69 -0
  287. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -0
  288. package/build-types/components/plugin-more-menu-item/index.d.ts +3 -0
  289. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -0
  290. package/build-types/components/plugin-post-publish-panel/index.d.ts +47 -0
  291. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -0
  292. package/build-types/components/plugin-post-status-info/index.d.ts +57 -0
  293. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -0
  294. package/build-types/components/plugin-pre-publish-panel/index.d.ts +50 -0
  295. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -0
  296. package/build-types/components/plugin-sidebar/index.d.ts +73 -0
  297. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -0
  298. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +52 -0
  299. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -0
  300. package/build-types/components/post-actions/actions.d.ts +31 -0
  301. package/build-types/components/post-actions/actions.d.ts.map +1 -0
  302. package/build-types/components/post-actions/index.d.ts +5 -0
  303. package/build-types/components/post-actions/index.d.ts.map +1 -0
  304. package/build-types/components/post-author/check.d.ts +13 -0
  305. package/build-types/components/post-author/check.d.ts.map +1 -0
  306. package/build-types/components/post-author/combobox.d.ts +2 -0
  307. package/build-types/components/post-author/combobox.d.ts.map +1 -0
  308. package/build-types/components/post-author/constants.d.ts +9 -0
  309. package/build-types/components/post-author/constants.d.ts.map +1 -0
  310. package/build-types/components/post-author/hook.d.ts +6 -0
  311. package/build-types/components/post-author/hook.d.ts.map +1 -0
  312. package/build-types/components/post-author/index.d.ts +8 -0
  313. package/build-types/components/post-author/index.d.ts.map +1 -0
  314. package/build-types/components/post-author/panel.d.ts +8 -0
  315. package/build-types/components/post-author/panel.d.ts.map +1 -0
  316. package/build-types/components/post-author/select.d.ts +2 -0
  317. package/build-types/components/post-author/select.d.ts.map +1 -0
  318. package/build-types/components/post-card-panel/index.d.ts +4 -0
  319. package/build-types/components/post-card-panel/index.d.ts.map +1 -0
  320. package/build-types/components/post-comments/index.d.ts +3 -0
  321. package/build-types/components/post-comments/index.d.ts.map +1 -0
  322. package/build-types/components/post-content-information/index.d.ts +2 -0
  323. package/build-types/components/post-content-information/index.d.ts.map +1 -0
  324. package/build-types/components/post-discussion/panel.d.ts +10 -0
  325. package/build-types/components/post-discussion/panel.d.ts.map +1 -0
  326. package/build-types/components/post-excerpt/check.d.ts +13 -0
  327. package/build-types/components/post-excerpt/check.d.ts.map +1 -0
  328. package/build-types/components/post-excerpt/index.d.ts +15 -0
  329. package/build-types/components/post-excerpt/index.d.ts.map +1 -0
  330. package/build-types/components/post-excerpt/panel.d.ts +8 -0
  331. package/build-types/components/post-excerpt/panel.d.ts.map +1 -0
  332. package/build-types/components/post-excerpt/plugin.d.ts +53 -0
  333. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -0
  334. package/build-types/components/post-featured-image/check.d.ts +14 -0
  335. package/build-types/components/post-featured-image/check.d.ts.map +1 -0
  336. package/build-types/components/post-featured-image/index.d.ts +3 -0
  337. package/build-types/components/post-featured-image/index.d.ts.map +1 -0
  338. package/build-types/components/post-featured-image/panel.d.ts +13 -0
  339. package/build-types/components/post-featured-image/panel.d.ts.map +1 -0
  340. package/build-types/components/post-format/check.d.ts +5 -0
  341. package/build-types/components/post-format/check.d.ts.map +1 -0
  342. package/build-types/components/post-format/index.d.ts +16 -0
  343. package/build-types/components/post-format/index.d.ts.map +1 -0
  344. package/build-types/components/post-format/panel.d.ts +8 -0
  345. package/build-types/components/post-format/panel.d.ts.map +1 -0
  346. package/build-types/components/post-last-edited-panel/index.d.ts +2 -0
  347. package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -0
  348. package/build-types/components/post-last-revision/check.d.ts +13 -0
  349. package/build-types/components/post-last-revision/check.d.ts.map +1 -0
  350. package/build-types/components/post-last-revision/index.d.ts +9 -0
  351. package/build-types/components/post-last-revision/index.d.ts.map +1 -0
  352. package/build-types/components/post-last-revision/panel.d.ts +8 -0
  353. package/build-types/components/post-last-revision/panel.d.ts.map +1 -0
  354. package/build-types/components/post-locked-modal/index.d.ts +8 -0
  355. package/build-types/components/post-locked-modal/index.d.ts.map +1 -0
  356. package/build-types/components/post-panel-row/index.d.ts +3 -0
  357. package/build-types/components/post-panel-row/index.d.ts.map +1 -0
  358. package/build-types/components/post-panel-section/index.d.ts +6 -0
  359. package/build-types/components/post-panel-section/index.d.ts.map +1 -0
  360. package/build-types/components/post-pending-status/check.d.ts +15 -0
  361. package/build-types/components/post-pending-status/check.d.ts.map +1 -0
  362. package/build-types/components/post-pending-status/index.d.ts +8 -0
  363. package/build-types/components/post-pending-status/index.d.ts.map +1 -0
  364. package/build-types/components/post-pingbacks/index.d.ts +3 -0
  365. package/build-types/components/post-pingbacks/index.d.ts.map +1 -0
  366. package/build-types/components/post-preview-button/index.d.ts +23 -0
  367. package/build-types/components/post-preview-button/index.d.ts.map +1 -0
  368. package/build-types/components/post-publish-button/index.d.ts +17 -0
  369. package/build-types/components/post-publish-button/index.d.ts.map +1 -0
  370. package/build-types/components/post-publish-button/label.d.ts +7 -0
  371. package/build-types/components/post-publish-button/label.d.ts.map +1 -0
  372. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts +17 -0
  373. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -0
  374. package/build-types/components/post-publish-panel/index.d.ts +10 -0
  375. package/build-types/components/post-publish-panel/index.d.ts.map +1 -0
  376. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts +3 -0
  377. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -0
  378. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts +2 -0
  379. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -0
  380. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts +3 -0
  381. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -0
  382. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +2 -0
  383. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -0
  384. package/build-types/components/post-publish-panel/postpublish.d.ts +3 -0
  385. package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -0
  386. package/build-types/components/post-publish-panel/prepublish.d.ts +5 -0
  387. package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -0
  388. package/build-types/components/post-saved-state/index.d.ts +13 -0
  389. package/build-types/components/post-saved-state/index.d.ts.map +1 -0
  390. package/build-types/components/post-schedule/check.d.ts +12 -0
  391. package/build-types/components/post-schedule/check.d.ts.map +1 -0
  392. package/build-types/components/post-schedule/index.d.ts +17 -0
  393. package/build-types/components/post-schedule/index.d.ts.map +1 -0
  394. package/build-types/components/post-schedule/label.d.ts +25 -0
  395. package/build-types/components/post-schedule/label.d.ts.map +1 -0
  396. package/build-types/components/post-schedule/panel.d.ts +7 -0
  397. package/build-types/components/post-schedule/panel.d.ts.map +1 -0
  398. package/build-types/components/post-slug/check.d.ts +12 -0
  399. package/build-types/components/post-slug/check.d.ts.map +1 -0
  400. package/build-types/components/post-slug/index.d.ts +7 -0
  401. package/build-types/components/post-slug/index.d.ts.map +1 -0
  402. package/build-types/components/post-slug/panel.d.ts +3 -0
  403. package/build-types/components/post-slug/panel.d.ts.map +1 -0
  404. package/build-types/components/post-status/index.d.ts +6 -0
  405. package/build-types/components/post-status/index.d.ts.map +1 -0
  406. package/build-types/components/post-sticky/check.d.ts +12 -0
  407. package/build-types/components/post-sticky/check.d.ts.map +1 -0
  408. package/build-types/components/post-sticky/index.d.ts +7 -0
  409. package/build-types/components/post-sticky/index.d.ts.map +1 -0
  410. package/build-types/components/post-sticky/panel.d.ts +3 -0
  411. package/build-types/components/post-sticky/panel.d.ts.map +1 -0
  412. package/build-types/components/post-switch-to-draft-button/index.d.ts +7 -0
  413. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -0
  414. package/build-types/components/post-sync-status/index.d.ts +7 -0
  415. package/build-types/components/post-sync-status/index.d.ts.map +1 -0
  416. package/build-types/components/post-taxonomies/check.d.ts +12 -0
  417. package/build-types/components/post-taxonomies/check.d.ts.map +1 -0
  418. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +64 -0
  419. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -0
  420. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +102 -0
  421. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -0
  422. package/build-types/components/post-taxonomies/index.d.ts +5 -0
  423. package/build-types/components/post-taxonomies/index.d.ts.map +1 -0
  424. package/build-types/components/post-taxonomies/most-used-terms.d.ts +5 -0
  425. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -0
  426. package/build-types/components/post-taxonomies/panel.d.ts +3 -0
  427. package/build-types/components/post-taxonomies/panel.d.ts.map +1 -0
  428. package/build-types/components/post-template/block-theme.d.ts +4 -0
  429. package/build-types/components/post-template/block-theme.d.ts.map +1 -0
  430. package/build-types/components/post-template/classic-theme.d.ts +3 -0
  431. package/build-types/components/post-template/classic-theme.d.ts.map +1 -0
  432. package/build-types/components/post-template/create-new-template-modal.d.ts +4 -0
  433. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -0
  434. package/build-types/components/post-template/create-new-template.d.ts +4 -0
  435. package/build-types/components/post-template/create-new-template.d.ts.map +1 -0
  436. package/build-types/components/post-template/hooks.d.ts +8 -0
  437. package/build-types/components/post-template/hooks.d.ts.map +1 -0
  438. package/build-types/components/post-template/panel.d.ts +7 -0
  439. package/build-types/components/post-template/panel.d.ts.map +1 -0
  440. package/build-types/components/post-template/reset-default-template.d.ts +4 -0
  441. package/build-types/components/post-template/reset-default-template.d.ts.map +1 -0
  442. package/build-types/components/post-template/swap-template-button.d.ts +4 -0
  443. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -0
  444. package/build-types/components/post-text-editor/index.d.ts +7 -0
  445. package/build-types/components/post-text-editor/index.d.ts.map +1 -0
  446. package/build-types/components/post-title/constants.d.ts +3 -0
  447. package/build-types/components/post-title/constants.d.ts.map +1 -0
  448. package/build-types/components/post-title/index.d.ts +3 -0
  449. package/build-types/components/post-title/index.d.ts.map +1 -0
  450. package/build-types/components/post-title/post-title-raw.d.ts +3 -0
  451. package/build-types/components/post-title/post-title-raw.d.ts.map +1 -0
  452. package/build-types/components/post-title/use-post-title-focus.d.ts +9 -0
  453. package/build-types/components/post-title/use-post-title-focus.d.ts.map +1 -0
  454. package/build-types/components/post-title/use-post-title.d.ts +7 -0
  455. package/build-types/components/post-title/use-post-title.d.ts.map +1 -0
  456. package/build-types/components/post-transform-panel/hooks.d.ts +2 -0
  457. package/build-types/components/post-transform-panel/hooks.d.ts.map +1 -0
  458. package/build-types/components/post-transform-panel/index.d.ts +2 -0
  459. package/build-types/components/post-transform-panel/index.d.ts.map +1 -0
  460. package/build-types/components/post-trash/check.d.ts +12 -0
  461. package/build-types/components/post-trash/check.d.ts.map +1 -0
  462. package/build-types/components/post-trash/index.d.ts +7 -0
  463. package/build-types/components/post-trash/index.d.ts.map +1 -0
  464. package/build-types/components/post-type-support-check/index.d.ts +18 -0
  465. package/build-types/components/post-type-support-check/index.d.ts.map +1 -0
  466. package/build-types/components/post-url/check.d.ts +12 -0
  467. package/build-types/components/post-url/check.d.ts.map +1 -0
  468. package/build-types/components/post-url/index.d.ts +14 -0
  469. package/build-types/components/post-url/index.d.ts.map +1 -0
  470. package/build-types/components/post-url/label.d.ts +13 -0
  471. package/build-types/components/post-url/label.d.ts.map +1 -0
  472. package/build-types/components/post-url/panel.d.ts +7 -0
  473. package/build-types/components/post-url/panel.d.ts.map +1 -0
  474. package/build-types/components/post-view-link/index.d.ts +2 -0
  475. package/build-types/components/post-view-link/index.d.ts.map +1 -0
  476. package/build-types/components/post-visibility/check.d.ts +13 -0
  477. package/build-types/components/post-visibility/check.d.ts.map +1 -0
  478. package/build-types/components/post-visibility/index.d.ts +11 -0
  479. package/build-types/components/post-visibility/index.d.ts.map +1 -0
  480. package/build-types/components/post-visibility/label.d.ts +13 -0
  481. package/build-types/components/post-visibility/label.d.ts.map +1 -0
  482. package/build-types/components/post-visibility/utils.d.ts +21 -0
  483. package/build-types/components/post-visibility/utils.d.ts.map +1 -0
  484. package/build-types/components/posts-per-page/index.d.ts +2 -0
  485. package/build-types/components/posts-per-page/index.d.ts.map +1 -0
  486. package/build-types/components/preferences-modal/enable-panel.d.ts +3 -0
  487. package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -0
  488. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts +14 -0
  489. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -0
  490. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +3 -0
  491. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -0
  492. package/build-types/components/preferences-modal/index.d.ts +4 -0
  493. package/build-types/components/preferences-modal/index.d.ts.map +1 -0
  494. package/build-types/components/preview-dropdown/index.d.ts +5 -0
  495. package/build-types/components/preview-dropdown/index.d.ts.map +1 -0
  496. package/build-types/components/provider/disable-non-page-content-blocks.d.ts +6 -0
  497. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -0
  498. package/build-types/components/provider/index.d.ts +65 -0
  499. package/build-types/components/provider/index.d.ts.map +1 -0
  500. package/build-types/components/provider/navigation-block-editing-mode.d.ts +9 -0
  501. package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -0
  502. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts +7 -0
  503. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts.map +1 -0
  504. package/build-types/components/provider/use-block-editor-settings.d.ts +13 -0
  505. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -0
  506. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts +9 -0
  507. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts.map +1 -0
  508. package/build-types/components/provider/with-registry-provider.d.ts +3 -0
  509. package/build-types/components/provider/with-registry-provider.d.ts.map +1 -0
  510. package/build-types/components/resizable-editor/index.d.ts +8 -0
  511. package/build-types/components/resizable-editor/index.d.ts.map +1 -0
  512. package/build-types/components/resizable-editor/resize-handle.d.ts +5 -0
  513. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -0
  514. package/build-types/components/save-publish-panels/index.d.ts +11 -0
  515. package/build-types/components/save-publish-panels/index.d.ts.map +1 -0
  516. package/build-types/components/sidebar/constants.d.ts +5 -0
  517. package/build-types/components/sidebar/constants.d.ts.map +1 -0
  518. package/build-types/components/sidebar/header.d.ts +3 -0
  519. package/build-types/components/sidebar/header.d.ts.map +1 -0
  520. package/build-types/components/sidebar/index.d.ts +6 -0
  521. package/build-types/components/sidebar/index.d.ts.map +1 -0
  522. package/build-types/components/sidebar/post-summary.d.ts +4 -0
  523. package/build-types/components/sidebar/post-summary.d.ts.map +1 -0
  524. package/build-types/components/site-discussion/index.d.ts +2 -0
  525. package/build-types/components/site-discussion/index.d.ts.map +1 -0
  526. package/build-types/components/start-page-options/index.d.ts +2 -0
  527. package/build-types/components/start-page-options/index.d.ts.map +1 -0
  528. package/build-types/components/start-template-options/index.d.ts +2 -0
  529. package/build-types/components/start-template-options/index.d.ts.map +1 -0
  530. package/build-types/components/table-of-contents/index.d.ts +7 -0
  531. package/build-types/components/table-of-contents/index.d.ts.map +1 -0
  532. package/build-types/components/table-of-contents/panel.d.ts +6 -0
  533. package/build-types/components/table-of-contents/panel.d.ts.map +1 -0
  534. package/build-types/components/template-content-panel/index.d.ts +4 -0
  535. package/build-types/components/template-content-panel/index.d.ts.map +1 -0
  536. package/build-types/components/template-part-content-panel/index.d.ts +2 -0
  537. package/build-types/components/template-part-content-panel/index.d.ts.map +1 -0
  538. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts +5 -0
  539. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -0
  540. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts +5 -0
  541. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts.map +1 -0
  542. package/build-types/components/template-part-menu-items/index.d.ts +2 -0
  543. package/build-types/components/template-part-menu-items/index.d.ts.map +1 -0
  544. package/build-types/components/template-validation-notice/index.d.ts +2 -0
  545. package/build-types/components/template-validation-notice/index.d.ts.map +1 -0
  546. package/build-types/components/text-editor/index.d.ts +4 -0
  547. package/build-types/components/text-editor/index.d.ts.map +1 -0
  548. package/build-types/components/theme-support-check/index.d.ts +14 -0
  549. package/build-types/components/theme-support-check/index.d.ts.map +1 -0
  550. package/build-types/components/time-to-read/index.d.ts +7 -0
  551. package/build-types/components/time-to-read/index.d.ts.map +1 -0
  552. package/build-types/components/unsaved-changes-warning/index.d.ts +8 -0
  553. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -0
  554. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +18 -0
  555. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -0
  556. package/build-types/components/visual-editor/index.d.ts +10 -0
  557. package/build-types/components/visual-editor/index.d.ts.map +1 -0
  558. package/build-types/components/word-count/index.d.ts +7 -0
  559. package/build-types/components/word-count/index.d.ts.map +1 -0
  560. package/build-types/dataviews/actions/delete-post.d.ts +5 -0
  561. package/build-types/dataviews/actions/delete-post.d.ts.map +1 -0
  562. package/build-types/dataviews/actions/export-pattern.d.ts +8 -0
  563. package/build-types/dataviews/actions/export-pattern.d.ts.map +1 -0
  564. package/build-types/dataviews/actions/index.d.ts +2 -0
  565. package/build-types/dataviews/actions/index.d.ts.map +1 -0
  566. package/build-types/dataviews/actions/reset-post.d.ts +5 -0
  567. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -0
  568. package/build-types/dataviews/actions/utils.d.ts +11 -0
  569. package/build-types/dataviews/actions/utils.d.ts.map +1 -0
  570. package/build-types/dataviews/api.d.ts +27 -0
  571. package/build-types/dataviews/api.d.ts.map +1 -0
  572. package/build-types/dataviews/store/private-actions.d.ts +2 -2
  573. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  574. package/build-types/dataviews/store/private-selectors.d.ts +2 -5
  575. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  576. package/build-types/dataviews/store/reducer.d.ts +5 -1
  577. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  578. package/build-types/dataviews/types.d.ts +34 -0
  579. package/build-types/dataviews/types.d.ts.map +1 -0
  580. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +10 -0
  581. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -0
  582. package/build-types/hooks/default-autocompleters.d.ts +2 -0
  583. package/build-types/hooks/default-autocompleters.d.ts.map +1 -0
  584. package/build-types/hooks/index.d.ts +2 -0
  585. package/build-types/hooks/index.d.ts.map +1 -0
  586. package/build-types/hooks/media-upload.d.ts +2 -0
  587. package/build-types/hooks/media-upload.d.ts.map +1 -0
  588. package/build-types/hooks/pattern-overrides.d.ts +2 -0
  589. package/build-types/hooks/pattern-overrides.d.ts.map +1 -0
  590. package/build-types/hooks/use-select-nearest-editable-block.d.ts +4 -0
  591. package/build-types/hooks/use-select-nearest-editable-block.d.ts.map +1 -0
  592. package/build-types/index.d.ts +6 -0
  593. package/build-types/index.d.ts.map +1 -0
  594. package/build-types/lock-unlock.d.ts +3 -0
  595. package/build-types/lock-unlock.d.ts.map +1 -0
  596. package/build-types/private-apis.d.ts +2 -0
  597. package/build-types/private-apis.d.ts.map +1 -0
  598. package/build-types/store/actions.d.ts +367 -0
  599. package/build-types/store/actions.d.ts.map +1 -0
  600. package/build-types/store/constants.d.ts +31 -0
  601. package/build-types/store/constants.d.ts.map +1 -0
  602. package/build-types/store/defaults.d.ts +21 -0
  603. package/build-types/store/defaults.d.ts.map +1 -0
  604. package/build-types/store/index.d.ts +17 -0
  605. package/build-types/store/index.d.ts.map +1 -0
  606. package/build-types/store/local-autosave.d.ts +4 -0
  607. package/build-types/store/local-autosave.d.ts.map +1 -0
  608. package/build-types/store/private-actions.d.ts +37 -0
  609. package/build-types/store/private-actions.d.ts.map +1 -0
  610. package/build-types/store/private-selectors.d.ts +24 -0
  611. package/build-types/store/private-selectors.d.ts.map +1 -0
  612. package/build-types/store/reducer.d.ts +228 -0
  613. package/build-types/store/reducer.d.ts.map +1 -0
  614. package/build-types/store/selectors.d.ts +854 -0
  615. package/build-types/store/selectors.d.ts.map +1 -0
  616. package/build-types/store/utils/get-filtered-template-parts.d.ts +3 -0
  617. package/build-types/store/utils/get-filtered-template-parts.d.ts.map +1 -0
  618. package/build-types/store/utils/is-template-revertable.d.ts +8 -0
  619. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -0
  620. package/build-types/store/utils/notice-builder.d.ts +27 -0
  621. package/build-types/store/utils/notice-builder.d.ts.map +1 -0
  622. package/build-types/utils/get-template-part-icon.d.ts +9 -0
  623. package/build-types/utils/get-template-part-icon.d.ts.map +1 -0
  624. package/build-types/utils/index.d.ts +5 -0
  625. package/build-types/utils/index.d.ts.map +1 -0
  626. package/build-types/utils/media-upload/index.d.ts +21 -0
  627. package/build-types/utils/media-upload/index.d.ts.map +1 -0
  628. package/build-types/utils/set-nested-value.d.ts +20 -0
  629. package/build-types/utils/set-nested-value.d.ts.map +1 -0
  630. package/build-types/utils/terms.d.ts +12 -0
  631. package/build-types/utils/terms.d.ts.map +1 -0
  632. package/build-types/utils/url.d.ts +18 -0
  633. package/build-types/utils/url.d.ts.map +1 -0
  634. package/package.json +36 -35
  635. package/src/bindings/pattern-overrides.js +9 -10
  636. package/src/bindings/post-meta.js +5 -0
  637. package/src/components/editor-interface/index.js +17 -12
  638. package/src/components/entities-saved-states/index.js +1 -1
  639. package/src/components/inserter-sidebar/index.js +4 -24
  640. package/src/components/list-view-sidebar/index.js +34 -62
  641. package/src/components/list-view-sidebar/style.scss +0 -34
  642. package/src/components/page-attributes/parent.js +6 -3
  643. package/src/components/post-actions/actions.js +82 -277
  644. package/src/components/post-actions/index.js +1 -1
  645. package/src/components/post-excerpt/panel.js +1 -1
  646. package/src/components/post-featured-image/style.scss +15 -0
  647. package/src/components/post-panel-row/style.scss +1 -0
  648. package/src/components/post-preview-button/index.js +1 -1
  649. package/src/components/post-publish-panel/index.js +1 -1
  650. package/src/components/post-saved-state/index.js +11 -1
  651. package/src/components/post-schedule/index.js +5 -0
  652. package/src/components/post-status/index.js +1 -1
  653. package/src/components/post-taxonomies/README.md +1 -1
  654. package/src/components/post-title/index.js +5 -12
  655. package/src/components/preview-dropdown/index.js +1 -1
  656. package/src/components/provider/index.native.js +3 -11
  657. package/src/components/provider/use-block-editor-settings.js +10 -5
  658. package/src/components/save-publish-panels/index.js +33 -23
  659. package/src/components/sidebar/index.js +1 -3
  660. package/src/components/sidebar/post-summary.js +0 -2
  661. package/src/components/template-content-panel/index.js +29 -5
  662. package/src/components/visual-editor/index.js +1 -1
  663. package/src/components/visual-editor/style.scss +1 -1
  664. package/src/dataviews/actions/delete-post.tsx +107 -0
  665. package/src/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.tsx} +19 -19
  666. package/src/dataviews/actions/index.ts +25 -0
  667. package/src/dataviews/actions/reset-post.tsx +144 -0
  668. package/src/dataviews/actions/utils.ts +54 -0
  669. package/src/dataviews/store/private-actions.ts +2 -2
  670. package/src/dataviews/store/private-selectors.ts +13 -6
  671. package/src/dataviews/store/reducer.ts +12 -5
  672. package/src/dataviews/types.ts +33 -0
  673. package/src/hooks/pattern-overrides.js +4 -1
  674. package/src/private-apis.js +2 -0
  675. package/src/private-apis.native.js +0 -2
  676. package/src/store/private-actions.js +1 -6
  677. package/src/store/private-selectors.js +0 -25
  678. package/src/store/utils/is-template-revertable.js +8 -8
  679. package/src/style.scss +0 -1
  680. package/tsconfig.json +3 -2
  681. package/tsconfig.tsbuildinfo +1 -1
  682. package/build/components/post-actions/export-pattern-action.js.map +0 -1
  683. package/build/components/post-actions/export-pattern-action.native.js +0 -11
  684. package/build/components/post-actions/export-pattern-action.native.js.map +0 -1
  685. package/build/components/template-areas/index.js +0 -84
  686. package/build/components/template-areas/index.js.map +0 -1
  687. package/build-module/components/post-actions/export-pattern-action.js.map +0 -1
  688. package/build-module/components/post-actions/export-pattern-action.native.js +0 -5
  689. package/build-module/components/post-actions/export-pattern-action.native.js.map +0 -1
  690. package/build-module/components/template-areas/index.js +0 -78
  691. package/build-module/components/template-areas/index.js.map +0 -1
  692. package/src/components/post-actions/export-pattern-action.native.js +0 -4
  693. package/src/components/template-areas/index.js +0 -94
  694. package/src/components/template-areas/style.scss +0 -22
  695. /package/src/store/{constants.js → constants.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_components","_data","_compose","_icons","_coreData","_postPublishButton","_interopRequireDefault","_prepublish","_postpublish","_store","_jsxRuntime","PostPublishPanel","Component","constructor","arguments","onSubmit","bind","componentDidUpdate","prevProps","isPublished","props","isSaving","isDirty","onClose","hasPublishAction","isPostTypeViewable","render","forceIsDirty","isBeingScheduled","isPublishSidebarEnabled","isScheduled","isSavingNonPostEntityChanges","onTogglePublishSidebar","PostPublishExtension","PrePublishExtension","additionalProps","propsForPanel","isPublishedOrScheduled","isPrePublish","isPostPublish","jsxs","className","children","jsx","Button","onClick","icon","closeSmall","label","__","Fragment","default","focusOnMount","__experimentalIsFocusable","disabled","variant","size","Spinner","CheckboxControl","__nextHasNoMarginBottom","checked","onChange","exports","_default","compose","withSelect","select","_getCurrentPost$_link","getPostType","coreStore","getCurrentPost","getEditedPostAttribute","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostBeingScheduled","isEditedPostDirty","isAutosavingPost","isSavingPost","editorStore","postType","_links","viewable","withDispatch","dispatch","disablePublishSidebar","enablePublishSidebar","withFocusReturn","withConstrainedTabbing"],"sources":["@wordpress/editor/src/components/post-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport {\n\tButton,\n\tSpinner,\n\tCheckboxControl,\n\twithFocusReturn,\n\twithConstrainedTabbing,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { closeSmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from '../post-publish-button';\nimport PostPublishPanelPrepublish from './prepublish';\nimport PostPublishPanelPostpublish from './postpublish';\nimport { store as editorStore } from '../../store';\n\nexport class PostPublishPanel extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSubmit = this.onSubmit.bind( this );\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Automatically collapse the publish sidebar when a post\n\t\t// is published and the user makes an edit.\n\t\tif (\n\t\t\tprevProps.isPublished &&\n\t\t\t! this.props.isSaving &&\n\t\t\tthis.props.isDirty\n\t\t) {\n\t\t\tthis.props.onClose();\n\t\t}\n\t}\n\n\tonSubmit() {\n\t\tconst { onClose, hasPublishAction, isPostTypeViewable } = this.props;\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\tisBeingScheduled,\n\t\t\tisPublished,\n\t\t\tisPublishSidebarEnabled,\n\t\t\tisScheduled,\n\t\t\tisSaving,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tonClose,\n\t\t\tonTogglePublishSidebar,\n\t\t\tPostPublishExtension,\n\t\t\tPrePublishExtension,\n\t\t\t...additionalProps\n\t\t} = this.props;\n\t\tconst {\n\t\t\thasPublishAction,\n\t\t\tisDirty,\n\t\t\tisPostTypeViewable,\n\t\t\t...propsForPanel\n\t\t} = additionalProps;\n\t\tconst isPublishedOrScheduled =\n\t\t\tisPublished || ( isScheduled && isBeingScheduled );\n\t\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\t\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\t\treturn (\n\t\t\t<div className=\"editor-post-publish-panel\" { ...propsForPanel }>\n\t\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\t\t\tonSubmit={ this.onSubmit }\n\t\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\n/**\n * Renders a panel for publishing a post.\n */\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\n\t\t\tgetEditedPostAttribute,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisEditedPostDirty,\n\t\t\tisAutosavingPost,\n\t\t\tisSavingPost,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst { isPublishSidebarEnabled } = select( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPostTypeViewable: postType?.viewable,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled: isPublishSidebarEnabled(),\n\t\t\tisSaving: isSavingPost() && ! isAutosavingPost(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { isPublishSidebarEnabled } ) => {\n\t\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonTogglePublishSidebar: () => {\n\t\t\t\tif ( isPublishSidebarEnabled ) {\n\t\t\t\t\tdisablePublishSidebar();\n\t\t\t\t} else {\n\t\t\t\t\tenablePublishSidebar();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t} ),\n\twithFocusReturn,\n\twithConstrainedTabbing,\n] )( PostPublishPanel );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAKA,IAAAO,kBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,WAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,YAAA,GAAAF,sBAAA,CAAAR,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAmD,IAAAY,WAAA,GAAAZ,OAAA;AAvBnD;AACA;AACA;;AAeA;AACA;AACA;;AAMO,MAAMa,gBAAgB,SAASC,kBAAS,CAAC;EAC/CC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GA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,GAAI,KAAK;IAC1D1C,kBAAkB,EAAEsD,QAAQ,EAAEE,QAAQ;IACtCrD,gBAAgB,EAAE8C,0BAA0B,CAAC,CAAC;IAC9CpD,OAAO,EAAEqD,iBAAiB,CAAC,CAAC;IAC5BxD,WAAW,EAAEqD,sBAAsB,CAAC,CAAC;IACrC3C,uBAAuB,EAAEA,uBAAuB,CAAC,CAAC;IAClDR,QAAQ,EAAEwD,YAAY,CAAC,CAAC,IAAI,CAAED,gBAAgB,CAAC,CAAC;IAChD7C,4BAA4B,EAAEA,4BAA4B,CAAC,CAAC;IAC5DD,WAAW,EAAE2C,sBAAsB,CAAC;EACrC,CAAC;AACF,CAAE,CAAC,EACH,IAAAS,kBAAY,EAAE,CAAEC,QAAQ,EAAE;EAAEtD;AAAwB,CAAC,KAAM;EAC1D,MAAM;IAAEuD,qBAAqB;IAAEC;EAAqB,CAAC,GACpDF,QAAQ,CAAEL,YAAY,CAAC;EACxB,OAAO;IACN9C,sBAAsB,EAAEA,CAAA,KAAM;MAC7B,IAAKH,uBAAuB,EAAG;QAC9BuD,qBAAqB,CAAC,CAAC;MACxB,CAAC,MAAM;QACNC,oBAAoB,CAAC,CAAC;MACvB;IACD;EACD,CAAC;AACF,CAAE,CAAC,EACHC,2BAAe,EACfC,kCAAsB,CACrB,CAAC,CAAE5E,gBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_components","_data","_compose","_icons","_coreData","_postPublishButton","_interopRequireDefault","_prepublish","_postpublish","_store","_jsxRuntime","PostPublishPanel","Component","constructor","arguments","onSubmit","bind","componentDidUpdate","prevProps","isPublished","props","isSaving","isDirty","onClose","hasPublishAction","isPostTypeViewable","render","forceIsDirty","isBeingScheduled","isPublishSidebarEnabled","isScheduled","isSavingNonPostEntityChanges","onTogglePublishSidebar","PostPublishExtension","PrePublishExtension","additionalProps","propsForPanel","isPublishedOrScheduled","isPrePublish","isPostPublish","jsxs","className","children","jsx","Button","onClick","icon","closeSmall","label","__","Fragment","default","focusOnMount","accessibleWhenDisabled","disabled","variant","size","Spinner","CheckboxControl","__nextHasNoMarginBottom","checked","onChange","exports","_default","compose","withSelect","select","_getCurrentPost$_link","getPostType","coreStore","getCurrentPost","getEditedPostAttribute","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostBeingScheduled","isEditedPostDirty","isAutosavingPost","isSavingPost","editorStore","postType","_links","viewable","withDispatch","dispatch","disablePublishSidebar","enablePublishSidebar","withFocusReturn","withConstrainedTabbing"],"sources":["@wordpress/editor/src/components/post-publish-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport {\n\tButton,\n\tSpinner,\n\tCheckboxControl,\n\twithFocusReturn,\n\twithConstrainedTabbing,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { closeSmall } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostPublishButton from '../post-publish-button';\nimport PostPublishPanelPrepublish from './prepublish';\nimport PostPublishPanelPostpublish from './postpublish';\nimport { store as editorStore } from '../../store';\n\nexport class PostPublishPanel extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.onSubmit = this.onSubmit.bind( this );\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Automatically collapse the publish sidebar when a post\n\t\t// is published and the user makes an edit.\n\t\tif (\n\t\t\tprevProps.isPublished &&\n\t\t\t! this.props.isSaving &&\n\t\t\tthis.props.isDirty\n\t\t) {\n\t\t\tthis.props.onClose();\n\t\t}\n\t}\n\n\tonSubmit() {\n\t\tconst { onClose, hasPublishAction, isPostTypeViewable } = this.props;\n\t\tif ( ! hasPublishAction || ! isPostTypeViewable ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tforceIsDirty,\n\t\t\tisBeingScheduled,\n\t\t\tisPublished,\n\t\t\tisPublishSidebarEnabled,\n\t\t\tisScheduled,\n\t\t\tisSaving,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t\tonClose,\n\t\t\tonTogglePublishSidebar,\n\t\t\tPostPublishExtension,\n\t\t\tPrePublishExtension,\n\t\t\t...additionalProps\n\t\t} = this.props;\n\t\tconst {\n\t\t\thasPublishAction,\n\t\t\tisDirty,\n\t\t\tisPostTypeViewable,\n\t\t\t...propsForPanel\n\t\t} = additionalProps;\n\t\tconst isPublishedOrScheduled =\n\t\t\tisPublished || ( isScheduled && isBeingScheduled );\n\t\tconst isPrePublish = ! isPublishedOrScheduled && ! isSaving;\n\t\tconst isPostPublish = isPublishedOrScheduled && ! isSaving;\n\t\treturn (\n\t\t\t<div className=\"editor-post-publish-panel\" { ...propsForPanel }>\n\t\t\t\t<div className=\"editor-post-publish-panel__header\">\n\t\t\t\t\t{ isPostPublish ? (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-publish-button\">\n\t\t\t\t\t\t\t\t<PostPublishButton\n\t\t\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\t\t\tonSubmit={ this.onSubmit }\n\t\t\t\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"editor-post-publish-panel__header-cancel-button\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ isSavingNonPostEntityChanges }\n\t\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__content\">\n\t\t\t\t\t{ isPrePublish && (\n\t\t\t\t\t\t<PostPublishPanelPrepublish>\n\t\t\t\t\t\t\t{ PrePublishExtension && <PrePublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPrepublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isPostPublish && (\n\t\t\t\t\t\t<PostPublishPanelPostpublish focusOnMount>\n\t\t\t\t\t\t\t{ PostPublishExtension && <PostPublishExtension /> }\n\t\t\t\t\t\t</PostPublishPanelPostpublish>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isSaving && <Spinner /> }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-post-publish-panel__footer\">\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Always show pre-publish checks.' ) }\n\t\t\t\t\t\tchecked={ isPublishSidebarEnabled }\n\t\t\t\t\t\tonChange={ onTogglePublishSidebar }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}\n}\n\n/**\n * Renders a panel for publishing a post.\n */\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst {\n\t\t\tgetCurrentPost,\n\t\t\tgetEditedPostAttribute,\n\t\t\tisCurrentPostPublished,\n\t\t\tisCurrentPostScheduled,\n\t\t\tisEditedPostBeingScheduled,\n\t\t\tisEditedPostDirty,\n\t\t\tisAutosavingPost,\n\t\t\tisSavingPost,\n\t\t\tisSavingNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst { isPublishSidebarEnabled } = select( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPostTypeViewable: postType?.viewable,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\tisPublishSidebarEnabled: isPublishSidebarEnabled(),\n\t\t\tisSaving: isSavingPost() && ! isAutosavingPost(),\n\t\t\tisSavingNonPostEntityChanges: isSavingNonPostEntityChanges(),\n\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { isPublishSidebarEnabled } ) => {\n\t\tconst { disablePublishSidebar, enablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonTogglePublishSidebar: () => {\n\t\t\t\tif ( isPublishSidebarEnabled ) {\n\t\t\t\t\tdisablePublishSidebar();\n\t\t\t\t} else {\n\t\t\t\t\tenablePublishSidebar();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t} ),\n\twithFocusReturn,\n\twithConstrainedTabbing,\n] )( PostPublishPanel );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAKA,IAAAO,kBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,WAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,YAAA,GAAAF,sBAAA,CAAAR,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAmD,IAAAY,WAAA,GAAAZ,OAAA;AAvBn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O;IACN/C,gBAAgB,GAAA2C,qBAAA,GACfG,cAAc,CAAC,CAAC,CAACU,MAAM,GAAI,mBAAmB,CAAE,cAAAb,qBAAA,cAAAA,qBAAA,GAAI,KAAK;IAC1D1C,kBAAkB,EAAEsD,QAAQ,EAAEE,QAAQ;IACtCrD,gBAAgB,EAAE8C,0BAA0B,CAAC,CAAC;IAC9CpD,OAAO,EAAEqD,iBAAiB,CAAC,CAAC;IAC5BxD,WAAW,EAAEqD,sBAAsB,CAAC,CAAC;IACrC3C,uBAAuB,EAAEA,uBAAuB,CAAC,CAAC;IAClDR,QAAQ,EAAEwD,YAAY,CAAC,CAAC,IAAI,CAAED,gBAAgB,CAAC,CAAC;IAChD7C,4BAA4B,EAAEA,4BAA4B,CAAC,CAAC;IAC5DD,WAAW,EAAE2C,sBAAsB,CAAC;EACrC,CAAC;AACF,CAAE,CAAC,EACH,IAAAS,kBAAY,EAAE,CAAEC,QAAQ,EAAE;EAAEtD;AAAwB,CAAC,KAAM;EAC1D,MAAM;IAAEuD,qBAAqB;IAAEC;EAAqB,CAAC,GACpDF,QAAQ,CAAEL,YAAY,CAAC;EACxB,OAAO;IACN9C,sBAAsB,EAAEA,CAAA,KAAM;MAC7B,IAAKH,uBAAuB,EAAG;QAC9BuD,qBAAqB,CAAC,CAAC;MACxB,CAAC,MAAM;QACNC,oBAAoB,CAAC,CAAC;MACvB;IACD;EACD,CAAC;AACF,CAAE,CAAC,EACHC,2BAAe,EACfC,kCAAsB,CACrB,CAAC,CAAE5E,gBAAiB,CAAC","ignoreList":[]}
@@ -14,6 +14,7 @@ var _i18n = require("@wordpress/i18n");
14
14
  var _icons = require("@wordpress/icons");
15
15
  var _keycodes = require("@wordpress/keycodes");
16
16
  var _preferences = require("@wordpress/preferences");
17
+ var _postStatus = require("../../components/post-status");
17
18
  var _store = require("../../store");
18
19
  var _jsxRuntime = require("react/jsx-runtime");
19
20
  /**
@@ -105,7 +106,16 @@ var _jsxRuntime = require("react/jsx-runtime");
105
106
  if (!hasPublishAction && isPending) {
106
107
  return null;
107
108
  }
108
- if (isPublished || isScheduled || !['pending', 'draft', 'auto-draft'].includes(postStatus) || postStatusHasChanged && ['pending', 'draft'].includes(postStatus)) {
109
+
110
+ // We shouldn't render the button if the post has not one of the following statuses: pending, draft, auto-draft.
111
+ // The reason for this is that this button handles the `save as pending` and `save draft` actions.
112
+ // An exception for this is when the post has a custom status and there should be a way to save changes without
113
+ // having to publish. This should be handled better in the future when custom statuses have better support.
114
+ // @see https://github.com/WordPress/gutenberg/issues/3144.
115
+ const isIneligibleStatus = !['pending', 'draft', 'auto-draft'].includes(postStatus) && _postStatus.STATUS_OPTIONS.map(({
116
+ value
117
+ }) => value).includes(postStatus);
118
+ if (isPublished || isScheduled || isIneligibleStatus || postStatusHasChanged && ['pending', 'draft'].includes(postStatus)) {
109
119
  return null;
110
120
  }
111
121
 
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_compose","_data","_element","_i18n","_icons","_keycodes","_preferences","_store","_jsxRuntime","PostSavedState","forceIsDirty","forceSavedMessage","setForceSavedMessage","useState","isLargeViewport","useViewportMatch","isAutosaving","isDirty","isNew","isPublished","isSaveable","isSaving","isScheduled","hasPublishAction","showIconLabels","postStatus","postStatusHasChanged","useSelect","select","_getCurrentPost$_link","isEditedPostNew","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostDirty","isSavingPost","isEditedPostSaveable","getCurrentPost","isAutosavingPost","getEditedPostAttribute","getPostEdits","editorStore","get","preferencesStore","_links","status","isPending","savePost","useDispatch","wasSaving","usePrevious","useEffect","timeoutId","setTimeout","clearTimeout","includes","label","__","shortLabel","isSaved","isSavedState","isDisabled","text","jsxs","Button","className","clsx","getAnimateClassName","type","undefined","onClick","shortcut","displayShortcut","primary","variant","size","icon","cloudUpload","children","jsx","Icon","check","cloud"],"sources":["@wordpress/editor/src/components/post-saved-state/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__unstableGetAnimateClassName as getAnimateClassName,\n\tButton,\n} from '@wordpress/components';\nimport { usePrevious, useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, check, cloud, cloudUpload } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component showing whether the post is saved or not and providing save\n * buttons.\n *\n * @param {Object} props Component props.\n * @param {?boolean} props.forceIsDirty Whether to force the post to be marked\n * as dirty.\n * @return {import('react').ComponentType} The component.\n */\nexport default function PostSavedState( { forceIsDirty } ) {\n\tconst [ forceSavedMessage, setForceSavedMessage ] = useState( false );\n\tconst isLargeViewport = useViewportMatch( 'small' );\n\n\tconst {\n\t\tisAutosaving,\n\t\tisDirty,\n\t\tisNew,\n\t\tisPublished,\n\t\tisSaveable,\n\t\tisSaving,\n\t\tisScheduled,\n\t\thasPublishAction,\n\t\tshowIconLabels,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisEditedPostNew,\n\t\t\t\tisCurrentPostPublished,\n\t\t\t\tisCurrentPostScheduled,\n\t\t\t\tisEditedPostDirty,\n\t\t\t\tisSavingPost,\n\t\t\t\tisEditedPostSaveable,\n\t\t\t\tgetCurrentPost,\n\t\t\t\tisAutosavingPost,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetPostEdits,\n\t\t\t} = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\treturn {\n\t\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\t\tisDirty: forceIsDirty || isEditedPostDirty(),\n\t\t\t\tisNew: isEditedPostNew(),\n\t\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\t\tisSaving: isSavingPost(),\n\t\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\t\thasPublishAction:\n\t\t\t\t\tgetCurrentPost()?._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\t};\n\t\t},\n\t\t[ forceIsDirty ]\n\t);\n\tconst isPending = postStatus === 'pending';\n\tconst { savePost } = useDispatch( editorStore );\n\n\tconst wasSaving = usePrevious( isSaving );\n\n\tuseEffect( () => {\n\t\tlet timeoutId;\n\n\t\tif ( wasSaving && ! isSaving ) {\n\t\t\tsetForceSavedMessage( true );\n\t\t\ttimeoutId = setTimeout( () => {\n\t\t\t\tsetForceSavedMessage( false );\n\t\t\t}, 1000 );\n\t\t}\n\n\t\treturn () => clearTimeout( timeoutId );\n\t}, [ isSaving ] );\n\n\t// Once the post has been submitted for review this button\n\t// is not needed for the contributor role.\n\tif ( ! hasPublishAction && isPending ) {\n\t\treturn null;\n\t}\n\n\tif (\n\t\tisPublished ||\n\t\tisScheduled ||\n\t\t! [ 'pending', 'draft', 'auto-draft' ].includes( postStatus ) ||\n\t\t( postStatusHasChanged &&\n\t\t\t[ 'pending', 'draft' ].includes( postStatus ) )\n\t) {\n\t\treturn null;\n\t}\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst label = isPending ? __( 'Save as pending' ) : __( 'Save draft' );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst shortLabel = __( 'Save' );\n\n\tconst isSaved = forceSavedMessage || ( ! isNew && ! isDirty );\n\tconst isSavedState = isSaving || isSaved;\n\tconst isDisabled = isSaving || isSaved || ! isSaveable;\n\tlet text;\n\n\tif ( isSaving ) {\n\t\ttext = isAutosaving ? __( 'Autosaving' ) : __( 'Saving' );\n\t} else if ( isSaved ) {\n\t\ttext = __( 'Saved' );\n\t} else if ( isLargeViewport ) {\n\t\ttext = label;\n\t} else if ( showIconLabels ) {\n\t\ttext = shortLabel;\n\t}\n\n\t// Use common Button instance for all saved states so that focus is not\n\t// lost.\n\treturn (\n\t\t<Button\n\t\t\tclassName={\n\t\t\t\tisSaveable || isSaving\n\t\t\t\t\t? clsx( {\n\t\t\t\t\t\t\t'editor-post-save-draft': ! isSavedState,\n\t\t\t\t\t\t\t'editor-post-saved-state': isSavedState,\n\t\t\t\t\t\t\t'is-saving': isSaving,\n\t\t\t\t\t\t\t'is-autosaving': isAutosaving,\n\t\t\t\t\t\t\t'is-saved': isSaved,\n\t\t\t\t\t\t\t[ getAnimateClassName( {\n\t\t\t\t\t\t\t\ttype: 'loading',\n\t\t\t\t\t\t\t} ) ]: isSaving,\n\t\t\t\t\t } )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tonClick={ isDisabled ? undefined : () => savePost() }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ isDisabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\tvariant=\"tertiary\"\n\t\t\tsize=\"compact\"\n\t\t\ticon={ isLargeViewport ? undefined : cloudUpload }\n\t\t\tlabel={ text || label }\n\t\t\taria-disabled={ isDisabled }\n\t\t>\n\t\t\t{ isSavedState && <Icon icon={ isSaved ? check : cloud } /> }\n\t\t\t{ text }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SA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Ae,CAACC,OAAO,CAAE,GAAI,CAAG;IACpEC,OAAO,EAAC,UAAU;IAClBC,IAAI,EAAC,SAAS;IACdC,IAAI,EAAG7D,eAAe,GAAGsD,SAAS,GAAGQ,kBAAa;IAClDrB,KAAK,EAAGM,IAAI,IAAIN,KAAO;IACvB,iBAAgBK,UAAY;IAAAiB,QAAA,GAE1BlB,YAAY,iBAAI,IAAAnD,WAAA,CAAAsE,GAAA,EAAC1E,MAAA,CAAA2E,IAAI;MAACJ,IAAI,EAAGjB,OAAO,GAAGsB,YAAK,GAAGC;IAAO,CAAE,CAAC,EACzDpB,IAAI;EAAA,CACC,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_compose","_data","_element","_i18n","_icons","_keycodes","_preferences","_postStatus","_store","_jsxRuntime","PostSavedState","forceIsDirty","forceSavedMessage","setForceSavedMessage","useState","isLargeViewport","useViewportMatch","isAutosaving","isDirty","isNew","isPublished","isSaveable","isSaving","isScheduled","hasPublishAction","showIconLabels","postStatus","postStatusHasChanged","useSelect","select","_getCurrentPost$_link","isEditedPostNew","isCurrentPostPublished","isCurrentPostScheduled","isEditedPostDirty","isSavingPost","isEditedPostSaveable","getCurrentPost","isAutosavingPost","getEditedPostAttribute","getPostEdits","editorStore","get","preferencesStore","_links","status","isPending","savePost","useDispatch","wasSaving","usePrevious","useEffect","timeoutId","setTimeout","clearTimeout","isIneligibleStatus","includes","STATUS_OPTIONS","map","value","label","__","shortLabel","isSaved","isSavedState","isDisabled","text","jsxs","Button","className","clsx","getAnimateClassName","type","undefined","onClick","shortcut","displayShortcut","primary","variant","size","icon","cloudUpload","children","jsx","Icon","check","cloud"],"sources":["@wordpress/editor/src/components/post-saved-state/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__unstableGetAnimateClassName as getAnimateClassName,\n\tButton,\n} from '@wordpress/components';\nimport { usePrevious, useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, check, cloud, cloudUpload } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { STATUS_OPTIONS } from '../../components/post-status';\nimport { store as editorStore } from '../../store';\n\n/**\n * Component showing whether the post is saved or not and providing save\n * buttons.\n *\n * @param {Object} props Component props.\n * @param {?boolean} props.forceIsDirty Whether to force the post to be marked\n * as dirty.\n * @return {import('react').ComponentType} The component.\n */\nexport default function PostSavedState( { forceIsDirty } ) {\n\tconst [ forceSavedMessage, setForceSavedMessage ] = useState( false );\n\tconst isLargeViewport = useViewportMatch( 'small' );\n\n\tconst {\n\t\tisAutosaving,\n\t\tisDirty,\n\t\tisNew,\n\t\tisPublished,\n\t\tisSaveable,\n\t\tisSaving,\n\t\tisScheduled,\n\t\thasPublishAction,\n\t\tshowIconLabels,\n\t\tpostStatus,\n\t\tpostStatusHasChanged,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisEditedPostNew,\n\t\t\t\tisCurrentPostPublished,\n\t\t\t\tisCurrentPostScheduled,\n\t\t\t\tisEditedPostDirty,\n\t\t\t\tisSavingPost,\n\t\t\t\tisEditedPostSaveable,\n\t\t\t\tgetCurrentPost,\n\t\t\t\tisAutosavingPost,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetPostEdits,\n\t\t\t} = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\treturn {\n\t\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\t\tisDirty: forceIsDirty || isEditedPostDirty(),\n\t\t\t\tisNew: isEditedPostNew(),\n\t\t\t\tisPublished: isCurrentPostPublished(),\n\t\t\t\tisSaving: isSavingPost(),\n\t\t\t\tisSaveable: isEditedPostSaveable(),\n\t\t\t\tisScheduled: isCurrentPostScheduled(),\n\t\t\t\thasPublishAction:\n\t\t\t\t\tgetCurrentPost()?._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tpostStatus: getEditedPostAttribute( 'status' ),\n\t\t\t\tpostStatusHasChanged: !! getPostEdits()?.status,\n\t\t\t};\n\t\t},\n\t\t[ forceIsDirty ]\n\t);\n\tconst isPending = postStatus === 'pending';\n\tconst { savePost } = useDispatch( editorStore );\n\n\tconst wasSaving = usePrevious( isSaving );\n\n\tuseEffect( () => {\n\t\tlet timeoutId;\n\n\t\tif ( wasSaving && ! isSaving ) {\n\t\t\tsetForceSavedMessage( true );\n\t\t\ttimeoutId = setTimeout( () => {\n\t\t\t\tsetForceSavedMessage( false );\n\t\t\t}, 1000 );\n\t\t}\n\n\t\treturn () => clearTimeout( timeoutId );\n\t}, [ isSaving ] );\n\n\t// Once the post has been submitted for review this button\n\t// is not needed for the contributor role.\n\tif ( ! hasPublishAction && isPending ) {\n\t\treturn null;\n\t}\n\n\t// We shouldn't render the button if the post has not one of the following statuses: pending, draft, auto-draft.\n\t// The reason for this is that this button handles the `save as pending` and `save draft` actions.\n\t// An exception for this is when the post has a custom status and there should be a way to save changes without\n\t// having to publish. This should be handled better in the future when custom statuses have better support.\n\t// @see https://github.com/WordPress/gutenberg/issues/3144.\n\tconst isIneligibleStatus =\n\t\t! [ 'pending', 'draft', 'auto-draft' ].includes( postStatus ) &&\n\t\tSTATUS_OPTIONS.map( ( { value } ) => value ).includes( postStatus );\n\n\tif (\n\t\tisPublished ||\n\t\tisScheduled ||\n\t\tisIneligibleStatus ||\n\t\t( postStatusHasChanged &&\n\t\t\t[ 'pending', 'draft' ].includes( postStatus ) )\n\t) {\n\t\treturn null;\n\t}\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst label = isPending ? __( 'Save as pending' ) : __( 'Save draft' );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst shortLabel = __( 'Save' );\n\n\tconst isSaved = forceSavedMessage || ( ! isNew && ! isDirty );\n\tconst isSavedState = isSaving || isSaved;\n\tconst isDisabled = isSaving || isSaved || ! isSaveable;\n\tlet text;\n\n\tif ( isSaving ) {\n\t\ttext = isAutosaving ? __( 'Autosaving' ) : __( 'Saving' );\n\t} else if ( isSaved ) {\n\t\ttext = __( 'Saved' );\n\t} else if ( isLargeViewport ) {\n\t\ttext = label;\n\t} else if ( showIconLabels ) {\n\t\ttext = shortLabel;\n\t}\n\n\t// Use common Button instance for all saved states so that focus is not\n\t// lost.\n\treturn (\n\t\t<Button\n\t\t\tclassName={\n\t\t\t\tisSaveable || isSaving\n\t\t\t\t\t? clsx( {\n\t\t\t\t\t\t\t'editor-post-save-draft': ! isSavedState,\n\t\t\t\t\t\t\t'editor-post-saved-state': isSavedState,\n\t\t\t\t\t\t\t'is-saving': isSaving,\n\t\t\t\t\t\t\t'is-autosaving': isAutosaving,\n\t\t\t\t\t\t\t'is-saved': isSaved,\n\t\t\t\t\t\t\t[ getAnimateClassName( {\n\t\t\t\t\t\t\t\ttype: 'loading',\n\t\t\t\t\t\t\t} ) ]: isSaving,\n\t\t\t\t\t } )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tonClick={ isDisabled ? undefined : () => savePost() }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ isDisabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\tvariant=\"tertiary\"\n\t\t\tsize=\"compact\"\n\t\t\ticon={ isLargeViewport ? undefined : cloudUpload }\n\t\t\tlabel={ text || label }\n\t\t\taria-disabled={ isDisabled }\n\t\t>\n\t\t\t{ isSavedState && <Icon icon={ isSaved ? check : cloud } /> }\n\t\t\t{ text }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAA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,IAAAgD,aAAI,EAAE;MACN,wBAAwB,EAAE,CAAEN,YAAY;MACxC,yBAAyB,EAAEA,YAAY;MACvC,WAAW,EAAE1C,QAAQ;MACrB,eAAe,EAAEL,YAAY;MAC7B,UAAU,EAAE8C,OAAO;MACnB,CAAE,IAAAQ,yCAAmB,EAAE;QACtBC,IAAI,EAAE;MACP,CAAE,CAAC,GAAIlD;IACP,CAAE,CAAC,GACHmD,SACH;IACDC,OAAO,EAAGT,UAAU,GAAGQ,SAAS,GAAG,MAAM1B,QAAQ,CAAC;IAClD;AACH;AACA;AACA,OAHG;IAIA4B,QAAQ,EAAGV,UAAU,GAAGQ,SAAS,GAAGG,yBAAe,CAACC,OAAO,CAAE,GAAI,CAAG;IACpEC,OAAO,EAAC,UAAU;IAClBC,IAAI,EAAC,SAAS;IACdC,IAAI,EAAGjE,eAAe,GAAG0D,SAAS,GAAGQ,kBAAa;IAClDrB,KAAK,EAAGM,IAAI,IAAIN,KAAO;IACvB,iBAAgBK,UAAY;IAAAiB,QAAA,GAE1BlB,YAAY,iBAAI,IAAAvD,WAAA,CAAA0E,GAAA,EAAC/E,MAAA,CAAAgF,IAAI;MAACJ,IAAI,EAAGjB,OAAO,GAAGsB,YAAK,GAAGC;IAAO,CAAE,CAAC,EACzDpB,IAAI;EAAA,CACC,CAAC;AAEX","ignoreList":[]}
@@ -7,6 +7,7 @@ exports.PrivatePostSchedule = PrivatePostSchedule;
7
7
  exports.default = PostSchedule;
8
8
  var _dateFns = require("date-fns");
9
9
  var _date = require("@wordpress/date");
10
+ var _i18n = require("@wordpress/i18n");
10
11
  var _data = require("@wordpress/data");
11
12
  var _blockEditor = require("@wordpress/block-editor");
12
13
  var _element = require("@wordpress/element");
@@ -91,6 +92,8 @@ function PrivatePostSchedule({
91
92
  currentDate: postDate,
92
93
  onChange: onUpdateDate,
93
94
  is12Hour: is12HourTime,
95
+ dateOrder: /* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */
96
+ (0, _i18n._x)('dmy', 'date order'),
94
97
  events: events,
95
98
  onMonthPreviewed: date => setPreviewedMonth((0, _dateFns.parseISO)(date)),
96
99
  onClose: onClose,
@@ -1 +1 @@
1
- {"version":3,"names":["_dateFns","require","_date","_data","_blockEditor","_element","_coreData","_store","_lockUnlock","_jsxRuntime","PrivatePublishDateTimePicker","unlock","blockEditorPrivateApis","PostSchedule","props","jsx","PrivatePostSchedule","showPopoverHeaderActions","isCompact","onClose","postDate","postType","useSelect","select","editorStore","getEditedPostAttribute","getCurrentPostType","editPost","useDispatch","onUpdateDate","date","previewedMonth","setPreviewedMonth","useState","startOfMonth","Date","eventsByPostType","coreStore","getEntityRecords","status","after","toISOString","before","endOfMonth","exclude","getCurrentPostId","per_page","_fields","events","useMemo","map","eventDate","settings","getSettings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join","currentDate","onChange","is12Hour","onMonthPreviewed","parseISO"],"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { parseISO, endOfMonth, startOfMonth } from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport { getSettings } from '@wordpress/date';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PrivatePublishDateTimePicker } = unlock( blockEditorPrivateApis );\n\n/**\n * Renders the PostSchedule component. It allows the user to schedule a post.\n *\n * @param {Object} props Props.\n * @param {Function} props.onClose Function to close the component.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function PostSchedule( props ) {\n\treturn (\n\t\t<PrivatePostSchedule\n\t\t\t{ ...props }\n\t\t\tshowPopoverHeaderActions\n\t\t\tisCompact={ false }\n\t\t/>\n\t);\n}\n\nexport function PrivatePostSchedule( {\n\tonClose,\n\tshowPopoverHeaderActions,\n\tisCompact,\n} ) {\n\tconst { postDate, postType } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostDate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onUpdateDate = ( date ) => editPost( { date } );\n\n\tconst [ previewedMonth, setPreviewedMonth ] = useState(\n\t\tstartOfMonth( new Date( postDate ) )\n\t);\n\n\t// Pick up published and schduled site posts.\n\tconst eventsByPostType = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords( 'postType', postType, {\n\t\t\t\tstatus: 'publish,future',\n\t\t\t\tafter: startOfMonth( previewedMonth ).toISOString(),\n\t\t\t\tbefore: endOfMonth( previewedMonth ).toISOString(),\n\t\t\t\texclude: [ select( editorStore ).getCurrentPostId() ],\n\t\t\t\tper_page: 100,\n\t\t\t\t_fields: 'id,date',\n\t\t\t} ),\n\t\t[ previewedMonth, postType ]\n\t);\n\n\tconst events = useMemo(\n\t\t() =>\n\t\t\t( eventsByPostType || [] ).map( ( { date: eventDate } ) => ( {\n\t\t\t\tdate: new Date( eventDate ),\n\t\t\t} ) ),\n\t\t[ eventsByPostType ]\n\t);\n\n\tconst settings = getSettings();\n\n\t// To know if the current timezone is a 12 hour time with look for \"a\" in the time format\n\t// We also make sure this a is not escaped by a \"/\"\n\tconst is12HourTime = /a(?!\\\\)/i.test(\n\t\tsettings.formats.time\n\t\t\t.toLowerCase() // Test only the lower case a.\n\t\t\t.replace( /\\\\\\\\/g, '' ) // Replace \"//\" with empty strings.\n\t\t\t.split( '' )\n\t\t\t.reverse()\n\t\t\t.join( '' ) // Reverse the string and test for \"a\" not followed by a slash.\n\t);\n\n\treturn (\n\t\t<PrivatePublishDateTimePicker\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onUpdateDate }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed={ ( date ) =>\n\t\t\t\tsetPreviewedMonth( parseISO( date ) )\n\t\t\t}\n\t\t\tonClose={ onClose }\n\t\t\tisCompact={ isCompact }\n\t\t\tshowPopoverHeaderActions={ showPopoverHeaderActions }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAlB3C;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAIA,MAAM;EAAES;AAA6B,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,YAAYA,CAAEC,KAAK,EAAG;EAC7C,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACC,mBAAmB;IAAA,GACdF,KAAK;IACVG,wBAAwB;IACxBC,SAAS,EAAG;EAAO,CACnB,CAAC;AAEJ;AAEO,SAASF,mBAAmBA,CAAE;EACpCG,OAAO;EACPF,wBAAwB;EACxBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEE,QAAQ;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EACrCC,MAAM,KAAQ;IACfH,QAAQ,EAAEG,MAAM,CAAEC,YAAY,CAAC,CAACC,sBAAsB,CAAE,MAAO,CAAC;IAChEJ,QAAQ,EAAEE,MAAM,CAAEC,YAAY,CAAC,CAACE,kBAAkB,CAAC;EACpD,CAAC,CAAE,EACH,EACD,CAAC;EAED,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iB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EAAG,CAAC,CAAC;EAAA,CACvBC,KAAK,CAAE,EAAG,CAAC,CACXC,OAAO,CAAC,CAAC,CACTC,IAAI,CAAE,EAAG,CAAC,CAAC;EACd,CAAC;EAED,oBACC,IAAArD,WAAA,CAAAM,GAAA,EAACL,4BAA4B;IAC5BqD,WAAW,EAAG3C,QAAU;IACxB4C,QAAQ,EAAGnC,YAAc;IACzBoC,QAAQ,EAAGX,YAAc;IACzBN,MAAM,EAAGA,MAAQ;IACjBkB,gBAAgB,EAAKpC,IAAI,IACxBE,iBAAiB,CAAE,IAAAmC,iBAAQ,EAAErC,IAAK,CAAE,CACpC;IACDX,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvBD,wBAAwB,EAAGA;EAA0B,CACrD,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_dateFns","require","_date","_i18n","_data","_blockEditor","_element","_coreData","_store","_lockUnlock","_jsxRuntime","PrivatePublishDateTimePicker","unlock","blockEditorPrivateApis","PostSchedule","props","jsx","PrivatePostSchedule","showPopoverHeaderActions","isCompact","onClose","postDate","postType","useSelect","select","editorStore","getEditedPostAttribute","getCurrentPostType","editPost","useDispatch","onUpdateDate","date","previewedMonth","setPreviewedMonth","useState","startOfMonth","Date","eventsByPostType","coreStore","getEntityRecords","status","after","toISOString","before","endOfMonth","exclude","getCurrentPostId","per_page","_fields","events","useMemo","map","eventDate","settings","getSettings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join","currentDate","onChange","is12Hour","dateOrder","_x","onMonthPreviewed","parseISO"],"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { parseISO, endOfMonth, startOfMonth } from 'date-fns';\n\n/**\n * WordPress dependencies\n */\nimport { getSettings } from '@wordpress/date';\nimport { _x } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PrivatePublishDateTimePicker } = unlock( blockEditorPrivateApis );\n\n/**\n * Renders the PostSchedule component. It allows the user to schedule a post.\n *\n * @param {Object} props Props.\n * @param {Function} props.onClose Function to close the component.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function PostSchedule( props ) {\n\treturn (\n\t\t<PrivatePostSchedule\n\t\t\t{ ...props }\n\t\t\tshowPopoverHeaderActions\n\t\t\tisCompact={ false }\n\t\t/>\n\t);\n}\n\nexport function PrivatePostSchedule( {\n\tonClose,\n\tshowPopoverHeaderActions,\n\tisCompact,\n} ) {\n\tconst { postDate, postType } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostDate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onUpdateDate = ( date ) => editPost( { date } );\n\n\tconst [ previewedMonth, setPreviewedMonth ] = useState(\n\t\tstartOfMonth( new Date( postDate ) )\n\t);\n\n\t// Pick up published and schduled site posts.\n\tconst eventsByPostType = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords( 'postType', postType, {\n\t\t\t\tstatus: 'publish,future',\n\t\t\t\tafter: startOfMonth( previewedMonth ).toISOString(),\n\t\t\t\tbefore: endOfMonth( previewedMonth ).toISOString(),\n\t\t\t\texclude: [ select( editorStore ).getCurrentPostId() ],\n\t\t\t\tper_page: 100,\n\t\t\t\t_fields: 'id,date',\n\t\t\t} ),\n\t\t[ previewedMonth, postType ]\n\t);\n\n\tconst events = useMemo(\n\t\t() =>\n\t\t\t( eventsByPostType || [] ).map( ( { date: eventDate } ) => ( {\n\t\t\t\tdate: new Date( eventDate ),\n\t\t\t} ) ),\n\t\t[ eventsByPostType ]\n\t);\n\n\tconst settings = getSettings();\n\n\t// To know if the current timezone is a 12 hour time with look for \"a\" in the time format\n\t// We also make sure this a is not escaped by a \"/\"\n\tconst is12HourTime = /a(?!\\\\)/i.test(\n\t\tsettings.formats.time\n\t\t\t.toLowerCase() // Test only the lower case a.\n\t\t\t.replace( /\\\\\\\\/g, '' ) // Replace \"//\" with empty strings.\n\t\t\t.split( '' )\n\t\t\t.reverse()\n\t\t\t.join( '' ) // Reverse the string and test for \"a\" not followed by a slash.\n\t);\n\n\treturn (\n\t\t<PrivatePublishDateTimePicker\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onUpdateDate }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tdateOrder={\n\t\t\t\t/* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */\n\t\t\t\t_x( 'dmy', 'date order' )\n\t\t\t}\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed={ ( date ) =>\n\t\t\t\tsetPreviewedMonth( parseISO( date ) )\n\t\t\t}\n\t\t\tonClose={ onClose }\n\t\t\tisCompact={ isCompact }\n\t\t\tshowPopoverHeaderActions={ showPopoverHeaderActions }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA2C,IAAAS,WAAA,GAAAT,OAAA;AAnB3C;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAIA,MAAM;EAAEU;AAA6B,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;;AAEzE;AACA;AACA;AACA;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;IACrDC,QAAQ,EAAE,GAAG;IACbC,OAAO,EAAE;EACV,CAAE,CAAC,EACJ,CAAEhB,cAAc,EAAEV,QAAQ,CAC3B,CAAC;EAED,MAAM2B,MAAM,GAAG,IAAAC,gBAAO,EACrB,MACC,CAAEb,gBAAgB,IAAI,EAAE,EAAGc,GAAG,CAAE,CAAE;IAAEpB,IAAI,EAAEqB;EAAU,CAAC,MAAQ;IAC5DrB,IAAI,EAAE,IAAIK,IAAI,CAAEgB,SAAU;EAC3B,CAAC,CAAG,CAAC,EACN,CAAEf,gBAAgB,CACnB,CAAC;EAED,MAAMgB,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;;EAE9B;EACA;EACA,MAAMC,YAAY,GAAG,UAAU,CAACC,IAAI,CACnCH,QAAQ,CAACI,OAAO,CAACC,IAAI,CACnBC,WAAW,CAAC,CAAC,CAAC;EAAA,CACdC,OAAO,CAAE,OAAO,EAAE,EAAG,CAAC,CAAC;EAAA,CACvBC,KAAK,CAAE,EAAG,CAAC,CACXC,OAAO,CAAC,CAAC,CACTC,IAAI,CAAE,EAAG,CAAC,CAAC;EACd,CAAC;EAED,oBACC,IAAArD,WAAA,CAAAM,GAAA,EAACL,4BAA4B;IAC5BqD,WAAW,EAAG3C,QAAU;IACxB4C,QAAQ,EAAGnC,YAAc;IACzBoC,QAAQ,EAAGX,YAAc;IACzBY,SAAS,EACR;IACA,IAAAC,QAAE,EAAE,KAAK,EAAE,YAAa,CACxB;IACDnB,MAAM,EAAGA,MAAQ;IACjBoB,gBAAgB,EAAKtC,IAAI,IACxBE,iBAAiB,CAAE,IAAAqC,iBAAQ,EAAEvC,IAAK,CAAE,CACpC;IACDX,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvBD,wBAAwB,EAAGA;EAA0B,CACrD,CAAC;AAEJ","ignoreList":[]}
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.STATUS_OPTIONS = void 0;
7
8
  exports.default = PostStatus;
8
9
  var _components = require("@wordpress/components");
9
10
  var _i18n = require("@wordpress/i18n");
@@ -34,7 +35,7 @@ const labels = {
34
35
  future: (0, _i18n.__)('Scheduled'),
35
36
  publish: (0, _i18n.__)('Published')
36
37
  };
37
- const STATUS_OPTIONS = [{
38
+ const STATUS_OPTIONS = exports.STATUS_OPTIONS = [{
38
39
  label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
39
40
  children: [(0, _i18n.__)('Draft'), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
40
41
  variant: "muted",
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_data","_element","_coreData","_blockEditor","_compose","_constants","_postPanelRow","_interopRequireDefault","_postSticky","_postSchedule","_store","_jsxRuntime","labels","__","draft","pending","private","future","publish","STATUS_OPTIONS","label","jsxs","Fragment","children","jsx","__experimentalText","variant","size","value","DESIGN_POST_TYPES","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","PostStatus","status","date","password","postId","postType","canEdit","useSelect","select","_getCurrentPost$_link","getEditedPostAttribute","getCurrentPostId","getCurrentPostType","getCurrentPost","editorStore","_links","showPassword","setShowPassword","useState","passwordInputId","useInstanceId","editEntityRecord","useDispatch","coreStore","popoverAnchor","setPopoverAnchor","popoverProps","useMemo","anchor","headerTitle","placement","offset","shift","includes","updatePost","newStatus","newPassword","newDate","handleTogglePassword","handleStatus","Date","default","ref","Dropdown","className","contentClassName","focusOnMount","renderToggle","onToggle","Button","onClick","sprintf","renderContent","onClose","__experimentalInspectorPopoverHeader","title","__experimentalVStack","spacing","RadioControl","hideLabelFromVision","options","onChange","selected","PrivatePostSchedule","showPopoverHeaderActions","isCompact","as","CheckboxControl","__nextHasNoMarginBottom","help","checked","TextControl","placeholder","type","id","__next40pxDefaultSize"],"sources":["@wordpress/editor/src/components/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tCheckboxControl,\n\tDropdown,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n\tTextControl,\n\tRadioControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../store/constants';\nimport PostPanelRow from '../post-panel-row';\nimport PostSticky from '../post-sticky';\nimport { PrivatePostSchedule } from '../post-schedule';\nimport { store as editorStore } from '../../store';\n\nconst labels = {\n\t'auto-draft': __( 'Draft' ),\n\tdraft: __( 'Draft' ),\n\tpending: __( 'Pending' ),\n\tprivate: __( 'Private' ),\n\tfuture: __( 'Scheduled' ),\n\tpublish: __( 'Published' ),\n};\n\nconst STATUS_OPTIONS = [\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Draft' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Not ready to publish.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'draft',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Pending' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Waiting for review before publishing.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'pending',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Private' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Only visible to site admins and editors.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'private',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Scheduled' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Publish automatically on a chosen date.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'future',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Published' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Visible to everyone.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'publish',\n\t},\n];\n\nconst DESIGN_POST_TYPES = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n];\n\nexport default function PostStatus() {\n\tconst { status, date, password, postId, postType, canEdit } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPost,\n\t\t\t} = select( editorStore );\n\t\t\treturn {\n\t\t\t\tstatus: getEditedPostAttribute( 'status' ),\n\t\t\t\tdate: getEditedPostAttribute( 'date' ),\n\t\t\t\tpassword: getEditedPostAttribute( 'password' ),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tcanEdit:\n\t\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ showPassword, setShowPassword ] = useState( !! password );\n\tconst passwordInputId = useInstanceId(\n\t\tPostStatus,\n\t\t'editor-change-status__password-input'\n\t);\n\tconst { editEntityRecord } = useDispatch( coreStore );\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\t'aria-label': __( 'Status & visibility' ),\n\t\t\theaderTitle: __( 'Status & visibility' ),\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\tif ( DESIGN_POST_TYPES.includes( postType ) ) {\n\t\treturn null;\n\t}\n\n\tconst updatePost = ( {\n\t\tstatus: newStatus = status,\n\t\tpassword: newPassword = password,\n\t\tdate: newDate = date,\n\t} ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tstatus: newStatus,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\tconst handleTogglePassword = ( value ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tupdatePost( { password: '' } );\n\t\t}\n\t};\n\n\tconst handleStatus = ( value ) => {\n\t\tlet newDate = date;\n\t\tlet newPassword = password;\n\t\tif ( status === 'future' && new Date( date ) > new Date() ) {\n\t\t\tnewDate = null;\n\t\t}\n\t\tif ( value === 'private' && password ) {\n\t\t\tnewPassword = '';\n\t\t}\n\t\tupdatePost( {\n\t\t\tstatus: value,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Status' ) } ref={ setPopoverAnchor }>\n\t\t\t{ canEdit ? (\n\t\t\t\t<Dropdown\n\t\t\t\t\tclassName=\"editor-post-status\"\n\t\t\t\t\tcontentClassName=\"editor-change-status__content\"\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Current post status.\n\t\t\t\t\t\t\t\t__( 'Change post status: %s' ),\n\t\t\t\t\t\t\t\tlabels[ status ]\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ labels[ status ] }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\t\ttitle={ __( 'Status & visibility' ) }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\t\t\tclassName=\"editor-change-status__options\"\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Status' ) }\n\t\t\t\t\t\t\t\t\t\toptions={ STATUS_OPTIONS }\n\t\t\t\t\t\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\t\t\t\t\tstatus === 'auto-draft'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'draft'\n\t\t\t\t\t\t\t\t\t\t\t\t: status\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\t{ status === 'future' && (\n\t\t\t\t\t\t\t\t\t\t<div className=\"editor-change-status__publish-date-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t<PrivatePostSchedule\n\t\t\t\t\t\t\t\t\t\t\t\tshowPopoverHeaderActions={\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tisCompact\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ status !== 'private' && (\n\t\t\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\t\t\tas=\"fieldset\"\n\t\t\t\t\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-change-status__password-fieldset\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Password protected'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Only visible to those who know the password'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tchecked={ showPassword }\n\t\t\t\t\t\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\t\t\t\t\t\thandleTogglePassword\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t{ showPassword && (\n\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"editor-change-status__password-input\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePost( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpassword: value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Use a secure password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid={ passwordInputId }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"editor-post-status is-read-only\">\n\t\t\t\t\t{ labels[ status ] }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</PostPanelRow>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AASA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,G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8F,IAAI,EAAC,MAAM;kBACXC,EAAE,EAAGvD,eAAiB;kBACtBwD,qBAAqB;kBACrBP,uBAAuB;gBAAA,CACvB;cAAC,CACE,CACL;YAAA,CACM,CACR,eACD,IAAA3F,WAAA,CAAAa,GAAA,EAAChB,WAAA,CAAAmE,OAAU,IAAE,CAAC;UAAA,CACP;QAAC,CACJ,CAAC;MAAA,CACN;IACA,CACH,CAAC,gBAEF,IAAAhE,WAAA,CAAAa,GAAA;MAAKsD,SAAS,EAAC,iCAAiC;MAAAvD,QAAA,EAC7CX,MAAM,CAAEuB,MAAM;IAAE,CACd;EACL,CACY,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_data","_element","_coreData","_blockEditor","_compose","_constants","_postPanelRow","_interopRequireDefault","_postSticky","_postSchedule","_store","_jsxRuntime","labels","__","draft","pending","private","future","publish","STATUS_OPTIONS","exports","label","jsxs","Fragment","children","jsx","__experimentalText","variant","size","value","DESIGN_POST_TYPES","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","NAVIGATION_POST_TYPE","PostStatus","status","date","password","postId","postType","canEdit","useSelect","select","_getCurrentPost$_link","getEditedPostAttribute","getCurrentPostId","getCurrentPostType","getCurrentPost","editorStore","_links","showPassword","setShowPassword","useState","passwordInputId","useInstanceId","editEntityRecord","useDispatch","coreStore","popoverAnchor","setPopoverAnchor","popoverProps","useMemo","anchor","headerTitle","placement","offset","shift","includes","updatePost","newStatus","newPassword","newDate","handleTogglePassword","handleStatus","Date","default","ref","Dropdown","className","contentClassName","focusOnMount","renderToggle","onToggle","Button","onClick","sprintf","renderContent","onClose","__experimentalInspectorPopoverHeader","title","__experimentalVStack","spacing","RadioControl","hideLabelFromVision","options","onChange","selected","PrivatePostSchedule","showPopoverHeaderActions","isCompact","as","CheckboxControl","__nextHasNoMarginBottom","help","checked","TextControl","placeholder","type","id","__next40pxDefaultSize"],"sources":["@wordpress/editor/src/components/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tCheckboxControl,\n\tDropdown,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n\tTextControl,\n\tRadioControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../store/constants';\nimport PostPanelRow from '../post-panel-row';\nimport PostSticky from '../post-sticky';\nimport { PrivatePostSchedule } from '../post-schedule';\nimport { store as editorStore } from '../../store';\n\nconst labels = {\n\t'auto-draft': __( 'Draft' ),\n\tdraft: __( 'Draft' ),\n\tpending: __( 'Pending' ),\n\tprivate: __( 'Private' ),\n\tfuture: __( 'Scheduled' ),\n\tpublish: __( 'Published' ),\n};\n\nexport const STATUS_OPTIONS = [\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Draft' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Not ready to publish.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'draft',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Pending' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Waiting for review before publishing.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'pending',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Private' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Only visible to site admins and editors.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'private',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Scheduled' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Publish automatically on a chosen date.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'future',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Published' ) }\n\t\t\t\t<Text variant=\"muted\" size={ 12 }>\n\t\t\t\t\t{ __( 'Visible to everyone.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'publish',\n\t},\n];\n\nconst DESIGN_POST_TYPES = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n];\n\nexport default function PostStatus() {\n\tconst { status, date, password, postId, postType, canEdit } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPost,\n\t\t\t} = select( editorStore );\n\t\t\treturn {\n\t\t\t\tstatus: getEditedPostAttribute( 'status' ),\n\t\t\t\tdate: getEditedPostAttribute( 'date' ),\n\t\t\t\tpassword: getEditedPostAttribute( 'password' ),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tcanEdit:\n\t\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ showPassword, setShowPassword ] = useState( !! password );\n\tconst passwordInputId = useInstanceId(\n\t\tPostStatus,\n\t\t'editor-change-status__password-input'\n\t);\n\tconst { editEntityRecord } = useDispatch( coreStore );\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\t'aria-label': __( 'Status & visibility' ),\n\t\t\theaderTitle: __( 'Status & visibility' ),\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\tif ( DESIGN_POST_TYPES.includes( postType ) ) {\n\t\treturn null;\n\t}\n\n\tconst updatePost = ( {\n\t\tstatus: newStatus = status,\n\t\tpassword: newPassword = password,\n\t\tdate: newDate = date,\n\t} ) => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tstatus: newStatus,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\tconst handleTogglePassword = ( value ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tupdatePost( { password: '' } );\n\t\t}\n\t};\n\n\tconst handleStatus = ( value ) => {\n\t\tlet newDate = date;\n\t\tlet newPassword = password;\n\t\tif ( status === 'future' && new Date( date ) > new Date() ) {\n\t\t\tnewDate = null;\n\t\t}\n\t\tif ( value === 'private' && password ) {\n\t\t\tnewPassword = '';\n\t\t}\n\t\tupdatePost( {\n\t\t\tstatus: value,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Status' ) } ref={ setPopoverAnchor }>\n\t\t\t{ canEdit ? (\n\t\t\t\t<Dropdown\n\t\t\t\t\tclassName=\"editor-post-status\"\n\t\t\t\t\tcontentClassName=\"editor-change-status__content\"\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Current post status.\n\t\t\t\t\t\t\t\t__( 'Change post status: %s' ),\n\t\t\t\t\t\t\t\tlabels[ status ]\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ labels[ status ] }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\t\ttitle={ __( 'Status & visibility' ) }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\t\t\tclassName=\"editor-change-status__options\"\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Status' ) }\n\t\t\t\t\t\t\t\t\t\toptions={ STATUS_OPTIONS }\n\t\t\t\t\t\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\t\t\t\t\tstatus === 'auto-draft'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'draft'\n\t\t\t\t\t\t\t\t\t\t\t\t: status\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\t{ status === 'future' && (\n\t\t\t\t\t\t\t\t\t\t<div className=\"editor-change-status__publish-date-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t<PrivatePostSchedule\n\t\t\t\t\t\t\t\t\t\t\t\tshowPopoverHeaderActions={\n\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tisCompact\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ status !== 'private' && (\n\t\t\t\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\t\t\t\tas=\"fieldset\"\n\t\t\t\t\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-change-status__password-fieldset\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Password protected'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Only visible to those who know the password'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tchecked={ showPassword }\n\t\t\t\t\t\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\t\t\t\t\t\thandleTogglePassword\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t{ showPassword && (\n\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"editor-change-status__password-input\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdatePost( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpassword: value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Use a secure password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid={ passwordInputId }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<div className=\"editor-post-status is-read-only\">\n\t\t\t\t\t{ labels[ status ] }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</PostPanelRow>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AASA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN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I,EAAC,MAAM;kBACXC,EAAE,EAAGvD,eAAiB;kBACtBwD,qBAAqB;kBACrBP,uBAAuB;gBAAA,CACvB;cAAC,CACE,CACL;YAAA,CACM,CACR,eACD,IAAA5F,WAAA,CAAAc,GAAA,EAACjB,WAAA,CAAAoE,OAAU,IAAE,CAAC;UAAA,CACP;QAAC,CACJ,CAAC;MAAA,CACN;IACA,CACH,CAAC,gBAEF,IAAAjE,WAAA,CAAAc,GAAA;MAAKsD,SAAS,EAAC,iCAAiC;MAAAvD,QAAA,EAC7CZ,MAAM,CAAEwB,MAAM;IAAE,CACd;EACL,CACY,CAAC;AAEjB","ignoreList":[]}
@@ -88,22 +88,14 @@ function PostTitle(_, forwardedRef) {
88
88
  const clipboardData = event.clipboardData;
89
89
  let plainText = '';
90
90
  let html = '';
91
-
92
- // IE11 only supports `Text` as an argument for `getData` and will
93
- // otherwise throw an invalid argument error, so we try the standard
94
- // arguments first, then fallback to `Text` if they fail.
95
91
  try {
96
92
  plainText = clipboardData.getData('text/plain');
97
93
  html = clipboardData.getData('text/html');
98
- } catch (error1) {
99
- try {
100
- html = clipboardData.getData('Text');
101
- } catch (error2) {
102
- // Some browsers like UC Browser paste plain text by default and
103
- // don't support clipboardData at all, so allow default
104
- // behaviour.
105
- return;
106
- }
94
+ } catch (error) {
95
+ // Some browsers like UC Browser paste plain text by default and
96
+ // don't support clipboardData at all, so allow default
97
+ // behaviour.
98
+ return;
107
99
  }
108
100
 
109
101
  // Allows us to ask for this information when we get a report.
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_htmlEntities","_data","_blockEditor","_keycodes","_blocks","_richText","_compose","_dom","_constants","_usePostTitleFocus","_usePostTitle","_postTypeSupportCheck","_jsxRuntime","PostTitle","_","forwardedRef","placeholder","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","onChange","value","replace","REGEXP_NEWLINES","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error1","error2","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","create","newValue","insert","toHTMLString","start","end","decodedPlaceholder","decodeEntities","__","richTextRef","useRichText","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","clsx","DEFAULT_CLASSNAMES","jsx","default","supportKeys","children","useMergeRefs","contentEditable","role","onFocus","onBlur","onKeyPress","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"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\ttoHTMLString,\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\nfunction PostTitle( _, 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\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\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\t// IE11 only supports `Text` as an argument for `getData` and will\n\t\t// otherwise throw an invalid argument error, so we try the standard\n\t\t// arguments first, then fallback to `Text` if they fail.\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error1 ) {\n\t\t\ttry {\n\t\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t\t} catch ( error2 ) {\n\t\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t\t// behaviour.\n\t\t\t\treturn;\n\t\t\t}\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\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\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\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\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\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<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\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 {Component} The rendered PostTitle component.\n */\nexport default forwardRef( PostTitle );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAC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AO,EAAGA;MAAS,CACnB;IAAC,CACmB;IACtB;EAAA;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAmD,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAQe,IAAAW,mBAAU,EAAE7F,SAAU,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_htmlEntities","_data","_blockEditor","_keycodes","_blocks","_richText","_compose","_dom","_constants","_usePostTitleFocus","_usePostTitle","_postTypeSupportCheck","_jsxRuntime","PostTitle","_","forwardedRef","placeholder","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","onChange","value","replace","REGEXP_NEWLINES","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","create","newValue","insert","toHTMLString","start","end","decodedPlaceholder","decodeEntities","__","richTextRef","useRichText","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","clsx","DEFAULT_CLASSNAMES","jsx","default","supportKeys","children","useMergeRefs","contentEditable","role","onFocus","onBlur","onKeyPress","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"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\ttoHTMLString,\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\nfunction PostTitle( _, 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\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\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\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\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\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\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\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<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\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 {Component} The rendered PostTitle component.\n */\nexport default forwardRef( PostTitle );\n"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CqB,IAAI,EAAC,SAAS;QACd,kBAAe,MAAM;QACrBC,OAAO,EAAGxD,QAAU;QACpByD,MAAM,EAAGxD,UAAY;QACrBG,SAAS,EAAGA,SAAW;QACvBsD,UAAU,EAAGzD,UAAY;QACzBQ,OAAO,EAAGA;MAAS,CACnB;IAAC,CACmB;IACtB;EAAA;AAEF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAkD,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAQe,IAAAW,mBAAU,EAAE5F,SAAU,CAAC","ignoreList":[]}
@@ -70,7 +70,7 @@ function PreviewDropdown({
70
70
  size: 'compact',
71
71
  showTooltip: !showIconLabels,
72
72
  disabled,
73
- __experimentalIsFocusable: disabled
73
+ accessibleWhenDisabled: disabled
74
74
  };
75
75
  const menuProps = {
76
76
  'aria-label': (0, _i18n.__)('View options')
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_components","_i18n","_icons","_data","_coreData","_preferences","_store","_postPreviewButton","_interopRequireDefault","_jsxRuntime","PreviewDropdown","forceIsAutosaveable","disabled","deviceType","homeUrl","isTemplate","isViewable","showIconLabels","useSelect","select","_getPostType$viewable","getDeviceType","getCurrentPostType","editorStore","getUnstableBase","getPostType","coreStore","get","preferencesStore","_currentPostType","home","viewable","setDeviceType","useDispatch","isMobile","useViewportMatch","popoverProps","placement","toggleProps","className","size","showTooltip","__experimentalIsFocusable","menuProps","__","deviceIcons","mobile","tablet","desktop","jsx","DropdownMenu","icon","toLowerCase","label","disableOpenOnArrowDown","children","onClose","jsxs","Fragment","MenuGroup","MenuItem","onClick","check","href","target","external","VisuallyHidden","as","default","role","textContent","Icon","onPreview"],"sources":["@wordpress/editor/src/components/preview-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check, desktop, mobile, tablet, external } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostPreviewButton from '../post-preview-button';\n\nexport default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {\n\tconst { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getDeviceType, getCurrentPostType } = select( editorStore );\n\t\t\tconst { getUnstableBase, getPostType } = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst _currentPostType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tisTemplate: _currentPostType === 'wp_template',\n\t\t\t\tisViewable: getPostType( _currentPostType )?.viewable ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tif ( isMobile ) {\n\t\treturn null;\n\t}\n\n\tconst popoverProps = {\n\t\tplacement: 'bottom-end',\n\t};\n\tconst toggleProps = {\n\t\tclassName: 'editor-preview-dropdown__toggle',\n\t\tsize: 'compact',\n\t\tshowTooltip: ! showIconLabels,\n\t\tdisabled,\n\t\t__experimentalIsFocusable: disabled,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\n\tconst deviceIcons = {\n\t\tmobile,\n\t\ttablet,\n\t\tdesktop,\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"editor-preview-dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ deviceIcons[ deviceType.toLowerCase() ] }\n\t\t\tlabel={ __( 'View' ) }\n\t\t\tdisableOpenOnArrowDown={ disabled }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ isTemplate && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\t\tclassName=\"editor-preview-dropdown__button-external\"\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\tforceIsAutosaveable={ forceIsAutosaveable }\n\t\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Preview in new tab' ) }\n\t\t\t\t\t\t\t\t\t\t<Icon icon={ external } />\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\tonPreview={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAC,sBAAA,CAAAT,OAAA;AAAuD,IAAAU,WAAA,GAAAV,OAAA;AArBvD;AACA;AACA;;AAeA;AACA;AACA;;AAIe,SAASW,eAAeA,CAAE;EAAEC,mBAAmB;EAAEC;AAAS,CAAC,EAAG;EAC5E,MAAM;IAAEC,UAAU;IAAEC,OAAO;IAAEC,UAAU;IAAEC,UAAU;IAAEC;EAAe,CAAC,GACpE,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAC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AAC,CACP,CAAC;MAAA,CACD,CAAC,EACV7B,UAAU,iBACX,IAAAN,WAAA,CAAAwC,GAAA,EAACjD,WAAA,CAAA2D,SAAS;QAAAJ,QAAA,eACT,IAAA9C,WAAA,CAAAgD,IAAA,EAACzD,WAAA,CAAA4D,QAAQ;UACRG,IAAI,EAAGjD,OAAS;UAChBkD,MAAM,EAAC,QAAQ;UACfb,IAAI,EAAGc,eAAU;UACjBJ,OAAO,EAAGL,OAAS;UAAAD,QAAA,GAEjB,IAAAX,QAAE,EAAE,WAAY,CAAC,eACnB,IAAAnC,WAAA,CAAAwC,GAAA,EAACjD,WAAA,CAAAkE,cAAc;YAACC,EAAE,EAAC,MAAM;YAAAZ,QAAA,EAEvB;YACA,IAAAX,QAAE,EAAE,sBAAuB;UAAC,CAEd,CAAC;QAAA,CACR;MAAC,CACD,CACX,EACC5B,UAAU,iBACX,IAAAP,WAAA,CAAAwC,GAAA,EAACjD,WAAA,CAAA2D,SAAS;QAAAJ,QAAA,eACT,IAAA9C,WAAA,CAAAwC,GAAA,EAAC1C,kBAAA,CAAA6D,OAAiB;UACjB7B,SAAS,EAAC,0CAA0C;UACpD8B,IAAI,EAAC,UAAU;UACf1D,mBAAmB,EAAGA,mBAAqB;UAC3C2D,WAAW,eACV,IAAA7D,WAAA,CAAAgD,IAAA,EAAAhD,WAAA,CAAAiD,QAAA;YAAAH,QAAA,GACG,IAAAX,QAAE,EAAE,oBAAqB,CAAC,eAC5B,IAAAnC,WAAA,CAAAwC,GAAA,EAACjD,WAAA,CAAAuE,IAAI;cAACpB,IAAI,EAAGc;YAAU,CAAE,CAAC;UAAA,CACzB,CACF;UACDO,SAAS,EAAGhB;QAAS,CACrB;MAAC,CACQ,CACX;IAAA,CACA;EACF,CACY,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_components","_i18n","_icons","_data","_coreData","_preferences","_store","_postPreviewButton","_interopRequireDefault","_jsxRuntime","PreviewDropdown","forceIsAutosaveable","disabled","deviceType","homeUrl","isTemplate","isViewable","showIconLabels","useSelect","select","_getPostType$viewable","getDeviceType","getCurrentPostType","editorStore","getUnstableBase","getPostType","coreStore","get","preferencesStore","_currentPostType","home","viewable","setDeviceType","useDispatch","isMobile","useViewportMatch","popoverProps","placement","toggleProps","className","size","showTooltip","accessibleWhenDisabled","menuProps","__","deviceIcons","mobile","tablet","desktop","jsx","DropdownMenu","icon","toLowerCase","label","disableOpenOnArrowDown","children","onClose","jsxs","Fragment","MenuGroup","MenuItem","onClick","check","href","target","external","VisuallyHidden","as","default","role","textContent","Icon","onPreview"],"sources":["@wordpress/editor/src/components/preview-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check, desktop, mobile, tablet, external } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostPreviewButton from '../post-preview-button';\n\nexport default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {\n\tconst { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getDeviceType, getCurrentPostType } = select( editorStore );\n\t\t\tconst { getUnstableBase, getPostType } = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst _currentPostType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tisTemplate: _currentPostType === 'wp_template',\n\t\t\t\tisViewable: getPostType( _currentPostType )?.viewable ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tif ( isMobile ) {\n\t\treturn null;\n\t}\n\n\tconst popoverProps = {\n\t\tplacement: 'bottom-end',\n\t};\n\tconst toggleProps = {\n\t\tclassName: 'editor-preview-dropdown__toggle',\n\t\tsize: 'compact',\n\t\tshowTooltip: ! showIconLabels,\n\t\tdisabled,\n\t\taccessibleWhenDisabled: disabled,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\n\tconst deviceIcons = {\n\t\tmobile,\n\t\ttablet,\n\t\tdesktop,\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"editor-preview-dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ deviceIcons[ deviceType.toLowerCase() ] }\n\t\t\tlabel={ __( 'View' ) }\n\t\t\tdisableOpenOnArrowDown={ disabled }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ isTemplate && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\t\tclassName=\"editor-preview-dropdown__button-external\"\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\tforceIsAutosaveable={ forceIsAutosaveable }\n\t\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Preview in new tab' ) }\n\t\t\t\t\t\t\t\t\t\t<Icon icon={ external } />\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\tonPreview={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,O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AAiB;UACjB7B,SAAS,EAAC,0CAA0C;UACpD8B,IAAI,EAAC,UAAU;UACf1D,mBAAmB,EAAGA,mBAAqB;UAC3C2D,WAAW,eACV,IAAA7D,WAAA,CAAAgD,IAAA,EAAAhD,WAAA,CAAAiD,QAAA;YAAAH,QAAA,GACG,IAAAX,QAAE,EAAE,oBAAqB,CAAC,eAC5B,IAAAnC,WAAA,CAAAwC,GAAA,EAACjD,WAAA,CAAAuE,IAAI;cAACpB,IAAI,EAAGc;YAAU,CAAE,CAAC;UAAA,CACzB,CACF;UACDO,SAAS,EAAGhB;QAAS,CACrB;MAAC,CACQ,CACX;IAAA,CACA;EACF,CACY,CAAC;AAEjB","ignoreList":[]}
@@ -129,12 +129,8 @@ class NativeEditorProvider extends _element.Component {
129
129
  }
130
130
  });
131
131
  this.subscriptionParentUpdateEditorSettings = (0, _reactNativeBridge.subscribeUpdateEditorSettings)(({
132
- galleryWithImageBlocks,
133
132
  ...editorSettings
134
133
  }) => {
135
- if (typeof galleryWithImageBlocks === 'boolean') {
136
- window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;
137
- }
138
134
  updateEditorSettings(this.getThemeColors(editorSettings));
139
135
  });
140
136
  this.subscriptionParentUpdateCapabilities = (0, _reactNativeBridge.subscribeUpdateCapabilities)(payload => {