@wordpress/editor 13.10.0 → 13.12.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 (373) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/autosave-monitor/index.js +1 -2
  3. package/build/components/autosave-monitor/index.js.map +1 -1
  4. package/build/components/deprecated.js +3 -4
  5. package/build/components/deprecated.js.map +1 -1
  6. package/build/components/document-outline/check.js +4 -5
  7. package/build/components/document-outline/check.js.map +1 -1
  8. package/build/components/document-outline/index.js +12 -16
  9. package/build/components/document-outline/index.js.map +1 -1
  10. package/build/components/document-outline/item.js +22 -25
  11. package/build/components/document-outline/item.js.map +1 -1
  12. package/build/components/editor-help/help-detail-navigation-screen.native.js +4 -5
  13. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  14. package/build/components/editor-help/help-get-support-button.native.js +4 -5
  15. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  16. package/build/components/editor-help/help-section-title.native.js +3 -4
  17. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  18. package/build/components/editor-help/help-topic-row.native.js +6 -7
  19. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  20. package/build/components/editor-help/index.native.js +19 -24
  21. package/build/components/editor-help/index.native.js.map +1 -1
  22. package/build/components/editor-help/view-sections.native.js +16 -20
  23. package/build/components/editor-help/view-sections.native.js.map +1 -1
  24. package/build/components/editor-notices/index.js +12 -19
  25. package/build/components/editor-notices/index.js.map +1 -1
  26. package/build/components/editor-snackbars/index.js +3 -6
  27. package/build/components/editor-snackbars/index.js.map +1 -1
  28. package/build/components/entities-saved-states/entity-record-item.js +7 -10
  29. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  30. package/build/components/entities-saved-states/entity-type-list.js +6 -7
  31. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  32. package/build/components/entities-saved-states/hooks/use-is-dirty.js +84 -0
  33. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
  34. package/build/components/entities-saved-states/index.js +42 -110
  35. package/build/components/entities-saved-states/index.js.map +1 -1
  36. package/build/components/error-boundary/index.js +4 -5
  37. package/build/components/error-boundary/index.js.map +1 -1
  38. package/build/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
  39. package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  40. package/build/components/index.js +9 -0
  41. package/build/components/index.js.map +1 -1
  42. package/build/components/media-categories/index.js +25 -42
  43. package/build/components/media-categories/index.js.map +1 -1
  44. package/build/components/page-attributes/check.js +4 -7
  45. package/build/components/page-attributes/check.js.map +1 -1
  46. package/build/components/page-attributes/order.js +5 -8
  47. package/build/components/page-attributes/order.js.map +1 -1
  48. package/build/components/page-attributes/parent.js +5 -12
  49. package/build/components/page-attributes/parent.js.map +1 -1
  50. package/build/components/post-author/check.js +6 -7
  51. package/build/components/post-author/check.js.map +1 -1
  52. package/build/components/post-author/combobox.js +3 -6
  53. package/build/components/post-author/combobox.js.map +1 -1
  54. package/build/components/post-author/index.js +1 -1
  55. package/build/components/post-author/index.js.map +1 -1
  56. package/build/components/post-comments/index.js +4 -6
  57. package/build/components/post-comments/index.js.map +1 -1
  58. package/build/components/post-excerpt/index.js +4 -5
  59. package/build/components/post-excerpt/index.js.map +1 -1
  60. package/build/components/post-featured-image/index.js +56 -69
  61. package/build/components/post-featured-image/index.js.map +1 -1
  62. package/build/components/post-format/check.js +4 -5
  63. package/build/components/post-format/check.js.map +1 -1
  64. package/build/components/post-format/index.js +1 -1
  65. package/build/components/post-format/index.js.map +1 -1
  66. package/build/components/post-last-revision/check.js +5 -7
  67. package/build/components/post-last-revision/check.js.map +1 -1
  68. package/build/components/post-last-revision/index.js +4 -5
  69. package/build/components/post-last-revision/index.js.map +1 -1
  70. package/build/components/post-locked-modal/index.js +1 -1
  71. package/build/components/post-locked-modal/index.js.map +1 -1
  72. package/build/components/post-pending-status/check.js +7 -9
  73. package/build/components/post-pending-status/check.js.map +1 -1
  74. package/build/components/post-pending-status/index.js +4 -6
  75. package/build/components/post-pending-status/index.js.map +1 -1
  76. package/build/components/post-pingbacks/index.js +4 -6
  77. package/build/components/post-pingbacks/index.js.map +1 -1
  78. package/build/components/post-preview-button/index.js +8 -12
  79. package/build/components/post-preview-button/index.js.map +1 -1
  80. package/build/components/post-publish-button/index.js +6 -13
  81. package/build/components/post-publish-button/index.js.map +1 -1
  82. package/build/components/post-publish-button/label.js +14 -17
  83. package/build/components/post-publish-button/label.js.map +1 -1
  84. package/build/components/post-publish-panel/index.js +6 -7
  85. package/build/components/post-publish-panel/index.js.map +1 -1
  86. package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
  87. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  88. package/build/components/post-publish-panel/maybe-post-format-panel.js +9 -12
  89. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  90. package/build/components/post-publish-panel/maybe-tags-panel.js +4 -7
  91. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  92. package/build/components/post-publish-panel/postpublish.js +8 -11
  93. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  94. package/build/components/post-publish-panel/prepublish.js +5 -6
  95. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  96. package/build/components/post-saved-state/index.js +13 -8
  97. package/build/components/post-saved-state/index.js.map +1 -1
  98. package/build/components/post-schedule/check.js +6 -8
  99. package/build/components/post-schedule/check.js.map +1 -1
  100. package/build/components/post-schedule/index.js +8 -12
  101. package/build/components/post-schedule/index.js.map +1 -1
  102. package/build/components/post-schedule/label.js +7 -10
  103. package/build/components/post-schedule/label.js.map +1 -1
  104. package/build/components/post-slug/check.js +3 -4
  105. package/build/components/post-slug/check.js.map +1 -1
  106. package/build/components/post-slug/index.js +5 -6
  107. package/build/components/post-slug/index.js.map +1 -1
  108. package/build/components/post-sticky/check.js +7 -9
  109. package/build/components/post-sticky/check.js.map +1 -1
  110. package/build/components/post-sticky/index.js +4 -5
  111. package/build/components/post-sticky/index.js.map +1 -1
  112. package/build/components/post-switch-to-draft-button/index.js +6 -7
  113. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  114. package/build/components/post-taxonomies/check.js +6 -7
  115. package/build/components/post-taxonomies/check.js.map +1 -1
  116. package/build/components/post-taxonomies/flat-term-selector.js +13 -14
  117. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  118. package/build/components/post-taxonomies/hierarchical-term-selector.js +13 -14
  119. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  120. package/build/components/post-taxonomies/index.js +6 -11
  121. package/build/components/post-taxonomies/index.js.map +1 -1
  122. package/build/components/post-taxonomies/most-used-terms.js +5 -6
  123. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  124. package/build/components/post-template/index.js +6 -9
  125. package/build/components/post-template/index.js.map +1 -1
  126. package/build/components/post-title/index.js +2 -6
  127. package/build/components/post-title/index.js.map +1 -1
  128. package/build/components/post-title/index.native.js +8 -11
  129. package/build/components/post-title/index.native.js.map +1 -1
  130. package/build/components/post-trash/check.js +7 -9
  131. package/build/components/post-trash/check.js.map +1 -1
  132. package/build/components/post-type-support-check/index.js +5 -6
  133. package/build/components/post-type-support-check/index.js.map +1 -1
  134. package/build/components/post-url/check.js +4 -5
  135. package/build/components/post-url/check.js.map +1 -1
  136. package/build/components/post-url/index.js +8 -9
  137. package/build/components/post-url/index.js.map +1 -1
  138. package/build/components/post-visibility/check.js +6 -7
  139. package/build/components/post-visibility/check.js.map +1 -1
  140. package/build/components/post-visibility/index.js +10 -12
  141. package/build/components/post-visibility/index.js.map +1 -1
  142. package/build/components/post-visibility/label.js +1 -3
  143. package/build/components/post-visibility/label.js.map +1 -1
  144. package/build/components/provider/index.js +9 -10
  145. package/build/components/provider/index.js.map +1 -1
  146. package/build/components/provider/index.native.js +14 -20
  147. package/build/components/provider/index.native.js.map +1 -1
  148. package/build/components/provider/use-block-editor-settings.js +6 -10
  149. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  150. package/build/components/provider/use-block-editor-settings.native.js +1 -3
  151. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  152. package/build/components/table-of-contents/index.js +26 -33
  153. package/build/components/table-of-contents/index.js.map +1 -1
  154. package/build/components/table-of-contents/panel.js +4 -5
  155. package/build/components/table-of-contents/panel.js.map +1 -1
  156. package/build/components/template-validation-notice/index.js +4 -6
  157. package/build/components/template-validation-notice/index.js.map +1 -1
  158. package/build/components/theme-support-check/index.js +7 -8
  159. package/build/components/theme-support-check/index.js.map +1 -1
  160. package/build/hooks/custom-sources-backwards-compatibility.js +16 -35
  161. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  162. package/build/hooks/default-autocompleters.js +1 -2
  163. package/build/hooks/default-autocompleters.js.map +1 -1
  164. package/build/private-apis.js +4 -1
  165. package/build/private-apis.js.map +1 -1
  166. package/build/store/actions.js +147 -179
  167. package/build/store/actions.js.map +1 -1
  168. package/build/store/actions.native.js +1 -2
  169. package/build/store/actions.native.js.map +1 -1
  170. package/build/store/reducer.js +14 -44
  171. package/build/store/reducer.js.map +1 -1
  172. package/build/store/reducer.native.js +3 -12
  173. package/build/store/reducer.native.js.map +1 -1
  174. package/build/store/selectors.js +23 -54
  175. package/build/store/selectors.js.map +1 -1
  176. package/build/store/utils/notice-builder.js +3 -3
  177. package/build/store/utils/notice-builder.js.map +1 -1
  178. package/build/utils/media-upload/index.js +11 -15
  179. package/build/utils/media-upload/index.js.map +1 -1
  180. package/build/utils/terms.js +3 -6
  181. package/build/utils/terms.js.map +1 -1
  182. package/build-module/components/autosave-monitor/index.js +1 -2
  183. package/build-module/components/autosave-monitor/index.js.map +1 -1
  184. package/build-module/components/deprecated.js +3 -4
  185. package/build-module/components/deprecated.js.map +1 -1
  186. package/build-module/components/document-outline/check.js +4 -5
  187. package/build-module/components/document-outline/check.js.map +1 -1
  188. package/build-module/components/document-outline/index.js +12 -16
  189. package/build-module/components/document-outline/index.js.map +1 -1
  190. package/build-module/components/document-outline/item.js +22 -25
  191. package/build-module/components/document-outline/item.js.map +1 -1
  192. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +4 -5
  193. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  194. package/build-module/components/editor-help/help-get-support-button.native.js +4 -5
  195. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  196. package/build-module/components/editor-help/help-section-title.native.js +3 -4
  197. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  198. package/build-module/components/editor-help/help-topic-row.native.js +6 -7
  199. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  200. package/build-module/components/editor-help/index.native.js +19 -23
  201. package/build-module/components/editor-help/index.native.js.map +1 -1
  202. package/build-module/components/editor-help/view-sections.native.js +16 -20
  203. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  204. package/build-module/components/editor-notices/index.js +12 -19
  205. package/build-module/components/editor-notices/index.js.map +1 -1
  206. package/build-module/components/editor-snackbars/index.js +3 -6
  207. package/build-module/components/editor-snackbars/index.js.map +1 -1
  208. package/build-module/components/entities-saved-states/entity-record-item.js +7 -10
  209. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  210. package/build-module/components/entities-saved-states/entity-type-list.js +6 -7
  211. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  212. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +70 -0
  213. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
  214. package/build-module/components/entities-saved-states/index.js +43 -113
  215. package/build-module/components/entities-saved-states/index.js.map +1 -1
  216. package/build-module/components/error-boundary/index.js +4 -5
  217. package/build-module/components/error-boundary/index.js.map +1 -1
  218. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
  219. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  220. package/build-module/components/index.js +1 -0
  221. package/build-module/components/index.js.map +1 -1
  222. package/build-module/components/media-categories/index.js +25 -42
  223. package/build-module/components/media-categories/index.js.map +1 -1
  224. package/build-module/components/page-attributes/check.js +4 -7
  225. package/build-module/components/page-attributes/check.js.map +1 -1
  226. package/build-module/components/page-attributes/order.js +5 -8
  227. package/build-module/components/page-attributes/order.js.map +1 -1
  228. package/build-module/components/page-attributes/parent.js +5 -12
  229. package/build-module/components/page-attributes/parent.js.map +1 -1
  230. package/build-module/components/post-author/check.js +6 -7
  231. package/build-module/components/post-author/check.js.map +1 -1
  232. package/build-module/components/post-author/combobox.js +3 -6
  233. package/build-module/components/post-author/combobox.js.map +1 -1
  234. package/build-module/components/post-author/index.js +1 -1
  235. package/build-module/components/post-author/index.js.map +1 -1
  236. package/build-module/components/post-comments/index.js +4 -6
  237. package/build-module/components/post-comments/index.js.map +1 -1
  238. package/build-module/components/post-excerpt/index.js +4 -5
  239. package/build-module/components/post-excerpt/index.js.map +1 -1
  240. package/build-module/components/post-featured-image/index.js +56 -69
  241. package/build-module/components/post-featured-image/index.js.map +1 -1
  242. package/build-module/components/post-format/check.js +4 -5
  243. package/build-module/components/post-format/check.js.map +1 -1
  244. package/build-module/components/post-format/index.js +1 -1
  245. package/build-module/components/post-format/index.js.map +1 -1
  246. package/build-module/components/post-last-revision/check.js +5 -7
  247. package/build-module/components/post-last-revision/check.js.map +1 -1
  248. package/build-module/components/post-last-revision/index.js +4 -5
  249. package/build-module/components/post-last-revision/index.js.map +1 -1
  250. package/build-module/components/post-locked-modal/index.js +1 -1
  251. package/build-module/components/post-locked-modal/index.js.map +1 -1
  252. package/build-module/components/post-pending-status/check.js +7 -9
  253. package/build-module/components/post-pending-status/check.js.map +1 -1
  254. package/build-module/components/post-pending-status/index.js +4 -6
  255. package/build-module/components/post-pending-status/index.js.map +1 -1
  256. package/build-module/components/post-pingbacks/index.js +4 -6
  257. package/build-module/components/post-pingbacks/index.js.map +1 -1
  258. package/build-module/components/post-preview-button/index.js +8 -12
  259. package/build-module/components/post-preview-button/index.js.map +1 -1
  260. package/build-module/components/post-publish-button/index.js +6 -13
  261. package/build-module/components/post-publish-button/index.js.map +1 -1
  262. package/build-module/components/post-publish-button/label.js +14 -17
  263. package/build-module/components/post-publish-button/label.js.map +1 -1
  264. package/build-module/components/post-publish-panel/index.js +6 -7
  265. package/build-module/components/post-publish-panel/index.js.map +1 -1
  266. package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
  267. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  268. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +9 -12
  269. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  270. package/build-module/components/post-publish-panel/maybe-tags-panel.js +4 -7
  271. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  272. package/build-module/components/post-publish-panel/postpublish.js +8 -11
  273. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  274. package/build-module/components/post-publish-panel/prepublish.js +5 -6
  275. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  276. package/build-module/components/post-saved-state/index.js +13 -8
  277. package/build-module/components/post-saved-state/index.js.map +1 -1
  278. package/build-module/components/post-schedule/check.js +6 -8
  279. package/build-module/components/post-schedule/check.js.map +1 -1
  280. package/build-module/components/post-schedule/index.js +8 -12
  281. package/build-module/components/post-schedule/index.js.map +1 -1
  282. package/build-module/components/post-schedule/label.js +7 -10
  283. package/build-module/components/post-schedule/label.js.map +1 -1
  284. package/build-module/components/post-slug/check.js +3 -4
  285. package/build-module/components/post-slug/check.js.map +1 -1
  286. package/build-module/components/post-slug/index.js +5 -6
  287. package/build-module/components/post-slug/index.js.map +1 -1
  288. package/build-module/components/post-sticky/check.js +7 -9
  289. package/build-module/components/post-sticky/check.js.map +1 -1
  290. package/build-module/components/post-sticky/index.js +4 -5
  291. package/build-module/components/post-sticky/index.js.map +1 -1
  292. package/build-module/components/post-switch-to-draft-button/index.js +6 -7
  293. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  294. package/build-module/components/post-taxonomies/check.js +6 -7
  295. package/build-module/components/post-taxonomies/check.js.map +1 -1
  296. package/build-module/components/post-taxonomies/flat-term-selector.js +13 -14
  297. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  298. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +13 -14
  299. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  300. package/build-module/components/post-taxonomies/index.js +6 -11
  301. package/build-module/components/post-taxonomies/index.js.map +1 -1
  302. package/build-module/components/post-taxonomies/most-used-terms.js +5 -6
  303. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  304. package/build-module/components/post-template/index.js +6 -9
  305. package/build-module/components/post-template/index.js.map +1 -1
  306. package/build-module/components/post-title/index.js +2 -6
  307. package/build-module/components/post-title/index.js.map +1 -1
  308. package/build-module/components/post-title/index.native.js +8 -11
  309. package/build-module/components/post-title/index.native.js.map +1 -1
  310. package/build-module/components/post-trash/check.js +7 -9
  311. package/build-module/components/post-trash/check.js.map +1 -1
  312. package/build-module/components/post-type-support-check/index.js +5 -6
  313. package/build-module/components/post-type-support-check/index.js.map +1 -1
  314. package/build-module/components/post-url/check.js +4 -5
  315. package/build-module/components/post-url/check.js.map +1 -1
  316. package/build-module/components/post-url/index.js +8 -9
  317. package/build-module/components/post-url/index.js.map +1 -1
  318. package/build-module/components/post-visibility/check.js +6 -7
  319. package/build-module/components/post-visibility/check.js.map +1 -1
  320. package/build-module/components/post-visibility/index.js +10 -12
  321. package/build-module/components/post-visibility/index.js.map +1 -1
  322. package/build-module/components/post-visibility/label.js +1 -3
  323. package/build-module/components/post-visibility/label.js.map +1 -1
  324. package/build-module/components/provider/index.js +9 -10
  325. package/build-module/components/provider/index.js.map +1 -1
  326. package/build-module/components/provider/index.native.js +14 -20
  327. package/build-module/components/provider/index.native.js.map +1 -1
  328. package/build-module/components/provider/use-block-editor-settings.js +6 -10
  329. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  330. package/build-module/components/provider/use-block-editor-settings.native.js +1 -3
  331. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  332. package/build-module/components/table-of-contents/index.js +26 -33
  333. package/build-module/components/table-of-contents/index.js.map +1 -1
  334. package/build-module/components/table-of-contents/panel.js +4 -5
  335. package/build-module/components/table-of-contents/panel.js.map +1 -1
  336. package/build-module/components/template-validation-notice/index.js +4 -6
  337. package/build-module/components/template-validation-notice/index.js.map +1 -1
  338. package/build-module/components/theme-support-check/index.js +7 -8
  339. package/build-module/components/theme-support-check/index.js.map +1 -1
  340. package/build-module/hooks/custom-sources-backwards-compatibility.js +16 -35
  341. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  342. package/build-module/hooks/default-autocompleters.js +1 -2
  343. package/build-module/hooks/default-autocompleters.js.map +1 -1
  344. package/build-module/private-apis.js +3 -1
  345. package/build-module/private-apis.js.map +1 -1
  346. package/build-module/store/actions.js +147 -179
  347. package/build-module/store/actions.js.map +1 -1
  348. package/build-module/store/actions.native.js +1 -2
  349. package/build-module/store/actions.native.js.map +1 -1
  350. package/build-module/store/reducer.js +14 -44
  351. package/build-module/store/reducer.js.map +1 -1
  352. package/build-module/store/reducer.native.js +3 -12
  353. package/build-module/store/reducer.native.js.map +1 -1
  354. package/build-module/store/selectors.js +21 -54
  355. package/build-module/store/selectors.js.map +1 -1
  356. package/build-module/store/utils/notice-builder.js +3 -3
  357. package/build-module/store/utils/notice-builder.js.map +1 -1
  358. package/build-module/utils/media-upload/index.js +11 -15
  359. package/build-module/utils/media-upload/index.js.map +1 -1
  360. package/build-module/utils/terms.js +3 -6
  361. package/build-module/utils/terms.js.map +1 -1
  362. package/build-style/style-rtl.css +1 -1
  363. package/build-style/style.css +1 -1
  364. package/package.json +31 -31
  365. package/src/components/entities-saved-states/hooks/use-is-dirty.js +85 -0
  366. package/src/components/entities-saved-states/index.js +29 -107
  367. package/src/components/entities-saved-states/test/use-is-dirty.js +94 -0
  368. package/src/components/index.js +1 -0
  369. package/src/components/post-saved-state/index.js +6 -0
  370. package/src/components/post-taxonomies/flat-term-selector.js +1 -1
  371. package/src/components/post-title/index.js +2 -1
  372. package/src/components/provider/use-block-editor-settings.js +1 -0
  373. package/src/private-apis.js +2 -0
@@ -24,10 +24,9 @@ import { getNotificationArgumentsForSaveSuccess, getNotificationArgumentsForSave
24
24
  * @param {Array?} template Block Template.
25
25
  */
26
26
 
27
- export const setupEditor = (post, edits, template) => _ref => {
28
- let {
29
- dispatch
30
- } = _ref;
27
+ export const setupEditor = (post, edits, template) => ({
28
+ dispatch
29
+ }) => {
31
30
  dispatch.setupEditorState(post); // Apply a template for new posts only, if exists.
32
31
 
33
32
  const isNewPost = post.status === 'auto-draft';
@@ -51,11 +50,10 @@ export const setupEditor = (post, edits, template) => _ref => {
51
50
  });
52
51
  }
53
52
 
54
- if (edits && Object.values(edits).some(_ref2 => {
55
- var _post$key$raw, _post$key;
53
+ if (edits && Object.values(edits).some(([key, edit]) => {
54
+ var _post$key$raw;
56
55
 
57
- let [key, edit] = _ref2;
58
- return edit !== ((_post$key$raw = (_post$key = post[key]) === null || _post$key === void 0 ? void 0 : _post$key.raw) !== null && _post$key$raw !== void 0 ? _post$key$raw : post[key]);
56
+ return edit !== ((_post$key$raw = post[key]?.raw) !== null && _post$key$raw !== void 0 ? _post$key$raw : post[key]);
59
57
  })) {
60
58
  dispatch.editPost(edits);
61
59
  }
@@ -129,11 +127,10 @@ export function setupEditorState(post) {
129
127
  * @param {Object} options Options for the edit.
130
128
  */
131
129
 
132
- export const editPost = (edits, options) => _ref3 => {
133
- let {
134
- select,
135
- registry
136
- } = _ref3;
130
+ export const editPost = (edits, options) => ({
131
+ select,
132
+ registry
133
+ }) => {
137
134
  const {
138
135
  id,
139
136
  type
@@ -146,76 +143,71 @@ export const editPost = (edits, options) => _ref3 => {
146
143
  * @param {Object} options
147
144
  */
148
145
 
149
- export const savePost = function () {
150
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
151
- return async _ref4 => {
152
- let {
153
- select,
154
- dispatch,
155
- registry
156
- } = _ref4;
146
+ export const savePost = (options = {}) => async ({
147
+ select,
148
+ dispatch,
149
+ registry
150
+ }) => {
151
+ if (!select.isEditedPostSaveable()) {
152
+ return;
153
+ }
157
154
 
158
- if (!select.isEditedPostSaveable()) {
159
- return;
160
- }
155
+ const content = select.getEditedPostContent();
161
156
 
162
- const content = select.getEditedPostContent();
157
+ if (!options.isAutosave) {
158
+ dispatch.editPost({
159
+ content
160
+ }, {
161
+ undoIgnore: true
162
+ });
163
+ }
163
164
 
164
- if (!options.isAutosave) {
165
- dispatch.editPost({
166
- content
167
- }, {
168
- undoIgnore: true
169
- });
170
- }
165
+ const previousRecord = select.getCurrentPost();
166
+ const edits = {
167
+ id: previousRecord.id,
168
+ ...registry.select(coreStore).getEntityRecordNonTransientEdits('postType', previousRecord.type, previousRecord.id),
169
+ content
170
+ };
171
+ dispatch({
172
+ type: 'REQUEST_POST_UPDATE_START',
173
+ options
174
+ });
175
+ await registry.dispatch(coreStore).saveEntityRecord('postType', previousRecord.type, edits, options);
176
+ dispatch({
177
+ type: 'REQUEST_POST_UPDATE_FINISH',
178
+ options
179
+ });
180
+ const error = registry.select(coreStore).getLastEntitySaveError('postType', previousRecord.type, previousRecord.id);
171
181
 
172
- const previousRecord = select.getCurrentPost();
173
- const edits = {
174
- id: previousRecord.id,
175
- ...registry.select(coreStore).getEntityRecordNonTransientEdits('postType', previousRecord.type, previousRecord.id),
176
- content
177
- };
178
- dispatch({
179
- type: 'REQUEST_POST_UPDATE_START',
180
- options
182
+ if (error) {
183
+ const args = getNotificationArgumentsForSaveFail({
184
+ post: previousRecord,
185
+ edits,
186
+ error
181
187
  });
182
- await registry.dispatch(coreStore).saveEntityRecord('postType', previousRecord.type, edits, options);
183
- dispatch({
184
- type: 'REQUEST_POST_UPDATE_FINISH',
188
+
189
+ if (args.length) {
190
+ registry.dispatch(noticesStore).createErrorNotice(...args);
191
+ }
192
+ } else {
193
+ const updatedRecord = select.getCurrentPost();
194
+ const args = getNotificationArgumentsForSaveSuccess({
195
+ previousPost: previousRecord,
196
+ post: updatedRecord,
197
+ postType: await registry.resolveSelect(coreStore).getPostType(updatedRecord.type),
185
198
  options
186
199
  });
187
- const error = registry.select(coreStore).getLastEntitySaveError('postType', previousRecord.type, previousRecord.id);
188
-
189
- if (error) {
190
- const args = getNotificationArgumentsForSaveFail({
191
- post: previousRecord,
192
- edits,
193
- error
194
- });
195
-
196
- if (args.length) {
197
- registry.dispatch(noticesStore).createErrorNotice(...args);
198
- }
199
- } else {
200
- const updatedRecord = select.getCurrentPost();
201
- const args = getNotificationArgumentsForSaveSuccess({
202
- previousPost: previousRecord,
203
- post: updatedRecord,
204
- postType: await registry.resolveSelect(coreStore).getPostType(updatedRecord.type),
205
- options
206
- });
207
-
208
- if (args.length) {
209
- registry.dispatch(noticesStore).createSuccessNotice(...args);
210
- } // Make sure that any edits after saving create an undo level and are
211
- // considered for change detection.
212
-
213
-
214
- if (!options.isAutosave) {
215
- registry.dispatch(blockEditorStore).__unstableMarkLastChangeAsPersistent();
216
- }
200
+
201
+ if (args.length) {
202
+ registry.dispatch(noticesStore).createSuccessNotice(...args);
203
+ } // Make sure that any edits after saving create an undo level and are
204
+ // considered for change detection.
205
+
206
+
207
+ if (!options.isAutosave) {
208
+ registry.dispatch(blockEditorStore).__unstableMarkLastChangeAsPersistent();
217
209
  }
218
- };
210
+ }
219
211
  };
220
212
  /**
221
213
  * Action for refreshing the current post.
@@ -237,12 +229,11 @@ export function refreshPost() {
237
229
  * Action for trashing the current post in the editor.
238
230
  */
239
231
 
240
- export const trashPost = () => async _ref5 => {
241
- let {
242
- select,
243
- dispatch,
244
- registry
245
- } = _ref5;
232
+ export const trashPost = () => async ({
233
+ select,
234
+ dispatch,
235
+ registry
236
+ }) => {
246
237
  const postTypeSlug = select.getCurrentPostType();
247
238
  const postType = await registry.resolveSelect(coreStore).getPostType(postTypeSlug);
248
239
  registry.dispatch(noticesStore).removeNotice(TRASH_POST_NOTICE_ID);
@@ -280,50 +271,43 @@ export const trashPost = () => async _ref5 => {
280
271
  * @param {Object?} options Extra flags to identify the autosave.
281
272
  */
282
273
 
283
- export const autosave = function () {
284
- let {
285
- local = false,
286
- ...options
287
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
288
- return async _ref6 => {
289
- let {
290
- select,
291
- dispatch
292
- } = _ref6;
293
-
294
- if (local) {
295
- const post = select.getCurrentPost();
296
- const isPostNew = select.isEditedPostNew();
297
- const title = select.getEditedPostAttribute('title');
298
- const content = select.getEditedPostAttribute('content');
299
- const excerpt = select.getEditedPostAttribute('excerpt');
300
- localAutosaveSet(post.id, isPostNew, title, content, excerpt);
301
- } else {
302
- await dispatch.savePost({
303
- isAutosave: true,
304
- ...options
305
- });
306
- }
307
- };
274
+ export const autosave = ({
275
+ local = false,
276
+ ...options
277
+ } = {}) => async ({
278
+ select,
279
+ dispatch
280
+ }) => {
281
+ if (local) {
282
+ const post = select.getCurrentPost();
283
+ const isPostNew = select.isEditedPostNew();
284
+ const title = select.getEditedPostAttribute('title');
285
+ const content = select.getEditedPostAttribute('content');
286
+ const excerpt = select.getEditedPostAttribute('excerpt');
287
+ localAutosaveSet(post.id, isPostNew, title, content, excerpt);
288
+ } else {
289
+ await dispatch.savePost({
290
+ isAutosave: true,
291
+ ...options
292
+ });
293
+ }
308
294
  };
309
295
  /**
310
296
  * Action that restores last popped state in undo history.
311
297
  */
312
298
 
313
- export const redo = () => _ref7 => {
314
- let {
315
- registry
316
- } = _ref7;
299
+ export const redo = () => ({
300
+ registry
301
+ }) => {
317
302
  registry.dispatch(coreStore).redo();
318
303
  };
319
304
  /**
320
305
  * Action that pops a record from undo history and undoes the edit.
321
306
  */
322
307
 
323
- export const undo = () => _ref8 => {
324
- let {
325
- registry
326
- } = _ref8;
308
+ export const undo = () => ({
309
+ registry
310
+ }) => {
327
311
  registry.dispatch(coreStore).undo();
328
312
  };
329
313
  /**
@@ -359,20 +343,18 @@ export function updatePostLock(lock) {
359
343
  * Enable the publish sidebar.
360
344
  */
361
345
 
362
- export const enablePublishSidebar = () => _ref9 => {
363
- let {
364
- registry
365
- } = _ref9;
346
+ export const enablePublishSidebar = () => ({
347
+ registry
348
+ }) => {
366
349
  registry.dispatch(preferencesStore).set('core/edit-post', 'isPublishSidebarEnabled', true);
367
350
  };
368
351
  /**
369
352
  * Disables the publish sidebar.
370
353
  */
371
354
 
372
- export const disablePublishSidebar = () => _ref10 => {
373
- let {
374
- registry
375
- } = _ref10;
355
+ export const disablePublishSidebar = () => ({
356
+ registry
357
+ }) => {
376
358
  registry.dispatch(preferencesStore).set('core/edit-post', 'isPublishSidebarEnabled', false);
377
359
  };
378
360
  /**
@@ -492,49 +474,42 @@ export function unlockPostAutosaving(lockName) {
492
474
  * @param {?Object} options Optional options.
493
475
  */
494
476
 
495
- export const resetEditorBlocks = function (blocks) {
496
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
497
- return _ref11 => {
498
- let {
499
- select,
500
- dispatch,
501
- registry
502
- } = _ref11;
477
+ export const resetEditorBlocks = (blocks, options = {}) => ({
478
+ select,
479
+ dispatch,
480
+ registry
481
+ }) => {
482
+ const {
483
+ __unstableShouldCreateUndoLevel,
484
+ selection
485
+ } = options;
486
+ const edits = {
487
+ blocks,
488
+ selection
489
+ };
490
+
491
+ if (__unstableShouldCreateUndoLevel !== false) {
503
492
  const {
504
- __unstableShouldCreateUndoLevel,
505
- selection
506
- } = options;
507
- const edits = {
508
- blocks,
509
- selection
510
- };
511
-
512
- if (__unstableShouldCreateUndoLevel !== false) {
513
- const {
514
- id,
515
- type
516
- } = select.getCurrentPost();
517
- const noChange = registry.select(coreStore).getEditedEntityRecord('postType', type, id).blocks === edits.blocks;
518
-
519
- if (noChange) {
520
- registry.dispatch(coreStore).__unstableCreateUndoLevel('postType', type, id);
521
-
522
- return;
523
- } // We create a new function here on every persistent edit
524
- // to make sure the edit makes the post dirty and creates
525
- // a new undo level.
526
-
527
-
528
- edits.content = _ref12 => {
529
- let {
530
- blocks: blocksForSerialization = []
531
- } = _ref12;
532
- return __unstableSerializeAndClean(blocksForSerialization);
533
- };
534
- }
493
+ id,
494
+ type
495
+ } = select.getCurrentPost();
496
+ const noChange = registry.select(coreStore).getEditedEntityRecord('postType', type, id).blocks === edits.blocks;
535
497
 
536
- dispatch.editPost(edits);
537
- };
498
+ if (noChange) {
499
+ registry.dispatch(coreStore).__unstableCreateUndoLevel('postType', type, id);
500
+
501
+ return;
502
+ } // We create a new function here on every persistent edit
503
+ // to make sure the edit makes the post dirty and creates
504
+ // a new undo level.
505
+
506
+
507
+ edits.content = ({
508
+ blocks: blocksForSerialization = []
509
+ }) => __unstableSerializeAndClean(blocksForSerialization);
510
+ }
511
+
512
+ dispatch.editPost(edits);
538
513
  };
539
514
  /*
540
515
  * Returns an action object used in signalling that the post editor settings have been updated.
@@ -554,22 +529,15 @@ export function updateEditorSettings(settings) {
554
529
  * Backward compatibility
555
530
  */
556
531
 
557
- const getBlockEditorAction = name => function () {
558
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
559
- args[_key] = arguments[_key];
560
- }
561
-
562
- return _ref13 => {
563
- let {
564
- registry
565
- } = _ref13;
566
- deprecated("`wp.data.dispatch( 'core/editor' )." + name + '`', {
567
- since: '5.3',
568
- alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`',
569
- version: '6.2'
570
- });
571
- registry.dispatch(blockEditorStore)[name](...args);
572
- };
532
+ const getBlockEditorAction = name => (...args) => ({
533
+ registry
534
+ }) => {
535
+ deprecated("`wp.data.dispatch( 'core/editor' )." + name + '`', {
536
+ since: '5.3',
537
+ alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`',
538
+ version: '6.2'
539
+ });
540
+ registry.dispatch(blockEditorStore)[name](...args);
573
541
  };
574
542
  /**
575
543
  * @see resetBlocks in core/block-editor store.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["apiFetch","deprecated","parse","synchronizeBlocksWithTemplate","__unstableSerializeAndClean","store","noticesStore","coreStore","blockEditorStore","preferencesStore","TRASH_POST_NOTICE_ID","localAutosaveSet","getNotificationArgumentsForSaveSuccess","getNotificationArgumentsForSaveFail","getNotificationArgumentsForTrashFail","setupEditor","post","edits","template","dispatch","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","editPost","__experimentalTearDownEditor","type","resetPost","since","version","alternative","updatePost","options","select","registry","id","getCurrentPost","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","args","length","createErrorNotice","updatedRecord","previousPost","postType","resolveSelect","getPostType","createSuccessNotice","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","rest_base","restBase","rest_namespace","restNamespace","path","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","set","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","clearSelectedBlock","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAP,MAAqB,sBAArB;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SACCC,KADD,EAECC,6BAFD,EAGCC,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AMoB,kBAAkB,GAAGpB,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;AACA,OAAO,MAAMqB,mBAAmB,GAAGrB,oBAAoB,CACtD,qBADsD,CAAhD;AAIP;AACA;AACA;;AACA,OAAO,MAAMsB,mBAAmB,GAAGtB,oBAAoB,CACtD,qBADsD,CAAhD;AAIP;AACA;AACA;;AACA,OAAO,MAAMuB,WAAW,GAAGvB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;AACA,OAAO,MAAMwB,YAAY,GAAGxB,oBAAoB,CAAE,cAAF,CAAzC;AAEP;AACA;AACA;;AACA,OAAO,MAAMyB,WAAW,GAAGzB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;AACA,OAAO,MAAM0B,eAAe,GAAG1B,oBAAoB,CAAE,iBAAF,CAA5C;AAEP;AACA;AACA;;AACA,OAAO,MAAM2B,WAAW,GAAG3B,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;AACA,OAAO,MAAM4B,UAAU,GAAG5B,oBAAoB,CAAE,YAAF,CAAvC;AAEP;AACA;AACA;;AACA,OAAO,MAAM6B,kBAAkB,GAAG7B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;AACA,OAAO,MAAM8B,iBAAiB,GAAG9B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;AACA,OAAO,MAAM+B,kBAAkB,GAAG/B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;AACA,OAAO,MAAMgC,uBAAuB,GAAGhC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tparse,\n\tsynchronizeBlocksWithTemplate,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { TRASH_POST_NOTICE_ID } from './constants';\nimport { localAutosaveSet } from './local-autosave';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\n\n/**\n * Returns an action generator used in signalling that editor has initialized with\n * the specified post object and editor settings.\n *\n * @param {Object} post Post object.\n * @param {Object} edits Initial edited attributes object.\n * @param {Array?} template Block Template.\n */\nexport const setupEditor =\n\t( post, edits, template ) =>\n\t( { dispatch } ) => {\n\t\tdispatch.setupEditorState( post );\n\t\t// Apply a template for new posts only, if exists.\n\t\tconst isNewPost = post.status === 'auto-draft';\n\t\tif ( isNewPost && template ) {\n\t\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t\t// included as part of editor setup action. Assume edited content as\n\t\t\t// canonical if provided, falling back to post.\n\t\t\tlet content;\n\t\t\tif ( 'content' in edits ) {\n\t\t\t\tcontent = edits.content;\n\t\t\t} else {\n\t\t\t\tcontent = post.content.raw;\n\t\t\t}\n\t\t\tlet blocks = parse( content );\n\t\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tedits &&\n\t\t\tObject.values( edits ).some(\n\t\t\t\t( [ key, edit ] ) =>\n\t\t\t\t\tedit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t\t)\n\t\t) {\n\t\t\tdispatch.editPost( edits );\n\t\t}\n\t};\n\n/**\n * Returns an action object signalling that the editor is being destroyed and\n * that any necessary state or side-effect cleanup should occur.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\treturn { type: 'TEAR_DOWN_EDITOR' };\n}\n\n/**\n * Returns an action object used in signalling that the latest version of the\n * post has been received, either by initialization or save.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function resetPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).resetPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Initialize the editor with the setupEditorState action',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Returns an action object used in signalling that a patch of updates for the\n * latest version of the post have been received.\n *\n * @return {Object} Action object.\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function updatePost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).updatePost\", {\n\t\tsince: '5.7',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Returns an action object used to setup the editor state when first opening\n * an editor.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function setupEditorState( post ) {\n\treturn {\n\t\ttype: 'SETUP_EDITOR_STATE',\n\t\tpost,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that attributes of the post have\n * been edited.\n *\n * @param {Object} edits Post attributes to edit.\n * @param {Object} options Options for the edit.\n */\nexport const editPost =\n\t( edits, options ) =>\n\t( { select, registry } ) => {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', type, id, edits, options );\n\t};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport const savePost =\n\t( options = {} ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tif ( ! select.isEditedPostSaveable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = select.getEditedPostContent();\n\n\t\tif ( ! options.isAutosave ) {\n\t\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t\t}\n\n\t\tconst previousRecord = select.getCurrentPost();\n\t\tconst edits = {\n\t\t\tid: previousRecord.id,\n\t\t\t...registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t),\n\t\t\tcontent,\n\t\t};\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\t\tawait registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tedits,\n\t\t\t\toptions\n\t\t\t);\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\t\tconst error = registry\n\t\t\t.select( coreStore )\n\t\t\t.getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tpreviousRecord.id\n\t\t\t);\n\t\tif ( error ) {\n\t\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\t\tpost: previousRecord,\n\t\t\t\tedits,\n\t\t\t\terror,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t\t}\n\t\t} else {\n\t\t\tconst updatedRecord = select.getCurrentPost();\n\t\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\t\tpreviousPost: previousRecord,\n\t\t\t\tpost: updatedRecord,\n\t\t\t\tpostType: await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\t\toptions,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( ...args );\n\t\t\t}\n\t\t\t// Make sure that any edits after saving create an undo level and are\n\t\t\t// considered for change detection.\n\t\t\tif ( ! options.isAutosave ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t}\n\t};\n\n/**\n * Action for refreshing the current post.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function refreshPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).refreshPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action for trashing the current post in the editor.\n */\nexport const trashPost =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postTypeSlug = select.getCurrentPostType();\n\t\tconst postType = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postTypeSlug );\n\t\tregistry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );\n\t\tconst { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' } =\n\t\t\tpostType;\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_START' } );\n\t\ttry {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: `/${ restNamespace }/${ restBase }/${ post.id }`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\tawait dispatch.savePost();\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t\t);\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_FINISH' } );\n\t};\n\n/**\n * Action that autosaves the current post. This\n * includes server-side autosaving (default) and client-side (a.k.a. local)\n * autosaving (e.g. on the Web, the post might be committed to Session\n * Storage).\n *\n * @param {Object?} options Extra flags to identify the autosave.\n */\nexport const autosave =\n\t( { local = false, ...options } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif ( local ) {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tconst isPostNew = select.isEditedPostNew();\n\t\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t\t} else {\n\t\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t\t}\n\t};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).redo();\n\t};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).undo();\n\t};\n\n/**\n * Action that creates an undo history record.\n *\n * @deprecated Since WordPress 6.0\n */\nexport function createUndoLevel() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).createUndoLevel\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action that locks the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n * @return {Object} Action object.\n */\nexport function updatePostLock( lock ) {\n\treturn {\n\t\ttype: 'UPDATE_POST_LOCK',\n\t\tlock,\n\t};\n}\n\n/**\n * Enable the publish sidebar.\n */\nexport const enablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', true );\n\t};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', false );\n\t};\n\n/**\n * Action that locks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * const { subscribe } = wp.data;\n *\n * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n *\n * // Only allow publishing posts that are set to a future date.\n * if ( 'publish' !== initialPostStatus ) {\n *\n * \t// Track locking.\n * \tlet locked = false;\n *\n * \t// Watch for the publish event.\n * \tlet unssubscribe = subscribe( () => {\n * \t\tconst currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n * \t\tif ( 'publish' !== currentPostStatus ) {\n *\n * \t\t\t// Compare the post date to the current date, lock the post if the date isn't in the future.\n * \t\t\tconst postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );\n * \t\t\tconst currentDate = new Date();\n * \t\t\tif ( postDate.getTime() <= currentDate.getTime() ) {\n * \t\t\t\tif ( ! locked ) {\n * \t\t\t\t\tlocked = true;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t} else {\n * \t\t\t\tif ( locked ) {\n * \t\t\t\t\tlocked = false;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t}\n * \t\t}\n * \t} );\n * }\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that locks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Lock post autosaving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that the blocks have been updated.\n *\n * @param {Array} blocks Block Array.\n * @param {?Object} options Optional options.\n */\nexport const resetEditorBlocks =\n\t( blocks, options = {} ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\t\tconst edits = { blocks, selection };\n\n\t\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\t\tconst { id, type } = select.getCurrentPost();\n\t\t\tconst noChange =\n\t\t\t\tregistry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\t\tedits.blocks;\n\t\t\tif ( noChange ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We create a new function here on every persistent edit\n\t\t\t// to make sure the edit makes the post dirty and creates\n\t\t\t// a new undo level.\n\t\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t\t}\n\n\t\tdispatch.editPost( edits );\n\t};\n\n/*\n * Returns an action object used in signalling that the post editor settings have been updated.\n *\n * @param {Object} settings Updated settings\n *\n * @return {Object} Action object\n */\nexport function updateEditorSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_EDITOR_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction =\n\t( name ) =>\n\t( ...args ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative:\n\t\t\t\t\"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\t\tversion: '6.2',\n\t\t} );\n\t\tregistry.dispatch( blockEditorStore )[ name ]( ...args );\n\t};\n\n/**\n * @see resetBlocks in core/block-editor store.\n */\nexport const resetBlocks = getBlockEditorAction( 'resetBlocks' );\n\n/**\n * @see receiveBlocks in core/block-editor store.\n */\nexport const receiveBlocks = getBlockEditorAction( 'receiveBlocks' );\n\n/**\n * @see updateBlock in core/block-editor store.\n */\nexport const updateBlock = getBlockEditorAction( 'updateBlock' );\n\n/**\n * @see updateBlockAttributes in core/block-editor store.\n */\nexport const updateBlockAttributes = getBlockEditorAction(\n\t'updateBlockAttributes'\n);\n\n/**\n * @see selectBlock in core/block-editor store.\n */\nexport const selectBlock = getBlockEditorAction( 'selectBlock' );\n\n/**\n * @see startMultiSelect in core/block-editor store.\n */\nexport const startMultiSelect = getBlockEditorAction( 'startMultiSelect' );\n\n/**\n * @see stopMultiSelect in core/block-editor store.\n */\nexport const stopMultiSelect = getBlockEditorAction( 'stopMultiSelect' );\n\n/**\n * @see multiSelect in core/block-editor store.\n */\nexport const multiSelect = getBlockEditorAction( 'multiSelect' );\n\n/**\n * @see clearSelectedBlock in core/block-editor store.\n */\nexport const clearSelectedBlock = getBlockEditorAction( 'clearSelectedBlock' );\n\n/**\n * @see toggleSelection in core/block-editor store.\n */\nexport const toggleSelection = getBlockEditorAction( 'toggleSelection' );\n\n/**\n * @see replaceBlocks in core/block-editor store.\n */\nexport const replaceBlocks = getBlockEditorAction( 'replaceBlocks' );\n\n/**\n * @see replaceBlock in core/block-editor store.\n */\nexport const replaceBlock = getBlockEditorAction( 'replaceBlock' );\n\n/**\n * @see moveBlocksDown in core/block-editor store.\n */\nexport const moveBlocksDown = getBlockEditorAction( 'moveBlocksDown' );\n\n/**\n * @see moveBlocksUp in core/block-editor store.\n */\nexport const moveBlocksUp = getBlockEditorAction( 'moveBlocksUp' );\n\n/**\n * @see moveBlockToPosition in core/block-editor store.\n */\nexport const moveBlockToPosition = getBlockEditorAction(\n\t'moveBlockToPosition'\n);\n\n/**\n * @see insertBlock in core/block-editor store.\n */\nexport const insertBlock = getBlockEditorAction( 'insertBlock' );\n\n/**\n * @see insertBlocks in core/block-editor store.\n */\nexport const insertBlocks = getBlockEditorAction( 'insertBlocks' );\n\n/**\n * @see showInsertionPoint in core/block-editor store.\n */\nexport const showInsertionPoint = getBlockEditorAction( 'showInsertionPoint' );\n\n/**\n * @see hideInsertionPoint in core/block-editor store.\n */\nexport const hideInsertionPoint = getBlockEditorAction( 'hideInsertionPoint' );\n\n/**\n * @see setTemplateValidity in core/block-editor store.\n */\nexport const setTemplateValidity = getBlockEditorAction(\n\t'setTemplateValidity'\n);\n\n/**\n * @see synchronizeTemplate in core/block-editor store.\n */\nexport const synchronizeTemplate = getBlockEditorAction(\n\t'synchronizeTemplate'\n);\n\n/**\n * @see mergeBlocks in core/block-editor store.\n */\nexport const mergeBlocks = getBlockEditorAction( 'mergeBlocks' );\n\n/**\n * @see removeBlocks in core/block-editor store.\n */\nexport const removeBlocks = getBlockEditorAction( 'removeBlocks' );\n\n/**\n * @see removeBlock in core/block-editor store.\n */\nexport const removeBlock = getBlockEditorAction( 'removeBlock' );\n\n/**\n * @see toggleBlockMode in core/block-editor store.\n */\nexport const toggleBlockMode = getBlockEditorAction( 'toggleBlockMode' );\n\n/**\n * @see startTyping in core/block-editor store.\n */\nexport const startTyping = getBlockEditorAction( 'startTyping' );\n\n/**\n * @see stopTyping in core/block-editor store.\n */\nexport const stopTyping = getBlockEditorAction( 'stopTyping' );\n\n/**\n * @see enterFormattedText in core/block-editor store.\n */\nexport const enterFormattedText = getBlockEditorAction( 'enterFormattedText' );\n\n/**\n * @see exitFormattedText in core/block-editor store.\n */\nexport const exitFormattedText = getBlockEditorAction( 'exitFormattedText' );\n\n/**\n * @see insertDefaultBlock in core/block-editor store.\n */\nexport const insertDefaultBlock = getBlockEditorAction( 'insertDefaultBlock' );\n\n/**\n * @see updateBlockListSettings in core/block-editor store.\n */\nexport const updateBlockListSettings = getBlockEditorAction(\n\t'updateBlockListSettings'\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["apiFetch","deprecated","parse","synchronizeBlocksWithTemplate","__unstableSerializeAndClean","store","noticesStore","coreStore","blockEditorStore","preferencesStore","TRASH_POST_NOTICE_ID","localAutosaveSet","getNotificationArgumentsForSaveSuccess","getNotificationArgumentsForSaveFail","getNotificationArgumentsForTrashFail","setupEditor","post","edits","template","dispatch","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","values","some","key","edit","editPost","__experimentalTearDownEditor","type","resetPost","since","version","alternative","updatePost","options","select","registry","id","getCurrentPost","editEntityRecord","savePost","isEditedPostSaveable","getEditedPostContent","isAutosave","undoIgnore","previousRecord","getEntityRecordNonTransientEdits","saveEntityRecord","error","getLastEntitySaveError","args","length","createErrorNotice","updatedRecord","previousPost","postType","resolveSelect","getPostType","createSuccessNotice","__unstableMarkLastChangeAsPersistent","refreshPost","trashPost","postTypeSlug","getCurrentPostType","removeNotice","rest_base","restBase","rest_namespace","restNamespace","path","method","autosave","local","isPostNew","isEditedPostNew","title","getEditedPostAttribute","excerpt","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","set","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","getEditedEntityRecord","__unstableCreateUndoLevel","blocksForSerialization","updateEditorSettings","settings","getBlockEditorAction","name","resetBlocks","receiveBlocks","updateBlock","updateBlockAttributes","selectBlock","startMultiSelect","stopMultiSelect","multiSelect","clearSelectedBlock","toggleSelection","replaceBlocks","replaceBlock","moveBlocksDown","moveBlocksUp","moveBlockToPosition","insertBlock","insertBlocks","showInsertionPoint","hideInsertionPoint","setTemplateValidity","synchronizeTemplate","mergeBlocks","removeBlocks","removeBlock","toggleBlockMode","startTyping","stopTyping","enterFormattedText","exitFormattedText","insertDefaultBlock","updateBlockListSettings"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAP,MAAqB,sBAArB;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SACCC,KADD,EAECC,6BAFD,EAGCC,2BAHD,QAIO,mBAJP;AAKA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AACA,SAASF,KAAK,IAAIG,gBAAlB,QAA0C,yBAA1C;AACA,SAASH,KAAK,IAAII,gBAAlB,QAA0C,wBAA1C;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,aAArC;AACA,SAASC,gBAAT,QAAiC,kBAAjC;AACA,SACCC,sCADD,EAECC,mCAFD,EAGCC,oCAHD,QAIO,wBAJP;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,WAAW,GACvB,CAAEC,IAAF,EAAQC,KAAR,EAAeC,QAAf,KACA,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAoB;AACnBA,EAAAA,QAAQ,CAACC,gBAAT,CAA2BJ,IAA3B,EADmB,CAEnB;;AACA,QAAMK,SAAS,GAAGL,IAAI,CAACM,MAAL,KAAgB,YAAlC;;AACA,MAAKD,SAAS,IAAIH,QAAlB,EAA6B;AAC5B;AACA;AACA;AACA,QAAIK,OAAJ;;AACA,QAAK,aAAaN,KAAlB,EAA0B;AACzBM,MAAAA,OAAO,GAAGN,KAAK,CAACM,OAAhB;AACA,KAFD,MAEO;AACNA,MAAAA,OAAO,GAAGP,IAAI,CAACO,OAAL,CAAaC,GAAvB;AACA;;AACD,QAAIC,MAAM,GAAGvB,KAAK,CAAEqB,OAAF,CAAlB;AACA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AAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;AACA,OAAO,MAAMoB,kBAAkB,GAAGpB,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;AACA,OAAO,MAAMqB,mBAAmB,GAAGrB,oBAAoB,CACtD,qBADsD,CAAhD;AAIP;AACA;AACA;;AACA,OAAO,MAAMsB,mBAAmB,GAAGtB,oBAAoB,CACtD,qBADsD,CAAhD;AAIP;AACA;AACA;;AACA,OAAO,MAAMuB,WAAW,GAAGvB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;AACA,OAAO,MAAMwB,YAAY,GAAGxB,oBAAoB,CAAE,cAAF,CAAzC;AAEP;AACA;AACA;;AACA,OAAO,MAAMyB,WAAW,GAAGzB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;AACA,OAAO,MAAM0B,eAAe,GAAG1B,oBAAoB,CAAE,iBAAF,CAA5C;AAEP;AACA;AACA;;AACA,OAAO,MAAM2B,WAAW,GAAG3B,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;AACA,OAAO,MAAM4B,UAAU,GAAG5B,oBAAoB,CAAE,YAAF,CAAvC;AAEP;AACA;AACA;;AACA,OAAO,MAAM6B,kBAAkB,GAAG7B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;AACA,OAAO,MAAM8B,iBAAiB,GAAG9B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;AACA,OAAO,MAAM+B,kBAAkB,GAAG/B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;AACA,OAAO,MAAMgC,uBAAuB,GAAGhC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tparse,\n\tsynchronizeBlocksWithTemplate,\n\t__unstableSerializeAndClean,\n} from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { TRASH_POST_NOTICE_ID } from './constants';\nimport { localAutosaveSet } from './local-autosave';\nimport {\n\tgetNotificationArgumentsForSaveSuccess,\n\tgetNotificationArgumentsForSaveFail,\n\tgetNotificationArgumentsForTrashFail,\n} from './utils/notice-builder';\n\n/**\n * Returns an action generator used in signalling that editor has initialized with\n * the specified post object and editor settings.\n *\n * @param {Object} post Post object.\n * @param {Object} edits Initial edited attributes object.\n * @param {Array?} template Block Template.\n */\nexport const setupEditor =\n\t( post, edits, template ) =>\n\t( { dispatch } ) => {\n\t\tdispatch.setupEditorState( post );\n\t\t// Apply a template for new posts only, if exists.\n\t\tconst isNewPost = post.status === 'auto-draft';\n\t\tif ( isNewPost && template ) {\n\t\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t\t// included as part of editor setup action. Assume edited content as\n\t\t\t// canonical if provided, falling back to post.\n\t\t\tlet content;\n\t\t\tif ( 'content' in edits ) {\n\t\t\t\tcontent = edits.content;\n\t\t\t} else {\n\t\t\t\tcontent = post.content.raw;\n\t\t\t}\n\t\t\tlet blocks = parse( content );\n\t\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\t\tdispatch.resetEditorBlocks( blocks, {\n\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t} );\n\t\t}\n\t\tif (\n\t\t\tedits &&\n\t\t\tObject.values( edits ).some(\n\t\t\t\t( [ key, edit ] ) =>\n\t\t\t\t\tedit !== ( post[ key ]?.raw ?? post[ key ] )\n\t\t\t)\n\t\t) {\n\t\t\tdispatch.editPost( edits );\n\t\t}\n\t};\n\n/**\n * Returns an action object signalling that the editor is being destroyed and\n * that any necessary state or side-effect cleanup should occur.\n *\n * @return {Object} Action object.\n */\nexport function __experimentalTearDownEditor() {\n\treturn { type: 'TEAR_DOWN_EDITOR' };\n}\n\n/**\n * Returns an action object used in signalling that the latest version of the\n * post has been received, either by initialization or save.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function resetPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).resetPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Initialize the editor with the setupEditorState action',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Returns an action object used in signalling that a patch of updates for the\n * latest version of the post have been received.\n *\n * @return {Object} Action object.\n * @deprecated since Gutenberg 9.7.0.\n */\nexport function updatePost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).updatePost\", {\n\t\tsince: '5.7',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn {\n\t\ttype: 'DO_NOTHING',\n\t};\n}\n\n/**\n * Returns an action object used to setup the editor state when first opening\n * an editor.\n *\n * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function setupEditorState( post ) {\n\treturn {\n\t\ttype: 'SETUP_EDITOR_STATE',\n\t\tpost,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that attributes of the post have\n * been edited.\n *\n * @param {Object} edits Post attributes to edit.\n * @param {Object} options Options for the edit.\n */\nexport const editPost =\n\t( edits, options ) =>\n\t( { select, registry } ) => {\n\t\tconst { id, type } = select.getCurrentPost();\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord( 'postType', type, id, edits, options );\n\t};\n\n/**\n * Action for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport const savePost =\n\t( options = {} ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tif ( ! select.isEditedPostSaveable() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst content = select.getEditedPostContent();\n\n\t\tif ( ! options.isAutosave ) {\n\t\t\tdispatch.editPost( { content }, { undoIgnore: true } );\n\t\t}\n\n\t\tconst previousRecord = select.getCurrentPost();\n\t\tconst edits = {\n\t\t\tid: previousRecord.id,\n\t\t\t...registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityRecordNonTransientEdits(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpreviousRecord.type,\n\t\t\t\t\tpreviousRecord.id\n\t\t\t\t),\n\t\t\tcontent,\n\t\t};\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_START', options } );\n\t\tawait registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tedits,\n\t\t\t\toptions\n\t\t\t);\n\t\tdispatch( { type: 'REQUEST_POST_UPDATE_FINISH', options } );\n\n\t\tconst error = registry\n\t\t\t.select( coreStore )\n\t\t\t.getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\tpreviousRecord.type,\n\t\t\t\tpreviousRecord.id\n\t\t\t);\n\t\tif ( error ) {\n\t\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\t\tpost: previousRecord,\n\t\t\t\tedits,\n\t\t\t\terror,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( ...args );\n\t\t\t}\n\t\t} else {\n\t\t\tconst updatedRecord = select.getCurrentPost();\n\t\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\t\tpreviousPost: previousRecord,\n\t\t\t\tpost: updatedRecord,\n\t\t\t\tpostType: await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getPostType( updatedRecord.type ),\n\t\t\t\toptions,\n\t\t\t} );\n\t\t\tif ( args.length ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( ...args );\n\t\t\t}\n\t\t\t// Make sure that any edits after saving create an undo level and are\n\t\t\t// considered for change detection.\n\t\t\tif ( ! options.isAutosave ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t}\n\t};\n\n/**\n * Action for refreshing the current post.\n *\n * @deprecated Since WordPress 6.0.\n */\nexport function refreshPost() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).refreshPost\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action for trashing the current post in the editor.\n */\nexport const trashPost =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postTypeSlug = select.getCurrentPostType();\n\t\tconst postType = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postTypeSlug );\n\t\tregistry.dispatch( noticesStore ).removeNotice( TRASH_POST_NOTICE_ID );\n\t\tconst { rest_base: restBase, rest_namespace: restNamespace = 'wp/v2' } =\n\t\t\tpostType;\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_START' } );\n\t\ttry {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: `/${ restNamespace }/${ restBase }/${ post.id }`,\n\t\t\t\tmethod: 'DELETE',\n\t\t\t} );\n\n\t\t\tawait dispatch.savePost();\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t\t\t);\n\t\t}\n\t\tdispatch( { type: 'REQUEST_POST_DELETE_FINISH' } );\n\t};\n\n/**\n * Action that autosaves the current post. This\n * includes server-side autosaving (default) and client-side (a.k.a. local)\n * autosaving (e.g. on the Web, the post might be committed to Session\n * Storage).\n *\n * @param {Object?} options Extra flags to identify the autosave.\n */\nexport const autosave =\n\t( { local = false, ...options } = {} ) =>\n\tasync ( { select, dispatch } ) => {\n\t\tif ( local ) {\n\t\t\tconst post = select.getCurrentPost();\n\t\t\tconst isPostNew = select.isEditedPostNew();\n\t\t\tconst title = select.getEditedPostAttribute( 'title' );\n\t\t\tconst content = select.getEditedPostAttribute( 'content' );\n\t\t\tconst excerpt = select.getEditedPostAttribute( 'excerpt' );\n\t\t\tlocalAutosaveSet( post.id, isPostNew, title, content, excerpt );\n\t\t} else {\n\t\t\tawait dispatch.savePost( { isAutosave: true, ...options } );\n\t\t}\n\t};\n\n/**\n * Action that restores last popped state in undo history.\n */\nexport const redo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).redo();\n\t};\n\n/**\n * Action that pops a record from undo history and undoes the edit.\n */\nexport const undo =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry.dispatch( coreStore ).undo();\n\t};\n\n/**\n * Action that creates an undo history record.\n *\n * @deprecated Since WordPress 6.0\n */\nexport function createUndoLevel() {\n\tdeprecated( \"wp.data.dispatch( 'core/editor' ).createUndoLevel\", {\n\t\tsince: '6.0',\n\t\tversion: '6.3',\n\t\talternative: 'Use the core entities store instead',\n\t} );\n\treturn { type: 'DO_NOTHING' };\n}\n\n/**\n * Action that locks the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n * @return {Object} Action object.\n */\nexport function updatePostLock( lock ) {\n\treturn {\n\t\ttype: 'UPDATE_POST_LOCK',\n\t\tlock,\n\t};\n}\n\n/**\n * Enable the publish sidebar.\n */\nexport const enablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', true );\n\t};\n\n/**\n * Disables the publish sidebar.\n */\nexport const disablePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core/edit-post', 'isPublishSidebarEnabled', false );\n\t};\n\n/**\n * Action that locks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * const { subscribe } = wp.data;\n *\n * const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n *\n * // Only allow publishing posts that are set to a future date.\n * if ( 'publish' !== initialPostStatus ) {\n *\n * \t// Track locking.\n * \tlet locked = false;\n *\n * \t// Watch for the publish event.\n * \tlet unssubscribe = subscribe( () => {\n * \t\tconst currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );\n * \t\tif ( 'publish' !== currentPostStatus ) {\n *\n * \t\t\t// Compare the post date to the current date, lock the post if the date isn't in the future.\n * \t\t\tconst postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );\n * \t\t\tconst currentDate = new Date();\n * \t\t\tif ( postDate.getTime() <= currentDate.getTime() ) {\n * \t\t\t\tif ( ! locked ) {\n * \t\t\t\t\tlocked = true;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t} else {\n * \t\t\t\tif ( locked ) {\n * \t\t\t\t\tlocked = false;\n * \t\t\t\t\twp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );\n * \t\t\t\t}\n * \t\t\t}\n * \t\t}\n * \t} );\n * }\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post saving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostSaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_SAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that locks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Lock post autosaving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function lockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'LOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Action that unlocks post autosaving.\n *\n * @param {string} lockName The lock name.\n *\n * @example\n * ```\n * // Unlock post saving with the lock key `mylock`:\n * wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );\n * ```\n *\n * @return {Object} Action object\n */\nexport function unlockPostAutosaving( lockName ) {\n\treturn {\n\t\ttype: 'UNLOCK_POST_AUTOSAVING',\n\t\tlockName,\n\t};\n}\n\n/**\n * Returns an action object used to signal that the blocks have been updated.\n *\n * @param {Array} blocks Block Array.\n * @param {?Object} options Optional options.\n */\nexport const resetEditorBlocks =\n\t( blocks, options = {} ) =>\n\t( { select, dispatch, registry } ) => {\n\t\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\t\tconst edits = { blocks, selection };\n\n\t\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\t\tconst { id, type } = select.getCurrentPost();\n\t\t\tconst noChange =\n\t\t\t\tregistry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.getEditedEntityRecord( 'postType', type, id ).blocks ===\n\t\t\t\tedits.blocks;\n\t\t\tif ( noChange ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__unstableCreateUndoLevel( 'postType', type, id );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// We create a new function here on every persistent edit\n\t\t\t// to make sure the edit makes the post dirty and creates\n\t\t\t// a new undo level.\n\t\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t\t}\n\n\t\tdispatch.editPost( edits );\n\t};\n\n/*\n * Returns an action object used in signalling that the post editor settings have been updated.\n *\n * @param {Object} settings Updated settings\n *\n * @return {Object} Action object\n */\nexport function updateEditorSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_EDITOR_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Backward compatibility\n */\n\nconst getBlockEditorAction =\n\t( name ) =>\n\t( ...args ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"`wp.data.dispatch( 'core/editor' ).\" + name + '`', {\n\t\t\tsince: '5.3',\n\t\t\talternative:\n\t\t\t\t\"`wp.data.dispatch( 'core/block-editor' ).\" + name + '`',\n\t\t\tversion: '6.2',\n\t\t} );\n\t\tregistry.dispatch( blockEditorStore )[ name ]( ...args );\n\t};\n\n/**\n * @see resetBlocks in core/block-editor store.\n */\nexport const resetBlocks = getBlockEditorAction( 'resetBlocks' );\n\n/**\n * @see receiveBlocks in core/block-editor store.\n */\nexport const receiveBlocks = getBlockEditorAction( 'receiveBlocks' );\n\n/**\n * @see updateBlock in core/block-editor store.\n */\nexport const updateBlock = getBlockEditorAction( 'updateBlock' );\n\n/**\n * @see updateBlockAttributes in core/block-editor store.\n */\nexport const updateBlockAttributes = getBlockEditorAction(\n\t'updateBlockAttributes'\n);\n\n/**\n * @see selectBlock in core/block-editor store.\n */\nexport const selectBlock = getBlockEditorAction( 'selectBlock' );\n\n/**\n * @see startMultiSelect in core/block-editor store.\n */\nexport const startMultiSelect = getBlockEditorAction( 'startMultiSelect' );\n\n/**\n * @see stopMultiSelect in core/block-editor store.\n */\nexport const stopMultiSelect = getBlockEditorAction( 'stopMultiSelect' );\n\n/**\n * @see multiSelect in core/block-editor store.\n */\nexport const multiSelect = getBlockEditorAction( 'multiSelect' );\n\n/**\n * @see clearSelectedBlock in core/block-editor store.\n */\nexport const clearSelectedBlock = getBlockEditorAction( 'clearSelectedBlock' );\n\n/**\n * @see toggleSelection in core/block-editor store.\n */\nexport const toggleSelection = getBlockEditorAction( 'toggleSelection' );\n\n/**\n * @see replaceBlocks in core/block-editor store.\n */\nexport const replaceBlocks = getBlockEditorAction( 'replaceBlocks' );\n\n/**\n * @see replaceBlock in core/block-editor store.\n */\nexport const replaceBlock = getBlockEditorAction( 'replaceBlock' );\n\n/**\n * @see moveBlocksDown in core/block-editor store.\n */\nexport const moveBlocksDown = getBlockEditorAction( 'moveBlocksDown' );\n\n/**\n * @see moveBlocksUp in core/block-editor store.\n */\nexport const moveBlocksUp = getBlockEditorAction( 'moveBlocksUp' );\n\n/**\n * @see moveBlockToPosition in core/block-editor store.\n */\nexport const moveBlockToPosition = getBlockEditorAction(\n\t'moveBlockToPosition'\n);\n\n/**\n * @see insertBlock in core/block-editor store.\n */\nexport const insertBlock = getBlockEditorAction( 'insertBlock' );\n\n/**\n * @see insertBlocks in core/block-editor store.\n */\nexport const insertBlocks = getBlockEditorAction( 'insertBlocks' );\n\n/**\n * @see showInsertionPoint in core/block-editor store.\n */\nexport const showInsertionPoint = getBlockEditorAction( 'showInsertionPoint' );\n\n/**\n * @see hideInsertionPoint in core/block-editor store.\n */\nexport const hideInsertionPoint = getBlockEditorAction( 'hideInsertionPoint' );\n\n/**\n * @see setTemplateValidity in core/block-editor store.\n */\nexport const setTemplateValidity = getBlockEditorAction(\n\t'setTemplateValidity'\n);\n\n/**\n * @see synchronizeTemplate in core/block-editor store.\n */\nexport const synchronizeTemplate = getBlockEditorAction(\n\t'synchronizeTemplate'\n);\n\n/**\n * @see mergeBlocks in core/block-editor store.\n */\nexport const mergeBlocks = getBlockEditorAction( 'mergeBlocks' );\n\n/**\n * @see removeBlocks in core/block-editor store.\n */\nexport const removeBlocks = getBlockEditorAction( 'removeBlocks' );\n\n/**\n * @see removeBlock in core/block-editor store.\n */\nexport const removeBlock = getBlockEditorAction( 'removeBlock' );\n\n/**\n * @see toggleBlockMode in core/block-editor store.\n */\nexport const toggleBlockMode = getBlockEditorAction( 'toggleBlockMode' );\n\n/**\n * @see startTyping in core/block-editor store.\n */\nexport const startTyping = getBlockEditorAction( 'startTyping' );\n\n/**\n * @see stopTyping in core/block-editor store.\n */\nexport const stopTyping = getBlockEditorAction( 'stopTyping' );\n\n/**\n * @see enterFormattedText in core/block-editor store.\n */\nexport const enterFormattedText = getBlockEditorAction( 'enterFormattedText' );\n\n/**\n * @see exitFormattedText in core/block-editor store.\n */\nexport const exitFormattedText = getBlockEditorAction( 'exitFormattedText' );\n\n/**\n * @see insertDefaultBlock in core/block-editor store.\n */\nexport const insertDefaultBlock = getBlockEditorAction( 'insertDefaultBlock' );\n\n/**\n * @see updateBlockListSettings in core/block-editor store.\n */\nexport const updateBlockListSettings = getBlockEditorAction(\n\t'updateBlockListSettings'\n);\n"]}
@@ -11,8 +11,7 @@ export * from './actions.js';
11
11
  * @return {Object} Action object.
12
12
  */
13
13
 
14
- export function togglePostTitleSelection() {
15
- let isSelected = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
14
+ export function togglePostTitleSelection(isSelected = true) {
16
15
  return {
17
16
  type: 'TOGGLE_POST_TITLE_SELECTION',
18
17
  isSelected
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/actions.native.js"],"names":["RNReactNativeGutenbergBridge","togglePostTitleSelection","isSelected","type","autosave","editorDidAutosave"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,4BAAP,MAAyC,gCAAzC;AAEA,cAAc,cAAd;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,wBAAT,GAAuD;AAAA,MAApBC,UAAoB,uEAAP,IAAO;AAC7D,SAAO;AACNC,IAAAA,IAAI,EAAE,6BADA;AAEND,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;;AACA,OAAO,MAAME,QAAQ,GAAG,MAAM,MAAM;AACnCJ,EAAAA,4BAA4B,CAACK,iBAA7B;AACA,CAFM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge from '@wordpress/react-native-bridge';\n\nexport * from './actions.js';\n\n/**\n * Returns an action object that enables or disables post title selection.\n *\n * @param {boolean} [isSelected=true] Whether post title is currently selected.\n *\n * @return {Object} Action object.\n */\nexport function togglePostTitleSelection( isSelected = true ) {\n\treturn {\n\t\ttype: 'TOGGLE_POST_TITLE_SELECTION',\n\t\tisSelected,\n\t};\n}\n\n/**\n * Action that autosaves the post.\n */\nexport const autosave = () => () => {\n\tRNReactNativeGutenbergBridge.editorDidAutosave();\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/actions.native.js"],"names":["RNReactNativeGutenbergBridge","togglePostTitleSelection","isSelected","type","autosave","editorDidAutosave"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,4BAAP,MAAyC,gCAAzC;AAEA,cAAc,cAAd;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,wBAAT,CAAmCC,UAAU,GAAG,IAAhD,EAAuD;AAC7D,SAAO;AACNC,IAAAA,IAAI,EAAE,6BADA;AAEND,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;;AACA,OAAO,MAAME,QAAQ,GAAG,MAAM,MAAM;AACnCJ,EAAAA,4BAA4B,CAACK,iBAA7B;AACA,CAFM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge from '@wordpress/react-native-bridge';\n\nexport * from './actions.js';\n\n/**\n * Returns an action object that enables or disables post title selection.\n *\n * @param {boolean} [isSelected=true] Whether post title is currently selected.\n *\n * @return {Object} Action object.\n */\nexport function togglePostTitleSelection( isSelected = true ) {\n\treturn {\n\t\ttype: 'TOGGLE_POST_TITLE_SELECTION',\n\t\tisSelected,\n\t};\n}\n\n/**\n * Action that autosaves the post.\n */\nexport const autosave = () => () => {\n\tRNReactNativeGutenbergBridge.editorDidAutosave();\n};\n"]}