@wordpress/editor 12.0.3 → 12.0.7

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 (316) hide show
  1. package/build/components/autocompleters/user.js +1 -1
  2. package/build/components/autosave-monitor/index.js +2 -1
  3. package/build/components/autosave-monitor/index.js.map +1 -1
  4. package/build/components/deprecated.js +6 -4
  5. package/build/components/deprecated.js.map +1 -1
  6. package/build/components/deprecated.native.js +26 -26
  7. package/build/components/document-outline/check.js +5 -4
  8. package/build/components/document-outline/check.js.map +1 -1
  9. package/build/components/document-outline/index.js +13 -9
  10. package/build/components/document-outline/index.js.map +1 -1
  11. package/build/components/document-outline/item.js +25 -22
  12. package/build/components/document-outline/item.js.map +1 -1
  13. package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -4
  14. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  15. package/build/components/editor-help/help-get-support-button.native.js +5 -4
  16. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  17. package/build/components/editor-help/help-topic-row.native.js +6 -5
  18. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  19. package/build/components/editor-help/index.native.js +21 -16
  20. package/build/components/editor-help/index.native.js.map +1 -1
  21. package/build/components/editor-help/view-sections.native.js +16 -13
  22. package/build/components/editor-help/view-sections.native.js.map +1 -1
  23. package/build/components/editor-notices/index.js +5 -4
  24. package/build/components/editor-notices/index.js.map +1 -1
  25. package/build/components/entities-saved-states/entity-record-item.js +7 -6
  26. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  27. package/build/components/entities-saved-states/entity-type-list.js +7 -6
  28. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  29. package/build/components/entities-saved-states/index.js +31 -22
  30. package/build/components/entities-saved-states/index.js.map +1 -1
  31. package/build/components/error-boundary/index.js +5 -4
  32. package/build/components/error-boundary/index.js.map +1 -1
  33. package/build/components/global-keyboard-shortcuts/save-shortcut.js +4 -3
  34. package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  35. package/build/components/index.js +22 -22
  36. package/build/components/index.native.js +4 -4
  37. package/build/components/page-attributes/check.js +4 -3
  38. package/build/components/page-attributes/check.js.map +1 -1
  39. package/build/components/page-attributes/order.js +5 -4
  40. package/build/components/page-attributes/order.js.map +1 -1
  41. package/build/components/page-attributes/parent.js +6 -3
  42. package/build/components/page-attributes/parent.js.map +1 -1
  43. package/build/components/post-author/check.js +4 -3
  44. package/build/components/post-author/check.js.map +1 -1
  45. package/build/components/post-author/combobox.js +6 -3
  46. package/build/components/post-author/combobox.js.map +1 -1
  47. package/build/components/post-comments/index.js +6 -4
  48. package/build/components/post-comments/index.js.map +1 -1
  49. package/build/components/post-excerpt/index.js +5 -4
  50. package/build/components/post-excerpt/index.js.map +1 -1
  51. package/build/components/post-featured-image/index.js +51 -41
  52. package/build/components/post-featured-image/index.js.map +1 -1
  53. package/build/components/post-format/check.js +5 -4
  54. package/build/components/post-format/check.js.map +1 -1
  55. package/build/components/post-format/index.js +1 -1
  56. package/build/components/post-last-revision/check.js +7 -5
  57. package/build/components/post-last-revision/check.js.map +1 -1
  58. package/build/components/post-last-revision/index.js +5 -4
  59. package/build/components/post-last-revision/index.js.map +1 -1
  60. package/build/components/post-pending-status/check.js +7 -5
  61. package/build/components/post-pending-status/check.js.map +1 -1
  62. package/build/components/post-pending-status/index.js +6 -4
  63. package/build/components/post-pending-status/index.js.map +1 -1
  64. package/build/components/post-pingbacks/index.js +6 -4
  65. package/build/components/post-pingbacks/index.js.map +1 -1
  66. package/build/components/post-preview-button/index.js +11 -7
  67. package/build/components/post-preview-button/index.js.map +1 -1
  68. package/build/components/post-publish-button/index.js +12 -4
  69. package/build/components/post-publish-button/index.js.map +1 -1
  70. package/build/components/post-publish-button/label.js +15 -12
  71. package/build/components/post-publish-button/label.js.map +1 -1
  72. package/build/components/post-publish-panel/index.js +4 -3
  73. package/build/components/post-publish-panel/index.js.map +1 -1
  74. package/build/components/post-publish-panel/maybe-post-format-panel.js +11 -8
  75. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  76. package/build/components/post-publish-panel/maybe-tags-panel.js +7 -4
  77. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  78. package/build/components/post-publish-panel/postpublish.js +6 -5
  79. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  80. package/build/components/post-publish-panel/prepublish.js +4 -3
  81. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  82. package/build/components/post-saved-state/index.js +6 -5
  83. package/build/components/post-saved-state/index.js.map +1 -1
  84. package/build/components/post-schedule/check.js +6 -4
  85. package/build/components/post-schedule/check.js.map +1 -1
  86. package/build/components/post-schedule/index.js +15 -10
  87. package/build/components/post-schedule/index.js.map +1 -1
  88. package/build/components/post-schedule/label.js +5 -4
  89. package/build/components/post-schedule/label.js.map +1 -1
  90. package/build/components/post-slug/check.js +4 -3
  91. package/build/components/post-slug/check.js.map +1 -1
  92. package/build/components/post-slug/index.js +6 -5
  93. package/build/components/post-slug/index.js.map +1 -1
  94. package/build/components/post-sticky/check.js +7 -5
  95. package/build/components/post-sticky/check.js.map +1 -1
  96. package/build/components/post-sticky/index.js +5 -4
  97. package/build/components/post-sticky/index.js.map +1 -1
  98. package/build/components/post-switch-to-draft-button/index.js +7 -6
  99. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  100. package/build/components/post-taxonomies/check.js +6 -5
  101. package/build/components/post-taxonomies/check.js.map +1 -1
  102. package/build/components/post-taxonomies/flat-term-selector.js +4 -3
  103. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  104. package/build/components/post-taxonomies/hierarchical-term-selector.js +6 -5
  105. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  106. package/build/components/post-taxonomies/index.js +6 -5
  107. package/build/components/post-taxonomies/index.js.map +1 -1
  108. package/build/components/post-taxonomies/most-used-terms.js +5 -4
  109. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  110. package/build/components/post-template/index.js +2 -1
  111. package/build/components/post-template/index.js.map +1 -1
  112. package/build/components/post-title/index.native.js +6 -5
  113. package/build/components/post-title/index.native.js.map +1 -1
  114. package/build/components/post-trash/check.js +8 -6
  115. package/build/components/post-trash/check.js.map +1 -1
  116. package/build/components/post-trash/index.js +8 -6
  117. package/build/components/post-trash/index.js.map +1 -1
  118. package/build/components/post-type-support-check/index.js +6 -5
  119. package/build/components/post-type-support-check/index.js.map +1 -1
  120. package/build/components/post-visibility/check.js +5 -4
  121. package/build/components/post-visibility/check.js.map +1 -1
  122. package/build/components/post-visibility/index.js +28 -24
  123. package/build/components/post-visibility/index.js.map +1 -1
  124. package/build/components/post-visibility/label.js +5 -3
  125. package/build/components/post-visibility/label.js.map +1 -1
  126. package/build/components/provider/index.js +9 -8
  127. package/build/components/provider/index.js.map +1 -1
  128. package/build/components/provider/index.native.js +17 -11
  129. package/build/components/provider/index.native.js.map +1 -1
  130. package/build/components/table-of-contents/index.js +33 -26
  131. package/build/components/table-of-contents/index.js.map +1 -1
  132. package/build/components/table-of-contents/panel.js +5 -4
  133. package/build/components/table-of-contents/panel.js.map +1 -1
  134. package/build/components/template-validation-notice/index.js +6 -4
  135. package/build/components/template-validation-notice/index.js.map +1 -1
  136. package/build/components/theme-support-check/index.js +7 -6
  137. package/build/components/theme-support-check/index.js.map +1 -1
  138. package/build/hooks/custom-sources-backwards-compatibility.js +12 -8
  139. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  140. package/build/hooks/default-autocompleters.js +2 -1
  141. package/build/hooks/default-autocompleters.js.map +1 -1
  142. package/build/index.js +4 -4
  143. package/build/store/actions.js +51 -30
  144. package/build/store/actions.js.map +1 -1
  145. package/build/store/actions.native.js +3 -2
  146. package/build/store/actions.native.js.map +1 -1
  147. package/build/store/constants.js +1 -1
  148. package/build/store/controls.js +10 -9
  149. package/build/store/controls.js.map +1 -1
  150. package/build/store/defaults.js +1 -1
  151. package/build/store/index.js +5 -3
  152. package/build/store/index.js.map +1 -1
  153. package/build/store/reducer.js +52 -22
  154. package/build/store/reducer.js.map +1 -1
  155. package/build/store/reducer.native.js +14 -4
  156. package/build/store/reducer.native.js.map +1 -1
  157. package/build/store/selectors.js +56 -37
  158. package/build/store/selectors.js.map +1 -1
  159. package/build/store/selectors.native.js +1 -1
  160. package/build/store/utils/notice-builder.js +1 -1
  161. package/build/utils/index.js +6 -6
  162. package/build/utils/media-upload/index.js +15 -11
  163. package/build/utils/media-upload/index.js.map +1 -1
  164. package/build/utils/url.js +1 -1
  165. package/build-module/components/autosave-monitor/index.js +2 -1
  166. package/build-module/components/autosave-monitor/index.js.map +1 -1
  167. package/build-module/components/deprecated.js +4 -3
  168. package/build-module/components/deprecated.js.map +1 -1
  169. package/build-module/components/document-outline/check.js +5 -4
  170. package/build-module/components/document-outline/check.js.map +1 -1
  171. package/build-module/components/document-outline/index.js +13 -9
  172. package/build-module/components/document-outline/index.js.map +1 -1
  173. package/build-module/components/document-outline/item.js +25 -22
  174. package/build-module/components/document-outline/item.js.map +1 -1
  175. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +5 -4
  176. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  177. package/build-module/components/editor-help/help-get-support-button.native.js +5 -4
  178. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  179. package/build-module/components/editor-help/help-topic-row.native.js +6 -5
  180. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  181. package/build-module/components/editor-help/index.native.js +20 -16
  182. package/build-module/components/editor-help/index.native.js.map +1 -1
  183. package/build-module/components/editor-help/view-sections.native.js +15 -12
  184. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  185. package/build-module/components/editor-notices/index.js +5 -4
  186. package/build-module/components/editor-notices/index.js.map +1 -1
  187. package/build-module/components/entities-saved-states/entity-record-item.js +7 -6
  188. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  189. package/build-module/components/entities-saved-states/entity-type-list.js +7 -6
  190. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  191. package/build-module/components/entities-saved-states/index.js +31 -22
  192. package/build-module/components/entities-saved-states/index.js.map +1 -1
  193. package/build-module/components/error-boundary/index.js +5 -4
  194. package/build-module/components/error-boundary/index.js.map +1 -1
  195. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +4 -3
  196. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  197. package/build-module/components/page-attributes/check.js +4 -3
  198. package/build-module/components/page-attributes/check.js.map +1 -1
  199. package/build-module/components/page-attributes/order.js +5 -4
  200. package/build-module/components/page-attributes/order.js.map +1 -1
  201. package/build-module/components/page-attributes/parent.js +5 -2
  202. package/build-module/components/page-attributes/parent.js.map +1 -1
  203. package/build-module/components/post-author/check.js +4 -3
  204. package/build-module/components/post-author/check.js.map +1 -1
  205. package/build-module/components/post-author/combobox.js +6 -3
  206. package/build-module/components/post-author/combobox.js.map +1 -1
  207. package/build-module/components/post-comments/index.js +6 -4
  208. package/build-module/components/post-comments/index.js.map +1 -1
  209. package/build-module/components/post-excerpt/index.js +5 -4
  210. package/build-module/components/post-excerpt/index.js.map +1 -1
  211. package/build-module/components/post-featured-image/index.js +51 -41
  212. package/build-module/components/post-featured-image/index.js.map +1 -1
  213. package/build-module/components/post-format/check.js +5 -4
  214. package/build-module/components/post-format/check.js.map +1 -1
  215. package/build-module/components/post-last-revision/check.js +7 -5
  216. package/build-module/components/post-last-revision/check.js.map +1 -1
  217. package/build-module/components/post-last-revision/index.js +5 -4
  218. package/build-module/components/post-last-revision/index.js.map +1 -1
  219. package/build-module/components/post-pending-status/check.js +7 -5
  220. package/build-module/components/post-pending-status/check.js.map +1 -1
  221. package/build-module/components/post-pending-status/index.js +6 -4
  222. package/build-module/components/post-pending-status/index.js.map +1 -1
  223. package/build-module/components/post-pingbacks/index.js +6 -4
  224. package/build-module/components/post-pingbacks/index.js.map +1 -1
  225. package/build-module/components/post-preview-button/index.js +11 -7
  226. package/build-module/components/post-preview-button/index.js.map +1 -1
  227. package/build-module/components/post-publish-button/index.js +12 -4
  228. package/build-module/components/post-publish-button/index.js.map +1 -1
  229. package/build-module/components/post-publish-button/label.js +15 -12
  230. package/build-module/components/post-publish-button/label.js.map +1 -1
  231. package/build-module/components/post-publish-panel/index.js +4 -3
  232. package/build-module/components/post-publish-panel/index.js.map +1 -1
  233. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +11 -8
  234. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  235. package/build-module/components/post-publish-panel/maybe-tags-panel.js +7 -4
  236. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  237. package/build-module/components/post-publish-panel/postpublish.js +6 -5
  238. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  239. package/build-module/components/post-publish-panel/prepublish.js +4 -3
  240. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  241. package/build-module/components/post-saved-state/index.js +6 -5
  242. package/build-module/components/post-saved-state/index.js.map +1 -1
  243. package/build-module/components/post-schedule/check.js +6 -4
  244. package/build-module/components/post-schedule/check.js.map +1 -1
  245. package/build-module/components/post-schedule/index.js +15 -10
  246. package/build-module/components/post-schedule/index.js.map +1 -1
  247. package/build-module/components/post-schedule/label.js +6 -4
  248. package/build-module/components/post-schedule/label.js.map +1 -1
  249. package/build-module/components/post-slug/check.js +4 -3
  250. package/build-module/components/post-slug/check.js.map +1 -1
  251. package/build-module/components/post-slug/index.js +6 -5
  252. package/build-module/components/post-slug/index.js.map +1 -1
  253. package/build-module/components/post-sticky/check.js +7 -5
  254. package/build-module/components/post-sticky/check.js.map +1 -1
  255. package/build-module/components/post-sticky/index.js +5 -4
  256. package/build-module/components/post-sticky/index.js.map +1 -1
  257. package/build-module/components/post-switch-to-draft-button/index.js +7 -6
  258. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  259. package/build-module/components/post-taxonomies/check.js +6 -5
  260. package/build-module/components/post-taxonomies/check.js.map +1 -1
  261. package/build-module/components/post-taxonomies/flat-term-selector.js +4 -3
  262. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  263. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -3
  264. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  265. package/build-module/components/post-taxonomies/index.js +6 -5
  266. package/build-module/components/post-taxonomies/index.js.map +1 -1
  267. package/build-module/components/post-taxonomies/most-used-terms.js +5 -4
  268. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  269. package/build-module/components/post-template/index.js +2 -1
  270. package/build-module/components/post-template/index.js.map +1 -1
  271. package/build-module/components/post-title/index.native.js +6 -5
  272. package/build-module/components/post-title/index.native.js.map +1 -1
  273. package/build-module/components/post-trash/check.js +8 -6
  274. package/build-module/components/post-trash/check.js.map +1 -1
  275. package/build-module/components/post-trash/index.js +8 -6
  276. package/build-module/components/post-trash/index.js.map +1 -1
  277. package/build-module/components/post-type-support-check/index.js +6 -5
  278. package/build-module/components/post-type-support-check/index.js.map +1 -1
  279. package/build-module/components/post-visibility/check.js +5 -4
  280. package/build-module/components/post-visibility/check.js.map +1 -1
  281. package/build-module/components/post-visibility/index.js +28 -24
  282. package/build-module/components/post-visibility/index.js.map +1 -1
  283. package/build-module/components/post-visibility/label.js +5 -3
  284. package/build-module/components/post-visibility/label.js.map +1 -1
  285. package/build-module/components/provider/index.js +9 -8
  286. package/build-module/components/provider/index.js.map +1 -1
  287. package/build-module/components/provider/index.native.js +13 -9
  288. package/build-module/components/provider/index.native.js.map +1 -1
  289. package/build-module/components/table-of-contents/index.js +33 -26
  290. package/build-module/components/table-of-contents/index.js.map +1 -1
  291. package/build-module/components/table-of-contents/panel.js +5 -4
  292. package/build-module/components/table-of-contents/panel.js.map +1 -1
  293. package/build-module/components/template-validation-notice/index.js +6 -4
  294. package/build-module/components/template-validation-notice/index.js.map +1 -1
  295. package/build-module/components/theme-support-check/index.js +7 -6
  296. package/build-module/components/theme-support-check/index.js.map +1 -1
  297. package/build-module/hooks/custom-sources-backwards-compatibility.js +12 -8
  298. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  299. package/build-module/hooks/default-autocompleters.js +2 -1
  300. package/build-module/hooks/default-autocompleters.js.map +1 -1
  301. package/build-module/store/actions.js +27 -12
  302. package/build-module/store/actions.js.map +1 -1
  303. package/build-module/store/actions.native.js +2 -1
  304. package/build-module/store/actions.native.js.map +1 -1
  305. package/build-module/store/controls.js +8 -7
  306. package/build-module/store/controls.js.map +1 -1
  307. package/build-module/store/reducer.js +44 -14
  308. package/build-module/store/reducer.js.map +1 -1
  309. package/build-module/store/reducer.native.js +12 -3
  310. package/build-module/store/reducer.native.js.map +1 -1
  311. package/build-module/store/selectors.js +7 -4
  312. package/build-module/store/selectors.js.map +1 -1
  313. package/build-module/utils/media-upload/index.js +15 -11
  314. package/build-module/utils/media-upload/index.js.map +1 -1
  315. package/package.json +31 -31
  316. package/src/components/entities-saved-states/index.js +8 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"names":["TemplateValidationNotice","isValid","props","confirmSynchronization","window","confirm","synchronizeTemplate","label","onClick","resetTemplateValidity","select","blockEditorStore","isValidTemplate","dispatch","setTemplateValidity"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;AAOA,SAASA,wBAAT,CAAmC;AAAEC,EAAAA,OAAF;AAAW,KAAGC;AAAd,CAAnC,EAA2D;AAC1D,MAAKD,OAAL,EAAe;AACd,WAAO,IAAP;AACA;;AAED,QAAME,sBAAsB,GAAG,MAAM;AACpC,SACC;AACAC,IAAAA,MAAM,CAACC,OAAP,CACC,cACC,gFADD,CADD,CAFD,EAOE;AACDH,MAAAA,KAAK,CAACI,mBAAN;AACA;AACD,GAXD;;AAaA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,aAAa,EAAG,KAFjB;AAGC,IAAA,MAAM,EAAC,SAHR;AAIC,IAAA,OAAO,EAAG,CACT;AACCC,MAAAA,KAAK,EAAE,cAAI,eAAJ,CADR;AAECC,MAAAA,OAAO,EAAEN,KAAK,CAACO;AAFhB,KADS,EAKT;AACCF,MAAAA,KAAK,EAAE,cAAI,oBAAJ,CADR;AAECC,MAAAA,OAAO,EAAEL;AAFV,KALS;AAJX,KAeG,cACD,iFADC,CAfH,CADD;AAqBA;;eAEc,sBAAS,CACvB,sBAAcO,MAAF,KAAgB;AAC3BT,EAAAA,OAAO,EAAES,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,eAA3B;AADkB,CAAhB,CAAZ,CADuB,EAIvB,wBAAgBC,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,mBAAF;AAAuBR,IAAAA;AAAvB,MAA+CO,QAAQ,CAC5DF,kBAD4D,CAA7D;AAGA,SAAO;AACNF,IAAAA,qBAAqB,EAAE,MAAMK,mBAAmB,CAAE,IAAF,CAD1C;AAENR,IAAAA;AAFM,GAAP;AAIA,CARD,CAJuB,CAAT,EAaVN,wBAbU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction TemplateValidationNotice( { isValid, ...props } ) {\n\tif ( isValid ) {\n\t\treturn null;\n\t}\n\n\tconst confirmSynchronization = () => {\n\t\tif (\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\twindow.confirm(\n\t\t\t\t__(\n\t\t\t\t\t'Resetting the template may result in loss of content, do you want to continue?'\n\t\t\t\t)\n\t\t\t)\n\t\t) {\n\t\t\tprops.synchronizeTemplate();\n\t\t}\n\t};\n\n\treturn (\n\t\t<Notice\n\t\t\tclassName=\"editor-template-validation-notice\"\n\t\t\tisDismissible={ false }\n\t\t\tstatus=\"warning\"\n\t\t\tactions={ [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Keep it as is' ),\n\t\t\t\t\tonClick: props.resetTemplateValidity,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Reset the template' ),\n\t\t\t\t\tonClick: confirmSynchronization,\n\t\t\t\t},\n\t\t\t] }\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'The content of your post doesn’t match the template assigned to your post type.'\n\t\t\t) }\n\t\t</Notice>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tisValid: select( blockEditorStore ).isValidTemplate(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { setTemplateValidity, synchronizeTemplate } = dispatch(\n\t\t\tblockEditorStore\n\t\t);\n\t\treturn {\n\t\t\tresetTemplateValidity: () => setTemplateValidity( true ),\n\t\t\tsynchronizeTemplate,\n\t\t};\n\t} ),\n] )( TemplateValidationNotice );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"names":["TemplateValidationNotice","isValid","props","confirmSynchronization","window","confirm","synchronizeTemplate","label","onClick","resetTemplateValidity","select","blockEditorStore","isValidTemplate","dispatch","setTemplateValidity"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;AAOA,SAASA,wBAAT,OAA2D;AAAA,MAAxB;AAAEC,IAAAA,OAAF;AAAW,OAAGC;AAAd,GAAwB;;AAC1D,MAAKD,OAAL,EAAe;AACd,WAAO,IAAP;AACA;;AAED,QAAME,sBAAsB,GAAG,MAAM;AACpC,SACC;AACAC,IAAAA,MAAM,CAACC,OAAP,CACC,cACC,gFADD,CADD,CAFD,EAOE;AACDH,MAAAA,KAAK,CAACI,mBAAN;AACA;AACD,GAXD;;AAaA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,aAAa,EAAG,KAFjB;AAGC,IAAA,MAAM,EAAC,SAHR;AAIC,IAAA,OAAO,EAAG,CACT;AACCC,MAAAA,KAAK,EAAE,cAAI,eAAJ,CADR;AAECC,MAAAA,OAAO,EAAEN,KAAK,CAACO;AAFhB,KADS,EAKT;AACCF,MAAAA,KAAK,EAAE,cAAI,oBAAJ,CADR;AAECC,MAAAA,OAAO,EAAEL;AAFV,KALS;AAJX,KAeG,cACD,iFADC,CAfH,CADD;AAqBA;;eAEc,sBAAS,CACvB,sBAAcO,MAAF,KAAgB;AAC3BT,EAAAA,OAAO,EAAES,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,eAA3B;AADkB,CAAhB,CAAZ,CADuB,EAIvB,wBAAgBC,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,mBAAF;AAAuBR,IAAAA;AAAvB,MAA+CO,QAAQ,CAC5DF,kBAD4D,CAA7D;AAGA,SAAO;AACNF,IAAAA,qBAAqB,EAAE,MAAMK,mBAAmB,CAAE,IAAF,CAD1C;AAENR,IAAAA;AAFM,GAAP;AAIA,CARD,CAJuB,CAAT,EAaVN,wBAbU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction TemplateValidationNotice( { isValid, ...props } ) {\n\tif ( isValid ) {\n\t\treturn null;\n\t}\n\n\tconst confirmSynchronization = () => {\n\t\tif (\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\twindow.confirm(\n\t\t\t\t__(\n\t\t\t\t\t'Resetting the template may result in loss of content, do you want to continue?'\n\t\t\t\t)\n\t\t\t)\n\t\t) {\n\t\t\tprops.synchronizeTemplate();\n\t\t}\n\t};\n\n\treturn (\n\t\t<Notice\n\t\t\tclassName=\"editor-template-validation-notice\"\n\t\t\tisDismissible={ false }\n\t\t\tstatus=\"warning\"\n\t\t\tactions={ [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Keep it as is' ),\n\t\t\t\t\tonClick: props.resetTemplateValidity,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Reset the template' ),\n\t\t\t\t\tonClick: confirmSynchronization,\n\t\t\t\t},\n\t\t\t] }\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'The content of your post doesn’t match the template assigned to your post type.'\n\t\t\t) }\n\t\t</Notice>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tisValid: select( blockEditorStore ).isValidTemplate(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { setTemplateValidity, synchronizeTemplate } = dispatch(\n\t\t\tblockEditorStore\n\t\t);\n\t\treturn {\n\t\t\tresetTemplateValidity: () => setTemplateValidity( true ),\n\t\t\tsynchronizeTemplate,\n\t\t};\n\t} ),\n] )( TemplateValidationNotice );\n"]}
@@ -25,12 +25,13 @@ var _store = require("../../store");
25
25
  /**
26
26
  * Internal dependencies
27
27
  */
28
- function ThemeSupportCheck({
29
- themeSupports,
30
- children,
31
- postType,
32
- supportKeys
33
- }) {
28
+ function ThemeSupportCheck(_ref) {
29
+ let {
30
+ themeSupports,
31
+ children,
32
+ postType,
33
+ supportKeys
34
+ } = _ref;
34
35
  const isSupported = (0, _lodash.some)((0, _lodash.castArray)(supportKeys), key => {
35
36
  const supported = (0, _lodash.get)(themeSupports, [key], false); // 'post-thumbnails' can be boolean or an array of post types.
36
37
  // In the latter case, we need to verify `postType` exists
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"names":["ThemeSupportCheck","themeSupports","children","postType","supportKeys","isSupported","key","supported","select","getThemeSupports","coreStore","getEditedPostAttribute","editorStore"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAGO,SAASA,iBAAT,CAA4B;AAClCC,EAAAA,aADkC;AAElCC,EAAAA,QAFkC;AAGlCC,EAAAA,QAHkC;AAIlCC,EAAAA;AAJkC,CAA5B,EAKH;AACH,QAAMC,WAAW,GAAG,kBAAM,uBAAWD,WAAX,CAAN,EAAkCE,GAAF,IAAW;AAC9D,UAAMC,SAAS,GAAG,iBAAKN,aAAL,EAAoB,CAAEK,GAAF,CAApB,EAA6B,KAA7B,CAAlB,CAD8D,CAE9D;AACA;AACA;AACA;;AACA,QAAK,sBAAsBA,GAAtB,IAA6B,qBAASC,SAAT,CAAlC,EAAyD;AACxD,aAAO,sBAAUA,SAAV,EAAqBJ,QAArB,CAAP;AACA;;AACD,WAAOI,SAAP;AACA,GAVmB,CAApB;;AAYA,MAAK,CAAEF,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOH,QAAP;AACA;;eAEc,sBAAcM,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAAuBD,MAAM,CAAEE,eAAF,CAAnC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA6BH,MAAM,CAAEI,YAAF,CAAzC;AACA,SAAO;AACNT,IAAAA,QAAQ,EAAEQ,sBAAsB,CAAE,MAAF,CAD1B;AAENV,IAAAA,aAAa,EAAEQ,gBAAgB;AAFzB,GAAP;AAIA,CAPc,EAOVT,iBAPU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray, includes, isArray, get, some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function ThemeSupportCheck( {\n\tthemeSupports,\n\tchildren,\n\tpostType,\n\tsupportKeys,\n} ) {\n\tconst isSupported = some( castArray( supportKeys ), ( key ) => {\n\t\tconst supported = get( themeSupports, [ key ], false );\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && isArray( supported ) ) {\n\t\t\treturn includes( supported, postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getThemeSupports } = select( coreStore );\n\tconst { getEditedPostAttribute } = select( editorStore );\n\treturn {\n\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\tthemeSupports: getThemeSupports(),\n\t};\n} )( ThemeSupportCheck );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"names":["ThemeSupportCheck","themeSupports","children","postType","supportKeys","isSupported","key","supported","select","getThemeSupports","coreStore","getEditedPostAttribute","editorStore"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAGO,SAASA,iBAAT,OAKH;AAAA,MAL+B;AAClCC,IAAAA,aADkC;AAElCC,IAAAA,QAFkC;AAGlCC,IAAAA,QAHkC;AAIlCC,IAAAA;AAJkC,GAK/B;AACH,QAAMC,WAAW,GAAG,kBAAM,uBAAWD,WAAX,CAAN,EAAkCE,GAAF,IAAW;AAC9D,UAAMC,SAAS,GAAG,iBAAKN,aAAL,EAAoB,CAAEK,GAAF,CAApB,EAA6B,KAA7B,CAAlB,CAD8D,CAE9D;AACA;AACA;AACA;;AACA,QAAK,sBAAsBA,GAAtB,IAA6B,qBAASC,SAAT,CAAlC,EAAyD;AACxD,aAAO,sBAAUA,SAAV,EAAqBJ,QAArB,CAAP;AACA;;AACD,WAAOI,SAAP;AACA,GAVmB,CAApB;;AAYA,MAAK,CAAEF,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOH,QAAP;AACA;;eAEc,sBAAcM,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAAuBD,MAAM,CAAEE,eAAF,CAAnC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA6BH,MAAM,CAAEI,YAAF,CAAzC;AACA,SAAO;AACNT,IAAAA,QAAQ,EAAEQ,sBAAsB,CAAE,MAAF,CAD1B;AAENV,IAAAA,aAAa,EAAEQ,gBAAgB;AAFzB,GAAP;AAIA,CAPc,EAOVT,iBAPU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray, includes, isArray, get, some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function ThemeSupportCheck( {\n\tthemeSupports,\n\tchildren,\n\tpostType,\n\tsupportKeys,\n} ) {\n\tconst isSupported = some( castArray( supportKeys ), ( key ) => {\n\t\tconst supported = get( themeSupports, [ key ], false );\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && isArray( supported ) ) {\n\t\t\treturn includes( supported, postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getThemeSupports } = select( coreStore );\n\tconst { getEditedPostAttribute } = select( editorStore );\n\treturn {\n\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\tthemeSupports: getThemeSupports(),\n\t};\n} )( ThemeSupportCheck );\n"]}
@@ -55,11 +55,12 @@ var _store = require("../store");
55
55
  *
56
56
  * @return {WPHigherOrderComponent} Higher-order component.
57
57
  */
58
- const createWithMetaAttributeSource = metaAttributes => (0, _compose.createHigherOrderComponent)(BlockEdit => ({
59
- attributes,
60
- setAttributes,
61
- ...props
62
- }) => {
58
+ const createWithMetaAttributeSource = metaAttributes => (0, _compose.createHigherOrderComponent)(BlockEdit => _ref => {
59
+ let {
60
+ attributes,
61
+ setAttributes,
62
+ ...props
63
+ } = _ref;
63
64
  const postType = (0, _data.useSelect)(select => select(_store.store).getCurrentPostType(), []);
64
65
  const [meta, setMeta] = (0, _coreData.useEntityProp)('postType', postType, 'meta');
65
66
  const mergedAttributes = (0, _element.useMemo)(() => ({ ...attributes,
@@ -123,7 +124,10 @@ function shimAttributeSource(settings) {
123
124
  // In the future, we could support updating block settings, at which point this
124
125
  // implementation could use that mechanism instead.
125
126
 
126
- (0, _data.select)(_blocks.store).getBlockTypes().map(({
127
- name
128
- }) => (0, _data.select)(_blocks.store).getBlockType(name)).forEach(shimAttributeSource);
127
+ (0, _data.select)(_blocks.store).getBlockTypes().map(_ref2 => {
128
+ let {
129
+ name
130
+ } = _ref2;
131
+ return (0, _data.select)(_blocks.store).getBlockType(name);
132
+ }).forEach(shimAttributeSource);
129
133
  //# sourceMappingURL=custom-sources-backwards-compatibility.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/hooks/custom-sources-backwards-compatibility.js"],"names":["createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","select","editorStore","getCurrentPostType","meta","setMeta","mergedAttributes","metaKey","nextAttributes","nextMeta","value","key","attributeKey","shimAttributeSource","settings","source","edit","blocksStore","getBlockTypes","map","name","getBlockType","forEach"],"mappings":";;;;AAWA;;;;AARA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AAKA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAGA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,6BAA6B,GAAKC,cAAF,IACrC,yCACGC,SAAF,IAAiB,CAAE;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,aAAd;AAA6B,KAAGC;AAAhC,CAAF,KAA+C;AAC/D,QAAMC,QAAQ,GAAG,qBACdC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,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AOF,QAAP;AACA;;AAED,sBACC,0BADD,EAEC,0EAFD,EAGCD,mBAHD,E,CAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,kBAAcI,aAAd,EACEC,aADF,GAEEC,GAFF,CAEO,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAgB,kBAAcH,aAAd,EAA4BI,YAA5B,CAA0CD,IAA1C,CAFvB,EAGEE,OAHF,CAGWT,mBAHX","sourcesContent":["/**\n * External dependencies\n */\nimport { pickBy, mapValues, isEmpty, mapKeys } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { select as globalSelect, useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Object whose keys are the names of block attributes, where each value\n * represents the meta key to which the block attribute is intended to save.\n *\n * @see https://developer.wordpress.org/reference/functions/register_meta/\n *\n * @typedef {Object<string,string>} WPMetaAttributeMapping\n */\n\n/**\n * Given a mapping of attribute names (meta source attributes) to their\n * associated meta key, returns a higher order component that overrides its\n * `attributes` and `setAttributes` props to sync any changes with the edited\n * post's meta keys.\n *\n * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\nconst createWithMetaAttributeSource = ( metaAttributes ) =>\n\tcreateHigherOrderComponent(\n\t\t( BlockEdit ) => ( { attributes, setAttributes, ...props } ) => {\n\t\t\tconst postType = useSelect(\n\t\t\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t\t\t[]\n\t\t\t);\n\t\t\tconst [ meta, setMeta ] = useEntityProp(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t'meta'\n\t\t\t);\n\n\t\t\tconst mergedAttributes = useMemo(\n\t\t\t\t() => ( {\n\t\t\t\t\t...attributes,\n\t\t\t\t\t...mapValues(\n\t\t\t\t\t\tmetaAttributes,\n\t\t\t\t\t\t( metaKey ) => meta[ metaKey ]\n\t\t\t\t\t),\n\t\t\t\t} ),\n\t\t\t\t[ attributes, meta ]\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<BlockEdit\n\t\t\t\t\tattributes={ mergedAttributes }\n\t\t\t\t\tsetAttributes={ ( nextAttributes ) => {\n\t\t\t\t\t\tconst nextMeta = mapKeys(\n\t\t\t\t\t\t\t// Filter to intersection of keys between the updated\n\t\t\t\t\t\t\t// attributes and those with an associated meta key.\n\t\t\t\t\t\t\tpickBy(\n\t\t\t\t\t\t\t\tnextAttributes,\n\t\t\t\t\t\t\t\t( value, key ) => metaAttributes[ key ]\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\t// Rename the keys to the expected meta key name.\n\t\t\t\t\t\t\t( value, attributeKey ) =>\n\t\t\t\t\t\t\t\tmetaAttributes[ attributeKey ]\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! isEmpty( nextMeta ) ) {\n\t\t\t\t\t\t\tsetMeta( nextMeta );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t} }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t\t'withMetaAttributeSource'\n\t);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade meta-sourced attributes to use the post's meta entity property.\n *\n * @param {WPBlockSettings} settings Registered block settings.\n *\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings ) {\n\t/** @type {WPMetaAttributeMapping} */\n\tconst metaAttributes = mapValues(\n\t\tpickBy( settings.attributes, { source: 'meta' } ),\n\t\t'meta'\n\t);\n\tif ( ! isEmpty( metaAttributes ) ) {\n\t\tsettings.edit = createWithMetaAttributeSource( metaAttributes )(\n\t\t\tsettings.edit\n\t\t);\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n\n// The above filter will only capture blocks registered after the filter was\n// added. There may already be blocks registered by this point, and those must\n// be updated to apply the shim.\n//\n// The following implementation achieves this, albeit with a couple caveats:\n// - Only blocks registered on the global store will be modified.\n// - The block settings are directly mutated, since there is currently no\n// mechanism to update an existing block registration. This is the reason for\n// `getBlockType` separate from `getBlockTypes`, since the latter returns a\n// _copy_ of the block registration (i.e. the mutation would not affect the\n// actual registered block settings).\n//\n// `getBlockTypes` or `getBlockType` implementation could change in the future\n// in regards to creating settings clones, but the corresponding end-to-end\n// tests for meta blocks should cover against any potential regressions.\n//\n// In the future, we could support updating block settings, at which point this\n// implementation could use that mechanism instead.\nglobalSelect( blocksStore )\n\t.getBlockTypes()\n\t.map( ( { name } ) => globalSelect( blocksStore ).getBlockType( name ) )\n\t.forEach( shimAttributeSource );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/hooks/custom-sources-backwards-compatibility.js"],"names":["createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","select","editorStore","getCurrentPostType","meta","setMeta","mergedAttributes","metaKey","nextAttributes","nextMeta","value","key","attributeKey","shimAttributeSource","settings","source","edit","blocksStore","getBlockTypes","map","name","getBlockType","forEach"],"mappings":";;;;AAWA;;;;AARA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AAKA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAGA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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kB,IAAAA,MAAM,EAAE;AAAV,GAA7B,CADsB,EAEtB,MAFsB,CAAvB;;AAIA,MAAK,CAAE,qBAASpB,cAAT,CAAP,EAAmC;AAClCmB,IAAAA,QAAQ,CAACE,IAAT,GAAgBtB,6BAA6B,CAAEC,cAAF,CAA7B,CACfmB,QAAQ,CAACE,IADM,CAAhB;AAGA;;AAED,SAAOF,QAAP;AACA;;AAED,sBACC,0BADD,EAEC,0EAFD,EAGCD,mBAHD,E,CAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,kBAAcI,aAAd,EACEC,aADF,GAEEC,GAFF,CAEO;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SAAgB,kBAAcH,aAAd,EAA4BI,YAA5B,CAA0CD,IAA1C,CAAhB;AAAA,CAFP,EAGEE,OAHF,CAGWT,mBAHX","sourcesContent":["/**\n * External dependencies\n */\nimport { pickBy, mapValues, isEmpty, mapKeys } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { select as globalSelect, useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Object whose keys are the names of block attributes, where each value\n * represents the meta key to which the block attribute is intended to save.\n *\n * @see https://developer.wordpress.org/reference/functions/register_meta/\n *\n * @typedef {Object<string,string>} WPMetaAttributeMapping\n */\n\n/**\n * Given a mapping of attribute names (meta source attributes) to their\n * associated meta key, returns a higher order component that overrides its\n * `attributes` and `setAttributes` props to sync any changes with the edited\n * post's meta keys.\n *\n * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\nconst createWithMetaAttributeSource = ( metaAttributes ) =>\n\tcreateHigherOrderComponent(\n\t\t( BlockEdit ) => ( { attributes, setAttributes, ...props } ) => {\n\t\t\tconst postType = useSelect(\n\t\t\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t\t\t[]\n\t\t\t);\n\t\t\tconst [ meta, setMeta ] = useEntityProp(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t'meta'\n\t\t\t);\n\n\t\t\tconst mergedAttributes = useMemo(\n\t\t\t\t() => ( {\n\t\t\t\t\t...attributes,\n\t\t\t\t\t...mapValues(\n\t\t\t\t\t\tmetaAttributes,\n\t\t\t\t\t\t( metaKey ) => meta[ metaKey ]\n\t\t\t\t\t),\n\t\t\t\t} ),\n\t\t\t\t[ attributes, meta ]\n\t\t\t);\n\n\t\t\treturn (\n\t\t\t\t<BlockEdit\n\t\t\t\t\tattributes={ mergedAttributes }\n\t\t\t\t\tsetAttributes={ ( nextAttributes ) => {\n\t\t\t\t\t\tconst nextMeta = mapKeys(\n\t\t\t\t\t\t\t// Filter to intersection of keys between the updated\n\t\t\t\t\t\t\t// attributes and those with an associated meta key.\n\t\t\t\t\t\t\tpickBy(\n\t\t\t\t\t\t\t\tnextAttributes,\n\t\t\t\t\t\t\t\t( value, key ) => metaAttributes[ key ]\n\t\t\t\t\t\t\t),\n\n\t\t\t\t\t\t\t// Rename the keys to the expected meta key name.\n\t\t\t\t\t\t\t( value, attributeKey ) =>\n\t\t\t\t\t\t\t\tmetaAttributes[ attributeKey ]\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! isEmpty( nextMeta ) ) {\n\t\t\t\t\t\t\tsetMeta( nextMeta );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t} }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t\t'withMetaAttributeSource'\n\t);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade meta-sourced attributes to use the post's meta entity property.\n *\n * @param {WPBlockSettings} settings Registered block settings.\n *\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings ) {\n\t/** @type {WPMetaAttributeMapping} */\n\tconst metaAttributes = mapValues(\n\t\tpickBy( settings.attributes, { source: 'meta' } ),\n\t\t'meta'\n\t);\n\tif ( ! isEmpty( metaAttributes ) ) {\n\t\tsettings.edit = createWithMetaAttributeSource( metaAttributes )(\n\t\t\tsettings.edit\n\t\t);\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n\n// The above filter will only capture blocks registered after the filter was\n// added. There may already be blocks registered by this point, and those must\n// be updated to apply the shim.\n//\n// The following implementation achieves this, albeit with a couple caveats:\n// - Only blocks registered on the global store will be modified.\n// - The block settings are directly mutated, since there is currently no\n// mechanism to update an existing block registration. This is the reason for\n// `getBlockType` separate from `getBlockTypes`, since the latter returns a\n// _copy_ of the block registration (i.e. the mutation would not affect the\n// actual registered block settings).\n//\n// `getBlockTypes` or `getBlockType` implementation could change in the future\n// in regards to creating settings clones, but the corresponding end-to-end\n// tests for meta blocks should cover against any potential regressions.\n//\n// In the future, we could support updating block settings, at which point this\n// implementation could use that mechanism instead.\nglobalSelect( blocksStore )\n\t.getBlockTypes()\n\t.map( ( { name } ) => globalSelect( blocksStore ).getBlockType( name ) )\n\t.forEach( shimAttributeSource );\n"]}
@@ -17,7 +17,8 @@ var _components = require("../components");
17
17
  /**
18
18
  * Internal dependencies
19
19
  */
20
- function setDefaultCompleters(completers = []) {
20
+ function setDefaultCompleters() {
21
+ let completers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
21
22
  // Provide copies so filters may directly modify them.
22
23
  completers.push((0, _lodash.clone)(_components.userAutocompleter));
23
24
  return completers;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/hooks/default-autocompleters.js"],"names":["setDefaultCompleters","completers","push","userAutocompleter"],"mappings":";;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,SAASA,oBAAT,CAA+BC,UAAU,GAAG,EAA5C,EAAiD;AAChD;AACAA,EAAAA,UAAU,CAACC,IAAX,CAAiB,mBAAOC,6BAAP,CAAjB;AAEA,SAAOF,UAAP;AACA;;AAED,sBACC,gCADD,EAEC,8CAFD,EAGCD,oBAHD","sourcesContent":["/**\n * External dependencies\n */\nimport { clone } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { userAutocompleter } from '../components';\n\nfunction setDefaultCompleters( completers = [] ) {\n\t// Provide copies so filters may directly modify them.\n\tcompleters.push( clone( userAutocompleter ) );\n\n\treturn completers;\n}\n\naddFilter(\n\t'editor.Autocomplete.completers',\n\t'editor/autocompleters/set-default-completers',\n\tsetDefaultCompleters\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/hooks/default-autocompleters.js"],"names":["setDefaultCompleters","completers","push","userAutocompleter"],"mappings":";;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,SAASA,oBAAT,GAAiD;AAAA,MAAlBC,UAAkB,uEAAL,EAAK;AAChD;AACAA,EAAAA,UAAU,CAACC,IAAX,CAAiB,mBAAOC,6BAAP,CAAjB;AAEA,SAAOF,UAAP;AACA;;AAED,sBACC,gCADD,EAEC,8CAFD,EAGCD,oBAHD","sourcesContent":["/**\n * External dependencies\n */\nimport { clone } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { userAutocompleter } from '../components';\n\nfunction setDefaultCompleters( completers = [] ) {\n\t// Provide copies so filters may directly modify them.\n\tcompleters.push( clone( userAutocompleter ) );\n\n\treturn completers;\n}\n\naddFilter(\n\t'editor.Autocomplete.completers',\n\t'editor/autocompleters/set-default-completers',\n\tsetDefaultCompleters\n);\n"]}
package/build/index.js CHANGED
@@ -8,16 +8,16 @@ var _exportNames = {
8
8
  store: true,
9
9
  transformStyles: true
10
10
  };
11
- Object.defineProperty(exports, "storeConfig", {
11
+ Object.defineProperty(exports, "store", {
12
12
  enumerable: true,
13
13
  get: function () {
14
- return _store.storeConfig;
14
+ return _store.store;
15
15
  }
16
16
  });
17
- Object.defineProperty(exports, "store", {
17
+ Object.defineProperty(exports, "storeConfig", {
18
18
  enumerable: true,
19
19
  get: function () {
20
- return _store.store;
20
+ return _store.storeConfig;
21
21
  }
22
22
  });
23
23
  Object.defineProperty(exports, "transformStyles", {
@@ -5,31 +5,37 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.setupEditor = setupEditor;
9
- exports.__experimentalTearDownEditor = __experimentalTearDownEditor;
10
- exports.resetPost = resetPost;
11
- exports.__experimentalRequestPostUpdateStart = __experimentalRequestPostUpdateStart;
12
8
  exports.__experimentalRequestPostUpdateFinish = __experimentalRequestPostUpdateFinish;
13
- exports.updatePost = updatePost;
14
- exports.setupEditorState = setupEditorState;
15
- exports.editPost = editPost;
16
- exports.savePost = savePost;
17
- exports.refreshPost = refreshPost;
18
- exports.trashPost = trashPost;
9
+ exports.__experimentalRequestPostUpdateStart = __experimentalRequestPostUpdateStart;
10
+ exports.__experimentalTearDownEditor = __experimentalTearDownEditor;
19
11
  exports.autosave = autosave;
20
- exports.redo = redo;
21
- exports.undo = undo;
12
+ exports.clearSelectedBlock = void 0;
22
13
  exports.createUndoLevel = createUndoLevel;
23
- exports.updatePostLock = updatePostLock;
24
- exports.enablePublishSidebar = enablePublishSidebar;
25
14
  exports.disablePublishSidebar = disablePublishSidebar;
26
- exports.lockPostSaving = lockPostSaving;
27
- exports.unlockPostSaving = unlockPostSaving;
15
+ exports.editPost = editPost;
16
+ exports.enablePublishSidebar = enablePublishSidebar;
17
+ exports.insertDefaultBlock = exports.insertBlocks = exports.insertBlock = exports.hideInsertionPoint = exports.exitFormattedText = exports.enterFormattedText = void 0;
28
18
  exports.lockPostAutosaving = lockPostAutosaving;
29
- exports.unlockPostAutosaving = unlockPostAutosaving;
19
+ exports.lockPostSaving = lockPostSaving;
20
+ exports.receiveBlocks = exports.multiSelect = exports.moveBlocksUp = exports.moveBlocksDown = exports.moveBlockToPosition = exports.mergeBlocks = void 0;
21
+ exports.redo = redo;
22
+ exports.refreshPost = refreshPost;
23
+ exports.resetBlocks = exports.replaceBlocks = exports.replaceBlock = exports.removeBlocks = exports.removeBlock = void 0;
30
24
  exports.resetEditorBlocks = resetEditorBlocks;
25
+ exports.resetPost = resetPost;
26
+ exports.savePost = savePost;
27
+ exports.setTemplateValidity = exports.selectBlock = void 0;
28
+ exports.setupEditor = setupEditor;
29
+ exports.setupEditorState = setupEditorState;
30
+ exports.toggleSelection = exports.toggleBlockMode = exports.synchronizeTemplate = exports.stopTyping = exports.stopMultiSelect = exports.startTyping = exports.startMultiSelect = exports.showInsertionPoint = void 0;
31
+ exports.trashPost = trashPost;
32
+ exports.undo = undo;
33
+ exports.unlockPostAutosaving = unlockPostAutosaving;
34
+ exports.unlockPostSaving = unlockPostSaving;
35
+ exports.updateBlockListSettings = exports.updateBlockAttributes = exports.updateBlock = void 0;
31
36
  exports.updateEditorSettings = updateEditorSettings;
32
- exports.updateBlockListSettings = exports.insertDefaultBlock = exports.exitFormattedText = exports.enterFormattedText = exports.stopTyping = exports.startTyping = exports.toggleBlockMode = exports.removeBlock = exports.removeBlocks = exports.mergeBlocks = exports.synchronizeTemplate = exports.setTemplateValidity = exports.hideInsertionPoint = exports.showInsertionPoint = exports.insertBlocks = exports.insertBlock = exports.moveBlockToPosition = exports.moveBlocksUp = exports.moveBlocksDown = exports.replaceBlock = exports.replaceBlocks = exports.toggleSelection = exports.clearSelectedBlock = exports.multiSelect = exports.stopMultiSelect = exports.startMultiSelect = exports.selectBlock = exports.updateBlockAttributes = exports.updateBlock = exports.receiveBlocks = exports.resetBlocks = void 0;
37
+ exports.updatePost = updatePost;
38
+ exports.updatePostLock = updatePostLock;
33
39
 
34
40
  var _lodash = require("lodash");
35
41
 
@@ -144,7 +150,8 @@ function resetPost(post) {
144
150
  */
145
151
 
146
152
 
147
- function __experimentalRequestPostUpdateStart(options = {}) {
153
+ function __experimentalRequestPostUpdateStart() {
154
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
148
155
  return {
149
156
  type: 'REQUEST_POST_UPDATE_START',
150
157
  options
@@ -159,7 +166,8 @@ function __experimentalRequestPostUpdateStart(options = {}) {
159
166
  */
160
167
 
161
168
 
162
- function __experimentalRequestPostUpdateFinish(options = {}) {
169
+ function __experimentalRequestPostUpdateFinish() {
170
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
163
171
  return {
164
172
  type: 'REQUEST_POST_UPDATE_FINISH',
165
173
  options
@@ -224,7 +232,9 @@ function* editPost(edits, options) {
224
232
  */
225
233
 
226
234
 
227
- function* savePost(options = {}) {
235
+ function* savePost() {
236
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
237
+
228
238
  if (!(yield _data.controls.select(_constants.STORE_NAME, 'isEditedPostSaveable'))) {
229
239
  return;
230
240
  }
@@ -329,10 +339,12 @@ function* trashPost() {
329
339
  */
330
340
 
331
341
 
332
- function* autosave({
333
- local = false,
334
- ...options
335
- } = {}) {
342
+ function* autosave() {
343
+ let {
344
+ local = false,
345
+ ...options
346
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
347
+
336
348
  if (local) {
337
349
  const post = yield _data.controls.select(_constants.STORE_NAME, 'getCurrentPost');
338
350
  const isPostNew = yield _data.controls.select(_constants.STORE_NAME, 'isEditedPostNew');
@@ -553,7 +565,8 @@ function unlockPostAutosaving(lockName) {
553
565
  */
554
566
 
555
567
 
556
- function* resetEditorBlocks(blocks, options = {}) {
568
+ function* resetEditorBlocks(blocks) {
569
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
557
570
  const {
558
571
  __unstableShouldCreateUndoLevel,
559
572
  selection
@@ -577,9 +590,12 @@ function* resetEditorBlocks(blocks, options = {}) {
577
590
  // a new undo level.
578
591
 
579
592
 
580
- edits.content = ({
581
- blocks: blocksForSerialization = []
582
- }) => (0, _blocks.__unstableSerializeAndClean)(blocksForSerialization);
593
+ edits.content = _ref => {
594
+ let {
595
+ blocks: blocksForSerialization = []
596
+ } = _ref;
597
+ return (0, _blocks.__unstableSerializeAndClean)(blocksForSerialization);
598
+ };
583
599
  }
584
600
 
585
601
  yield* editPost(edits);
@@ -604,11 +620,16 @@ function updateEditorSettings(settings) {
604
620
  */
605
621
 
606
622
 
607
- const getBlockEditorAction = name => function* (...args) {
623
+ const getBlockEditorAction = name => function* () {
608
624
  (0, _deprecated.default)("`wp.data.dispatch( 'core/editor' )." + name + '`', {
609
625
  since: '5.3',
610
626
  alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`'
611
627
  });
628
+
629
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
630
+ args[_key] = arguments[_key];
631
+ }
632
+
612
633
  yield _data.controls.dispatch(_blockEditor.store, name, ...args);
613
634
  };
614
635
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/actions.js"],"names":["setupEditor","post","edits","template","resetPost","type","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","keys","some","key","editPost","__experimentalTearDownEditor","__experimentalRequestPostUpdateStart","options","__experimentalRequestPostUpdateFinish","updatePost","since","alternative","id","controls","select","STORE_NAME","dispatch","coreStore","savePost","isAutosave","undoIgnore","previousRecord","error","args","length","noticesStore","updatedRecord","previousPost","postType","resolveSelect","blockEditorStore","refreshPost","postTypeSlug","newPost","path","rest_base","Date","now","trashPost","TRASH_POST_NOTICE_ID","method","autosave","local","isPostNew","title","excerpt","postId","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,UAAUA,WAAV,CAAuBC,IAAvB,EAA6BC,KAA7B,EAAoCC,QAApC,EAA+C;AACrD,QAAMC,SAAS,CAAEH,IAAF,CAAf;AACA,QAAM;AACLI,IAAAA,IAAI,EAAE,cADD;AAELJ,IAAAA,IAFK;AAGLC,IAAAA,KAHK;AAILC,IAAAA;AAJK,GAAN;AAMA,QAAMG,gBAAgB,CAAEL,IAAF,CAAtB,CARqD,CASrD;;AACA,QAAMM,SAAS,GAAGN,IAAI,CAACO,MAAL,KAAgB,YAAlC;;AACA,MAAKD,SAAS,IAAIJ,QAAlB,EAA6B;AAC5B;AACA;AACA;AACA,QAAIM,OAAJ;;AACA,QAAK,iBAAKP,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SAHK;AAILC,MAAAA,KAJK;AAKLjD,MAAAA,OALK;AAMLkD,MAAAA;AANK,KAAN;AAQA,GA7BD,MA6BO;AACN,UAAMhC,eAASG,QAAT,CAAmBD,qBAAnB,EAA+B,UAA/B,EAA2C;AAChDI,MAAAA,UAAU,EAAE,IADoC;AAEhD,SAAGZ;AAF6C,KAA3C,CAAN;AAIA;AACD;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,UAAUwC,IAAV,GAAiB;AACvB,QAAMlC,eAASG,QAAT,CAAmBC,eAAnB,EAA8B,MAA9B,CAAN;AACA;AAED;AACA;AACA;AACA;AACA;;;AACO,UAAU+B,IAAV,GAAiB;AACvB,QAAMnC,eAASG,QAAT,CAAmBC,eAAnB,EAA8B,MAA9B,CAAN;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASgC,eAAT,GAA2B;AACjC,SAAO;AAAE1D,IAAAA,IAAI,EAAE;AAAR,GAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS2D,cAAT,CAAyBC,IAAzB,EAAgC;AACtC,SAAO;AACN5D,IAAAA,IAAI,EAAE,kBADA;AAEN4D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,oBAAT,GAAgC;AACtC,SAAO;AACN7D,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS8D,qBAAT,GAAiC;AACvC,SAAO;AACN9D,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;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;;;AACO,SAAS+D,cAAT,CAAyBC,QAAzB,EAAoC;AAC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MAAMwB,YAAY,GAAGxB,oBAAoB,CAAE,cAAF,CAAzC;AAEP;AACA;AACA;;;AACO,MAAMyB,WAAW,GAAGzB,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM0B,eAAe,GAAG1B,oBAAoB,CAAE,iBAAF,CAA5C;AAEP;AACA;AACA;;;AACO,MAAM2B,WAAW,GAAG3B,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM4B,UAAU,GAAG5B,oBAAoB,CAAE,YAAF,CAAvC;AAEP;AACA;AACA;;;AACO,MAAM6B,kBAAkB,GAAG7B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAM8B,iBAAiB,GAAG9B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;;AACO,MAAM+B,kBAAkB,GAAG/B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMgC,uBAAuB,GAAGhC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport { has } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { controls } from '@wordpress/data';\nimport { apiFetch } from '@wordpress/data-controls';\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';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME, TRASH_POST_NOTICE_ID } from './constants';\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 function* setupEditor( post, edits, template ) {\n\tyield resetPost( post );\n\tyield {\n\t\ttype: 'SETUP_EDITOR',\n\t\tpost,\n\t\tedits,\n\t\ttemplate,\n\t};\n\tyield setupEditorState( post );\n\t// Apply a template for new posts only, if exists.\n\tconst isNewPost = post.status === 'auto-draft';\n\tif ( isNewPost && template ) {\n\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t// included as part of editor setup action. Assume edited content as\n\t\t// canonical if provided, falling back to post.\n\t\tlet content;\n\t\tif ( has( edits, [ 'content' ] ) ) {\n\t\t\tcontent = edits.content;\n\t\t} else {\n\t\t\tcontent = post.content.raw;\n\t\t}\n\t\tlet blocks = parse( content );\n\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\tyield resetEditorBlocks( blocks, {\n\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t} );\n\t}\n\tif (\n\t\tedits &&\n\t\tObject.keys( edits ).some(\n\t\t\t( key ) =>\n\t\t\t\tedits[ key ] !==\n\t\t\t\t( has( post, [ key, 'raw' ] ) ? post[ key ].raw : post[ key ] )\n\t\t)\n\t) {\n\t\tyield editPost( edits );\n\t}\n}\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 * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function resetPost( post ) {\n\treturn {\n\t\ttype: 'RESET_POST',\n\t\tpost,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has started.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateStart( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_START',\n\t\toptions,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has finished.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateFinish( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_FINISH',\n\t\toptions,\n\t};\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 *\n * @yield {Object} Action object or control.\n */\nexport function* editPost( edits, options ) {\n\tconst { id, type } = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'editEntityRecord',\n\t\t'postType',\n\t\ttype,\n\t\tid,\n\t\tedits,\n\t\toptions\n\t);\n}\n\n/**\n * Action generator for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport function* savePost( options = {} ) {\n\tif ( ! ( yield controls.select( STORE_NAME, 'isEditedPostSaveable' ) ) ) {\n\t\treturn;\n\t}\n\tlet edits = {\n\t\tcontent: yield controls.select( STORE_NAME, 'getEditedPostContent' ),\n\t};\n\tif ( ! options.isAutosave ) {\n\t\tyield controls.dispatch( STORE_NAME, 'editPost', edits, {\n\t\t\tundoIgnore: true,\n\t\t} );\n\t}\n\n\tyield __experimentalRequestPostUpdateStart( options );\n\tconst previousRecord = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPost'\n\t);\n\tedits = {\n\t\tid: previousRecord.id,\n\t\t...( yield controls.select(\n\t\t\tcoreStore,\n\t\t\t'getEntityRecordNonTransientEdits',\n\t\t\t'postType',\n\t\t\tpreviousRecord.type,\n\t\t\tpreviousRecord.id\n\t\t) ),\n\t\t...edits,\n\t};\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'saveEntityRecord',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tedits,\n\t\toptions\n\t);\n\tyield __experimentalRequestPostUpdateFinish( options );\n\n\tconst error = yield controls.select(\n\t\tcoreStore,\n\t\t'getLastEntitySaveError',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tpreviousRecord.id\n\t);\n\tif ( error ) {\n\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\tpost: previousRecord,\n\t\t\tedits,\n\t\t\terror,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createErrorNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t} else {\n\t\tconst updatedRecord = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\tpreviousPost: previousRecord,\n\t\t\tpost: updatedRecord,\n\t\t\tpostType: yield controls.resolveSelect(\n\t\t\t\tcoreStore,\n\t\t\t\t'getPostType',\n\t\t\t\tupdatedRecord.type\n\t\t\t),\n\t\t\toptions,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createSuccessNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t\t// Make sure that any edits after saving create an undo level and are\n\t\t// considered for change detection.\n\t\tif ( ! options.isAutosave ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tblockEditorStore,\n\t\t\t\t'__unstableMarkLastChangeAsPersistent'\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Action generator for handling refreshing the current post.\n */\nexport function* refreshPost() {\n\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tconst newPost = yield apiFetch( {\n\t\t// Timestamp arg allows caller to bypass browser caching, which is\n\t\t// expected for this specific function.\n\t\tpath:\n\t\t\t`/wp/v2/${ postType.rest_base }/${ post.id }` +\n\t\t\t`?context=edit&_timestamp=${ Date.now() }`,\n\t} );\n\tyield controls.dispatch( STORE_NAME, 'resetPost', newPost );\n}\n\n/**\n * Action generator for trashing the current post in the editor.\n */\nexport function* trashPost() {\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tyield controls.dispatch(\n\t\tnoticesStore,\n\t\t'removeNotice',\n\t\tTRASH_POST_NOTICE_ID\n\t);\n\ttry {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tyield apiFetch( {\n\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ post.id }`,\n\t\t\tmethod: 'DELETE',\n\t\t} );\n\n\t\tyield controls.dispatch( STORE_NAME, 'savePost' );\n\t} catch ( error ) {\n\t\tyield controls.dispatch(\n\t\t\tnoticesStore,\n\t\t\t'createErrorNotice',\n\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t);\n\t}\n}\n\n/**\n * Action generator used in signalling that the post should autosave. 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 function* autosave( { local = false, ...options } = {} ) {\n\tif ( local ) {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tconst isPostNew = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'isEditedPostNew'\n\t\t);\n\t\tconst title = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'title'\n\t\t);\n\t\tconst content = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'content'\n\t\t);\n\t\tconst excerpt = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'excerpt'\n\t\t);\n\t\tyield {\n\t\t\ttype: 'LOCAL_AUTOSAVE_SET',\n\t\t\tpostId: post.id,\n\t\t\tisPostNew,\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\texcerpt,\n\t\t};\n\t} else {\n\t\tyield controls.dispatch( STORE_NAME, 'savePost', {\n\t\t\tisAutosave: true,\n\t\t\t...options,\n\t\t} );\n\t}\n}\n\n/**\n * Returns an action object used in signalling that undo history should\n * restore last popped state.\n *\n * @yield {Object} Action object.\n */\nexport function* redo() {\n\tyield controls.dispatch( coreStore, 'redo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history should pop.\n *\n * @yield {Object} Action object.\n */\nexport function* undo() {\n\tyield controls.dispatch( coreStore, 'undo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history record should\n * be created.\n *\n * @return {Object} Action object.\n */\nexport function createUndoLevel() {\n\treturn { type: 'CREATE_UNDO_LEVEL' };\n}\n\n/**\n * Returns an action object used to lock the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n *\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 * Returns an action object used in signalling that the user has enabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function enablePublishSidebar() {\n\treturn {\n\t\ttype: 'ENABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has disabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function disablePublishSidebar() {\n\treturn {\n\t\ttype: 'DISABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to signal that post saving is locked.\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 * Returns an action object used to signal that post saving is unlocked.\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 * Returns an action object used to signal that post autosaving is locked.\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 * Returns an action object used to signal that post autosaving is unlocked.\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 *\n * @yield {Object} Action object\n */\nexport function* resetEditorBlocks( blocks, options = {} ) {\n\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\tconst edits = { blocks, selection };\n\n\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\tconst { id, type } = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst noChange =\n\t\t\t( yield controls.select(\n\t\t\t\tcoreStore,\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t) ).blocks === edits.blocks;\n\t\tif ( noChange ) {\n\t\t\treturn yield controls.dispatch(\n\t\t\t\tcoreStore,\n\t\t\t\t'__unstableCreateUndoLevel',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t);\n\t\t}\n\n\t\t// We create a new function here on every persistent edit\n\t\t// to make sure the edit makes the post dirty and creates\n\t\t// a new undo level.\n\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t}\n\tyield* editPost( edits );\n}\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 = ( name ) =>\n\tfunction* ( ...args ) {\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} );\n\t\tyield controls.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":["setupEditor","post","edits","template","resetPost","type","setupEditorState","isNewPost","status","content","raw","blocks","resetEditorBlocks","__unstableShouldCreateUndoLevel","Object","keys","some","key","editPost","__experimentalTearDownEditor","__experimentalRequestPostUpdateStart","options","__experimentalRequestPostUpdateFinish","updatePost","since","alternative","id","controls","select","STORE_NAME","dispatch","coreStore","savePost","isAutosave","undoIgnore","previousRecord","error","args","length","noticesStore","updatedRecord","previousPost","postType","resolveSelect","blockEditorStore","refreshPost","postTypeSlug","newPost","path","rest_base","Date","now","trashPost","TRASH_POST_NOTICE_ID","method","autosave","local","isPostNew","title","excerpt","postId","redo","undo","createUndoLevel","updatePostLock","lock","enablePublishSidebar","disablePublishSidebar","lockPostSaving","lockName","unlockPostSaving","lockPostAutosaving","unlockPostAutosaving","selection","noChange","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,UAAUA,WAAV,CAAuBC,IAAvB,EAA6BC,KAA7B,EAAoCC,QAApC,EAA+C;AACrD,QAAMC,SAAS,CAAEH,IAAF,CAAf;AACA,QAAM;AACLI,IAAAA,IAAI,EAAE,cADD;AAELJ,IAAAA,IAFK;AAGLC,IAAAA,KAHK;AAILC,IAAAA;AAJK,GAAN;AAMA,QAAMG,gBAAgB,CAAEL,IAAF,CAAtB,CARqD,CASrD;;AACA,QAAMM,SAAS,GAAGN,IAAI,CAACO,MAAL,KAAgB,YAAlC;;AACA,MAAKD,SAAS,IAAIJ,QAAlB,EAA6B;AAC5B;AACA;AACA;AACA,QAAIM,OAAJ;;AACA,QAAK,iBAAKP,KAAL,EAAY,CAAE,SAAF,CAAZ,CAAL,EAAmC;AAClCO,MAAAA,OAAO,GAAGP,KAAK,CAACO,OAAhB;AACA,KAFD,MAEO;AACNA,MAAAA,OAAO,GAAGR,IAAI,CAACQ,OAAL,CAAaC,GAAvB;AACA;;AACD,QAAIC,MAAM,GAAG,mBAAOF,OAAP,CAAb;AACAE,IAAAA,MAAM,GAAG,2CAA+BA,MAA/B,EAAuCR,QAAvC,CAAT;AACA,UAAMS,iBAAiB,CAA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C,IAAV,GAAiB;AACvB,QAAMlC,eAASG,QAAT,CAAmBC,eAAnB,EAA8B,MAA9B,CAAN;AACA;AAED;AACA;AACA;AACA;AACA;;;AACO,UAAU+B,IAAV,GAAiB;AACvB,QAAMnC,eAASG,QAAT,CAAmBC,eAAnB,EAA8B,MAA9B,CAAN;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASgC,eAAT,GAA2B;AACjC,SAAO;AAAE1D,IAAAA,IAAI,EAAE;AAAR,GAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS2D,cAAT,CAAyBC,IAAzB,EAAgC;AACtC,SAAO;AACN5D,IAAAA,IAAI,EAAE,kBADA;AAEN4D,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,oBAAT,GAAgC;AACtC,SAAO;AACN7D,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAAS8D,qBAAT,GAAiC;AACvC,SAAO;AACN9D,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;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;;;AACO,SAAS+D,cAAT,CAAyBC,QAAzB,EAAoC;AAC1C,SAAO;AACNhE,IAAAA,IAAI,EAAE,kBADA;AAENgE,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,gBAAT,CAA2BD,QAA3B,EAAsC;AAC5C,SAAO;AACNhE,IAAAA,IAAI,EAAE,oBADA;AAENgE,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;AACA;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O,MAAM2B,WAAW,GAAG3B,oBAAoB,CAAE,aAAF,CAAxC;AAEP;AACA;AACA;;;AACO,MAAM4B,UAAU,GAAG5B,oBAAoB,CAAE,YAAF,CAAvC;AAEP;AACA;AACA;;;AACO,MAAM6B,kBAAkB,GAAG7B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAM8B,iBAAiB,GAAG9B,oBAAoB,CAAE,mBAAF,CAA9C;AAEP;AACA;AACA;;;AACO,MAAM+B,kBAAkB,GAAG/B,oBAAoB,CAAE,oBAAF,CAA/C;AAEP;AACA;AACA;;;AACO,MAAMgC,uBAAuB,GAAGhC,oBAAoB,CAC1D,yBAD0D,CAApD","sourcesContent":["/**\n * External dependencies\n */\nimport { has } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { controls } from '@wordpress/data';\nimport { apiFetch } from '@wordpress/data-controls';\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';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME, TRASH_POST_NOTICE_ID } from './constants';\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 function* setupEditor( post, edits, template ) {\n\tyield resetPost( post );\n\tyield {\n\t\ttype: 'SETUP_EDITOR',\n\t\tpost,\n\t\tedits,\n\t\ttemplate,\n\t};\n\tyield setupEditorState( post );\n\t// Apply a template for new posts only, if exists.\n\tconst isNewPost = post.status === 'auto-draft';\n\tif ( isNewPost && template ) {\n\t\t// In order to ensure maximum of a single parse during setup, edits are\n\t\t// included as part of editor setup action. Assume edited content as\n\t\t// canonical if provided, falling back to post.\n\t\tlet content;\n\t\tif ( has( edits, [ 'content' ] ) ) {\n\t\t\tcontent = edits.content;\n\t\t} else {\n\t\t\tcontent = post.content.raw;\n\t\t}\n\t\tlet blocks = parse( content );\n\t\tblocks = synchronizeBlocksWithTemplate( blocks, template );\n\t\tyield resetEditorBlocks( blocks, {\n\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t} );\n\t}\n\tif (\n\t\tedits &&\n\t\tObject.keys( edits ).some(\n\t\t\t( key ) =>\n\t\t\t\tedits[ key ] !==\n\t\t\t\t( has( post, [ key, 'raw' ] ) ? post[ key ].raw : post[ key ] )\n\t\t)\n\t) {\n\t\tyield editPost( edits );\n\t}\n}\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 * @param {Object} post Post object.\n *\n * @return {Object} Action object.\n */\nexport function resetPost( post ) {\n\treturn {\n\t\ttype: 'RESET_POST',\n\t\tpost,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has started.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateStart( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_START',\n\t\toptions,\n\t};\n}\n\n/**\n * Action for dispatching that a post update request has finished.\n *\n * @param {Object} options\n *\n * @return {Object} An action object\n */\nexport function __experimentalRequestPostUpdateFinish( options = {} ) {\n\treturn {\n\t\ttype: 'REQUEST_POST_UPDATE_FINISH',\n\t\toptions,\n\t};\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 *\n * @yield {Object} Action object or control.\n */\nexport function* editPost( edits, options ) {\n\tconst { id, type } = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'editEntityRecord',\n\t\t'postType',\n\t\ttype,\n\t\tid,\n\t\tedits,\n\t\toptions\n\t);\n}\n\n/**\n * Action generator for saving the current post in the editor.\n *\n * @param {Object} options\n */\nexport function* savePost( options = {} ) {\n\tif ( ! ( yield controls.select( STORE_NAME, 'isEditedPostSaveable' ) ) ) {\n\t\treturn;\n\t}\n\tlet edits = {\n\t\tcontent: yield controls.select( STORE_NAME, 'getEditedPostContent' ),\n\t};\n\tif ( ! options.isAutosave ) {\n\t\tyield controls.dispatch( STORE_NAME, 'editPost', edits, {\n\t\t\tundoIgnore: true,\n\t\t} );\n\t}\n\n\tyield __experimentalRequestPostUpdateStart( options );\n\tconst previousRecord = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPost'\n\t);\n\tedits = {\n\t\tid: previousRecord.id,\n\t\t...( yield controls.select(\n\t\t\tcoreStore,\n\t\t\t'getEntityRecordNonTransientEdits',\n\t\t\t'postType',\n\t\t\tpreviousRecord.type,\n\t\t\tpreviousRecord.id\n\t\t) ),\n\t\t...edits,\n\t};\n\tyield controls.dispatch(\n\t\tcoreStore,\n\t\t'saveEntityRecord',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tedits,\n\t\toptions\n\t);\n\tyield __experimentalRequestPostUpdateFinish( options );\n\n\tconst error = yield controls.select(\n\t\tcoreStore,\n\t\t'getLastEntitySaveError',\n\t\t'postType',\n\t\tpreviousRecord.type,\n\t\tpreviousRecord.id\n\t);\n\tif ( error ) {\n\t\tconst args = getNotificationArgumentsForSaveFail( {\n\t\t\tpost: previousRecord,\n\t\t\tedits,\n\t\t\terror,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createErrorNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t} else {\n\t\tconst updatedRecord = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst args = getNotificationArgumentsForSaveSuccess( {\n\t\t\tpreviousPost: previousRecord,\n\t\t\tpost: updatedRecord,\n\t\t\tpostType: yield controls.resolveSelect(\n\t\t\t\tcoreStore,\n\t\t\t\t'getPostType',\n\t\t\t\tupdatedRecord.type\n\t\t\t),\n\t\t\toptions,\n\t\t} );\n\t\tif ( args.length ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tnoticesStore,\n\t\t\t\t'createSuccessNotice',\n\t\t\t\t...args\n\t\t\t);\n\t\t}\n\t\t// Make sure that any edits after saving create an undo level and are\n\t\t// considered for change detection.\n\t\tif ( ! options.isAutosave ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tblockEditorStore,\n\t\t\t\t'__unstableMarkLastChangeAsPersistent'\n\t\t\t);\n\t\t}\n\t}\n}\n\n/**\n * Action generator for handling refreshing the current post.\n */\nexport function* refreshPost() {\n\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tconst newPost = yield apiFetch( {\n\t\t// Timestamp arg allows caller to bypass browser caching, which is\n\t\t// expected for this specific function.\n\t\tpath:\n\t\t\t`/wp/v2/${ postType.rest_base }/${ post.id }` +\n\t\t\t`?context=edit&_timestamp=${ Date.now() }`,\n\t} );\n\tyield controls.dispatch( STORE_NAME, 'resetPost', newPost );\n}\n\n/**\n * Action generator for trashing the current post in the editor.\n */\nexport function* trashPost() {\n\tconst postTypeSlug = yield controls.select(\n\t\tSTORE_NAME,\n\t\t'getCurrentPostType'\n\t);\n\tconst postType = yield controls.resolveSelect(\n\t\tcoreStore,\n\t\t'getPostType',\n\t\tpostTypeSlug\n\t);\n\tyield controls.dispatch(\n\t\tnoticesStore,\n\t\t'removeNotice',\n\t\tTRASH_POST_NOTICE_ID\n\t);\n\ttry {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tyield apiFetch( {\n\t\t\tpath: `/wp/v2/${ postType.rest_base }/${ post.id }`,\n\t\t\tmethod: 'DELETE',\n\t\t} );\n\n\t\tyield controls.dispatch( STORE_NAME, 'savePost' );\n\t} catch ( error ) {\n\t\tyield controls.dispatch(\n\t\t\tnoticesStore,\n\t\t\t'createErrorNotice',\n\t\t\t...getNotificationArgumentsForTrashFail( { error } )\n\t\t);\n\t}\n}\n\n/**\n * Action generator used in signalling that the post should autosave. 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 function* autosave( { local = false, ...options } = {} ) {\n\tif ( local ) {\n\t\tconst post = yield controls.select( STORE_NAME, 'getCurrentPost' );\n\t\tconst isPostNew = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'isEditedPostNew'\n\t\t);\n\t\tconst title = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'title'\n\t\t);\n\t\tconst content = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'content'\n\t\t);\n\t\tconst excerpt = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getEditedPostAttribute',\n\t\t\t'excerpt'\n\t\t);\n\t\tyield {\n\t\t\ttype: 'LOCAL_AUTOSAVE_SET',\n\t\t\tpostId: post.id,\n\t\t\tisPostNew,\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\texcerpt,\n\t\t};\n\t} else {\n\t\tyield controls.dispatch( STORE_NAME, 'savePost', {\n\t\t\tisAutosave: true,\n\t\t\t...options,\n\t\t} );\n\t}\n}\n\n/**\n * Returns an action object used in signalling that undo history should\n * restore last popped state.\n *\n * @yield {Object} Action object.\n */\nexport function* redo() {\n\tyield controls.dispatch( coreStore, 'redo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history should pop.\n *\n * @yield {Object} Action object.\n */\nexport function* undo() {\n\tyield controls.dispatch( coreStore, 'undo' );\n}\n\n/**\n * Returns an action object used in signalling that undo history record should\n * be created.\n *\n * @return {Object} Action object.\n */\nexport function createUndoLevel() {\n\treturn { type: 'CREATE_UNDO_LEVEL' };\n}\n\n/**\n * Returns an action object used to lock the editor.\n *\n * @param {Object} lock Details about the post lock status, user, and nonce.\n *\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 * Returns an action object used in signalling that the user has enabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function enablePublishSidebar() {\n\treturn {\n\t\ttype: 'ENABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user has disabled the\n * publish sidebar.\n *\n * @return {Object} Action object\n */\nexport function disablePublishSidebar() {\n\treturn {\n\t\ttype: 'DISABLE_PUBLISH_SIDEBAR',\n\t};\n}\n\n/**\n * Returns an action object used to signal that post saving is locked.\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 * Returns an action object used to signal that post saving is unlocked.\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 * Returns an action object used to signal that post autosaving is locked.\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 * Returns an action object used to signal that post autosaving is unlocked.\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 *\n * @yield {Object} Action object\n */\nexport function* resetEditorBlocks( blocks, options = {} ) {\n\tconst { __unstableShouldCreateUndoLevel, selection } = options;\n\tconst edits = { blocks, selection };\n\n\tif ( __unstableShouldCreateUndoLevel !== false ) {\n\t\tconst { id, type } = yield controls.select(\n\t\t\tSTORE_NAME,\n\t\t\t'getCurrentPost'\n\t\t);\n\t\tconst noChange =\n\t\t\t( yield controls.select(\n\t\t\t\tcoreStore,\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t) ).blocks === edits.blocks;\n\t\tif ( noChange ) {\n\t\t\treturn yield controls.dispatch(\n\t\t\t\tcoreStore,\n\t\t\t\t'__unstableCreateUndoLevel',\n\t\t\t\t'postType',\n\t\t\t\ttype,\n\t\t\t\tid\n\t\t\t);\n\t\t}\n\n\t\t// We create a new function here on every persistent edit\n\t\t// to make sure the edit makes the post dirty and creates\n\t\t// a new undo level.\n\t\tedits.content = ( { blocks: blocksForSerialization = [] } ) =>\n\t\t\t__unstableSerializeAndClean( blocksForSerialization );\n\t}\n\tyield* editPost( edits );\n}\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 = ( name ) =>\n\tfunction* ( ...args ) {\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} );\n\t\tyield controls.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"]}
@@ -9,8 +9,8 @@ var _exportNames = {
9
9
  togglePostTitleSelection: true,
10
10
  autosave: true
11
11
  };
12
- exports.togglePostTitleSelection = togglePostTitleSelection;
13
12
  exports.autosave = autosave;
13
+ exports.togglePostTitleSelection = togglePostTitleSelection;
14
14
 
15
15
  var _reactNativeBridge = _interopRequireDefault(require("@wordpress/react-native-bridge"));
16
16
 
@@ -39,7 +39,8 @@ Object.keys(_actions).forEach(function (key) {
39
39
  *
40
40
  * @return {Object} Action object.
41
41
  */
42
- function togglePostTitleSelection(isSelected = true) {
42
+ function togglePostTitleSelection() {
43
+ let isSelected = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
43
44
  return {
44
45
  type: 'TOGGLE_POST_TITLE_SELECTION',
45
46
  isSelected
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/actions.native.js"],"names":["togglePostTitleSelection","isSelected","type","autosave","RNReactNativeGutenbergBridge","editorDidAutosave"],"mappings":";;;;;;;;;;;;;;AAGA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAT,CAAmCC,UAAU,GAAG,IAAhD,EAAuD;AAC7D,SAAO;AACNC,IAAAA,IAAI,EAAE,6BADA;AAEND,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;;;AACO,UAAUE,QAAV,GAAqB;AAC3BC,6BAA6BC,iBAA7B;AACA","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 generator used in signalling that the post should autosave.\n */\nexport function* autosave() {\n\tRNReactNativeGutenbergBridge.editorDidAutosave();\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/actions.native.js"],"names":["togglePostTitleSelection","isSelected","type","autosave","RNReactNativeGutenbergBridge","editorDidAutosave"],"mappings":";;;;;;;;;;;;;;AAGA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAT,GAAuD;AAAA,MAApBC,UAAoB,uEAAP,IAAO;AAC7D,SAAO;AACNC,IAAAA,IAAI,EAAE,6BADA;AAEND,IAAAA;AAFM,GAAP;AAIA;AAED;AACA;AACA;;;AACO,UAAUE,QAAV,GAAqB;AAC3BC,6BAA6BC,iBAA7B;AACA","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 generator used in signalling that the post should autosave.\n */\nexport function* autosave() {\n\tRNReactNativeGutenbergBridge.editorDidAutosave();\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.AUTOSAVE_PROPERTIES = exports.ONE_MINUTE_IN_MS = exports.PERMALINK_POSTNAME_REGEX = exports.TRASH_POST_NOTICE_ID = exports.SAVE_POST_NOTICE_ID = exports.STORE_NAME = exports.EDIT_MERGE_PROPERTIES = void 0;
6
+ exports.TRASH_POST_NOTICE_ID = exports.STORE_NAME = exports.SAVE_POST_NOTICE_ID = exports.PERMALINK_POSTNAME_REGEX = exports.ONE_MINUTE_IN_MS = exports.EDIT_MERGE_PROPERTIES = exports.AUTOSAVE_PROPERTIES = void 0;
7
7
 
8
8
  /**
9
9
  * Set of post properties for which edits should assume a merging behavior,
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.default = void 0;
7
+ exports.localAutosaveClear = localAutosaveClear;
6
8
  exports.localAutosaveGet = localAutosaveGet;
7
9
  exports.localAutosaveSet = localAutosaveSet;
8
- exports.localAutosaveClear = localAutosaveClear;
9
- exports.default = void 0;
10
10
 
11
11
  /**
12
12
  * Function returning a sessionStorage key to set or retrieve a given post's
@@ -43,13 +43,14 @@ function localAutosaveClear(postId, isPostNew) {
43
43
  }
44
44
 
45
45
  const controls = {
46
- LOCAL_AUTOSAVE_SET({
47
- postId,
48
- isPostNew,
49
- title,
50
- content,
51
- excerpt
52
- }) {
46
+ LOCAL_AUTOSAVE_SET(_ref) {
47
+ let {
48
+ postId,
49
+ isPostNew,
50
+ title,
51
+ content,
52
+ excerpt
53
+ } = _ref;
53
54
  localAutosaveSet(postId, isPostNew, title, content, excerpt);
54
55
  }
55
56
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/store/controls.js"],"names":["postKey","postId","isPostNew","localAutosaveGet","window","sessionStorage","getItem","localAutosaveSet","title","content","excerpt","setItem","JSON","stringify","post_title","localAutosaveClear","removeItem","controls","LOCAL_AUTOSAVE_SET"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAT,CAAkBC,MAAlB,EAA0BC,SAA1B,EAAsC;AACrC,SAAQ,iCACPA,SAAS,GAAG,YAAH,GAAkBD,MAC3B,EAFD;AAGA;;AAEM,SAASE,gBAAT,CAA2BF,MAA3B,EAAmCC,SAAnC,EAA+C;AACrD,SAAOE,MAAM,CAACC,cAAP,CAAsBC,OAAtB,CAA+BN,OAAO,CAAEC,MAAF,EAAUC,SAAV,CAAtC,CAAP;AACA;;AAEM,SAASK,gBAAT,CAA2BN,MAA3B,EAAmCC,SAAnC,EAA8CM,KAA9C,EAAqDC,OAArD,EAA8DC,OAA9D,EAAwE;AAC9EN,EAAAA,MAAM,CAACC,cAAP,CAAsBM,OAAtB,CACCX,OAAO,CAAEC,MAAF,EAAUC,SAAV,CADR,EAECU,IAAI,CAACC,SAAL,CAAgB;AACfC,IAAAA,UAAU,EAAEN,KADG;AAEfC,IAAAA,OAFe;AAGfC,IAAAA;AAHe,GAAhB,CAFD;AAQA;;AAEM,SAASK,kBAAT,CAA6Bd,MAA7B,EAAqCC,SAArC,EAAiD;AACvDE,EAAAA,MAAM,CAACC,cAAP,CAAsBW,UAAtB,CAAkChB,OAAO,CAAEC,MAAF,EAAUC,SAAV,CAAzC;AACA;;AAED,MAAMe,QAAQ,GAAG;AAChBC,EAAAA,kBAAkB,CAAE;AAAEjB,IAAAA,MAAF;AAAUC,IAAAA,SAAV;AAAqBM,IAAAA,KAArB;AAA4BC,IAAAA,OAA5B;AAAqCC,IAAAA;AAArC,GAAF,EAAmD;AACpEH,IAAAA,gBAAgB,CAAEN,MAAF,EAAUC,SAAV,EAAqBM,KAArB,EAA4BC,OAA5B,EAAqCC,OAArC,CAAhB;AACA;;AAHe,CAAjB;eAMeO,Q","sourcesContent":["/**\n * Function returning a sessionStorage key to set or retrieve a given post's\n * automatic session backup.\n *\n * Keys are crucially prefixed with 'wp-autosave-' so that wp-login.php's\n * `loggedout` handler can clear sessionStorage of any user-private content.\n *\n * @see https://github.com/WordPress/wordpress-develop/blob/6dad32d2aed47e6c0cf2aee8410645f6d7aba6bd/src/wp-login.php#L103\n *\n * @param {string} postId Post ID.\n * @param {boolean} isPostNew Whether post new.\n *\n * @return {string} sessionStorage key\n */\nfunction postKey( postId, isPostNew ) {\n\treturn `wp-autosave-block-editor-post-${\n\t\tisPostNew ? 'auto-draft' : postId\n\t}`;\n}\n\nexport function localAutosaveGet( postId, isPostNew ) {\n\treturn window.sessionStorage.getItem( postKey( postId, isPostNew ) );\n}\n\nexport function localAutosaveSet( postId, isPostNew, title, content, excerpt ) {\n\twindow.sessionStorage.setItem(\n\t\tpostKey( postId, isPostNew ),\n\t\tJSON.stringify( {\n\t\t\tpost_title: title,\n\t\t\tcontent,\n\t\t\texcerpt,\n\t\t} )\n\t);\n}\n\nexport function localAutosaveClear( postId, isPostNew ) {\n\twindow.sessionStorage.removeItem( postKey( postId, isPostNew ) );\n}\n\nconst controls = {\n\tLOCAL_AUTOSAVE_SET( { postId, isPostNew, title, content, excerpt } ) {\n\t\tlocalAutosaveSet( postId, isPostNew, title, content, excerpt );\n\t},\n};\n\nexport default controls;\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/store/controls.js"],"names":["postKey","postId","isPostNew","localAutosaveGet","window","sessionStorage","getItem","localAutosaveSet","title","content","excerpt","setItem","JSON","stringify","post_title","localAutosaveClear","removeItem","controls","LOCAL_AUTOSAVE_SET"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAT,CAAkBC,MAAlB,EAA0BC,SAA1B,EAAsC;AACrC,SAAQ,iCACPA,SAAS,GAAG,YAAH,GAAkBD,MAC3B,EAFD;AAGA;;AAEM,SAASE,gBAAT,CAA2BF,MAA3B,EAAmCC,SAAnC,EAA+C;AACrD,SAAOE,MAAM,CAACC,cAAP,CAAsBC,OAAtB,CAA+BN,OAAO,CAAEC,MAAF,EAAUC,SAAV,CAAtC,CAAP;AACA;;AAEM,SAASK,gBAAT,CAA2BN,MAA3B,EAAmCC,SAAnC,EAA8CM,KAA9C,EAAqDC,OAArD,EAA8DC,OAA9D,EAAwE;AAC9EN,EAAAA,MAAM,CAACC,cAAP,CAAsBM,OAAtB,CACCX,OAAO,CAAEC,MAAF,EAAUC,SAAV,CADR,EAECU,IAAI,CAACC,SAAL,CAAgB;AACfC,IAAAA,UAAU,EAAEN,KADG;AAEfC,IAAAA,OAFe;AAGfC,IAAAA;AAHe,GAAhB,CAFD;AAQA;;AAEM,SAASK,kBAAT,CAA6Bd,MAA7B,EAAqCC,SAArC,EAAiD;AACvDE,EAAAA,MAAM,CAACC,cAAP,CAAsBW,UAAtB,CAAkChB,OAAO,CAAEC,MAAF,EAAUC,SAAV,CAAzC;AACA;;AAED,MAAMe,QAAQ,GAAG;AAChBC,EAAAA,kBAAkB,OAAmD;AAAA,QAAjD;AAAEjB,MAAAA,MAAF;AAAUC,MAAAA,SAAV;AAAqBM,MAAAA,KAArB;AAA4BC,MAAAA,OAA5B;AAAqCC,MAAAA;AAArC,KAAiD;AACpEH,IAAAA,gBAAgB,CAAEN,MAAF,EAAUC,SAAV,EAAqBM,KAArB,EAA4BC,OAA5B,EAAqCC,OAArC,CAAhB;AACA;;AAHe,CAAjB;eAMeO,Q","sourcesContent":["/**\n * Function returning a sessionStorage key to set or retrieve a given post's\n * automatic session backup.\n *\n * Keys are crucially prefixed with 'wp-autosave-' so that wp-login.php's\n * `loggedout` handler can clear sessionStorage of any user-private content.\n *\n * @see https://github.com/WordPress/wordpress-develop/blob/6dad32d2aed47e6c0cf2aee8410645f6d7aba6bd/src/wp-login.php#L103\n *\n * @param {string} postId Post ID.\n * @param {boolean} isPostNew Whether post new.\n *\n * @return {string} sessionStorage key\n */\nfunction postKey( postId, isPostNew ) {\n\treturn `wp-autosave-block-editor-post-${\n\t\tisPostNew ? 'auto-draft' : postId\n\t}`;\n}\n\nexport function localAutosaveGet( postId, isPostNew ) {\n\treturn window.sessionStorage.getItem( postKey( postId, isPostNew ) );\n}\n\nexport function localAutosaveSet( postId, isPostNew, title, content, excerpt ) {\n\twindow.sessionStorage.setItem(\n\t\tpostKey( postId, isPostNew ),\n\t\tJSON.stringify( {\n\t\t\tpost_title: title,\n\t\t\tcontent,\n\t\t\texcerpt,\n\t\t} )\n\t);\n}\n\nexport function localAutosaveClear( postId, isPostNew ) {\n\twindow.sessionStorage.removeItem( postKey( postId, isPostNew ) );\n}\n\nconst controls = {\n\tLOCAL_AUTOSAVE_SET( { postId, isPostNew, title, content, excerpt } ) {\n\t\tlocalAutosaveSet( postId, isPostNew, title, content, excerpt );\n\t},\n};\n\nexport default controls;\n"]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.EDITOR_SETTINGS_DEFAULTS = exports.PREFERENCES_DEFAULTS = void 0;
6
+ exports.PREFERENCES_DEFAULTS = exports.EDITOR_SETTINGS_DEFAULTS = void 0;
7
7
 
8
8
  var _blockEditor = require("@wordpress/block-editor");
9
9
 
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
4
 
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
- exports.store = exports.storeConfig = void 0;
8
+ exports.storeConfig = exports.store = void 0;
11
9
 
12
10
  var _data = require("@wordpress/data");
13
11
 
@@ -23,6 +21,10 @@ var _controls = _interopRequireDefault(require("./controls"));
23
21
 
24
22
  var _constants = require("./constants");
25
23
 
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
+
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
26
28
  /**
27
29
  * WordPress dependencies
28
30
  */