@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/provider/index.native.js"],"names":["memize","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","createBlock","withDispatch","withSelect","compose","applyFilters","validateThemeColors","validateThemeGradients","store","blockEditorStore","getGlobalStyles","NEW_BLOCK_TYPES","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","EditorProvider","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","updateSettings","galleryWithImageBlocks","__unstableGalleryWithImageBlocks","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","editorSettings","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","colors","gradients","rawStyles","rawFeatures","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","clearSelectedBlock","render","children","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","getSettings","getBlockEditorSettings","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","__unstableShouldCreateUndoLevel"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AAEA;AACA;AACA;;AACA,OAAOC,4BAAP,IACCC,2BADD,EAECC,uBAFD,EAGCC,sBAHD,EAICC,6BAJD,EAKCC,mBALD,EAMCC,iBAND,EAOCC,oBAPD,EAQCC,qBARD,EASCC,6BATD,EAUCC,2BAVD,EAWCC,mBAXD,EAYCC,uBAZD,QAaO,gCAbP;AAcA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SACCC,KADD,EAECC,SAFD,EAGCC,8BAHD,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WAJM;AAKNM,IAAAA,mBALM;;AAMNzB,IAAAA,SAAS,CAAEC,KAAF,EAAU;AAClBmF,MAAAA,QAAQ,CAAE;AAAEnF,QAAAA;AAAF,OAAF,CAAR;AACA,KARK;;AASNrB,IAAAA,oBATM;;AAUNmF,IAAAA,iCAAiC,CAAEhG,MAAF,EAAW;AAC3CsH,MAAAA,iBAAiB,CAAEtH,MAAF,EAAU;AAC1BwH,QAAAA,+BAA+B,EAAE;AADP,OAAV,CAAjB;AAGA,KAdK;;AAeNrB,IAAAA,UAAU,CAAEZ,IAAF,EAAS;AAClBgC,MAAAA,gBAAgB,CAAEhC,IAAF,CAAhB;AACA,KAjBK;;AAkBNW,IAAAA;AAlBM,GAAP;AAoBA,CAhCW,CA9BW,CAAF,CAAP,CA+DV3F,oBA/DU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tvalidateThemeColors,\n\tvalidateThemeGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { getGlobalStyles } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tlocale,\n\t\t\tupdateSettings,\n\t\t\tgalleryWithImageBlocks,\n\t\t} = this.props;\n\n\t\tupdateSettings( {\n\t\t\t...capabilities,\n\t\t\t...{ __unstableGalleryWithImageBlocks: galleryWithImageBlocks },\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image'\n\t\t\t\t\t\t? 'url'\n\t\t\t\t\t\t: 'src' ]: payload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings(\n\t\t\t( editorSettings ) => {\n\t\t\t\tupdateSettings( {\n\t\t\t\t\t...{\n\t\t\t\t\t\t__unstableGalleryWithImageBlocks:\n\t\t\t\t\t\t\teditorSettings.galleryWithImageBlocks,\n\t\t\t\t\t},\n\t\t\t\t\t...this.getThemeColors( editorSettings ),\n\t\t\t\t} );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store\n\t\t\tupdateSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { colors, gradients, rawStyles, rawFeatures } ) {\n\t\treturn {\n\t\t\t...( rawStyles && rawFeatures\n\t\t\t\t? getGlobalStyles( rawStyles, rawFeatures )\n\t\t\t\t: {\n\t\t\t\t\t\tcolors: validateThemeColors( colors ),\n\t\t\t\t\t\tgradients: validateThemeGradients( gradients ),\n\t\t\t\t } ),\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// refresh html content first\n\t\tthis.serializeToNativeAction();\n\t\t// make sure to blur the selected block and dismiss the keyboard\n\t\tthis.props.clearSelectedBlock();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateSettings( capabilities );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tpost, // eslint-disable-line no-unused-vars\n\t\t\tcapabilities,\n\t\t\tsettings,\n\t\t\t...props\n\t\t} = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t} = select( 'core/editor' );\n\t\tconst { getEditorMode } = select( 'core/edit-post' );\n\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetGlobalBlockCount,\n\t\t\tgetSettings: getBlockEditorSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tgetBlockEditorSettings,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\tconst {\n\t\t\tupdateSettings,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( 'core/edit-post' );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( 'core' );\n\t\tconst { createSuccessNotice } = dispatch( 'core/notices' );\n\n\t\treturn {\n\t\t\tupdateSettings,\n\t\t\taddEntities,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/provider/index.native.js"],"names":["memize","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","createBlock","withDispatch","withSelect","compose","applyFilters","validateThemeColors","validateThemeGradients","store","blockEditorStore","getGlobalStyles","NEW_BLOCK_TYPES","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","EditorProvider","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","updateSettings","galleryWithImageBlocks","__unstableGalleryWithImageBlocks","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","editorSettings","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","colors","gradients","rawStyles","rawFeatures","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","clearSelectedBlock","render","children","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","getSettings","getBlockEditorSettings","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","__unstableShouldCreateUndoLevel"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AAEA;AACA;AACA;;AACA,OAAOC,4BAAP,IACCC,2BADD,EAECC,uBAFD,EAGCC,sBAHD,EAICC,6BAJD,EAKCC,mBALD,EAMCC,iBAND,EAOCC,oBAPD,EAQCC,qBARD,EASCC,6BATD,EAUCC,2BAVD,EAWCC,mBAXD,EAYCC,uBAZD,QAaO,gCAbP;AAcA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SACCC,KADD,EAECC,SAFD,EAGCC,8BAHD,EAICC,WAJD,QAKO,mBALP;AAMA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SACCC,mBADD,EAECC,sBAFD,EAGCC,KAAK,IAAIC,gBAHV,QAIO,yBAJP;AAKA,SAASC,eAAT,QAAgC,uBAAhC;AACA,SAASC,eAAT,QAAgC,0BAAhC;AAEA,MAAMC,gBAAgB,GAAG,CACxB;AAAEC,EAAAA,IAAI,EAAE,MAAR;AAAgBC,EAAAA,OAAO,EAAE;AAAzB,CADwB,EAExB;AAAED,EAAAA,IAAI,EAAE,MA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AAEhC,IAAF,CAAhB;AACA,KAjBK;;AAkBNW,IAAAA;AAlBM,GAAP;AAoBA,CAhCW,CA9BW,CAAF,CAAP,CA+DV3F,oBA/DU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tvalidateThemeColors,\n\tvalidateThemeGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { getGlobalStyles } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tlocale,\n\t\t\tupdateSettings,\n\t\t\tgalleryWithImageBlocks,\n\t\t} = this.props;\n\n\t\tupdateSettings( {\n\t\t\t...capabilities,\n\t\t\t...{ __unstableGalleryWithImageBlocks: galleryWithImageBlocks },\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image'\n\t\t\t\t\t\t? 'url'\n\t\t\t\t\t\t: 'src' ]: payload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings(\n\t\t\t( editorSettings ) => {\n\t\t\t\tupdateSettings( {\n\t\t\t\t\t...{\n\t\t\t\t\t\t__unstableGalleryWithImageBlocks:\n\t\t\t\t\t\t\teditorSettings.galleryWithImageBlocks,\n\t\t\t\t\t},\n\t\t\t\t\t...this.getThemeColors( editorSettings ),\n\t\t\t\t} );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store\n\t\t\tupdateSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { colors, gradients, rawStyles, rawFeatures } ) {\n\t\treturn {\n\t\t\t...( rawStyles && rawFeatures\n\t\t\t\t? getGlobalStyles( rawStyles, rawFeatures )\n\t\t\t\t: {\n\t\t\t\t\t\tcolors: validateThemeColors( colors ),\n\t\t\t\t\t\tgradients: validateThemeGradients( gradients ),\n\t\t\t\t } ),\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// refresh html content first\n\t\tthis.serializeToNativeAction();\n\t\t// make sure to blur the selected block and dismiss the keyboard\n\t\tthis.props.clearSelectedBlock();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateSettings( capabilities );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tpost, // eslint-disable-line no-unused-vars\n\t\t\tcapabilities,\n\t\t\tsettings,\n\t\t\t...props\n\t\t} = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t} = select( 'core/editor' );\n\t\tconst { getEditorMode } = select( 'core/edit-post' );\n\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetGlobalBlockCount,\n\t\t\tgetSettings: getBlockEditorSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tgetBlockEditorSettings,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\tconst {\n\t\t\tupdateSettings,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( 'core/edit-post' );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( 'core' );\n\t\tconst { createSuccessNotice } = dispatch( 'core/notices' );\n\n\t\treturn {\n\t\t\tupdateSettings,\n\t\t\taddEntities,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n"]}
@@ -16,37 +16,44 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
16
16
 
17
17
  import TableOfContentsPanel from './panel';
18
18
 
19
- function TableOfContents({
20
- hasOutlineItemsDisabled,
21
- repositionDropdown,
22
- ...props
23
- }, ref) {
19
+ function TableOfContents(_ref, ref) {
20
+ let {
21
+ hasOutlineItemsDisabled,
22
+ repositionDropdown,
23
+ ...props
24
+ } = _ref;
24
25
  const hasBlocks = useSelect(select => !!select(blockEditorStore).getBlockCount(), []);
25
26
  return createElement(Dropdown, {
26
27
  position: repositionDropdown ? 'middle right right' : 'bottom',
27
28
  className: "table-of-contents",
28
29
  contentClassName: "table-of-contents__popover",
29
- renderToggle: ({
30
- isOpen,
31
- onToggle
32
- }) => createElement(Button, _extends({}, props, {
33
- ref: ref,
34
- onClick: hasBlocks ? onToggle : undefined,
35
- icon: info,
36
- "aria-expanded": isOpen,
37
- "aria-haspopup": "true"
38
- /* translators: button label text should, if possible, be under 16 characters. */
39
- ,
40
- label: __('Details'),
41
- tooltipPosition: "bottom",
42
- "aria-disabled": !hasBlocks
43
- })),
44
- renderContent: ({
45
- onClose
46
- }) => createElement(TableOfContentsPanel, {
47
- onRequestClose: onClose,
48
- hasOutlineItemsDisabled: hasOutlineItemsDisabled
49
- })
30
+ renderToggle: _ref2 => {
31
+ let {
32
+ isOpen,
33
+ onToggle
34
+ } = _ref2;
35
+ return createElement(Button, _extends({}, props, {
36
+ ref: ref,
37
+ onClick: hasBlocks ? onToggle : undefined,
38
+ icon: info,
39
+ "aria-expanded": isOpen,
40
+ "aria-haspopup": "true"
41
+ /* translators: button label text should, if possible, be under 16 characters. */
42
+ ,
43
+ label: __('Details'),
44
+ tooltipPosition: "bottom",
45
+ "aria-disabled": !hasBlocks
46
+ }));
47
+ },
48
+ renderContent: _ref3 => {
49
+ let {
50
+ onClose
51
+ } = _ref3;
52
+ return createElement(TableOfContentsPanel, {
53
+ onRequestClose: onClose,
54
+ hasOutlineItemsDisabled: hasOutlineItemsDisabled
55
+ });
56
+ }
50
57
  });
51
58
  }
52
59
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","isOpen","onToggle","undefined","onClose"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,uBAAjC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,IAAT,QAAqB,kBAArB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,SAAjC;;AAEA,SAASC,eAAT,CACC;AAAEC,EAAAA,uBAAF;AAA2BC,EAAAA,kBAA3B;AAA+C,KAAGC;AAAlD,CADD,EAECC,GAFD,EAGE;AACD,QAAMC,SAAS,GAAGX,SAAS,CACxBY,MAAF,IAAc,CAAC,CAAEA,MAAM,CAAER,gBAAF,CAAN,CAA2BS,aAA3B,EADS,EAE1B,EAF0B,CAA3B;AAIA,SACC,cAAC,QAAD;AACC,IAAA,QAAQ,EAAGL,kBAAkB,GAAG,oBAAH,GAA0B,QADxD;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,gBAAgB,EAAC,4BAHlB;AAIC,IAAA,YAAY,EAAG,CAAE;AAAEM,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,cAAC,MAAD,eACMN,KADN;AAEC,MAAA,GAAG,EAAGC,GAFP;AAGC,MAAA,OAAO,EAAGC,SAAS,GAAGI,QAAH,GAAcC,SAHlC;AAIC,MAAA,IAAI,EAAGf,IAJR;AAKC,uBAAgBa,MALjB;AAMC,uBAAc;AACd;AAPD;AAQC,MAAA,KAAK,EAAGjB,EAAE,CAAE,SAAF,CARX;AASC,MAAA,eAAe,EAAC,QATjB;AAUC,uBAAgB,CAAEc;AAVnB,OALF;AAkBC,IAAA,aAAa,EAAG,CAAE;AAAEM,MAAAA;AAAF,KAAF,KACf,cAAC,oBAAD;AACC,MAAA,cAAc,EAAGA,OADlB;AAEC,MAAA,uBAAuB,EAAGV;AAF3B;AAnBF,IADD;AA2BA;;AAED,eAAeL,UAAU,CAAEI,eAAF,CAAzB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tposition={ repositionDropdown ? 'middle right right' : 'bottom' }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfContents );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","TableOfContents","ref","hasOutlineItemsDisabled","repositionDropdown","props","hasBlocks","select","getBlockCount","isOpen","onToggle","undefined","onClose"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,uBAAjC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,IAAT,QAAqB,kBAArB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,SAAjC;;AAEA,SAASC,eAAT,OAECC,GAFD,EAGE;AAAA,MAFD;AAAEC,IAAAA,uBAAF;AAA2BC,IAAAA,kBAA3B;AAA+C,OAAGC;AAAlD,GAEC;AACD,QAAMC,SAAS,GAAGX,SAAS,CACxBY,MAAF,IAAc,CAAC,CAAEA,MAAM,CAAER,gBAAF,CAAN,CAA2BS,aAA3B,EADS,EAE1B,EAF0B,CAA3B;AAIA,SACC,cAAC,QAAD;AACC,IAAA,QAAQ,EAAGJ,kBAAkB,GAAG,oBAAH,GAA0B,QADxD;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,gBAAgB,EAAC,4BAHlB;AAIC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEK,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd,cAAC,MAAD,eACML,KADN;AAEC,QAAA,GAAG,EAAGH,GAFP;AAGC,QAAA,OAAO,EAAGI,SAAS,GAAGI,QAAH,GAAcC,SAHlC;AAIC,QAAA,IAAI,EAAGf,IAJR;AAKC,yBAAgBa,MALjB;AAMC,yBAAc;AACd;AAPD;AAQC,QAAA,KAAK,EAAGjB,EAAE,CAAE,SAAF,CARX;AASC,QAAA,eAAe,EAAC,QATjB;AAUC,yBAAgB,CAAEc;AAVnB,SADc;AAAA,KAJhB;AAkBC,IAAA,aAAa,EAAG;AAAA,UAAE;AAAEM,QAAAA;AAAF,OAAF;AAAA,aACf,cAAC,oBAAD;AACC,QAAA,cAAc,EAAGA,OADlB;AAEC,QAAA,uBAAuB,EAAGT;AAF3B,QADe;AAAA;AAlBjB,IADD;AA2BA;;AAED,eAAeN,UAAU,CAAEI,eAAF,CAAzB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tposition={ repositionDropdown ? 'middle right right' : 'bottom' }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfContents );\n"]}
@@ -14,10 +14,11 @@ import WordCount from '../word-count';
14
14
  import DocumentOutline from '../document-outline';
15
15
  import CharacterCount from '../character-count';
16
16
 
17
- function TableOfContentsPanel({
18
- hasOutlineItemsDisabled,
19
- onRequestClose
20
- }) {
17
+ function TableOfContentsPanel(_ref) {
18
+ let {
19
+ hasOutlineItemsDisabled,
20
+ onRequestClose
21
+ } = _ref;
21
22
  const {
22
23
  headingCount,
23
24
  paragraphCount,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/panel.js"],"names":["__","useSelect","store","blockEditorStore","WordCount","DocumentOutline","CharacterCount","TableOfContentsPanel","hasOutlineItemsDisabled","onRequestClose","headingCount","paragraphCount","numberOfBlocks","select","getGlobalBlockCount"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;;AAEA,SAASC,oBAAT,CAA+B;AAAEC,EAAAA,uBAAF;AAA2BC,EAAAA;AAA3B,CAA/B,EAA6E;AAC5E,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,cAAhB;AAAgCC,IAAAA;AAAhC,MAAmDX,SAAS,CAC/DY,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAA0BD,MAAM,CAAEV,gBAAF,CAAtC;AACA,WAAO;AACNO,MAAAA,YAAY,EAAEI,mBAAmB,CAAE,cAAF,CAD3B;AAENH,MAAAA,cAAc,EAAEG,mBAAmB,CAAE,gBAAF,C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import { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport WordCount from '../word-count';\nimport DocumentOutline from '../document-outline';\nimport CharacterCount from '../character-count';\n\nfunction TableOfContentsPanel( { hasOutlineItemsDisabled, onRequestClose } ) {\n\tconst { headingCount, paragraphCount, numberOfBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\theadingCount: getGlobalBlockCount( 'core/heading' ),\n\t\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t\t\tnumberOfBlocks: getGlobalBlockCount(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn (\n\t\t/*\n\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t */\n\t\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName=\"table-of-contents__wrapper\"\n\t\t\t\trole=\"note\"\n\t\t\t\taria-label={ __( 'Document Statistics' ) }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t>\n\t\t\t\t<ul role=\"list\" className=\"table-of-contents__counts\">\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Characters' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Words' ) }\n\t\t\t\t\t\t<WordCount />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Headings' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ headingCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Paragraphs' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ paragraphCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Blocks' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ numberOfBlocks }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t{ headingCount > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<hr />\n\t\t\t\t\t<h2 className=\"table-of-contents__title\">\n\t\t\t\t\t\t{ __( 'Document Outline' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<DocumentOutline\n\t\t\t\t\t\tonSelect={ onRequestClose }\n\t\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t\t/* eslint-enable jsx-a11y/no-redundant-roles */\n\t);\n}\n\nexport default TableOfContentsPanel;\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/panel.js"],"names":["__","useSelect","store","blockEditorStore","WordCount","DocumentOutline","CharacterCount","TableOfContentsPanel","hasOutlineItemsDisabled","onRequestClose","headingCount","paragraphCount","numberOfBlocks","select","getGlobalBlockCount"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;;AAEA,SAASC,oBA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AE,QAAF,CADL,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGY,cADH,CAFD,CAvBD,CAND,CADD,EAsCGF,YAAY,GAAG,CAAf,IACD,8BACC,yBADD,EAEC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGV,EAAE,CAAE,kBAAF,CADL,CAFD,EAKC,cAAC,eAAD;AACC,MAAA,QAAQ,EAAGS,cADZ;AAEC,MAAA,uBAAuB,EAAGD;AAF3B,MALD,CAvCF;AAmDA;;AAzDD;AA2DA;;AAED,eAAeD,oBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport WordCount from '../word-count';\nimport DocumentOutline from '../document-outline';\nimport CharacterCount from '../character-count';\n\nfunction TableOfContentsPanel( { hasOutlineItemsDisabled, onRequestClose } ) {\n\tconst { headingCount, paragraphCount, numberOfBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\theadingCount: getGlobalBlockCount( 'core/heading' ),\n\t\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t\t\tnumberOfBlocks: getGlobalBlockCount(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn (\n\t\t/*\n\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t */\n\t\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName=\"table-of-contents__wrapper\"\n\t\t\t\trole=\"note\"\n\t\t\t\taria-label={ __( 'Document Statistics' ) }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t>\n\t\t\t\t<ul role=\"list\" className=\"table-of-contents__counts\">\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Characters' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Words' ) }\n\t\t\t\t\t\t<WordCount />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Headings' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ headingCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Paragraphs' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ paragraphCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Blocks' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ numberOfBlocks }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t{ headingCount > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<hr />\n\t\t\t\t\t<h2 className=\"table-of-contents__title\">\n\t\t\t\t\t\t{ __( 'Document Outline' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<DocumentOutline\n\t\t\t\t\t\tonSelect={ onRequestClose }\n\t\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t\t/* eslint-enable jsx-a11y/no-redundant-roles */\n\t);\n}\n\nexport default TableOfContentsPanel;\n"]}
@@ -9,10 +9,12 @@ import { withSelect, withDispatch } from '@wordpress/data';
9
9
  import { compose } from '@wordpress/compose';
10
10
  import { store as blockEditorStore } from '@wordpress/block-editor';
11
11
 
12
- function TemplateValidationNotice({
13
- isValid,
14
- ...props
15
- }) {
12
+ function TemplateValidationNotice(_ref) {
13
+ let {
14
+ isValid,
15
+ ...props
16
+ } = _ref;
17
+
16
18
  if (isValid) {
17
19
  return null;
18
20
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"names":["Notice","__","withSelect","withDispatch","compose","store","blockEditorStore","TemplateValidationNotice","isValid","props","confirmSynchronization","window","confirm","synchronizeTemplate","label","onClick","resetTemplateValidity","select","isValidTemplate","dispatch","setTemplateValidity"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;;AAEA,SAASC,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,CACCX,EAAE,CACD,gFADC,CADH,CAFD,EAOE;AACDQ,MAAAA,KAAK,CAACI,mBAAN;AACA;AACD,GAXD;;AAaA,SACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,aAAa,EAAG,KAFjB;AAGC,IAAA,MAAM,EAAC,SAHR;AAIC,IAAA,OAAO,EAAG,CACT;AACCC,MAAAA,KAAK,EAAEb,EAAE,CAAE,eAAF,CADV;AAECc,MAAAA,OAAO,EAAEN,KAAK,CAACO;AAFhB,KADS,EAKT;AACCF,MAAAA,KAAK,EAAEb,EAAE,CAAE,oBAAF,CADV;AAECc,MAAAA,OAAO,EAAEL;AAFV,KALS;AAJX,KAeGT,EAAE,CACH,iFADG,CAfL,CADD;AAqBA;;AAED,eAAeG,OAAO,CAAE,CACvBF,UAAU,CAAIe,MAAF,KAAgB;AAC3BT,EAAAA,OAAO,EAAES,MAAM,CAAEX,gBAAF,CAAN,CAA2BY,eAA3B;AADkB,CAAhB,CAAF,CADa,EAIvBf,YAAY,CAAIgB,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,mBAAF;AAAuBP,IAAAA;AAAvB,MAA+CM,QAAQ,CAC5Db,gBAD4D,CAA7D;AAGA,SAAO;AACNU,IAAAA,qBAAqB,EAAE,MAAMI,mBAAmB,CAAE,IAAF,CAD1C;AAENP,IAAAA;AAFM,GAAP;AAIA,CARW,CAJW,CAAF,CAAP,CAaVN,wBAbU,CAAf","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":["Notice","__","withSelect","withDispatch","compose","store","blockEditorStore","TemplateValidationNotice","isValid","props","confirmSynchronization","window","confirm","synchronizeTemplate","label","onClick","resetTemplateValidity","select","isValidTemplate","dispatch","setTemplateValidity"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;;AAEA,SAASC,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,CACCX,EAAE,CACD,gFADC,CADH,CAFD,EAOE;AACDQ,MAAAA,KAAK,CAACI,mBAAN;AACA;AACD,GAXD;;AAaA,SACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,aAAa,EAAG,KAFjB;AAGC,IAAA,MAAM,EAAC,SAHR;AAIC,IAAA,OAAO,EAAG,CACT;AACCC,MAAAA,KAAK,EAAEb,EAAE,CAAE,eAAF,CADV;AAECc,MAAAA,OAAO,EAAEN,KAAK,CAACO;AAFhB,KADS,EAKT;AACCF,MAAAA,KAAK,EAAEb,EAAE,CAAE,oBAAF,CADV;AAECc,MAAAA,OAAO,EAAEL;AAFV,KALS;AAJX,KAeGT,EAAE,CACH,iFADG,CAfL,CADD;AAqBA;;AAED,eAAeG,OAAO,CAAE,CACvBF,UAAU,CAAIe,MAAF,KAAgB;AAC3BT,EAAAA,OAAO,EAAES,MAAM,CAAEX,gBAAF,CAAN,CAA2BY,eAA3B;AADkB,CAAhB,CAAF,CADa,EAIvBf,YAAY,CAAIgB,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,mBAAF;AAAuBP,IAAAA;AAAvB,MAA+CM,QAAQ,CAC5Db,gBAD4D,CAA7D;AAGA,SAAO;AACNU,IAAAA,qBAAqB,EAAE,MAAMI,mBAAmB,CAAE,IAAF,CAD1C;AAENP,IAAAA;AAFM,GAAP;AAIA,CARW,CAJW,CAAF,CAAP,CAaVN,wBAbU,CAAf","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"]}
@@ -13,12 +13,13 @@ import { store as coreStore } from '@wordpress/core-data';
13
13
  */
14
14
 
15
15
  import { store as editorStore } from '../../store';
16
- export function ThemeSupportCheck({
17
- themeSupports,
18
- children,
19
- postType,
20
- supportKeys
21
- }) {
16
+ export function ThemeSupportCheck(_ref) {
17
+ let {
18
+ themeSupports,
19
+ children,
20
+ postType,
21
+ supportKeys
22
+ } = _ref;
22
23
  const isSupported = some(castArray(supportKeys), key => {
23
24
  const supported = get(themeSupports, [key], false); // 'post-thumbnails' can be boolean or an array of post types.
24
25
  // 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":["castArray","includes","isArray","get","some","withSelect","store","coreStore","editorStore","ThemeSupportCheck","themeSupports","children","postType","supportKeys","isSupported","key","supported","select","getThemeSupports","getEditedPostAttribute"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,EAA8BC,OAA9B,EAAuCC,GAAvC,EAA4CC,IAA5C,QAAwD,QAAxD;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,iBAAT,CAA4B;AAClCC,EAAAA,aADkC;AAElCC,EAAAA,QAFkC;AAGlCC,EAAAA,QAHkC;AAIlCC,EAAAA;AAJkC,CAA5B,EAKH;AACH,QAAMC,WAAW,GAAGV,IAAI,CAAEJ,SAAS,CAAEa,WAAF,CAAX,EAA8BE,GAAF,IAAW;AAC9D,UAAMC,SAAS,GAAGb,GAAG,CAAEO,aAAF,EAAiB,CAAEK,GAAF,CAAjB,EAA0B,KAA1B,CAArB,CAD8D,CAE9D;AACA;AACA;AACA;;AACA,QAAK,sBAAsBA,GAAtB,IAA6Bb,OAAO,CAAEc,SAAF,CAAzC,EAAyD;AACxD,aAAOf,QAAQ,CAAEe,SAAF,EAAaJ,QAAb,CAAf;AACA;;AACD,WAAOI,SAAP;AACA,GAVuB,CAAxB;;AAYA,MAAK,CAAEF,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOH,QAAP;AACA;AAED,eAAeN,UAAU,CAAIY,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAAuBD,MAAM,CAAEV,SAAF,CAAnC;AACA,QAAM;AAAEY,IAAAA;AAAF,MAA6BF,MAAM,CAAET,WAAF,CAAzC;AACA,SAAO;AACNI,IAAAA,QAAQ,EAAEO,sBAAsB,CAAE,MAAF,CAD1B;AAENT,IAAAA,aAAa,EAAEQ,gBAAgB;AAFzB,GAAP;AAIA,CAPwB,CAAV,CAOVT,iBAPU,CAAf","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":["castArray","includes","isArray","get","some","withSelect","store","coreStore","editorStore","ThemeSupportCheck","themeSupports","children","postType","supportKeys","isSupported","key","supported","select","getThemeSupports","getEditedPostAttribute"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,EAA8BC,OAA9B,EAAuCC,GAAvC,EAA4CC,IAA5C,QAAwD,QAAxD;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,iBAAT,OAKH;AAAA,MAL+B;AAClCC,IAAAA,aADkC;AAElCC,IAAAA,QAFkC;AAGlCC,IAAAA,QAHkC;AAIlCC,IAAAA;AAJkC,GAK/B;AACH,QAAMC,WAAW,GAAGV,IAAI,CAAEJ,SAAS,CAAEa,WAAF,CAAX,EAA8BE,GAAF,IAAW;AAC9D,UAAMC,SAAS,GAAGb,GAAG,CAAEO,aAAF,EAAiB,CAAEK,GAAF,CAAjB,EAA0B,KAA1B,CAArB,CAD8D,CAE9D;AACA;AACA;AACA;;AACA,QAAK,sBAAsBA,GAAtB,IAA6Bb,OAAO,CAAEc,SAAF,CAAzC,EAAyD;AACxD,aAAOf,QAAQ,CAAEe,SAAF,EAAaJ,QAAb,CAAf;AACA;;AACD,WAAOI,SAAP;AACA,GAVuB,CAAxB;;AAYA,MAAK,CAAEF,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOH,QAAP;AACA;AAED,eAAeN,UAAU,CAAIY,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAAuBD,MAAM,CAAEV,SAAF,CAAnC;AACA,QAAM;AAAEY,IAAAA;AAAF,MAA6BF,MAAM,CAAET,WAAF,CAAzC;AACA,SAAO;AACNI,IAAAA,QAAQ,EAAEO,sBAAsB,CAAE,MAAF,CAD1B;AAENT,IAAAA,aAAa,EAAEQ,gBAAgB;AAFzB,GAAP;AAIA,CAPwB,CAAV,CAOVT,iBAPU,CAAf","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"]}
@@ -44,11 +44,12 @@ import { store as editorStore } from '../store';
44
44
  * @return {WPHigherOrderComponent} Higher-order component.
45
45
  */
46
46
 
47
- const createWithMetaAttributeSource = metaAttributes => createHigherOrderComponent(BlockEdit => ({
48
- attributes,
49
- setAttributes,
50
- ...props
51
- }) => {
47
+ const createWithMetaAttributeSource = metaAttributes => createHigherOrderComponent(BlockEdit => _ref => {
48
+ let {
49
+ attributes,
50
+ setAttributes,
51
+ ...props
52
+ } = _ref;
52
53
  const postType = useSelect(select => select(editorStore).getCurrentPostType(), []);
53
54
  const [meta, setMeta] = useEntityProp('postType', postType, 'meta');
54
55
  const mergedAttributes = useMemo(() => ({ ...attributes,
@@ -112,7 +113,10 @@ addFilter('blocks.registerBlockType', 'core/editor/custom-sources-backwards-comp
112
113
  // In the future, we could support updating block settings, at which point this
113
114
  // implementation could use that mechanism instead.
114
115
 
115
- globalSelect(blocksStore).getBlockTypes().map(({
116
- name
117
- }) => globalSelect(blocksStore).getBlockType(name)).forEach(shimAttributeSource);
116
+ globalSelect(blocksStore).getBlockTypes().map(_ref2 => {
117
+ let {
118
+ name
119
+ } = _ref2;
120
+ return globalSelect(blocksStore).getBlockType(name);
121
+ }).forEach(shimAttributeSource);
118
122
  //# sourceMappingURL=custom-sources-backwards-compatibility.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/hooks/custom-sources-backwards-compatibility.js"],"names":["pickBy","mapValues","isEmpty","mapKeys","store","blocksStore","select","globalSelect","useSelect","useEntityProp","useMemo","createHigherOrderComponent","addFilter","editorStore","createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","getCurrentPostType","meta","setMeta","mergedAttributes","metaKey","nextAttributes","nextMeta","value","key","attributeKey","shimAttributeSource","settings","source","edit","getBlockTypes","map","name","getBlockType","forEach"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,SAAjB,EAA4BC,OAA5B,EAAqCC,OAArC,QAAoD,QAApD;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,MAAM,IAAIC,YAAnB,EAAiCC,SAAjC,QAAkD,iBAAlD;AACA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,SAASR,KAAK,IAAIS,WAAlB,QAAqC,UAArC;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,6BAA6B,GAAKC,cAAF,IACrCJ,0BAA0B,CACvBK,SAAF,IAAiB,CAAE;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,aAAd;AAA6B,KAAGC;AAAhC,CAAF,KAA+C;AAC/D,QAAMC,QAAQ,GAAGZ,SAAS,CACvBF,MAAF,IAAcA,MAAM,CAAEO,WAAF,CAAN,CAAsBQ,kBAAtB,EADW,EAEzB,EAFyB,CAA1B;AAIA,QAAM,CAAEC,IAAF,EAAQC,OAAR,IAAoBd,aAAa,CACtC,UADsC,EAEtCW,QAFsC,EAGtC,MAHsC,CAAvC;AAMA,QAAMI,gBAAgB,GAAGd,OAAO,CAC/B,OAAQ,EACP,GAAGO,UADI;AAEP,OAAGhB,SAAS,CACXc,cADW,EAETU,OAAF,IAAeH,IAAI,CAAEG,OAAF,CAF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ADF,GAEEC,GAFF,CAEO,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAgB9B,YAAY,CAAEF,WAAF,CAAZ,CAA4BiC,YAA5B,CAA0CD,IAA1C,CAFvB,EAGEE,OAHF,CAGWR,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":["pickBy","mapValues","isEmpty","mapKeys","store","blocksStore","select","globalSelect","useSelect","useEntityProp","useMemo","createHigherOrderComponent","addFilter","editorStore","createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","getCurrentPostType","meta","setMeta","mergedAttributes","metaKey","nextAttributes","nextMeta","value","key","attributeKey","shimAttributeSource","settings","source","edit","getBlockTypes","map","name","getBlockType","forEach"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,SAAjB,EAA4BC,OAA5B,EAAqCC,OAArC,QAAoD,QAApD;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,MAAM,IAAIC,YAAnB,EAAiCC,SAAjC,QAAkD,iBAAlD;AACA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,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AP;AACA;;AAEDT,MAAAA,aAAa,CAAEQ,cAAF,CAAb;AACA;AArBF,KAsBMP,KAtBN,EADD;AA0BA,CAjDwB,EAkDzB,yBAlDyB,CAD3B;AAsDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASY,mBAAT,CAA8BC,QAA9B,EAAyC;AACxC;AACA,QAAMjB,cAAc,GAAGd,SAAS,CAC/BD,MAAM,CAAEgC,QAAQ,CAACf,UAAX,EAAuB;AAAEgB,IAAAA,MAAM,EAAE;AAAV,GAAvB,CADyB,EAE/B,MAF+B,CAAhC;;AAIA,MAAK,CAAE/B,OAAO,CAAEa,cAAF,CAAd,EAAmC;AAClCiB,IAAAA,QAAQ,CAACE,IAAT,GAAgBpB,6BAA6B,CAAEC,cAAF,CAA7B,CACfiB,QAAQ,CAACE,IADM,CAAhB;AAGA;;AAED,SAAOF,QAAP;AACA;;AAEDpB,SAAS,CACR,0BADQ,EAER,0EAFQ,EAGRmB,mBAHQ,CAAT,C,CAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACAxB,YAAY,CAAEF,WAAF,CAAZ,CACE8B,aADF,GAEEC,GAFF,CAEO;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SAAgB9B,YAAY,CAAEF,WAAF,CAAZ,CAA4BiC,YAA5B,CAA0CD,IAA1C,CAAhB;AAAA,CAFP,EAGEE,OAHF,CAGWR,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"]}
@@ -13,7 +13,8 @@ import { addFilter } from '@wordpress/hooks';
13
13
 
14
14
  import { userAutocompleter } from '../components';
15
15
 
16
- function setDefaultCompleters(completers = []) {
16
+ function setDefaultCompleters() {
17
+ let completers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
17
18
  // Provide copies so filters may directly modify them.
18
19
  completers.push(clone(userAutocompleter));
19
20
  return completers;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/hooks/default-autocompleters.js"],"names":["clone","addFilter","userAutocompleter","setDefaultCompleters","completers","push"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,QAAtB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,eAAlC;;AAEA,SAASC,oBAAT,CAA+BC,UAAU,GAAG,EAA5C,EAAiD;AAChD;AACAA,EAAAA,UAAU,CAACC,IAAX,CAAiBL,KAAK,CAAEE,iBAAF,CAAtB;AAEA,SAAOE,UAAP;AACA;;AAEDH,SAAS,CACR,gCADQ,EAER,8CAFQ,EAGRE,oBAHQ,CAAT","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":["clone","addFilter","userAutocompleter","setDefaultCompleters","completers","push"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,QAAtB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,eAAlC;;AAEA,SAASC,oBAAT,GAAiD;AAAA,MAAlBC,UAAkB,uEAAL,EAAK;AAChD;AACAA,EAAAA,UAAU,CAACC,IAAX,CAAiBL,KAAK,CAAEE,iBAAF,CAAtB;AAEA,SAAOE,UAAP;AACA;;AAEDH,SAAS,CACR,gCADQ,EAER,8CAFQ,EAGRE,oBAHQ,CAAT","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"]}
@@ -98,7 +98,8 @@ export function resetPost(post) {
98
98
  * @return {Object} An action object
99
99
  */
100
100
 
101
- export function __experimentalRequestPostUpdateStart(options = {}) {
101
+ export function __experimentalRequestPostUpdateStart() {
102
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
102
103
  return {
103
104
  type: 'REQUEST_POST_UPDATE_START',
104
105
  options
@@ -112,7 +113,8 @@ export function __experimentalRequestPostUpdateStart(options = {}) {
112
113
  * @return {Object} An action object
113
114
  */
114
115
 
115
- export function __experimentalRequestPostUpdateFinish(options = {}) {
116
+ export function __experimentalRequestPostUpdateFinish() {
117
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
116
118
  return {
117
119
  type: 'REQUEST_POST_UPDATE_FINISH',
118
120
  options
@@ -173,7 +175,9 @@ export function* editPost(edits, options) {
173
175
  * @param {Object} options
174
176
  */
175
177
 
176
- export function* savePost(options = {}) {
178
+ export function* savePost() {
179
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
180
+
177
181
  if (!(yield controls.select(STORE_NAME, 'isEditedPostSaveable'))) {
178
182
  return;
179
183
  }
@@ -275,10 +279,12 @@ export function* trashPost() {
275
279
  * @param {Object?} options Extra flags to identify the autosave.
276
280
  */
277
281
 
278
- export function* autosave({
279
- local = false,
280
- ...options
281
- } = {}) {
282
+ export function* autosave() {
283
+ let {
284
+ local = false,
285
+ ...options
286
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
287
+
282
288
  if (local) {
283
289
  const post = yield controls.select(STORE_NAME, 'getCurrentPost');
284
290
  const isPostNew = yield controls.select(STORE_NAME, 'isEditedPostNew');
@@ -488,7 +494,8 @@ export function unlockPostAutosaving(lockName) {
488
494
  * @yield {Object} Action object
489
495
  */
490
496
 
491
- export function* resetEditorBlocks(blocks, options = {}) {
497
+ export function* resetEditorBlocks(blocks) {
498
+ let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
492
499
  const {
493
500
  __unstableShouldCreateUndoLevel,
494
501
  selection
@@ -512,9 +519,12 @@ export function* resetEditorBlocks(blocks, options = {}) {
512
519
  // a new undo level.
513
520
 
514
521
 
515
- edits.content = ({
516
- blocks: blocksForSerialization = []
517
- }) => __unstableSerializeAndClean(blocksForSerialization);
522
+ edits.content = _ref => {
523
+ let {
524
+ blocks: blocksForSerialization = []
525
+ } = _ref;
526
+ return __unstableSerializeAndClean(blocksForSerialization);
527
+ };
518
528
  }
519
529
 
520
530
  yield* editPost(edits);
@@ -537,11 +547,16 @@ export function updateEditorSettings(settings) {
537
547
  * Backward compatibility
538
548
  */
539
549
 
540
- const getBlockEditorAction = name => function* (...args) {
550
+ const getBlockEditorAction = name => function* () {
541
551
  deprecated("`wp.data.dispatch( 'core/editor' )." + name + '`', {
542
552
  since: '5.3',
543
553
  alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`'
544
554
  });
555
+
556
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
557
+ args[_key] = arguments[_key];
558
+ }
559
+
545
560
  yield controls.dispatch(blockEditorStore, name, ...args);
546
561
  };
547
562
  /**