@wordpress/editor 13.11.0 → 13.12.1

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 (416) hide show
  1. package/CHANGELOG.md +2 -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 +7 -9
  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 +6 -9
  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 +20 -27
  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-history/redo.js +2 -6
  25. package/build/components/editor-history/redo.js.map +1 -1
  26. package/build/components/editor-history/undo.js +2 -6
  27. package/build/components/editor-history/undo.js.map +1 -1
  28. package/build/components/editor-notices/index.js +12 -19
  29. package/build/components/editor-notices/index.js.map +1 -1
  30. package/build/components/editor-snackbars/index.js +3 -6
  31. package/build/components/editor-snackbars/index.js.map +1 -1
  32. package/build/components/entities-saved-states/entity-record-item.js +7 -10
  33. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  34. package/build/components/entities-saved-states/entity-type-list.js +6 -7
  35. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  36. package/build/components/entities-saved-states/hooks/use-is-dirty.js +86 -0
  37. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
  38. package/build/components/entities-saved-states/index.js +43 -116
  39. package/build/components/entities-saved-states/index.js.map +1 -1
  40. package/build/components/error-boundary/index.js +4 -5
  41. package/build/components/error-boundary/index.js.map +1 -1
  42. package/build/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
  43. package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  44. package/build/components/index.js +18 -0
  45. package/build/components/index.js.map +1 -1
  46. package/build/components/media-categories/index.js +25 -42
  47. package/build/components/media-categories/index.js.map +1 -1
  48. package/build/components/page-attributes/check.js +4 -7
  49. package/build/components/page-attributes/check.js.map +1 -1
  50. package/build/components/page-attributes/order.js +7 -9
  51. package/build/components/page-attributes/order.js.map +1 -1
  52. package/build/components/page-attributes/parent.js +5 -12
  53. package/build/components/page-attributes/parent.js.map +1 -1
  54. package/build/components/post-author/check.js +6 -7
  55. package/build/components/post-author/check.js.map +1 -1
  56. package/build/components/post-author/combobox.js +3 -6
  57. package/build/components/post-author/combobox.js.map +1 -1
  58. package/build/components/post-author/index.js +1 -1
  59. package/build/components/post-author/index.js.map +1 -1
  60. package/build/components/post-comments/index.js +4 -6
  61. package/build/components/post-comments/index.js.map +1 -1
  62. package/build/components/post-excerpt/check.js +2 -4
  63. package/build/components/post-excerpt/check.js.map +1 -1
  64. package/build/components/post-excerpt/index.js +4 -5
  65. package/build/components/post-excerpt/index.js.map +1 -1
  66. package/build/components/post-featured-image/check.js +2 -4
  67. package/build/components/post-featured-image/check.js.map +1 -1
  68. package/build/components/post-featured-image/index.js +56 -69
  69. package/build/components/post-featured-image/index.js.map +1 -1
  70. package/build/components/post-format/check.js +6 -9
  71. package/build/components/post-format/check.js.map +1 -1
  72. package/build/components/post-format/index.js +1 -1
  73. package/build/components/post-format/index.js.map +1 -1
  74. package/build/components/post-last-revision/check.js +5 -7
  75. package/build/components/post-last-revision/check.js.map +1 -1
  76. package/build/components/post-last-revision/index.js +4 -5
  77. package/build/components/post-last-revision/index.js.map +1 -1
  78. package/build/components/post-locked-modal/index.js +1 -1
  79. package/build/components/post-locked-modal/index.js.map +1 -1
  80. package/build/components/post-pending-status/check.js +7 -9
  81. package/build/components/post-pending-status/check.js.map +1 -1
  82. package/build/components/post-pending-status/index.js +4 -6
  83. package/build/components/post-pending-status/index.js.map +1 -1
  84. package/build/components/post-pingbacks/index.js +4 -6
  85. package/build/components/post-pingbacks/index.js.map +1 -1
  86. package/build/components/post-preview-button/index.js +8 -12
  87. package/build/components/post-preview-button/index.js.map +1 -1
  88. package/build/components/post-publish-button/index.js +10 -19
  89. package/build/components/post-publish-button/index.js.map +1 -1
  90. package/build/components/post-publish-button/label.js +14 -17
  91. package/build/components/post-publish-button/label.js.map +1 -1
  92. package/build/components/post-publish-panel/index.js +10 -12
  93. package/build/components/post-publish-panel/index.js.map +1 -1
  94. package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
  95. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  96. package/build/components/post-publish-panel/maybe-post-format-panel.js +9 -12
  97. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  98. package/build/components/post-publish-panel/maybe-tags-panel.js +4 -7
  99. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  100. package/build/components/post-publish-panel/maybe-upload-media.js +150 -0
  101. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -0
  102. package/build/components/post-publish-panel/postpublish.js +8 -11
  103. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  104. package/build/components/post-publish-panel/prepublish.js +8 -7
  105. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  106. package/build/components/post-saved-state/index.js +13 -8
  107. package/build/components/post-saved-state/index.js.map +1 -1
  108. package/build/components/post-schedule/check.js +6 -8
  109. package/build/components/post-schedule/check.js.map +1 -1
  110. package/build/components/post-schedule/index.js +8 -12
  111. package/build/components/post-schedule/index.js.map +1 -1
  112. package/build/components/post-schedule/label.js +7 -10
  113. package/build/components/post-schedule/label.js.map +1 -1
  114. package/build/components/post-slug/check.js +3 -4
  115. package/build/components/post-slug/check.js.map +1 -1
  116. package/build/components/post-slug/index.js +5 -6
  117. package/build/components/post-slug/index.js.map +1 -1
  118. package/build/components/post-sticky/check.js +7 -9
  119. package/build/components/post-sticky/check.js.map +1 -1
  120. package/build/components/post-sticky/index.js +4 -5
  121. package/build/components/post-sticky/index.js.map +1 -1
  122. package/build/components/post-switch-to-draft-button/index.js +6 -7
  123. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  124. package/build/components/post-sync-status/index.js +67 -0
  125. package/build/components/post-sync-status/index.js.map +1 -0
  126. package/build/components/post-taxonomies/check.js +6 -7
  127. package/build/components/post-taxonomies/check.js.map +1 -1
  128. package/build/components/post-taxonomies/flat-term-selector.js +36 -46
  129. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  130. package/build/components/post-taxonomies/hierarchical-term-selector.js +13 -14
  131. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  132. package/build/components/post-taxonomies/index.js +6 -11
  133. package/build/components/post-taxonomies/index.js.map +1 -1
  134. package/build/components/post-taxonomies/most-used-terms.js +5 -6
  135. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  136. package/build/components/post-template/index.js +6 -9
  137. package/build/components/post-template/index.js.map +1 -1
  138. package/build/components/post-title/index.js +8 -5
  139. package/build/components/post-title/index.js.map +1 -1
  140. package/build/components/post-title/index.native.js +8 -11
  141. package/build/components/post-title/index.native.js.map +1 -1
  142. package/build/components/post-trash/check.js +7 -9
  143. package/build/components/post-trash/check.js.map +1 -1
  144. package/build/components/post-type-support-check/index.js +5 -6
  145. package/build/components/post-type-support-check/index.js.map +1 -1
  146. package/build/components/post-url/check.js +4 -5
  147. package/build/components/post-url/check.js.map +1 -1
  148. package/build/components/post-url/index.js +8 -9
  149. package/build/components/post-url/index.js.map +1 -1
  150. package/build/components/post-visibility/check.js +6 -7
  151. package/build/components/post-visibility/check.js.map +1 -1
  152. package/build/components/post-visibility/index.js +14 -19
  153. package/build/components/post-visibility/index.js.map +1 -1
  154. package/build/components/post-visibility/label.js +1 -3
  155. package/build/components/post-visibility/label.js.map +1 -1
  156. package/build/components/provider/index.js +12 -15
  157. package/build/components/provider/index.js.map +1 -1
  158. package/build/components/provider/index.native.js +19 -30
  159. package/build/components/provider/index.native.js.map +1 -1
  160. package/build/components/provider/use-block-editor-settings.js +5 -9
  161. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  162. package/build/components/provider/use-block-editor-settings.native.js +1 -3
  163. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  164. package/build/components/provider/with-registry-provider.js +4 -2
  165. package/build/components/provider/with-registry-provider.js.map +1 -1
  166. package/build/components/table-of-contents/index.js +26 -35
  167. package/build/components/table-of-contents/index.js.map +1 -1
  168. package/build/components/table-of-contents/panel.js +4 -5
  169. package/build/components/table-of-contents/panel.js.map +1 -1
  170. package/build/components/template-validation-notice/index.js +4 -6
  171. package/build/components/template-validation-notice/index.js.map +1 -1
  172. package/build/components/theme-support-check/index.js +7 -8
  173. package/build/components/theme-support-check/index.js.map +1 -1
  174. package/build/hooks/custom-sources-backwards-compatibility.js +20 -42
  175. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  176. package/build/hooks/default-autocompleters.js +1 -2
  177. package/build/hooks/default-autocompleters.js.map +1 -1
  178. package/build/{lockUnlock.js → lock-unlock.js} +1 -1
  179. package/build/lock-unlock.js.map +1 -0
  180. package/build/private-apis.js +5 -2
  181. package/build/private-apis.js.map +1 -1
  182. package/build/store/actions.js +147 -179
  183. package/build/store/actions.js.map +1 -1
  184. package/build/store/actions.native.js +1 -2
  185. package/build/store/actions.native.js.map +1 -1
  186. package/build/store/reducer.js +14 -44
  187. package/build/store/reducer.js.map +1 -1
  188. package/build/store/reducer.native.js +3 -12
  189. package/build/store/reducer.native.js.map +1 -1
  190. package/build/store/selectors.js +23 -54
  191. package/build/store/selectors.js.map +1 -1
  192. package/build/store/utils/notice-builder.js +3 -3
  193. package/build/store/utils/notice-builder.js.map +1 -1
  194. package/build/utils/media-upload/index.js +11 -15
  195. package/build/utils/media-upload/index.js.map +1 -1
  196. package/build/utils/terms.js +3 -6
  197. package/build/utils/terms.js.map +1 -1
  198. package/build-module/components/autosave-monitor/index.js +1 -2
  199. package/build-module/components/autosave-monitor/index.js.map +1 -1
  200. package/build-module/components/deprecated.js +7 -8
  201. package/build-module/components/deprecated.js.map +1 -1
  202. package/build-module/components/document-outline/check.js +4 -5
  203. package/build-module/components/document-outline/check.js.map +1 -1
  204. package/build-module/components/document-outline/index.js +12 -16
  205. package/build-module/components/document-outline/index.js.map +1 -1
  206. package/build-module/components/document-outline/item.js +22 -25
  207. package/build-module/components/document-outline/item.js.map +1 -1
  208. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +6 -8
  209. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  210. package/build-module/components/editor-help/help-get-support-button.native.js +4 -5
  211. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  212. package/build-module/components/editor-help/help-section-title.native.js +3 -4
  213. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  214. package/build-module/components/editor-help/help-topic-row.native.js +6 -7
  215. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  216. package/build-module/components/editor-help/index.native.js +20 -25
  217. package/build-module/components/editor-help/index.native.js.map +1 -1
  218. package/build-module/components/editor-help/view-sections.native.js +16 -20
  219. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  220. package/build-module/components/editor-history/redo.js +2 -3
  221. package/build-module/components/editor-history/redo.js.map +1 -1
  222. package/build-module/components/editor-history/undo.js +2 -3
  223. package/build-module/components/editor-history/undo.js.map +1 -1
  224. package/build-module/components/editor-notices/index.js +12 -19
  225. package/build-module/components/editor-notices/index.js.map +1 -1
  226. package/build-module/components/editor-snackbars/index.js +3 -6
  227. package/build-module/components/editor-snackbars/index.js.map +1 -1
  228. package/build-module/components/entities-saved-states/entity-record-item.js +7 -10
  229. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  230. package/build-module/components/entities-saved-states/entity-type-list.js +6 -7
  231. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  232. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +72 -0
  233. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
  234. package/build-module/components/entities-saved-states/index.js +44 -118
  235. package/build-module/components/entities-saved-states/index.js.map +1 -1
  236. package/build-module/components/error-boundary/index.js +4 -5
  237. package/build-module/components/error-boundary/index.js.map +1 -1
  238. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
  239. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  240. package/build-module/components/index.js +2 -0
  241. package/build-module/components/index.js.map +1 -1
  242. package/build-module/components/media-categories/index.js +25 -42
  243. package/build-module/components/media-categories/index.js.map +1 -1
  244. package/build-module/components/page-attributes/check.js +4 -7
  245. package/build-module/components/page-attributes/check.js.map +1 -1
  246. package/build-module/components/page-attributes/order.js +7 -9
  247. package/build-module/components/page-attributes/order.js.map +1 -1
  248. package/build-module/components/page-attributes/parent.js +5 -12
  249. package/build-module/components/page-attributes/parent.js.map +1 -1
  250. package/build-module/components/post-author/check.js +6 -7
  251. package/build-module/components/post-author/check.js.map +1 -1
  252. package/build-module/components/post-author/combobox.js +3 -6
  253. package/build-module/components/post-author/combobox.js.map +1 -1
  254. package/build-module/components/post-author/index.js +1 -1
  255. package/build-module/components/post-author/index.js.map +1 -1
  256. package/build-module/components/post-comments/index.js +4 -6
  257. package/build-module/components/post-comments/index.js.map +1 -1
  258. package/build-module/components/post-excerpt/check.js +2 -3
  259. package/build-module/components/post-excerpt/check.js.map +1 -1
  260. package/build-module/components/post-excerpt/index.js +4 -5
  261. package/build-module/components/post-excerpt/index.js.map +1 -1
  262. package/build-module/components/post-featured-image/check.js +2 -3
  263. package/build-module/components/post-featured-image/check.js.map +1 -1
  264. package/build-module/components/post-featured-image/index.js +56 -69
  265. package/build-module/components/post-featured-image/index.js.map +1 -1
  266. package/build-module/components/post-format/check.js +6 -8
  267. package/build-module/components/post-format/check.js.map +1 -1
  268. package/build-module/components/post-format/index.js +1 -1
  269. package/build-module/components/post-format/index.js.map +1 -1
  270. package/build-module/components/post-last-revision/check.js +5 -7
  271. package/build-module/components/post-last-revision/check.js.map +1 -1
  272. package/build-module/components/post-last-revision/index.js +4 -5
  273. package/build-module/components/post-last-revision/index.js.map +1 -1
  274. package/build-module/components/post-locked-modal/index.js +1 -1
  275. package/build-module/components/post-locked-modal/index.js.map +1 -1
  276. package/build-module/components/post-pending-status/check.js +7 -9
  277. package/build-module/components/post-pending-status/check.js.map +1 -1
  278. package/build-module/components/post-pending-status/index.js +4 -6
  279. package/build-module/components/post-pending-status/index.js.map +1 -1
  280. package/build-module/components/post-pingbacks/index.js +4 -6
  281. package/build-module/components/post-pingbacks/index.js.map +1 -1
  282. package/build-module/components/post-preview-button/index.js +8 -12
  283. package/build-module/components/post-preview-button/index.js.map +1 -1
  284. package/build-module/components/post-publish-button/index.js +10 -18
  285. package/build-module/components/post-publish-button/index.js.map +1 -1
  286. package/build-module/components/post-publish-button/label.js +14 -17
  287. package/build-module/components/post-publish-button/label.js.map +1 -1
  288. package/build-module/components/post-publish-panel/index.js +10 -11
  289. package/build-module/components/post-publish-panel/index.js.map +1 -1
  290. package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
  291. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  292. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +9 -12
  293. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  294. package/build-module/components/post-publish-panel/maybe-tags-panel.js +4 -7
  295. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  296. package/build-module/components/post-publish-panel/maybe-upload-media.js +138 -0
  297. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -0
  298. package/build-module/components/post-publish-panel/postpublish.js +8 -11
  299. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  300. package/build-module/components/post-publish-panel/prepublish.js +7 -7
  301. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  302. package/build-module/components/post-saved-state/index.js +13 -8
  303. package/build-module/components/post-saved-state/index.js.map +1 -1
  304. package/build-module/components/post-schedule/check.js +6 -8
  305. package/build-module/components/post-schedule/check.js.map +1 -1
  306. package/build-module/components/post-schedule/index.js +8 -12
  307. package/build-module/components/post-schedule/index.js.map +1 -1
  308. package/build-module/components/post-schedule/label.js +7 -10
  309. package/build-module/components/post-schedule/label.js.map +1 -1
  310. package/build-module/components/post-slug/check.js +3 -4
  311. package/build-module/components/post-slug/check.js.map +1 -1
  312. package/build-module/components/post-slug/index.js +5 -6
  313. package/build-module/components/post-slug/index.js.map +1 -1
  314. package/build-module/components/post-sticky/check.js +7 -9
  315. package/build-module/components/post-sticky/check.js.map +1 -1
  316. package/build-module/components/post-sticky/index.js +4 -5
  317. package/build-module/components/post-sticky/index.js.map +1 -1
  318. package/build-module/components/post-switch-to-draft-button/index.js +6 -7
  319. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  320. package/build-module/components/post-sync-status/index.js +56 -0
  321. package/build-module/components/post-sync-status/index.js.map +1 -0
  322. package/build-module/components/post-taxonomies/check.js +6 -7
  323. package/build-module/components/post-taxonomies/check.js.map +1 -1
  324. package/build-module/components/post-taxonomies/flat-term-selector.js +36 -44
  325. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  326. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +13 -14
  327. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  328. package/build-module/components/post-taxonomies/index.js +6 -11
  329. package/build-module/components/post-taxonomies/index.js.map +1 -1
  330. package/build-module/components/post-taxonomies/most-used-terms.js +5 -6
  331. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  332. package/build-module/components/post-template/index.js +6 -9
  333. package/build-module/components/post-template/index.js.map +1 -1
  334. package/build-module/components/post-title/index.js +8 -5
  335. package/build-module/components/post-title/index.js.map +1 -1
  336. package/build-module/components/post-title/index.native.js +8 -11
  337. package/build-module/components/post-title/index.native.js.map +1 -1
  338. package/build-module/components/post-trash/check.js +7 -9
  339. package/build-module/components/post-trash/check.js.map +1 -1
  340. package/build-module/components/post-type-support-check/index.js +5 -6
  341. package/build-module/components/post-type-support-check/index.js.map +1 -1
  342. package/build-module/components/post-url/check.js +4 -5
  343. package/build-module/components/post-url/check.js.map +1 -1
  344. package/build-module/components/post-url/index.js +8 -9
  345. package/build-module/components/post-url/index.js.map +1 -1
  346. package/build-module/components/post-visibility/check.js +6 -7
  347. package/build-module/components/post-visibility/check.js.map +1 -1
  348. package/build-module/components/post-visibility/index.js +14 -16
  349. package/build-module/components/post-visibility/index.js.map +1 -1
  350. package/build-module/components/post-visibility/label.js +1 -3
  351. package/build-module/components/post-visibility/label.js.map +1 -1
  352. package/build-module/components/provider/index.js +12 -14
  353. package/build-module/components/provider/index.js.map +1 -1
  354. package/build-module/components/provider/index.native.js +19 -29
  355. package/build-module/components/provider/index.native.js.map +1 -1
  356. package/build-module/components/provider/use-block-editor-settings.js +5 -9
  357. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  358. package/build-module/components/provider/use-block-editor-settings.native.js +1 -3
  359. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  360. package/build-module/components/provider/with-registry-provider.js +4 -2
  361. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  362. package/build-module/components/table-of-contents/index.js +26 -34
  363. package/build-module/components/table-of-contents/index.js.map +1 -1
  364. package/build-module/components/table-of-contents/panel.js +4 -5
  365. package/build-module/components/table-of-contents/panel.js.map +1 -1
  366. package/build-module/components/template-validation-notice/index.js +4 -6
  367. package/build-module/components/template-validation-notice/index.js.map +1 -1
  368. package/build-module/components/theme-support-check/index.js +7 -8
  369. package/build-module/components/theme-support-check/index.js.map +1 -1
  370. package/build-module/hooks/custom-sources-backwards-compatibility.js +20 -39
  371. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  372. package/build-module/hooks/default-autocompleters.js +1 -2
  373. package/build-module/hooks/default-autocompleters.js.map +1 -1
  374. package/build-module/{lockUnlock.js → lock-unlock.js} +1 -1
  375. package/build-module/lock-unlock.js.map +1 -0
  376. package/build-module/private-apis.js +4 -2
  377. package/build-module/private-apis.js.map +1 -1
  378. package/build-module/store/actions.js +147 -179
  379. package/build-module/store/actions.js.map +1 -1
  380. package/build-module/store/actions.native.js +1 -2
  381. package/build-module/store/actions.native.js.map +1 -1
  382. package/build-module/store/reducer.js +14 -44
  383. package/build-module/store/reducer.js.map +1 -1
  384. package/build-module/store/reducer.native.js +3 -12
  385. package/build-module/store/reducer.native.js.map +1 -1
  386. package/build-module/store/selectors.js +21 -54
  387. package/build-module/store/selectors.js.map +1 -1
  388. package/build-module/store/utils/notice-builder.js +3 -3
  389. package/build-module/store/utils/notice-builder.js.map +1 -1
  390. package/build-module/utils/media-upload/index.js +11 -15
  391. package/build-module/utils/media-upload/index.js.map +1 -1
  392. package/build-module/utils/terms.js +3 -6
  393. package/build-module/utils/terms.js.map +1 -1
  394. package/build-style/style-rtl.css +15 -1
  395. package/build-style/style.css +15 -1
  396. package/package.json +30 -31
  397. package/src/components/editor-help/test/index.native.js +3 -2
  398. package/src/components/entities-saved-states/hooks/use-is-dirty.js +87 -0
  399. package/src/components/entities-saved-states/index.js +25 -106
  400. package/src/components/entities-saved-states/test/use-is-dirty.js +94 -0
  401. package/src/components/index.js +2 -0
  402. package/src/components/post-publish-panel/maybe-upload-media.js +167 -0
  403. package/src/components/post-publish-panel/prepublish.js +2 -0
  404. package/src/components/post-publish-panel/style.scss +1 -1
  405. package/src/components/post-saved-state/index.js +6 -0
  406. package/src/components/post-sync-status/index.js +55 -0
  407. package/src/components/post-sync-status/style.scss +16 -0
  408. package/src/components/post-taxonomies/flat-term-selector.js +20 -30
  409. package/src/components/post-title/index.js +4 -1
  410. package/src/components/provider/index.js +1 -1
  411. package/src/components/provider/index.native.js +2 -9
  412. package/src/private-apis.js +3 -1
  413. package/src/style.scss +1 -0
  414. package/build/lockUnlock.js.map +0 -1
  415. package/build-module/lockUnlock.js.map +0 -1
  416. /package/src/{lockUnlock.js → lock-unlock.js} +0 -0
@@ -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,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,QAAoB;AAAA,MAAlB;AAAEC,IAAAA;AAAF,GAAkB;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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EoD,KAFpD;AAGA,CANK;AAQP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,cAAT,CAAyBC,QAAzB,EAAoC;AAC1C,SAAO;AACN3D,IAAAA,IAAI,EAAE,kBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BD,QAA3B,EAAsC;AAC5C,SAAO;AACN3D,IAAAA,IAAI,EAAE,oBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,kBAAT,CAA6BF,QAA7B,EAAwC;AAC9C,SAAO;AACN3D,IAAAA,IAAI,EAAE,sBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,oBAAT,CAA+BH,QAA/B,EAA0C;AAChD,SAAO;AACN3D,IAAAA,IAAI,EAAE,wBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMpE,iBAAiB,GAC7B,UAAED,MAAF;AAAA,MAAUgB,OAAV,uEAAoB,EAApB;AAAA,SACA,UAAsC;AAAA,QAApC;AAAEC,MAAAA,MAAF;AAAUvB,MAAAA,QAAV;AAAoBwB,MAAAA;AAApB,KAAoC;AACrC,UAAM;AAAEhB,MAAAA,+BAAF;AAAmCuE,MAAAA;AAAnC,QAAiDzD,OAAvD;AACA,UAAMxB,KA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AA9C;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,gBAA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,OAAO,MAAMC,qBAAqB,GACjC,MACA,CAAE;AAAEjD,EAAAA;AAAF,CAAF,KAAoB;AACnBA,EAAAA,QAAQ,CACNxB,QADF,CACYV,gBADZ,EAEEkF,GAFF,CAEO,gBAFP,EAEyB,yBAFzB,EAEoD,KAFpD;AAGA,CANK;AAQP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,cAAT,CAAyBC,QAAzB,EAAoC;AAC1C,SAAO;AACN3D,IAAAA,IAAI,EAAE,kBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BD,QAA3B,EAAsC;AAC5C,SAAO;AACN3D,IAAAA,IAAI,EAAE,oBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,kBAAT,CAA6BF,QAA7B,EAAwC;AAC9C,SAAO;AACN3D,IAAAA,IAAI,EAAE,sBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,oBAAT,CAA+BH,QAA/B,EAA0C;AAChD,SAAO;AACN3D,IAAAA,IAAI,EAAE,wBADA;AAEN2D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMpE,iBAAiB,GAC7B,CAAED,MAAF,EAAUgB,OAAO,GAAG,EAApB,KACA,CAAE;AAAEC,EAAAA,MAAF;AAA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A,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"]}
@@ -74,10 +74,7 @@ export function shouldOverwriteState(action, previousAction) {
74
74
 
75
75
  return isUpdatingSamePostProperty(action, previousAction);
76
76
  }
77
- export function postId() {
78
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
79
- let action = arguments.length > 1 ? arguments[1] : undefined;
80
-
77
+ export function postId(state = null, action) {
81
78
  switch (action.type) {
82
79
  case 'SETUP_EDITOR_STATE':
83
80
  return action.post.id;
@@ -85,10 +82,7 @@ export function postId() {
85
82
 
86
83
  return state;
87
84
  }
88
- export function postType() {
89
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
90
- let action = arguments.length > 1 ? arguments[1] : undefined;
91
-
85
+ export function postType(state = null, action) {
92
86
  switch (action.type) {
93
87
  case 'SETUP_EDITOR_STATE':
94
88
  return action.post.type;
@@ -105,12 +99,9 @@ export function postType() {
105
99
  * @return {boolean} Updated state.
106
100
  */
107
101
 
108
- export function template() {
109
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
110
- isValid: true
111
- };
112
- let action = arguments.length > 1 ? arguments[1] : undefined;
113
-
102
+ export function template(state = {
103
+ isValid: true
104
+ }, action) {
114
105
  switch (action.type) {
115
106
  case 'SET_TEMPLATE_VALIDITY':
116
107
  return { ...state,
@@ -130,10 +121,7 @@ export function template() {
130
121
  * @return {Object} Updated state.
131
122
  */
132
123
 
133
- export function saving() {
134
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
135
- let action = arguments.length > 1 ? arguments[1] : undefined;
136
-
124
+ export function saving(state = {}, action) {
137
125
  switch (action.type) {
138
126
  case 'REQUEST_POST_UPDATE_START':
139
127
  case 'REQUEST_POST_UPDATE_FINISH':
@@ -154,10 +142,7 @@ export function saving() {
154
142
  * @return {Object} Updated state.
155
143
  */
156
144
 
157
- export function deleting() {
158
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
159
- let action = arguments.length > 1 ? arguments[1] : undefined;
160
-
145
+ export function deleting(state = {}, action) {
161
146
  switch (action.type) {
162
147
  case 'REQUEST_POST_DELETE_START':
163
148
  case 'REQUEST_POST_DELETE_FINISH':
@@ -188,12 +173,9 @@ export function deleting() {
188
173
  * @return {PostLockState} Updated state.
189
174
  */
190
175
 
191
- export function postLock() {
192
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
193
- isLocked: false
194
- };
195
- let action = arguments.length > 1 ? arguments[1] : undefined;
196
-
176
+ export function postLock(state = {
177
+ isLocked: false
178
+ }, action) {
197
179
  switch (action.type) {
198
180
  case 'UPDATE_POST_LOCK':
199
181
  return action.lock;
@@ -212,10 +194,7 @@ export function postLock() {
212
194
  * @return {PostLockState} Updated state.
213
195
  */
214
196
 
215
- export function postSavingLock() {
216
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
217
- let action = arguments.length > 1 ? arguments[1] : undefined;
218
-
197
+ export function postSavingLock(state = {}, action) {
219
198
  switch (action.type) {
220
199
  case 'LOCK_POST_SAVING':
221
200
  return { ...state,
@@ -245,10 +224,7 @@ export function postSavingLock() {
245
224
  * @return {PostLockState} Updated state.
246
225
  */
247
226
 
248
- export function postAutosavingLock() {
249
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
250
- let action = arguments.length > 1 ? arguments[1] : undefined;
251
-
227
+ export function postAutosavingLock(state = {}, action) {
252
228
  switch (action.type) {
253
229
  case 'LOCK_POST_AUTOSAVING':
254
230
  return { ...state,
@@ -278,10 +254,7 @@ export function postAutosavingLock() {
278
254
  * @return {boolean} Updated state.
279
255
  */
280
256
 
281
- export function isReady() {
282
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
283
- let action = arguments.length > 1 ? arguments[1] : undefined;
284
-
257
+ export function isReady(state = false, action) {
285
258
  switch (action.type) {
286
259
  case 'SETUP_EDITOR_STATE':
287
260
  return true;
@@ -301,10 +274,7 @@ export function isReady() {
301
274
  * @return {Object} Updated state.
302
275
  */
303
276
 
304
- export function editorSettings() {
305
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : EDITOR_SETTINGS_DEFAULTS;
306
- let action = arguments.length > 1 ? arguments[1] : undefined;
307
-
277
+ export function editorSettings(state = EDITOR_SETTINGS_DEFAULTS, action) {
308
278
  switch (action.type) {
309
279
  case 'UPDATE_EDITOR_SETTINGS':
310
280
  return { ...state,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/reducer.js"],"names":["combineReducers","EDITOR_SETTINGS_DEFAULTS","getPostRawValue","value","raw","hasSameKeys","a","b","keysA","Object","keys","sort","keysB","length","every","key","index","isUpdatingSamePostProperty","action","previousAction","type","edits","shouldOverwriteState","shouldCreateUndoLevel","postId","state","post","id","postType","template","isValid","saving","pending","options","deleting","postLock","isLocked","lock","postSavingLock","lockName","removedLockName","restState","postAutosavingLock","isReady","editorSettings","settings"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;;AACA,SAASC,wBAAT,QAAyC,YAAzC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,eAAT,CAA0BC,KAA1B,EAAkC;AACxC,MAAKA,KAAK,IAAI,aAAa,OAAOA,KAA7B,IAAsC,SAASA,KAApD,EAA4D;AAC3D,WAAOA,KAAK,CAACC,GAAb;AACA;;AAED,SAAOD,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,WAAT,CAAsBC,CAAtB,EAAyBC,CAAzB,EAA6B;AACnC,QAAMC,KAAK,GAAGC,MAAM,CAACC,IAAP,CAAaJ,CAAb,EAAiBK,IAAjB,EAAd;AACA,QAAMC,KAAK,GAAGH,MAAM,CAACC,IAAP,CAAaH,CA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,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASmB,cAAT,GAAoE;AAAA,MAA3CnB,KAA2C,uEAAnCxB,wBAAmC;AAAA,MAATiB,MAAS;;AAC1E,UAASA,MAAM,CAACE,IAAhB;AACC,SAAK,wBAAL;AACC,aAAO,EACN,GAAGK,KADG;AAEN,WAAGP,MAAM,CAAC2B;AAFJ,OAAP;AAFF;;AAQA,SAAOpB,KAAP;AACA;AAED,eAAezB,eAAe,CAAE;AAC/BwB,EAAAA,MAD+B;AAE/BI,EAAAA,QAF+B;AAG/BG,EAAAA,MAH+B;AAI/BG,EAAAA,QAJ+B;AAK/BC,EAAAA,QAL+B;AAM/BN,EAAAA,QAN+B;AAO/BS,EAAAA,cAP+B;AAQ/BK,EAAAA,OAR+B;AAS/BC,EAAAA,cAT+B;AAU/BF,EAAAA;AAV+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { EDITOR_SETTINGS_DEFAULTS } from './defaults';\n\n/**\n * Returns a post attribute value, flattening nested rendered content using its\n * raw value in place of its original object form.\n *\n * @param {*} value Original value.\n *\n * @return {*} Raw value.\n */\nexport function getPostRawValue( value ) {\n\tif ( value && 'object' === typeof value && 'raw' in value ) {\n\t\treturn value.raw;\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns true if the two object arguments have the same keys, or false\n * otherwise.\n *\n * @param {Object} a First object.\n * @param {Object} b Second object.\n *\n * @return {boolean} Whether the two objects have the same keys.\n */\nexport function hasSameKeys( a, b ) {\n\tconst keysA = Object.keys( a ).sort();\n\tconst keysB = Object.keys( b ).sort();\n\treturn (\n\t\tkeysA.length === keysB.length &&\n\t\tkeysA.every( ( key, index ) => keysB[ index ] === key )\n\t);\n}\n\n/**\n * Returns true if, given the currently dispatching action and the previously\n * dispatched action, the two actions are editing the same post property, or\n * false otherwise.\n *\n * @param {Object} action Currently dispatching action.\n * @param {Object} previousAction Previously dispatched action.\n *\n * @return {boolean} Whether actions are updating the same post property.\n */\nexport function isUpdatingSamePostProperty( action, previousAction ) {\n\treturn (\n\t\taction.type === 'EDIT_POST' &&\n\t\thasSameKeys( action.edits, previousAction.edits )\n\t);\n}\n\n/**\n * Returns true if, given the currently dispatching action and the previously\n * dispatched action, the two actions are modifying the same property such that\n * undo history should be batched.\n *\n * @param {Object} action Currently dispatching action.\n * @param {Object} previousAction Previously dispatched action.\n *\n * @return {boolean} Whether to overwrite present state.\n */\nexport function shouldOverwriteState( action, previousAction ) {\n\tif ( action.type === 'RESET_EDITOR_BLOCKS' ) {\n\t\treturn ! action.shouldCreateUndoLevel;\n\t}\n\n\tif ( ! previousAction || action.type !== previousAction.type ) {\n\t\treturn false;\n\t}\n\n\treturn isUpdatingSamePostProperty( action, previousAction );\n}\n\nexport function postId( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\t\treturn action.post.id;\n\t}\n\n\treturn state;\n}\n\nexport function postType( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\t\treturn action.post.type;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning whether the post blocks match the defined template or not.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {boolean} Updated state.\n */\nexport function template( state = { isValid: true }, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_TEMPLATE_VALIDITY':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisValid: action.isValid,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning current network request state (whether a request to\n * the WP REST API is in progress, successful, or failed).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function saving( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_POST_UPDATE_START':\n\t\tcase 'REQUEST_POST_UPDATE_FINISH':\n\t\t\treturn {\n\t\t\t\tpending: action.type === 'REQUEST_POST_UPDATE_START',\n\t\t\t\toptions: action.options || {},\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning deleting post request state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deleting( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_POST_DELETE_START':\n\t\tcase 'REQUEST_POST_DELETE_FINISH':\n\t\t\treturn {\n\t\t\t\tpending: action.type === 'REQUEST_POST_DELETE_START',\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Post Lock State.\n *\n * @typedef {Object} PostLockState\n *\n * @property {boolean} isLocked Whether the post is locked.\n * @property {?boolean} isTakeover Whether the post editing has been taken over.\n * @property {?boolean} activePostLock Active post lock value.\n * @property {?Object} user User that took over the post.\n */\n\n/**\n * Reducer returning the post lock status.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postLock( state = { isLocked: false }, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_POST_LOCK':\n\t\t\treturn action.lock;\n\t}\n\n\treturn state;\n}\n\n/**\n * Post saving lock.\n *\n * When post saving is locked, the post cannot be published or updated.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postSavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_POST_SAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_POST_SAVING': {\n\t\t\tconst { [ action.lockName ]: removedLockName, ...restState } =\n\t\t\t\tstate;\n\t\t\treturn restState;\n\t\t}\n\t}\n\treturn state;\n}\n\n/**\n * Post autosaving lock.\n *\n * When post autosaving is locked, the post will not autosave.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postAutosavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_POST_AUTOSAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_POST_AUTOSAVING': {\n\t\t\tconst { [ action.lockName ]: removedLockName, ...restState } =\n\t\t\t\tstate;\n\t\t\treturn restState;\n\t\t}\n\t}\n\treturn state;\n}\n\n/**\n * Reducer returning whether the editor is ready to be rendered.\n * The editor is considered ready to be rendered once\n * the post object is loaded properly and the initial blocks parsed.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nexport function isReady( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\t\treturn true;\n\n\t\tcase 'TEAR_DOWN_EDITOR':\n\t\t\treturn false;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the post editor setting.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editorSettings( state = EDITOR_SETTINGS_DEFAULTS, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_EDITOR_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpostId,\n\tpostType,\n\tsaving,\n\tdeleting,\n\tpostLock,\n\ttemplate,\n\tpostSavingLock,\n\tisReady,\n\teditorSettings,\n\tpostAutosavingLock,\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/reducer.js"],"names":["combineReducers","EDITOR_SETTINGS_DEFAULTS","getPostRawValue","value","raw","hasSameKeys","a","b","keysA","Object","keys","sort","keysB","length","every","key","index","isUpdatingSamePostProperty","action","previousAction","type","edits","shouldOverwriteState","shouldCreateUndoLevel","postId","state","post","id","postType","template","isValid","saving","pending","options","deleting","postLock","isLocked","lock","postSavingLock","lockName","removedLockName","restState","postAutosavingLock","isReady","editorSettings","settings"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;;AACA,SAASC,wBAAT,QAAyC,YAAzC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,eAAT,CAA0BC,KAA1B,EAAkC;AACxC,MAAKA,KAAK,IAAI,aAAa,OAAOA,KAA7B,IAAsC,SAASA,KAApD,EAA4D;AAC3D,WAAOA,KAAK,CAACC,GAAb;AACA;;AAED,SAAOD,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,WAAT,CAAsBC,CAAtB,EAAyBC,CAAzB,EAA6B;AACnC,QAAMC,KAAK,GAAGC,MAAM,CAACC,IAAP,CAAaJ,CAAb,EAAiBK,IAAjB,EAAd;AACA,QAAMC,KAAK,GAAGH,MAAM,CAACC,IAAP,CAAaH,CAAb,EAAiBI,IAAjB,EAAd;AACA,SACCH,KAAK,CAACK,MAAN,KAAiBD,KAAK,CAACC,MAAvB,IACAL,KAAK,CAACM,KAAN,CAAa,CAAEC,GAAF,EAAOC,KAAP,KAAkBJ,KAAK,CAAEI,KAAF,CAAL,KAAmBD,GAAlD,CAFD;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASE,0BAAT,CAAqCC,MAArC,EAA6CC,cAA7C,EAA8D;AACpE,SACCD,MAAM,CAACE,IAAP,KAAgB,WAAhB,IACAf,WAAW,CAAEa,MAAM,CAACG,KAAT,EAAgBF,cAAc,CAACE,KAA/B,CAFZ;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,oBAAT,CAA+BJ,MAA/B,EAAuCC,cAAvC,EAAwD;AAC9D,MAAKD,MAAM,CAACE,IAAP,KAAgB,qBAArB,EAA6C;AAC5C,WAAO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AK,sBAAL;AACC,aAAO,EAAE,GAAGK,KAAL;AAAY,SAAEP,MAAM,CAACqB,QAAT,GAAqB;AAAjC,OAAP;;AAED,SAAK,wBAAL;AAA+B;AAC9B,cAAM;AAAE,WAAErB,MAAM,CAACqB,QAAT,GAAqBC,eAAvB;AAAwC,aAAGC;AAA3C,YACLhB,KADD;AAEA,eAAOgB,SAAP;AACA;AARF;;AAUA,SAAOhB,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASkB,OAAT,CAAkBlB,KAAK,GAAG,KAA1B,EAAiCP,MAAjC,EAA0C;AAChD,UAASA,MAAM,CAACE,IAAhB;AACC,SAAK,oBAAL;AACC,aAAO,IAAP;;AAED,SAAK,kBAAL;AACC,aAAO,KAAP;AALF;;AAQA,SAAOK,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASmB,cAAT,CAAyBnB,KAAK,GAAGxB,wBAAjC,EAA2DiB,MAA3D,EAAoE;AAC1E,UAASA,MAAM,CAACE,IAAhB;AACC,SAAK,wBAAL;AACC,aAAO,EACN,GAAGK,KADG;AAEN,WAAGP,MAAM,CAAC2B;AAFJ,OAAP;AAFF;;AAQA,SAAOpB,KAAP;AACA;AAED,eAAezB,eAAe,CAAE;AAC/BwB,EAAAA,MAD+B;AAE/BI,EAAAA,QAF+B;AAG/BG,EAAAA,MAH+B;AAI/BG,EAAAA,QAJ+B;AAK/BC,EAAAA,QAL+B;AAM/BN,EAAAA,QAN+B;AAO/BS,EAAAA,cAP+B;AAQ/BK,EAAAA,OAR+B;AAS/BC,EAAAA,cAT+B;AAU/BF,EAAAA;AAV+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { EDITOR_SETTINGS_DEFAULTS } from './defaults';\n\n/**\n * Returns a post attribute value, flattening nested rendered content using its\n * raw value in place of its original object form.\n *\n * @param {*} value Original value.\n *\n * @return {*} Raw value.\n */\nexport function getPostRawValue( value ) {\n\tif ( value && 'object' === typeof value && 'raw' in value ) {\n\t\treturn value.raw;\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns true if the two object arguments have the same keys, or false\n * otherwise.\n *\n * @param {Object} a First object.\n * @param {Object} b Second object.\n *\n * @return {boolean} Whether the two objects have the same keys.\n */\nexport function hasSameKeys( a, b ) {\n\tconst keysA = Object.keys( a ).sort();\n\tconst keysB = Object.keys( b ).sort();\n\treturn (\n\t\tkeysA.length === keysB.length &&\n\t\tkeysA.every( ( key, index ) => keysB[ index ] === key )\n\t);\n}\n\n/**\n * Returns true if, given the currently dispatching action and the previously\n * dispatched action, the two actions are editing the same post property, or\n * false otherwise.\n *\n * @param {Object} action Currently dispatching action.\n * @param {Object} previousAction Previously dispatched action.\n *\n * @return {boolean} Whether actions are updating the same post property.\n */\nexport function isUpdatingSamePostProperty( action, previousAction ) {\n\treturn (\n\t\taction.type === 'EDIT_POST' &&\n\t\thasSameKeys( action.edits, previousAction.edits )\n\t);\n}\n\n/**\n * Returns true if, given the currently dispatching action and the previously\n * dispatched action, the two actions are modifying the same property such that\n * undo history should be batched.\n *\n * @param {Object} action Currently dispatching action.\n * @param {Object} previousAction Previously dispatched action.\n *\n * @return {boolean} Whether to overwrite present state.\n */\nexport function shouldOverwriteState( action, previousAction ) {\n\tif ( action.type === 'RESET_EDITOR_BLOCKS' ) {\n\t\treturn ! action.shouldCreateUndoLevel;\n\t}\n\n\tif ( ! previousAction || action.type !== previousAction.type ) {\n\t\treturn false;\n\t}\n\n\treturn isUpdatingSamePostProperty( action, previousAction );\n}\n\nexport function postId( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\t\treturn action.post.id;\n\t}\n\n\treturn state;\n}\n\nexport function postType( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\t\treturn action.post.type;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning whether the post blocks match the defined template or not.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {boolean} Updated state.\n */\nexport function template( state = { isValid: true }, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_TEMPLATE_VALIDITY':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisValid: action.isValid,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning current network request state (whether a request to\n * the WP REST API is in progress, successful, or failed).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function saving( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_POST_UPDATE_START':\n\t\tcase 'REQUEST_POST_UPDATE_FINISH':\n\t\t\treturn {\n\t\t\t\tpending: action.type === 'REQUEST_POST_UPDATE_START',\n\t\t\t\toptions: action.options || {},\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning deleting post request state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deleting( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_POST_DELETE_START':\n\t\tcase 'REQUEST_POST_DELETE_FINISH':\n\t\t\treturn {\n\t\t\t\tpending: action.type === 'REQUEST_POST_DELETE_START',\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Post Lock State.\n *\n * @typedef {Object} PostLockState\n *\n * @property {boolean} isLocked Whether the post is locked.\n * @property {?boolean} isTakeover Whether the post editing has been taken over.\n * @property {?boolean} activePostLock Active post lock value.\n * @property {?Object} user User that took over the post.\n */\n\n/**\n * Reducer returning the post lock status.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postLock( state = { isLocked: false }, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_POST_LOCK':\n\t\t\treturn action.lock;\n\t}\n\n\treturn state;\n}\n\n/**\n * Post saving lock.\n *\n * When post saving is locked, the post cannot be published or updated.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postSavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_POST_SAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_POST_SAVING': {\n\t\t\tconst { [ action.lockName ]: removedLockName, ...restState } =\n\t\t\t\tstate;\n\t\t\treturn restState;\n\t\t}\n\t}\n\treturn state;\n}\n\n/**\n * Post autosaving lock.\n *\n * When post autosaving is locked, the post will not autosave.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postAutosavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_POST_AUTOSAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_POST_AUTOSAVING': {\n\t\t\tconst { [ action.lockName ]: removedLockName, ...restState } =\n\t\t\t\tstate;\n\t\t\treturn restState;\n\t\t}\n\t}\n\treturn state;\n}\n\n/**\n * Reducer returning whether the editor is ready to be rendered.\n * The editor is considered ready to be rendered once\n * the post object is loaded properly and the initial blocks parsed.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nexport function isReady( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\t\treturn true;\n\n\t\tcase 'TEAR_DOWN_EDITOR':\n\t\t\treturn false;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the post editor setting.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editorSettings( state = EDITOR_SETTINGS_DEFAULTS, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_EDITOR_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpostId,\n\tpostType,\n\tsaving,\n\tdeleting,\n\tpostLock,\n\ttemplate,\n\tpostSavingLock,\n\tisReady,\n\teditorSettings,\n\tpostAutosavingLock,\n} );\n"]}
@@ -21,10 +21,7 @@ export * from './reducer.js';
21
21
  */
22
22
 
23
23
  export const postTitle = combineReducers({
24
- isSelected() {
25
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
26
- let action = arguments.length > 1 ? arguments[1] : undefined;
27
-
24
+ isSelected(state = false, action) {
28
25
  switch (action.type) {
29
26
  case 'TOGGLE_POST_TITLE_SELECTION':
30
27
  return action.isSelected;
@@ -43,10 +40,7 @@ export const postTitle = combineReducers({
43
40
  * @return {Object} Updated state.
44
41
  */
45
42
 
46
- export function clipboard() {
47
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
48
- let action = arguments.length > 1 ? arguments[1] : undefined;
49
-
43
+ export function clipboard(state = null, action) {
50
44
  switch (action.type) {
51
45
  case 'UPDATE_CLIPBOARD':
52
46
  return action.clipboard;
@@ -63,10 +57,7 @@ export function clipboard() {
63
57
  * @return {Object} Updated state.
64
58
  */
65
59
 
66
- export function notices() {
67
- let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
68
- let action = arguments.length > 1 ? arguments[1] : undefined;
69
-
60
+ export function notices(state = [], action) {
70
61
  switch (action.type) {
71
62
  case 'CREATE_NOTICE':
72
63
  return [...state, action.notice];
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/reducer.native.js"],"names":["combineReducers","postId","postType","saving","postLock","postSavingLock","template","isReady","editorSettings","EDITOR_SETTINGS_DEFAULTS","autosaveInterval","postTitle","isSelected","state","action","type","clipboard","notices","notice","filter","id"],"mappings":"AAAA;AACA;AACA;AAC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Aeb,eAAe,CAAE;AAC/BC,EAAAA,MAD+B;AAE/BC,EAAAA,QAF+B;AAG/BS,EAAAA,SAH+B;AAI/BR,EAAAA,MAJ+B;AAK/BC,EAAAA,QAL+B;AAM/BC,EAAAA,cAN+B;AAO/BC,EAAAA,QAP+B;AAQ/BC,EAAAA,OAR+B;AAS/BC,EAAAA,cAT+B;AAU/BQ,EAAAA,SAV+B;AAW/BC,EAAAA;AAX+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tpostId,\n\tpostType,\n\tsaving,\n\tpostLock,\n\tpostSavingLock,\n\ttemplate,\n\tisReady,\n\teditorSettings,\n} from './reducer.js';\n\nimport { EDITOR_SETTINGS_DEFAULTS } from './defaults.js';\n\nEDITOR_SETTINGS_DEFAULTS.autosaveInterval = 1; // This is a way to override default behavior on mobile, and make it ping the native save every second as long as something changed\n\nexport * from './reducer.js';\n\n/**\n * Reducer returning the post title state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const postTitle = combineReducers( {\n\tisSelected( state = false, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'TOGGLE_POST_TITLE_SELECTION':\n\t\t\t\treturn action.isSelected;\n\t\t}\n\n\t\treturn state;\n\t},\n} );\n\n/**\n * Reducer returning the clipboard state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function clipboard( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_CLIPBOARD':\n\t\t\treturn action.clipboard;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the notices state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function notices( state = [], action ) {\n\tswitch ( action.type ) {\n\t\tcase 'CREATE_NOTICE':\n\t\t\treturn [ ...state, action.notice ];\n\t\tcase 'REMOVE_ALL_NOTICES':\n\t\t\treturn [];\n\t\tcase 'REMOVE_NOTICE':\n\t\t\treturn state.filter( ( notice ) => notice.id !== action.id );\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpostId,\n\tpostType,\n\tpostTitle,\n\tsaving,\n\tpostLock,\n\tpostSavingLock,\n\ttemplate,\n\tisReady,\n\teditorSettings,\n\tclipboard,\n\tnotices,\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/reducer.native.js"],"names":["combineReducers","postId","postType","saving","postLock","postSavingLock","template","isReady","editorSettings","EDITOR_SETTINGS_DEFAULTS","autosaveInterval","postTitle","isSelected","state","action","type","clipboard","notices","notice","filter","id"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAT,QAAgC,iBAAhC;AAEA;AACA;AACA;;AACA,SACCC,MADD,EAECC,QAFD,EAGCC,MAHD,EAICC,QAJD,EAKCC,cALD,EAMCC,QAND,EAOCC,OAPD,EAQCC,cARD,QASO,cATP;AAWA,SAASC,wBAAT,QAAyC,eAAzC;AAEAA,wBAAwB,CAACC,gBAAzB,GAA4C,CAA5C,C,CAA+C;;AAE/C,cAAc,cAAd;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,SAAS,GAAGX,eAAe,CAAE;AACzCY,EAAAA,UAAU,CAAEC,KAAK,GAAG,KAAV,EAAiBC,MAAjB,EAA0B;AACnC,YAASA,MAAM,CAACC,IAAhB;AACC,WAAK,6BAAL;AACC,eAAOD,MAAM,CAACF,UAAd;AAFF;;AAKA,WAAOC,KAAP;AACA;;AARwC,CAAF,CAAjC;AAWP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,SAAT,CAAoBH,KAAK,GAAG,IAA5B,EAAkCC,MAAlC,EAA2C;AACjD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,kBAAL;AACC,aAAOD,MAAM,CAACE,SAAd;AAFF;;AAKA,SAAOH,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASI,OAAT,CAAkBJ,KAAK,GAAG,EAA1B,EAA8BC,MAA9B,EAAuC;AAC7C,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,eAAL;AACC,aAAO,CAAE,GAAGF,KAAL,EAAYC,MAAM,CAACI,MAAnB,CAAP;;AACD,SAAK,oBAAL;AACC,aAAO,EAAP;;AACD,SAAK,eAAL;AACC,aAAOL,KAAK,CAACM,MAAN,CAAgBD,MAAF,IAAcA,MAAM,CAACE,EAAP,KAAcN,MAAM,CAACM,EAAjD,CAAP;AANF;;AAQA,SAAOP,KAAP;AACA;AAED,eAAeb,eAAe,CAAE;AAC/BC,EAAAA,MAD+B;AAE/BC,EAAAA,QAF+B;AAG/BS,EAAAA,SAH+B;AAI/BR,EAAAA,MAJ+B;AAK/BC,EAAAA,QAL+B;AAM/BC,EAAAA,cAN+B;AAO/BC,EAAAA,QAP+B;AAQ/BC,EAAAA,OAR+B;AAS/BC,EAAAA,cAT+B;AAU/BQ,EAAAA,SAV+B;AAW/BC,EAAAA;AAX+B,CAAF,CAA9B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tpostId,\n\tpostType,\n\tsaving,\n\tpostLock,\n\tpostSavingLock,\n\ttemplate,\n\tisReady,\n\teditorSettings,\n} from './reducer.js';\n\nimport { EDITOR_SETTINGS_DEFAULTS } from './defaults.js';\n\nEDITOR_SETTINGS_DEFAULTS.autosaveInterval = 1; // This is a way to override default behavior on mobile, and make it ping the native save every second as long as something changed\n\nexport * from './reducer.js';\n\n/**\n * Reducer returning the post title state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const postTitle = combineReducers( {\n\tisSelected( state = false, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'TOGGLE_POST_TITLE_SELECTION':\n\t\t\t\treturn action.isSelected;\n\t\t}\n\n\t\treturn state;\n\t},\n} );\n\n/**\n * Reducer returning the clipboard state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function clipboard( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_CLIPBOARD':\n\t\t\treturn action.clipboard;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the notices state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function notices( state = [], action ) {\n\tswitch ( action.type ) {\n\t\tcase 'CREATE_NOTICE':\n\t\t\treturn [ ...state, action.notice ];\n\t\tcase 'REMOVE_ALL_NOTICES':\n\t\t\treturn [];\n\t\tcase 'REMOVE_NOTICE':\n\t\t\treturn state.filter( ( notice ) => notice.id !== action.id );\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpostId,\n\tpostType,\n\tpostTitle,\n\tsaving,\n\tpostLock,\n\tpostSavingLock,\n\ttemplate,\n\tisReady,\n\teditorSettings,\n\tclipboard,\n\tnotices,\n} );\n"]}