@wordpress/editor 12.0.2 → 12.0.6

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 (315) 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 +27 -21
  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 +27 -21
  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
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/most-used-terms.js"],"names":["get","Button","useSelect","store","coreStore","unescapeTerms","MAX_MOST_USED_TERMS","DEFAULT_QUERY","per_page","orderby","order","hide_empty","_fields","context","MostUsedTerms","onSelect","taxonomy","_terms","showTerms","select","mostUsedTerms","getEntityRecords","slug","length","terms","label","map","term","id","name"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,mBAA9B;AAEA,MAAMC,mBAAmB,GAAG,EAA5B;AACA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,QAAQ,EAAEF,mBADW;AAErBG,EAAAA,OAAO,EAAE,OAFY;AAGrBC,EAAAA,KAAK,EAAE,MAHc;AAIrBC,EAAAA,UAAU,EAA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n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unescapeTerms } from '../../utils/terms';\n\nconst MAX_MOST_USED_TERMS = 10;\nconst DEFAULT_QUERY = {\n\tper_page: MAX_MOST_USED_TERMS,\n\torderby: 'count',\n\torder: 'desc',\n\thide_empty: true,\n\t_fields: 'id,name,count',\n\tcontext: 'view',\n};\n\nexport default function MostUsedTerms( { onSelect, taxonomy } ) {\n\tconst { _terms, showTerms } = useSelect( ( select ) => {\n\t\tconst mostUsedTerms = select( coreStore ).getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\ttaxonomy.slug,\n\t\t\tDEFAULT_QUERY\n\t\t);\n\t\treturn {\n\t\t\t_terms: mostUsedTerms,\n\t\t\tshowTerms: mostUsedTerms?.length === MAX_MOST_USED_TERMS,\n\t\t};\n\t}, [] );\n\n\tif ( ! showTerms ) {\n\t\treturn null;\n\t}\n\n\tconst terms = unescapeTerms( _terms );\n\tconst label = get( taxonomy, [ 'labels', 'most_used' ] );\n\n\treturn (\n\t\t<div className=\"editor-post-taxonomies__flat-term-most-used\">\n\t\t\t<h3 className=\"editor-post-taxonomies__flat-term-most-used-label\">\n\t\t\t\t{ label }\n\t\t\t</h3>\n\t\t\t{ /*\n\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t */\n\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t<ul\n\t\t\t\trole=\"list\"\n\t\t\t\tclassName=\"editor-post-taxonomies__flat-term-most-used-list\"\n\t\t\t>\n\t\t\t\t{ terms.map( ( term ) => (\n\t\t\t\t\t<li key={ term.id }>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ () => onSelect( term ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ term.name }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/most-used-terms.js"],"names":["get","Button","useSelect","store","coreStore","unescapeTerms","MAX_MOST_USED_TERMS","DEFAULT_QUERY","per_page","orderby","order","hide_empty","_fields","context","MostUsedTerms","onSelect","taxonomy","_terms","showTerms","select","mostUsedTerms","getEntityRecords","slug","length","terms","label","map","term","id","name"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,mBAA9B;AAEA,MAAMC,mBAAmB,GAAG,EAA5B;AACA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,QAAQ,EAAEF,mBADW;AAErBG,EAAAA,OAAO,EAAE,OAFY;AAGrBC,EAAAA,KAAK,EAAE,MAHc;AAIrBC,EAAAA,UAAU,EAAE,IAJS;AAKrBC,EAAAA,OAAO,EAAE,eALY;AAMrBC,EAAAA,OAAO,EAAE;AANY,CAAtB;AASA,eAAe,SAASC,aAAT,OAAiD;AAAA,MAAzB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAyB;AAC/D,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAwBhB,SAAS,CAAIiB,MAAF,IAAc;AACtD,UAAMC,aAAa,GAAGD,MAAM,CAAEf,SAAF,CAAN,CAAoBiB,gBAApB,CACrB,UADqB,EAErBL,QAAQ,CAACM,IAFY,EAGrBf,aAHqB,CAAtB;AAKA,WAAO;AACNU,MAAAA,MAAM,EAAEG,aADF;AAENF,MAAAA,SAAS,EAAE,CAAAE,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEG,MAAf,MAA0BjB;AAF/B,KAAP;AAIA,GAVsC,EAUpC,EAVoC,CAAvC;;AAYA,MAAK,CAAEY,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMM,KAAK,GAAGnB,aAAa,CAAEY,MAAF,CAA3B;AACA,QAAMQ,KAAK,GAAGzB,GAAG,CAAEgB,QAAF,EAAY,CAAE,QAAF,EAAY,WAAZ,CAAZ,CAAjB;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGS,KADH,CADD,EASC;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGD,KAAK,CAACE,GAAN,CAAaC,IAAF,IACZ;AAAI,IAAA,GAAG,EAAGA,IAAI,CAACC;AAAf,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,MADT;AAEC,IAAA,OAAO,EAAG,MAAMb,QAAQ,CAAEY,IAAF;AAFzB,KAIGA,IAAI,CAACE,IAJR,CADD,CADC,CAJH,CATD,CADD;AA4BA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unescapeTerms } from '../../utils/terms';\n\nconst MAX_MOST_USED_TERMS = 10;\nconst DEFAULT_QUERY = {\n\tper_page: MAX_MOST_USED_TERMS,\n\torderby: 'count',\n\torder: 'desc',\n\thide_empty: true,\n\t_fields: 'id,name,count',\n\tcontext: 'view',\n};\n\nexport default function MostUsedTerms( { onSelect, taxonomy } ) {\n\tconst { _terms, showTerms } = useSelect( ( select ) => {\n\t\tconst mostUsedTerms = select( coreStore ).getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\ttaxonomy.slug,\n\t\t\tDEFAULT_QUERY\n\t\t);\n\t\treturn {\n\t\t\t_terms: mostUsedTerms,\n\t\t\tshowTerms: mostUsedTerms?.length === MAX_MOST_USED_TERMS,\n\t\t};\n\t}, [] );\n\n\tif ( ! showTerms ) {\n\t\treturn null;\n\t}\n\n\tconst terms = unescapeTerms( _terms );\n\tconst label = get( taxonomy, [ 'labels', 'most_used' ] );\n\n\treturn (\n\t\t<div className=\"editor-post-taxonomies__flat-term-most-used\">\n\t\t\t<h3 className=\"editor-post-taxonomies__flat-term-most-used-label\">\n\t\t\t\t{ label }\n\t\t\t</h3>\n\t\t\t{ /*\n\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t */\n\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t<ul\n\t\t\t\trole=\"list\"\n\t\t\t\tclassName=\"editor-post-taxonomies__flat-term-most-used-list\"\n\t\t\t>\n\t\t\t\t{ terms.map( ( term ) => (\n\t\t\t\t\t<li key={ term.id }>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ () => onSelect( term ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ term.name }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t</div>\n\t);\n}\n"]}
@@ -17,7 +17,8 @@ import { store as coreStore } from '@wordpress/core-data';
17
17
  */
18
18
 
19
19
  import { store as editorStore } from '../../store';
20
- export function PostTemplate({}) {
20
+ export function PostTemplate(_ref) {
21
+ let {} = _ref;
21
22
  const {
22
23
  availableTemplates,
23
24
  selectedTemplate,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-template/index.js"],"names":["isEmpty","map","__","SelectControl","useSelect","useDispatch","store","coreStore","editorStore","PostTemplate","availableTemplates","selectedTemplate","isViewable","select","getEditedPostAttribute","getEditorSettings","getCurrentPostType","getPostType","viewable","editPost","templateSlug","template","templateName","value","label"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,EAAkBC,GAAlB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,YAAT,CAAuB,EAAvB,EAA4B;AAClC,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA,gBAAtB;AAAwCC,IAAAA;AAAxC,MAAuDR,SAAS,CACnES,MAAF,IAAc;AAAA;;AACb,UAAM;AACLC,MAAAA,sBADK;AAELC,MAAAA,iBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEL,WAAF,CAJV;AAKA,UAAM;AAAES,MAAAA;AAAF,QAAkBJ,MAAM,CAAEN,SAAF,CAA9B;AAEA,WAAO;AACNI,MAAAA,gBAAgB,EAAEG,sBAAsB,CAAE,UAAF,CADlC;AAENJ,MAAAA,kBAAkB,EAAEK,iBAAiB,GAAGL,kBAFlC;AAGNE,MAAAA,UAAU,2CACTK,WAAW,CAAED,kBAAkB,EAApB,CADF,iDACT,aAAqCE,QAD5B,yEACwC;AAJ5C,KAAP;AAMA,GAfoE,EAgBrE,EAhBqE,CAAtE;AAmBA,QAAM;AAAEC,IAAAA;AAAF,MAAed,WAAW,CAAEG,WAAF,CAAhC;;AAEA,MAAK,CAAEI,UAAF,IAAgBZ,OAAO,CAAEU,kBAAF,CAA5B,EAAqD;AACpD,WAAO,IAAP;AACA;;AAED,SACC,cAAC,aAAD;AACC,IAAA,KAAK,EAAGR,EAAE,CAAE,WAAF,CADX;AAEC,IAAA,KAAK,EAAGS,gBAFT;AAGC,IAAA,QAAQ,EAAKS,YAAF,IAAoB;AAC9BD,MAAAA,QAAQ,CAAE;AACTE,QAAAA,QAAQ,EAAED,YAAY,IAAI;AADjB,OAAF,CAAR;AAGA,KAPF;AAQC,IAAA,OAAO,EAAGnB,GAAG,CACZS,kBADY,EAEZ,CAAEY,YAAF,EAAgBF,YAAhB,MAAoC;AACnCG,MAAAA,KAAK,EAAEH,YAD4B;AAEnCI,MAAAA,KAAK,EAAEF;AAF4B,KAApC,CAFY;AARd,IADD;AAkBA;AAED,eAAeb,YAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\nimport { useSelect, useDispatch } 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 PostTemplate( {} ) {\n\tconst { availableTemplates, selectedTemplate, isViewable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetEditorSettings,\n\t\t\t\tgetCurrentPostType,\n\t\t\t} = select( editorStore );\n\t\t\tconst { getPostType } = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\tselectedTemplate: getEditedPostAttribute( 'template' ),\n\t\t\t\tavailableTemplates: getEditorSettings().availableTemplates,\n\t\t\t\tisViewable:\n\t\t\t\t\tgetPostType( getCurrentPostType() )?.viewable ?? false,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tif ( ! isViewable || isEmpty( availableTemplates ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'Template:' ) }\n\t\t\tvalue={ selectedTemplate }\n\t\t\tonChange={ ( templateSlug ) => {\n\t\t\t\teditPost( {\n\t\t\t\t\ttemplate: templateSlug || '',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\toptions={ map(\n\t\t\t\tavailableTemplates,\n\t\t\t\t( templateName, templateSlug ) => ( {\n\t\t\t\t\tvalue: templateSlug,\n\t\t\t\t\tlabel: templateName,\n\t\t\t\t} )\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default PostTemplate;\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-template/index.js"],"names":["isEmpty","map","__","SelectControl","useSelect","useDispatch","store","coreStore","editorStore","PostTemplate","availableTemplates","selectedTemplate","isViewable","select","getEditedPostAttribute","getEditorSettings","getCurrentPostType","getPostType","viewable","editPost","templateSlug","template","templateName","value","label"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,EAAkBC,GAAlB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,YAAT,OAA4B;AAAA,MAAL,EAAK;AAClC,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA,gBAAtB;AAAwCC,IAAAA;AAAxC,MAAuDR,SAAS,CACnES,MAAF,IAAc;AAAA;;AACb,UAAM;AACLC,MAAAA,sBADK;AAELC,MAAAA,iBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEL,WAAF,CAJV;AAKA,UAAM;AAAES,MAAAA;AAAF,QAAkBJ,MAAM,CAAEN,SAAF,CAA9B;AAEA,WAAO;AACNI,MAAAA,gBAAgB,EAAEG,sBAAsB,CAAE,UAAF,CADlC;AAENJ,MAAAA,kBAAkB,EAAEK,iBAAiB,GAAGL,kBAFlC;AAGNE,MAAAA,UAAU,2CACTK,WAAW,CAAED,kBAAkB,EAApB,CADF,iDACT,aAAqCE,QAD5B,yEACwC;AAJ5C,KAAP;AAMA,GAfoE,EAgBrE,EAhBqE,CAAtE;AAmBA,QAAM;AAAEC,IAAAA;AAAF,MAAed,WAAW,CAAEG,WAAF,CAAhC;;AAEA,MAAK,CAAEI,UAAF,IAAgBZ,OAAO,CAAEU,kBAAF,CAA5B,EAAqD;AACpD,WAAO,IAAP;AACA;;AAED,SACC,cAAC,aAAD;AACC,IAAA,KAAK,EAAGR,EAAE,CAAE,WAAF,CADX;AAEC,IAAA,KAAK,EAAGS,gBAFT;AAGC,IAAA,QAAQ,EAAKS,YAAF,IAAoB;AAC9BD,MAAAA,QAAQ,CAAE;AACTE,QAAAA,QAAQ,EAAED,YAAY,IAAI;AADjB,OAAF,CAAR;AAGA,KAPF;AAQC,IAAA,OAAO,EAAGnB,GAAG,CACZS,kBADY,EAEZ,CAAEY,YAAF,EAAgBF,YAAhB,MAAoC;AACnCG,MAAAA,KAAK,EAAEH,YAD4B;AAEnCI,MAAAA,KAAK,EAAEF;AAF4B,KAApC,CAFY;AARd,IADD;AAkBA;AAED,eAAeb,YAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\nimport { useSelect, useDispatch } 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 PostTemplate( {} ) {\n\tconst { availableTemplates, selectedTemplate, isViewable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetEditorSettings,\n\t\t\t\tgetCurrentPostType,\n\t\t\t} = select( editorStore );\n\t\t\tconst { getPostType } = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\tselectedTemplate: getEditedPostAttribute( 'template' ),\n\t\t\t\tavailableTemplates: getEditorSettings().availableTemplates,\n\t\t\t\tisViewable:\n\t\t\t\t\tgetPostType( getCurrentPostType() )?.viewable ?? false,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tif ( ! isViewable || isEmpty( availableTemplates ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'Template:' ) }\n\t\t\tvalue={ selectedTemplate }\n\t\t\tonChange={ ( templateSlug ) => {\n\t\t\t\teditPost( {\n\t\t\t\t\ttemplate: templateSlug || '',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\toptions={ map(\n\t\t\t\tavailableTemplates,\n\t\t\t\t( templateName, templateSlug ) => ( {\n\t\t\t\t\tvalue: templateSlug,\n\t\t\t\t\tlabel: templateName,\n\t\t\t\t} )\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default PostTemplate;\n"]}
@@ -56,11 +56,12 @@ class PostTitle extends Component {
56
56
  this.props.onSelect();
57
57
  }
58
58
 
59
- onPaste({
60
- value,
61
- onChange,
62
- plainText
63
- }) {
59
+ onPaste(_ref) {
60
+ let {
61
+ value,
62
+ onChange,
63
+ plainText
64
+ } = _ref;
64
65
  const content = pasteHandler({
65
66
  plainText,
66
67
  mode: 'INLINE',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-title/index.native.js"],"names":["View","isEmpty","Component","__experimentalRichText","RichText","create","insert","decodeEntities","withDispatch","withSelect","withFocusOutside","withInstanceId","compose","__","sprintf","pasteHandler","store","blockEditorStore","editorStore","styles","PostTitle","constructor","props","setRef","bind","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","onPaste","value","onChange","plainText","content","mode","tagName","valueToInsert","html","richText","getTitle","title","postType","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","borderColor","titleStyles","text","color","placeholderColor","titleContainer","dimmed","onBlur","onUpdate","onEnterPress","select","isPostTitleSelected","getEditedPostAttribute","getSelectedBlockClientId","getBlockRootClientId","getSettings","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","dispatch","undo","redo","togglePostTitleSelection","clearSelectedBlock","insertDefaultBlock","undefined","onUndo","onRedo"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,cAArB;AACA,SAASC,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SACCC,sBAAsB,IAAIC,QAD3B,EAECC,MAFD,EAGCC,MAHD,QAIO,sBAJP;AAKA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,gBAAT,QAAiC,uBAAjC;AACA,SAASC,cAAT,EAAyBC,OAAzB,QAAwC,oBAAxC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,YAAT,QAA6B,mBAA7B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;;AAEA,MAAMC,SAAN,SAAwBlB,SAAxB,CAAkC;AACjCmB,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAOA,KAAP;AAEA,SAAKC,MAAL,GAAc,KAAKA,MAAL,CAAYC,IAAZ,CAAkB,IAAlB,CAAd;AACA;;AACDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAc;AAC/B;AACA,QACC,KAAKJ,KAAL,CAAWK,UAAX,IACA,CAAED,SAAS,CAACE,kBADZ,IAEA,KAAKN,KAAL,CAAWM,kBAHZ,EAIE;AACD,UAAK,KAAKC,WAAV,EAAwB;AACvB,a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,aAAeG,oCAAlB,0DAAG,sBAClBf,KADH;AAGA,SAAO;AACNZ,IAAAA,QAAQ,EAAEqB,sBAAsB,CAAE,MAAF,CAD1B;AAEN1C,IAAAA,kBAAkB,EAAE,CAAC,CAAE8C,UAFjB;AAGN/C,IAAAA,UAAU,EAAE0C,mBAAmB,EAHzB;AAINd,IAAAA,QAAQ,EAAEoB,iBAJJ;AAKNnB,IAAAA;AALM,GAAP;AAOA,CAtBS,CADW,EAwBrBhD,YAAY,CAAIqE,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA;AAAd,MAA2CH,QAAQ,CACxD3D,WADwD,CAAzD;AAIA,QAAM;AAAE+D,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MAA6CL,QAAQ,CAC1D5D,gBAD0D,CAA3D;AAIA,SAAO;AACNkD,IAAAA,YAAY,GAAG;AACde,MAAAA,kBAAkB,CAAEC,SAAF,EAAaA,SAAb,EAAwB,CAAxB,CAAlB;AACA,KAHK;;AAINC,IAAAA,MAAM,EAAEN,IAJF;AAKNO,IAAAA,MAAM,EAAEN,IALF;;AAMN3C,IAAAA,QAAQ,GAAG;AACV4C,MAAAA,wBAAwB,CAAE,IAAF,CAAxB;AACAC,MAAAA,kBAAkB;AAClB,KATK;;AAUNlD,IAAAA,UAAU,GAAG;AACZiD,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA;;AAZK,GAAP;AAcA,CAvBW,CAxBS,EAgDrBrE,cAhDqB,EAiDrBD,gBAjDqB,CAAP,CAkDZU,SAlDY,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\t__experimentalRichText as RichText,\n\tcreate,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { withFocusOutside } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { pasteHandler } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nclass PostTitle extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.setRef = this.setRef.bind( this );\n\t}\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Unselect if any other block is selected and blur the RichText\n\t\tif (\n\t\t\tthis.props.isSelected &&\n\t\t\t! prevProps.isAnyBlockSelected &&\n\t\t\tthis.props.isAnyBlockSelected\n\t\t) {\n\t\t\tif ( this.richTextRef ) {\n\t\t\t\tthis.richTextRef.blur();\n\t\t\t}\n\t\t\tthis.props.onUnselect();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.innerRef ) {\n\t\t\tthis.props.innerRef( this );\n\t\t}\n\t}\n\n\thandleFocusOutside() {\n\t\tthis.props.onUnselect();\n\t}\n\n\tfocus() {\n\t\tthis.props.onSelect();\n\t}\n\n\tonPaste( { value, onChange, plainText } ) {\n\t\tconst content = pasteHandler( {\n\t\t\tplainText,\n\t\t\tmode: 'INLINE',\n\t\t\ttagName: 'p',\n\t\t} );\n\n\t\tif ( typeof content === 'string' ) {\n\t\t\tconst valueToInsert = create( { html: content } );\n\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t}\n\t}\n\n\tsetRef( richText ) {\n\t\tthis.richTextRef = richText;\n\t}\n\n\tgetTitle( title, postType ) {\n\t\tif ( 'page' === postType ) {\n\t\t\treturn isEmpty( title )\n\t\t\t\t? /* translators: accessibility text. empty page title. */\n\t\t\t\t __( 'Page title. Empty' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. %s: text content of the page title. */\n\t\t\t\t\t\t__( 'Page title. %s' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t );\n\t\t}\n\n\t\treturn isEmpty( title )\n\t\t\t? /* translators: accessibility text. empty post title. */\n\t\t\t __( 'Post title. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: text content of the post title. */\n\t\t\t\t\t__( 'Post title. %s' ),\n\t\t\t\t\ttitle\n\t\t\t );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t\tfocusedBorderColor,\n\t\t\tborderStyle,\n\t\t\tisDimmed,\n\t\t\tpostType,\n\t\t\tglobalStyles,\n\t\t} = this.props;\n\n\t\tconst decodedPlaceholder = decodeEntities( placeholder );\n\t\tconst borderColor = this.props.isSelected\n\t\t\t? focusedBorderColor\n\t\t\t: 'transparent';\n\t\tconst titleStyles = {\n\t\t\t...style,\n\t\t\t...( globalStyles?.text && {\n\t\t\t\tcolor: globalStyles.text,\n\t\t\t\tplaceholderColor: globalStyles.text,\n\t\t\t} ),\n\t\t};\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles.titleContainer,\n\t\t\t\t\tborderStyle,\n\t\t\t\t\t{ borderColor },\n\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t] }\n\t\t\t\taccessible={ ! this.props.isSelected }\n\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\taccessibilityHint={ __( 'Updates the title.' ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tsetRef={ this.setRef }\n\t\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\t\ttagName={ 'p' }\n\t\t\t\t\ttagsToEliminate={ [ 'strong' ] }\n\t\t\t\t\tunstableOnFocus={ this.props.onSelect }\n\t\t\t\t\tonBlur={ this.props.onBlur } // always assign onBlur as a props\n\t\t\t\t\tmultiline={ false }\n\t\t\t\t\tstyle={ titleStyles }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tfontSize={ 24 }\n\t\t\t\t\tfontWeight={ 'bold' }\n\t\t\t\t\tdeleteEnter={ true }\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tthis.props.onUpdate( value );\n\t\t\t\t\t} }\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonSelectionChange={ () => {} }\n\t\t\t\t\tonEnter={ this.props.onEnterPress }\n\t\t\t\t\tdisableEditingMenu={ true }\n\t\t\t\t\t__unstableIsSelected={ this.props.isSelected }\n\t\t\t\t\t__unstableOnCreateUndoLevel={ () => {} }\n\t\t\t\t></RichText>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst { isPostTitleSelected, getEditedPostAttribute } = select(\n\t\t\teditorStore\n\t\t);\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedId = getSelectedBlockClientId();\n\t\tconst selectionIsNested = !! getBlockRootClientId( selectedId );\n\t\tconst globalStyles = getSettings()?.__experimentalGlobalStylesBaseStyles\n\t\t\t?.color;\n\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisAnyBlockSelected: !! selectedId,\n\t\t\tisSelected: isPostTitleSelected(),\n\t\t\tisDimmed: selectionIsNested,\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { undo, redo, togglePostTitleSelection } = dispatch(\n\t\t\teditorStore\n\t\t);\n\n\t\tconst { clearSelectedBlock, insertDefaultBlock } = dispatch(\n\t\t\tblockEditorStore\n\t\t);\n\n\t\treturn {\n\t\t\tonEnterPress() {\n\t\t\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t\t\t},\n\t\t\tonUndo: undo,\n\t\t\tonRedo: redo,\n\t\t\tonSelect() {\n\t\t\t\ttogglePostTitleSelection( true );\n\t\t\t\tclearSelectedBlock();\n\t\t\t},\n\t\t\tonUnselect() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithFocusOutside\n)( PostTitle );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-title/index.native.js"],"names":["View","isEmpty","Component","__experimentalRichText","RichText","create","insert","decodeEntities","withDispatch","withSelect","withFocusOutside","withInstanceId","compose","__","sprintf","pasteHandler","store","blockEditorStore","editorStore","styles","PostTitle","constructor","props","setRef","bind","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","onPaste","value","onChange","plainText","content","mode","tagName","valueToInsert","html","richText","getTitle","title","postType","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","borderColor","titleStyles","text","color","placeholderColor","titleContainer","dimmed","onBlur","onUpdate","onEnterPress","select","isPostTitleSelected","getEditedPostAttribute","getSelectedBlockClientId","getBlockRootClientId","getSettings","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","dispatch","undo","redo","togglePostTitleSelection","clearSelectedBlock","insertDefaultBlock","undefined","onUndo","onRedo"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,cAArB;AACA,SAASC,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SACCC,sBAAsB,IAAIC,QAD3B,EAECC,MAFD,EAGCC,MAHD,QAIO,sBAJP;AAKA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,gBAAT,QAAiC,uBAAjC;AACA,SAASC,cAAT,EAAyBC,OAAzB,QAAwC,oBAAxC;AACA,SAASC,EAAT,EAAa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A,KAHK;;AAINC,IAAAA,MAAM,EAAEN,IAJF;AAKNO,IAAAA,MAAM,EAAEN,IALF;;AAMN3C,IAAAA,QAAQ,GAAG;AACV4C,MAAAA,wBAAwB,CAAE,IAAF,CAAxB;AACAC,MAAAA,kBAAkB;AAClB,KATK;;AAUNlD,IAAAA,UAAU,GAAG;AACZiD,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA;;AAZK,GAAP;AAcA,CAvBW,CAxBS,EAgDrBrE,cAhDqB,EAiDrBD,gBAjDqB,CAAP,CAkDZU,SAlDY,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\t__experimentalRichText as RichText,\n\tcreate,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { withFocusOutside } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { pasteHandler } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nclass PostTitle extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.setRef = this.setRef.bind( this );\n\t}\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Unselect if any other block is selected and blur the RichText\n\t\tif (\n\t\t\tthis.props.isSelected &&\n\t\t\t! prevProps.isAnyBlockSelected &&\n\t\t\tthis.props.isAnyBlockSelected\n\t\t) {\n\t\t\tif ( this.richTextRef ) {\n\t\t\t\tthis.richTextRef.blur();\n\t\t\t}\n\t\t\tthis.props.onUnselect();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.innerRef ) {\n\t\t\tthis.props.innerRef( this );\n\t\t}\n\t}\n\n\thandleFocusOutside() {\n\t\tthis.props.onUnselect();\n\t}\n\n\tfocus() {\n\t\tthis.props.onSelect();\n\t}\n\n\tonPaste( { value, onChange, plainText } ) {\n\t\tconst content = pasteHandler( {\n\t\t\tplainText,\n\t\t\tmode: 'INLINE',\n\t\t\ttagName: 'p',\n\t\t} );\n\n\t\tif ( typeof content === 'string' ) {\n\t\t\tconst valueToInsert = create( { html: content } );\n\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t}\n\t}\n\n\tsetRef( richText ) {\n\t\tthis.richTextRef = richText;\n\t}\n\n\tgetTitle( title, postType ) {\n\t\tif ( 'page' === postType ) {\n\t\t\treturn isEmpty( title )\n\t\t\t\t? /* translators: accessibility text. empty page title. */\n\t\t\t\t __( 'Page title. Empty' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. %s: text content of the page title. */\n\t\t\t\t\t\t__( 'Page title. %s' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t );\n\t\t}\n\n\t\treturn isEmpty( title )\n\t\t\t? /* translators: accessibility text. empty post title. */\n\t\t\t __( 'Post title. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: text content of the post title. */\n\t\t\t\t\t__( 'Post title. %s' ),\n\t\t\t\t\ttitle\n\t\t\t );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t\tfocusedBorderColor,\n\t\t\tborderStyle,\n\t\t\tisDimmed,\n\t\t\tpostType,\n\t\t\tglobalStyles,\n\t\t} = this.props;\n\n\t\tconst decodedPlaceholder = decodeEntities( placeholder );\n\t\tconst borderColor = this.props.isSelected\n\t\t\t? focusedBorderColor\n\t\t\t: 'transparent';\n\t\tconst titleStyles = {\n\t\t\t...style,\n\t\t\t...( globalStyles?.text && {\n\t\t\t\tcolor: globalStyles.text,\n\t\t\t\tplaceholderColor: globalStyles.text,\n\t\t\t} ),\n\t\t};\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles.titleContainer,\n\t\t\t\t\tborderStyle,\n\t\t\t\t\t{ borderColor },\n\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t] }\n\t\t\t\taccessible={ ! this.props.isSelected }\n\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\taccessibilityHint={ __( 'Updates the title.' ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tsetRef={ this.setRef }\n\t\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\t\ttagName={ 'p' }\n\t\t\t\t\ttagsToEliminate={ [ 'strong' ] }\n\t\t\t\t\tunstableOnFocus={ this.props.onSelect }\n\t\t\t\t\tonBlur={ this.props.onBlur } // always assign onBlur as a props\n\t\t\t\t\tmultiline={ false }\n\t\t\t\t\tstyle={ titleStyles }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tfontSize={ 24 }\n\t\t\t\t\tfontWeight={ 'bold' }\n\t\t\t\t\tdeleteEnter={ true }\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tthis.props.onUpdate( value );\n\t\t\t\t\t} }\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonSelectionChange={ () => {} }\n\t\t\t\t\tonEnter={ this.props.onEnterPress }\n\t\t\t\t\tdisableEditingMenu={ true }\n\t\t\t\t\t__unstableIsSelected={ this.props.isSelected }\n\t\t\t\t\t__unstableOnCreateUndoLevel={ () => {} }\n\t\t\t\t></RichText>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst { isPostTitleSelected, getEditedPostAttribute } = select(\n\t\t\teditorStore\n\t\t);\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedId = getSelectedBlockClientId();\n\t\tconst selectionIsNested = !! getBlockRootClientId( selectedId );\n\t\tconst globalStyles = getSettings()?.__experimentalGlobalStylesBaseStyles\n\t\t\t?.color;\n\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisAnyBlockSelected: !! selectedId,\n\t\t\tisSelected: isPostTitleSelected(),\n\t\t\tisDimmed: selectionIsNested,\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { undo, redo, togglePostTitleSelection } = dispatch(\n\t\t\teditorStore\n\t\t);\n\n\t\tconst { clearSelectedBlock, insertDefaultBlock } = dispatch(\n\t\t\tblockEditorStore\n\t\t);\n\n\t\treturn {\n\t\t\tonEnterPress() {\n\t\t\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t\t\t},\n\t\t\tonUndo: undo,\n\t\t\tonRedo: redo,\n\t\t\tonSelect() {\n\t\t\t\ttogglePostTitleSelection( true );\n\t\t\t\tclearSelectedBlock();\n\t\t\t},\n\t\t\tonUnselect() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithFocusOutside\n)( PostTitle );\n"]}
@@ -9,12 +9,14 @@ import { store as coreStore } from '@wordpress/core-data';
9
9
 
10
10
  import { store as editorStore } from '../../store';
11
11
 
12
- function PostTrashCheck({
13
- isNew,
14
- postId,
15
- canUserDelete,
16
- children
17
- }) {
12
+ function PostTrashCheck(_ref) {
13
+ let {
14
+ isNew,
15
+ postId,
16
+ canUserDelete,
17
+ children
18
+ } = _ref;
19
+
18
20
  if (isNew || !postId || !canUserDelete) {
19
21
  return null;
20
22
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-trash/check.js"],"names":["withSelect","store","coreStore","editorStore","PostTrashCheck","isNew","postId","canUserDelete","children","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","getPostType","canUser","postType","resource","rest_base"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;;AAEA,SAASC,cAAT,CAAyB;AAAEC,EAAAA,KAAF;AAASC,EAAAA,MAAT;AAAiBC,EAAAA,aAAjB;AAAgCC,EAAAA;AAAhC,CAAzB,EAAsE;AACrE,MAAKH,KAAK,IAAI,CAAEC,MAAX,IAAqB,CAAEC,aAA5B,EAA4C;AAC3C,WAAO,IAAP;AACA;;AAED,SAAOC,QAAP;AACA;;AAED,eAAeR,UAAU,CAAIS,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA,gBAAnB;AAAqCC,IAAAA;AAArC,MAA4DH,MAAM,CACvEN,WADuE,CAAxE;AAGA,QAAM;AAAEU,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAA2BL,MAAM,CAAEP,SAAF,CAAvC;AACA,QAAMI,MAAM,GAAGK,gBAAgB,EAA/B;AACA,QAAMI,QAAQ,GAAGF,WAAW,CAAED,kBAAkB,EAApB,CAA5B;AACA,QAAMI,QAAQ,GAAG,CAAAD,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEE,SAAV,KAAuB,EAAxC,CAPwC,CAOI;;AAE5C,SAAO;AACNZ,IAAAA,KAAK,EAAEK,eAAe,EADhB;AAENJ,IAAAA,MAFM;AAGNC,IAAAA,aAAa,EACZD,MAAM,IAAIU,QAAV,GAAqBF,OAAO,CAAE,QAAF,EAAYE,QAAZ,EAAsBV,MAAtB,CAA5B,GAA6D;AAJxD,GAAP;AAMA,CAfwB,CAAV,CAeVF,cAfU,CAAf","sourcesContent":["/**\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\nfunction PostTrashCheck( { isNew, postId, canUserDelete, children } ) {\n\tif ( isNew || ! postId || ! canUserDelete ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } = select(\n\t\teditorStore\n\t);\n\tconst { getPostType, canUser } = select( coreStore );\n\tconst postId = getCurrentPostId();\n\tconst postType = getPostType( getCurrentPostType() );\n\tconst resource = postType?.rest_base || ''; // eslint-disable-line camelcase\n\n\treturn {\n\t\tisNew: isEditedPostNew(),\n\t\tpostId,\n\t\tcanUserDelete:\n\t\t\tpostId && resource ? canUser( 'delete', resource, postId ) : false,\n\t};\n} )( PostTrashCheck );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-trash/check.js"],"names":["withSelect","store","coreStore","editorStore","PostTrashCheck","isNew","postId","canUserDelete","children","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","getPostType","canUser","postType","resource","rest_base"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;;AAEA,SAASC,cAAT,OAAsE;AAAA,MAA7C;AAAEC,IAAAA,KAAF;AAASC,IAAAA,MAAT;AAAiBC,IAAAA,aAAjB;AAAgCC,IAAAA;AAAhC,GAA6C;;AACrE,MAAKH,KAAK,IAAI,CAAEC,MAAX,IAAqB,CAAEC,aAA5B,EAA4C;AAC3C,WAAO,IAAP;AACA;;AAED,SAAOC,QAAP;AACA;;AAED,eAAeR,UAAU,CAAIS,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA,gBAAnB;AAAqCC,IAAAA;AAArC,MAA4DH,MAAM,CACvEN,WADuE,CAAxE;AAGA,QAAM;AAAEU,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAA2BL,MAAM,CAAEP,SAAF,CAAvC;AACA,QAAMI,MAAM,GAAGK,gBAAgB,EAA/B;AACA,QAAMI,QAAQ,GAAGF,WAAW,CAAED,kBAAkB,EAApB,CAA5B;AACA,QAAMI,QAAQ,GAAG,CAAAD,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEE,SAAV,KAAuB,EAAxC,CAPwC,CAOI;;AAE5C,SAAO;AACNZ,IAAAA,KAAK,EAAEK,eAAe,EADhB;AAENJ,IAAAA,MAFM;AAGNC,IAAAA,aAAa,EACZD,MAAM,IAAIU,QAAV,GAAqBF,OAAO,CAAE,QAAF,EAAYE,QAAZ,EAAsBV,MAAtB,CAA5B,GAA6D;AAJxD,GAAP;AAMA,CAfwB,CAAV,CAeVF,cAfU,CAAf","sourcesContent":["/**\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\nfunction PostTrashCheck( { isNew, postId, canUserDelete, children } ) {\n\tif ( isNew || ! postId || ! canUserDelete ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } = select(\n\t\teditorStore\n\t);\n\tconst { getPostType, canUser } = select( coreStore );\n\tconst postId = getCurrentPostId();\n\tconst postType = getPostType( getCurrentPostType() );\n\tconst resource = postType?.rest_base || ''; // eslint-disable-line camelcase\n\n\treturn {\n\t\tisNew: isEditedPostNew(),\n\t\tpostId,\n\t\tcanUserDelete:\n\t\t\tpostId && resource ? canUser( 'delete', resource, postId ) : false,\n\t};\n} )( PostTrashCheck );\n"]}
@@ -13,12 +13,14 @@ import { compose } from '@wordpress/compose';
13
13
 
14
14
  import { store as editorStore } from '../../store';
15
15
 
16
- function PostTrash({
17
- isNew,
18
- postId,
19
- postType,
20
- ...props
21
- }) {
16
+ function PostTrash(_ref) {
17
+ let {
18
+ isNew,
19
+ postId,
20
+ postType,
21
+ ...props
22
+ } = _ref;
23
+
22
24
  if (isNew || !postId) {
23
25
  return null;
24
26
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-trash/index.js"],"names":["__","Button","withSelect","withDispatch","compose","store","editorStore","PostTrash","isNew","postId","postType","props","onClick","trashPost","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","dispatch"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,SAASC,SAAT,CAAoB;AAAEC,EAAAA,KAAF;AAASC,EAAAA,MAAT;AAAiBC,EAAAA,QAAjB;AAA2B,KAAGC;AAA9B,CAApB,EAA4D;AAC3D,MAAKH,KAAK,IAAI,CAAEC,MAAhB,EAAyB;AACxB,WAAO,IAAP;AACA;;AAED,QAAMG,OAAO,GAAG,MAAMD,KAAK,CAACE,SAAN,CAAiBJ,MAAjB,EAAyBC,QAAzB,CAAtB;;AAEA,SACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,mBADX;AAEC,IAAA,aAAa,MAFd;AAGC,IAAA,OAAO,EAAC,UAHT;AAIC,IAAA,OAAO,EAAGE;AAJX,KAMGZ,EAAE,CAAE,eAAF,CANL,CADD;AAUA;;AAED,eAAeI,OAAO,CAAE,CACvBF,UAAU,CAAIY,MAAF,IAAc;AACzB,QAAM;AACLC,IAAAA,eADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA;AAHK,MAIFH,MAAM,CAAER,WAAF,CAJV;AAKA,SAAO;AACNE,IAAAA,KAAK,EAAEO,eAAe,EADhB;AAENN,IAAAA,MAAM,EAAEO,gBAAgB,EAFlB;AAGNN,IAAAA,QAAQ,EAAEO,kBAAkB;AAHtB,GAAP;AAKA,CAXS,CADa,EAavBd,YAAY,CAAIe,QAAF,KAAkB;AAC/BL,EAAAA,SAAS,EAAEK,QAAQ,CAAEZ,WAAF,CAAR,CAAwBO;AADJ,CAAlB,CAAF,CAbW,CAAF,CAAP,CAgBVN,SAhBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostTrash( { isNew, postId, postType, ...props } ) {\n\tif ( isNew || ! postId ) {\n\t\treturn null;\n\t}\n\n\tconst onClick = () => props.trashPost( postId, postType );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"editor-post-trash\"\n\t\t\tisDestructive\n\t\t\tvariant=\"tertiary\"\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ __( 'Move to trash' ) }\n\t\t</Button>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisEditedPostNew,\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisNew: isEditedPostNew(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => ( {\n\t\ttrashPost: dispatch( editorStore ).trashPost,\n\t} ) ),\n] )( PostTrash );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-trash/index.js"],"names":["__","Button","withSelect","withDispatch","compose","store","editorStore","PostTrash","isNew","postId","postType","props","onClick","trashPost","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","dispatch"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,SAASC,SAAT,OAA4D;AAAA,MAAxC;AAAEC,IAAAA,KAAF;AAASC,IAAAA,MAAT;AAAiBC,IAAAA,QAAjB;AAA2B,OAAGC;AAA9B,GAAwC;;AAC3D,MAAKH,KAAK,IAAI,CAAEC,MAAhB,EAAyB;AACxB,WAAO,IAAP;AACA;;AAED,QAAMG,OAAO,GAAG,MAAMD,KAAK,CAACE,SAAN,CAAiBJ,MAAjB,EAAyBC,QAAzB,CAAtB;;AAEA,SACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,mBADX;AAEC,IAAA,aAAa,MAFd;AAGC,IAAA,OAAO,EAAC,UAHT;AAIC,IAAA,OAAO,EAAGE;AAJX,KAMGZ,EAAE,CAAE,eAAF,CANL,CADD;AAUA;;AAED,eAAeI,OAAO,CAAE,CACvBF,UAAU,CAAIY,MAAF,IAAc;AACzB,QAAM;AACLC,IAAAA,eADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA;AAHK,MAIFH,MAAM,CAAER,WAAF,CAJV;AAKA,SAAO;AACNE,IAAAA,KAAK,EAAEO,eAAe,EADhB;AAENN,IAAAA,MAAM,EAAEO,gBAAgB,EAFlB;AAGNN,IAAAA,QAAQ,EAAEO,kBAAkB;AAHtB,GAAP;AAKA,CAXS,CADa,EAavBd,YAAY,CAAIe,QAAF,KAAkB;AAC/BL,EAAAA,SAAS,EAAEK,QAAQ,CAAEZ,WAAF,CAAR,CAAwBO;AADJ,CAAlB,CAAF,CAbW,CAAF,CAAP,CAgBVN,SAhBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostTrash( { isNew, postId, postType, ...props } ) {\n\tif ( isNew || ! postId ) {\n\t\treturn null;\n\t}\n\n\tconst onClick = () => props.trashPost( postId, postType );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"editor-post-trash\"\n\t\t\tisDestructive\n\t\t\tvariant=\"tertiary\"\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ __( 'Move to trash' ) }\n\t\t</Button>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisEditedPostNew,\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t} = select( editorStore );\n\t\treturn {\n\t\t\tisNew: isEditedPostNew(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => ( {\n\t\ttrashPost: dispatch( editorStore ).trashPost,\n\t} ) ),\n] )( PostTrash );\n"]}
@@ -27,11 +27,12 @@ import { store as editorStore } from '../../store';
27
27
  * @return {WPComponent} The component to be rendered.
28
28
  */
29
29
 
30
- export function PostTypeSupportCheck({
31
- postType,
32
- children,
33
- supportKeys
34
- }) {
30
+ export function PostTypeSupportCheck(_ref) {
31
+ let {
32
+ postType,
33
+ children,
34
+ supportKeys
35
+ } = _ref;
35
36
  let isSupported = true;
36
37
 
37
38
  if (postType) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-type-support-check/index.js"],"names":["some","castArray","withSelect","store","coreStore","editorStore","PostTypeSupportCheck","postType","children","supportKeys","isSupported","key","supports","select","getEditedPostAttribute","getPostType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,SAAf,QAAgC,QAAhC;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,oBAAT,CAA+B;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,QAAZ;AAAsBC,EAAAA;AAAtB,CAA/B,EAAqE;AAC3E,MAAIC,WAAW,GAAG,IAAlB;;AACA,MAAKH,QAAL,EAAgB;AACfG,IAAAA,WAAW,GAAGV,IAAI,CACjBC,SAAS,CAAEQ,WAAF,CADQ,EAEfE,GAAF,IAAW,CAAC,CAAEJ,QAAQ,CAACK,QAAT,CAAmBD,GAAnB,CAFG,CAAlB;AAIA;;AAED,MAAK,CAAED,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOF,QAAP;AACA;AAED,eAAeN,UAAU,CAAIW,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAER,WAAF,CAAzC;AACA,QAAM;AAAEU,IAAAA;AAAF,MAAkBF,MAAM,CAAET,SAAF,CAA9B;AACA,SAAO;AACNG,IAAAA,QAAQ,EAAEQ,WAAW,CAAED,sBAAsB,CAAE,MAAF,CAAxB;AADf,GAAP;AAGA,CANwB,CAAV,CAMVR,oBANU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { some, castArray } 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\n/**\n * A component which renders its own children only if the current editor post\n * type supports one of the given `supportKeys` prop.\n *\n * @param {Object} props Props.\n * @param {string} [props.postType] Current post type.\n * @param {WPElement} props.children Children to be rendered if post\n * type supports.\n * @param {(string|string[])} props.supportKeys String or string array of keys\n * to test.\n *\n * @return {WPComponent} The component to be rendered.\n */\nexport function PostTypeSupportCheck( { postType, children, supportKeys } ) {\n\tlet isSupported = true;\n\tif ( postType ) {\n\t\tisSupported = some(\n\t\t\tcastArray( supportKeys ),\n\t\t\t( key ) => !! postType.supports[ key ]\n\t\t);\n\t}\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute } = select( editorStore );\n\tconst { getPostType } = select( coreStore );\n\treturn {\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t};\n} )( PostTypeSupportCheck );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-type-support-check/index.js"],"names":["some","castArray","withSelect","store","coreStore","editorStore","PostTypeSupportCheck","postType","children","supportKeys","isSupported","key","supports","select","getEditedPostAttribute","getPostType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,SAAf,QAAgC,QAAhC;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,oBAAT,OAAqE;AAAA,MAAtC;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,QAAZ;AAAsBC,IAAAA;AAAtB,GAAsC;AAC3E,MAAIC,WAAW,GAAG,IAAlB;;AACA,MAAKH,QAAL,EAAgB;AACfG,IAAAA,WAAW,GAAGV,IAAI,CACjBC,SAAS,CAAEQ,WAAF,CADQ,EAEfE,GAAF,IAAW,CAAC,CAAEJ,QAAQ,CAACK,QAAT,CAAmBD,GAAnB,CAFG,CAAlB;AAIA;;AAED,MAAK,CAAED,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOF,QAAP;AACA;AAED,eAAeN,UAAU,CAAIW,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAER,WAAF,CAAzC;AACA,QAAM;AAAEU,IAAAA;AAAF,MAAkBF,MAAM,CAAET,SAAF,CAA9B;AACA,SAAO;AACNG,IAAAA,QAAQ,EAAEQ,WAAW,CAAED,sBAAsB,CAAE,MAAF,CAAxB;AADf,GAAP;AAGA,CANwB,CAAV,CAMVR,oBANU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { some, castArray } 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\n/**\n * A component which renders its own children only if the current editor post\n * type supports one of the given `supportKeys` prop.\n *\n * @param {Object} props Props.\n * @param {string} [props.postType] Current post type.\n * @param {WPElement} props.children Children to be rendered if post\n * type supports.\n * @param {(string|string[])} props.supportKeys String or string array of keys\n * to test.\n *\n * @return {WPComponent} The component to be rendered.\n */\nexport function PostTypeSupportCheck( { postType, children, supportKeys } ) {\n\tlet isSupported = true;\n\tif ( postType ) {\n\t\tisSupported = some(\n\t\t\tcastArray( supportKeys ),\n\t\t\t( key ) => !! postType.supports[ key ]\n\t\t);\n\t}\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute } = select( editorStore );\n\tconst { getPostType } = select( coreStore );\n\treturn {\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t};\n} )( PostTypeSupportCheck );\n"]}
@@ -13,10 +13,11 @@ import { withSelect } from '@wordpress/data';
13
13
  */
14
14
 
15
15
  import { store as editorStore } from '../../store';
16
- export function PostVisibilityCheck({
17
- hasPublishAction,
18
- render
19
- }) {
16
+ export function PostVisibilityCheck(_ref) {
17
+ let {
18
+ hasPublishAction,
19
+ render
20
+ } = _ref;
20
21
  const canEdit = hasPublishAction;
21
22
  return render({
22
23
  canEdit
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"names":["get","compose","withSelect","store","editorStore","PostVisibilityCheck","hasPublishAction","render","canEdit","select","getCurrentPost","getCurrentPostType","postType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,mBAAT,CAA8B;AAAEC,EAAAA,gBAAF;AAAoBC,EAAAA;AAApB,CAA9B,EAA6D;AACnE,QAAMC,OAAO,GAAGF,gBAAhB;AACA,SAAOC,MAAM,CAAE;AAAEC,IAAAA;AAAF,GAAF,CAAb;AACA;AAED,eAAeP,OAAO,CAAE,CACvBC,UAAU,CAAIO,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAyCF,MAAM,CAAEL,WAAF,CAArD;AACA,SAAO;AACNE,IAAAA,gBAAgB,EAAEN,GAAG,CACpBU,cAAc,EADM,EAEpB,CAAE,QAAF,EAAY,mBAAZ,CAFoB,EAGpB,KAHoB,CADf;AAMNE,IAAAA,QAAQ,EAAED,kBAAkB;AANtB,GAAP;AAQA,CAVS,CADa,CAAF,CAAP,CAYVN,mBAZU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostVisibilityCheck( { hasPublishAction, render } ) {\n\tconst canEdit = hasPublishAction;\n\treturn render( { canEdit } );\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getCurrentPost, getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\thasPublishAction: get(\n\t\t\t\tgetCurrentPost(),\n\t\t\t\t[ '_links', 'wp:action-publish' ],\n\t\t\t\tfalse\n\t\t\t),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t} ),\n] )( PostVisibilityCheck );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"names":["get","compose","withSelect","store","editorStore","PostVisibilityCheck","hasPublishAction","render","canEdit","select","getCurrentPost","getCurrentPostType","postType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,mBAAT,OAA6D;AAAA,MAA/B;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,GAA+B;AACnE,QAAMC,OAAO,GAAGF,gBAAhB;AACA,SAAOC,MAAM,CAAE;AAAEC,IAAAA;AAAF,GAAF,CAAb;AACA;AAED,eAAeP,OAAO,CAAE,CACvBC,UAAU,CAAIO,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAyCF,MAAM,CAAEL,WAAF,CAArD;AACA,SAAO;AACNE,IAAAA,gBAAgB,EAAEN,GAAG,CACpBU,cAAc,EADM,EAEpB,CAAE,QAAF,EAAY,mBAAZ,CAFoB,EAGpB,KAHoB,CADf;AAMNE,IAAAA,QAAQ,EAAED,kBAAkB;AANtB,GAAP;AAQA,CAVS,CADa,CAAF,CAAP,CAYVN,mBAZU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostVisibilityCheck( { hasPublishAction, render } ) {\n\tconst canEdit = hasPublishAction;\n\treturn render( { canEdit } );\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getCurrentPost, getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\thasPublishAction: get(\n\t\t\t\tgetCurrentPost(),\n\t\t\t\t[ '_links', 'wp:action-publish' ],\n\t\t\t\tfalse\n\t\t\t),\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t} ),\n] )( PostVisibilityCheck );\n"]}
@@ -101,29 +101,32 @@ export class PostVisibility extends Component {
101
101
  className: "editor-post-visibility__dialog-fieldset"
102
102
  }, createElement("legend", {
103
103
  className: "editor-post-visibility__dialog-legend"
104
- }, __('Post Visibility')), visibilityOptions.map(({
105
- value,
106
- label,
107
- info
108
- }) => createElement("div", {
109
- key: value,
110
- className: "editor-post-visibility__choice"
111
- }, createElement("input", {
112
- type: "radio",
113
- name: `editor-post-visibility__setting-${instanceId}`,
114
- value: value,
115
- onChange: visibilityHandlers[value].onSelect,
116
- checked: visibilityHandlers[value].checked,
117
- id: `editor-post-${value}-${instanceId}`,
118
- "aria-describedby": `editor-post-${value}-${instanceId}-description`,
119
- className: "editor-post-visibility__dialog-radio"
120
- }), createElement("label", {
121
- htmlFor: `editor-post-${value}-${instanceId}`,
122
- className: "editor-post-visibility__dialog-label"
123
- }, label), createElement("p", {
124
- id: `editor-post-${value}-${instanceId}-description`,
125
- className: "editor-post-visibility__dialog-info"
126
- }, info)))), this.state.hasPassword && createElement("div", {
104
+ }, __('Post Visibility')), visibilityOptions.map(_ref => {
105
+ let {
106
+ value,
107
+ label,
108
+ info
109
+ } = _ref;
110
+ return createElement("div", {
111
+ key: value,
112
+ className: "editor-post-visibility__choice"
113
+ }, createElement("input", {
114
+ type: "radio",
115
+ name: `editor-post-visibility__setting-${instanceId}`,
116
+ value: value,
117
+ onChange: visibilityHandlers[value].onSelect,
118
+ checked: visibilityHandlers[value].checked,
119
+ id: `editor-post-${value}-${instanceId}`,
120
+ "aria-describedby": `editor-post-${value}-${instanceId}-description`,
121
+ className: "editor-post-visibility__dialog-radio"
122
+ }), createElement("label", {
123
+ htmlFor: `editor-post-${value}-${instanceId}`,
124
+ className: "editor-post-visibility__dialog-label"
125
+ }, label), createElement("p", {
126
+ id: `editor-post-${value}-${instanceId}-description`,
127
+ className: "editor-post-visibility__dialog-info"
128
+ }, info));
129
+ })), this.state.hasPassword && createElement("div", {
127
130
  className: "editor-post-visibility__dialog-password",
128
131
  key: "password-selector"
129
132
  }, createElement(VisuallyHidden, {
@@ -158,7 +161,8 @@ export default compose([withSelect(select => {
158
161
  return {
159
162
  onSave: savePost,
160
163
 
161
- onUpdateVisibility(status, password = '') {
164
+ onUpdateVisibility(status) {
165
+ let password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
162
166
  editPost({
163
167
  status,
164
168
  password
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"names":["__","Component","VisuallyHidden","withInstanceId","compose","withSelect","withDispatch","visibilityOptions","store","editorStore","PostVisibility","constructor","props","arguments","setPublic","bind","setPrivate","setPasswordProtected","updatePassword","state","hasPassword","password","visibility","onUpdateVisibility","status","setState","window","confirm","onSave","event","target","value","render","instanceId","visibilityHandlers","public","onSelect","checked","private","map","label","info","select","getEditedPostAttribute","getEditedPostVisibility","dispatch","savePost","editPost"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,cAAT,QAA+B,uBAA/B;AACA,SAASC,cAAT,EAAyBC,OAAzB,QAAwC,oBAAxC;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,SAAlC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,MAAMC,cAAN,SAA6BT,S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CAAIqC,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,sBAAF;AAA0BC,IAAAA;AAA1B,MAAsDF,MAAM,CACjEjC,WADiE,CAAlE;AAGA,SAAO;AACNe,IAAAA,MAAM,EAAEmB,sBAAsB,CAAE,QAAF,CADxB;AAENrB,IAAAA,UAAU,EAAEsB,uBAAuB,EAF7B;AAGNvB,IAAAA,QAAQ,EAAEsB,sBAAsB,CAAE,UAAF;AAH1B,GAAP;AAKA,CATS,CADa,EAWvBrC,YAAY,CAAIuC,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAEpC,WAAF,CAAvC;AACA,SAAO;AACNmB,IAAAA,MAAM,EAAEkB,QADF;;AAENvB,IAAAA,kBAAkB,CAAEC,MAAF,EAAUH,QAAQ,GAAG,EAArB,EAA0B;AAC3C0B,MAAAA,QAAQ,CAAE;AAAEvB,QAAAA,MAAF;AAAUH,QAAAA;AAAV,OAAF,CAAR;AACA;;AAJK,GAAP;AAMA,CARW,CAXW,EAoBvBlB,cApBuB,CAAF,CAAP,CAqBVO,cArBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport class PostVisibility extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.setPublic = this.setPublic.bind( this );\n\t\tthis.setPrivate = this.setPrivate.bind( this );\n\t\tthis.setPasswordProtected = this.setPasswordProtected.bind( this );\n\t\tthis.updatePassword = this.updatePassword.bind( this );\n\n\t\tthis.state = {\n\t\t\thasPassword: !! props.password,\n\t\t};\n\t}\n\n\tsetPublic() {\n\t\tconst { visibility, onUpdateVisibility, status } = this.props;\n\n\t\tonUpdateVisibility( visibility === 'private' ? 'draft' : status );\n\t\tthis.setState( { hasPassword: false } );\n\t}\n\n\tsetPrivate() {\n\t\tif (\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\t! window.confirm(\n\t\t\t\t__( 'Would you like to privately publish this post now?' )\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { onUpdateVisibility, onSave } = this.props;\n\n\t\tonUpdateVisibility( 'private' );\n\t\tthis.setState( { hasPassword: false } );\n\t\tonSave();\n\t}\n\n\tsetPasswordProtected() {\n\t\tconst { visibility, onUpdateVisibility, status, password } = this.props;\n\n\t\tonUpdateVisibility(\n\t\t\tvisibility === 'private' ? 'draft' : status,\n\t\t\tpassword || ''\n\t\t);\n\t\tthis.setState( { hasPassword: true } );\n\t}\n\n\tupdatePassword( event ) {\n\t\tconst { status, onUpdateVisibility } = this.props;\n\t\tonUpdateVisibility( status, event.target.value );\n\t}\n\n\trender() {\n\t\tconst { visibility, password, instanceId } = this.props;\n\n\t\tconst visibilityHandlers = {\n\t\t\tpublic: {\n\t\t\t\tonSelect: this.setPublic,\n\t\t\t\tchecked: visibility === 'public' && ! this.state.hasPassword,\n\t\t\t},\n\t\t\tprivate: {\n\t\t\t\tonSelect: this.setPrivate,\n\t\t\t\tchecked: visibility === 'private',\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tonSelect: this.setPasswordProtected,\n\t\t\t\tchecked: this.state.hasPassword,\n\t\t\t},\n\t\t};\n\n\t\treturn [\n\t\t\t<fieldset\n\t\t\t\tkey=\"visibility-selector\"\n\t\t\t\tclassName=\"editor-post-visibility__dialog-fieldset\"\n\t\t\t>\n\t\t\t\t<legend className=\"editor-post-visibility__dialog-legend\">\n\t\t\t\t\t{ __( 'Post Visibility' ) }\n\t\t\t\t</legend>\n\t\t\t\t{ visibilityOptions.map( ( { value, label, info } ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\tclassName=\"editor-post-visibility__choice\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ visibilityHandlers[ value ].onSelect }\n\t\t\t\t\t\t\tchecked={ visibilityHandlers[ value ].checked }\n\t\t\t\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-radio\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-label\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-info\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ info }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t) ) }\n\t\t\t</fieldset>,\n\t\t\tthis.state.hasPassword && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"editor-post-visibility__dialog-password\"\n\t\t\t\t\tkey=\"password-selector\"\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\thtmlFor={ `editor-post-visibility__dialog-password-input-${ instanceId }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-password-input\"\n\t\t\t\t\t\tid={ `editor-post-visibility__dialog-password-input-${ instanceId }` }\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tonChange={ this.updatePassword }\n\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t),\n\t\t];\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getEditedPostVisibility } = select(\n\t\t\teditorStore\n\t\t);\n\t\treturn {\n\t\t\tstatus: getEditedPostAttribute( 'status' ),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tpassword: getEditedPostAttribute( 'password' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { savePost, editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonSave: savePost,\n\t\t\tonUpdateVisibility( status, password = '' ) {\n\t\t\t\teditPost( { status, password } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n] )( PostVisibility );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"names":["__","Component","VisuallyHidden","withInstanceId","compose","withSelect","withDispatch","visibilityOptions","store","editorStore","PostVisibility","constructor","props","arguments","setPublic","bind","setPrivate","setPasswordProtected","updatePassword","state","hasPassword","password","visibility","onUpdateVisibility","status","setState","window","confirm","onSave","event","target","value","render","instanceId","visibilityHandlers","public","onSelect","checked","private","map","label","info","select","getEditedPostAttribute","getEditedPostVisibility","dispatch","savePost","editPost"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,cAAT,QAA+B,uBAA/B;AACA,SAASC,cAAT,EAAyBC,OAAzB,QAAwC,oBAAxC;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;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KC,MAAA,KAAK,EAAGG,QALT;AAMC,MAAA,WAAW,EAAGrB,EAAE,CAAE,uBAAF;AANjB,MAVD,CAzCK,CAAP;AA8DA;;AArI4C;AAwI9C,eAAeI,OAAO,CAAE,CACvBC,UAAU,CAAIqC,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,sBAAF;AAA0BC,IAAAA;AAA1B,MAAsDF,MAAM,CACjEjC,WADiE,CAAlE;AAGA,SAAO;AACNe,IAAAA,MAAM,EAAEmB,sBAAsB,CAAE,QAAF,CADxB;AAENrB,IAAAA,UAAU,EAAEsB,uBAAuB,EAF7B;AAGNvB,IAAAA,QAAQ,EAAEsB,sBAAsB,CAAE,UAAF;AAH1B,GAAP;AAKA,CATS,CADa,EAWvBrC,YAAY,CAAIuC,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAEpC,WAAF,CAAvC;AACA,SAAO;AACNmB,IAAAA,MAAM,EAAEkB,QADF;;AAENvB,IAAAA,kBAAkB,CAAEC,MAAF,EAA0B;AAAA,UAAhBH,QAAgB,uEAAL,EAAK;AAC3C0B,MAAAA,QAAQ,CAAE;AAAEvB,QAAAA,MAAF;AAAUH,QAAAA;AAAV,OAAF,CAAR;AACA;;AAJK,GAAP;AAMA,CARW,CAXW,EAoBvBlB,cApBuB,CAAF,CAAP,CAqBVO,cArBU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport class PostVisibility extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.setPublic = this.setPublic.bind( this );\n\t\tthis.setPrivate = this.setPrivate.bind( this );\n\t\tthis.setPasswordProtected = this.setPasswordProtected.bind( this );\n\t\tthis.updatePassword = this.updatePassword.bind( this );\n\n\t\tthis.state = {\n\t\t\thasPassword: !! props.password,\n\t\t};\n\t}\n\n\tsetPublic() {\n\t\tconst { visibility, onUpdateVisibility, status } = this.props;\n\n\t\tonUpdateVisibility( visibility === 'private' ? 'draft' : status );\n\t\tthis.setState( { hasPassword: false } );\n\t}\n\n\tsetPrivate() {\n\t\tif (\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\t! window.confirm(\n\t\t\t\t__( 'Would you like to privately publish this post now?' )\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { onUpdateVisibility, onSave } = this.props;\n\n\t\tonUpdateVisibility( 'private' );\n\t\tthis.setState( { hasPassword: false } );\n\t\tonSave();\n\t}\n\n\tsetPasswordProtected() {\n\t\tconst { visibility, onUpdateVisibility, status, password } = this.props;\n\n\t\tonUpdateVisibility(\n\t\t\tvisibility === 'private' ? 'draft' : status,\n\t\t\tpassword || ''\n\t\t);\n\t\tthis.setState( { hasPassword: true } );\n\t}\n\n\tupdatePassword( event ) {\n\t\tconst { status, onUpdateVisibility } = this.props;\n\t\tonUpdateVisibility( status, event.target.value );\n\t}\n\n\trender() {\n\t\tconst { visibility, password, instanceId } = this.props;\n\n\t\tconst visibilityHandlers = {\n\t\t\tpublic: {\n\t\t\t\tonSelect: this.setPublic,\n\t\t\t\tchecked: visibility === 'public' && ! this.state.hasPassword,\n\t\t\t},\n\t\t\tprivate: {\n\t\t\t\tonSelect: this.setPrivate,\n\t\t\t\tchecked: visibility === 'private',\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tonSelect: this.setPasswordProtected,\n\t\t\t\tchecked: this.state.hasPassword,\n\t\t\t},\n\t\t};\n\n\t\treturn [\n\t\t\t<fieldset\n\t\t\t\tkey=\"visibility-selector\"\n\t\t\t\tclassName=\"editor-post-visibility__dialog-fieldset\"\n\t\t\t>\n\t\t\t\t<legend className=\"editor-post-visibility__dialog-legend\">\n\t\t\t\t\t{ __( 'Post Visibility' ) }\n\t\t\t\t</legend>\n\t\t\t\t{ visibilityOptions.map( ( { value, label, info } ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\tclassName=\"editor-post-visibility__choice\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ visibilityHandlers[ value ].onSelect }\n\t\t\t\t\t\t\tchecked={ visibilityHandlers[ value ].checked }\n\t\t\t\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-radio\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-label\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-info\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ info }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t) ) }\n\t\t\t</fieldset>,\n\t\t\tthis.state.hasPassword && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"editor-post-visibility__dialog-password\"\n\t\t\t\t\tkey=\"password-selector\"\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\thtmlFor={ `editor-post-visibility__dialog-password-input-${ instanceId }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-password-input\"\n\t\t\t\t\t\tid={ `editor-post-visibility__dialog-password-input-${ instanceId }` }\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tonChange={ this.updatePassword }\n\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t),\n\t\t];\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getEditedPostVisibility } = select(\n\t\t\teditorStore\n\t\t);\n\t\treturn {\n\t\t\tstatus: getEditedPostAttribute( 'status' ),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tpassword: getEditedPostAttribute( 'password' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { savePost, editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonSave: savePost,\n\t\t\tonUpdateVisibility( status, password = '' ) {\n\t\t\t\teditPost( { status, password } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n] )( PostVisibility );\n"]}
@@ -14,9 +14,11 @@ import { withSelect } from '@wordpress/data';
14
14
  import { visibilityOptions } from './utils';
15
15
  import { store as editorStore } from '../../store';
16
16
 
17
- function PostVisibilityLabel({
18
- visibility
19
- }) {
17
+ function PostVisibilityLabel(_ref) {
18
+ let {
19
+ visibility
20
+ } = _ref;
21
+
20
22
  const getVisibilityLabel = () => find(visibilityOptions, {
21
23
  value: visibility
22
24
  }).label;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"names":["find","withSelect","visibilityOptions","store","editorStore","PostVisibilityLabel","visibility","getVisibilityLabel","value","label","select","getEditedPostVisibility"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,SAAlC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,SAASC,mBAAT,CAA8B;AAAEC,EAAAA;AAAF,CAA9B,EAA+C;AAC9C,QAAMC,kBAAkB,GAAG,MAC1BP,IAAI,CAAEE,iBAAF,EAAqB;AAAEM,IAAAA,KAAK,EAAEF;AAAT,GAArB,CAAJ,CAAiDG,KADlD;;AAGA,SAAOF,kBAAkB,CAAED,UAAF,CAAzB;AACA;;AAED,eAAeL,UAAU,CAAIS,MAAF,KAAgB;AAC1CJ,EAAAA,UAAU,EAAEI,MAAM,CAAEN,WAAF,CAAN,CAAsBO,uBAAtB;AAD8B,CAAhB,CAAF,CAAV,CAERN,mBAFQ,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { find } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nfunction PostVisibilityLabel( { visibility } ) {\n\tconst getVisibilityLabel = () =>\n\t\tfind( visibilityOptions, { value: visibility } ).label;\n\n\treturn getVisibilityLabel( visibility );\n}\n\nexport default withSelect( ( select ) => ( {\n\tvisibility: select( editorStore ).getEditedPostVisibility(),\n} ) )( PostVisibilityLabel );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"names":["find","withSelect","visibilityOptions","store","editorStore","PostVisibilityLabel","visibility","getVisibilityLabel","value","label","select","getEditedPostVisibility"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,SAAlC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;;AAEA,SAASC,mBAAT,OAA+C;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;;AAC9C,QAAMC,kBAAkB,GAAG,MAC1BP,IAAI,CAAEE,iBAAF,EAAqB;AAAEM,IAAAA,KAAK,EAAEF;AAAT,GAArB,CAAJ,CAAiDG,KADlD;;AAGA,SAAOF,kBAAkB,CAAED,UAAF,CAAzB;AACA;;AAED,eAAeL,UAAU,CAAIS,MAAF,KAAgB;AAC1CJ,EAAAA,UAAU,EAAEI,MAAM,CAAEN,WAAF,CAAN,CAAsBO,uBAAtB;AAD8B,CAAhB,CAAF,CAAV,CAERN,mBAFQ,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { find } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nfunction PostVisibilityLabel( { visibility } ) {\n\tconst getVisibilityLabel = () =>\n\t\tfind( visibilityOptions, { value: visibility } ).label;\n\n\treturn getVisibilityLabel( visibility );\n}\n\nexport default withSelect( ( select ) => ( {\n\tvisibility: select( editorStore ).getEditedPostVisibility(),\n} ) )( PostVisibilityLabel );\n"]}
@@ -18,14 +18,15 @@ import withRegistryProvider from './with-registry-provider';
18
18
  import { store as editorStore } from '../../store';
19
19
  import useBlockEditorSettings from './use-block-editor-settings';
20
20
 
21
- function EditorProvider({
22
- __unstableTemplate,
23
- post,
24
- settings,
25
- recovery,
26
- initialEdits,
27
- children
28
- }) {
21
+ function EditorProvider(_ref) {
22
+ let {
23
+ __unstableTemplate,
24
+ post,
25
+ settings,
26
+ recovery,
27
+ initialEdits,
28
+ children
29
+ } = _ref;
29
30
  const defaultBlockContext = useMemo(() => {
30
31
  if (post.type === 'wp_template') {
31
32
  return {};
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/index.js"],"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","ReusableBlocksMenuItems","store","noticesStore","withRegistryProvider","editorStore","useBlockEditorSettings","EditorProvider","__unstableTemplate","post","settings","recovery","initialEdits","children","defaultBlockContext","type","postId","id","postType","selection","isReady","select","getEditorSelection","__unstableIsEditorReady","blocks","onInput","onChange","editorSettings","updatePostLock","setupEditor","updateEditorSettings","__experimentalTearDownEditor","createWarningNotice","postLock","template","autosave","actions","label","url","editLink"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,eAApB,EAAqCC,OAArC,QAAoD,oBAApD;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,EAAyBC,oBAAzB,QAAqD,sBAArD;AACA,SACCC,mBADD,EAECC,oBAFD,QAGO,yBAHP;AAIA,SAASC,uBAAT,QAAwC,4BAAxC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AACA,SAASF,KAAK,IAAIG,WAAlB,QAAqC,aAArC;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;;AAEA,SAASC,cAAT,CAAyB;AACxBC,EAAAA,kBADwB;AAExBC,EAAAA,IAFwB;AAGxBC,EAAAA,QAHwB;AAIxBC,EAAAA,QAJwB;AAKxBC,EAAAA,YALwB;AAMxBC,EAAAA;AANwB,CAAzB,EAOI;AACH,QAAMC,mBAAmB,GAAGrB,OAAO,CAAE,MAAM;AAC1C,QAAKgB,IAAI,CAACM,IAAL,KAAc,aAAnB,EAAmC;AAClC,aAAO,EAAP;AACA;;AACD,WAAO;AAAEC,MAAAA,MAAM,EAAEP,IAAI,CAACQ,EAAf;AAAmBC,MAAAA,QAAQ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,QAAd,EAAyB;AACxBH,MAAAA,mBAAmB,CAClBpC,EAAE,CACD,+EADC,CADgB,EAIlB;AACCqB,QAAAA,EAAE,EAAE,iBADL;AAECmB,QAAAA,OAAO,EAAE,CACR;AACCC,UAAAA,KAAK,EAAEzC,EAAE,CAAE,mBAAF,CADV;AAEC0C,UAAAA,GAAG,EAAE5B,QAAQ,CAACyB,QAAT,CAAkBI;AAFxB,SADQ;AAFV,OAJkB,CAAnB;AAcA;;AAED,WAAO,MAAM;AACZR,MAAAA,4BAA4B;AAC5B,KAFD;AAGA,GA5Bc,EA4BZ,EA5BY,CAAf,CApCG,CAkEH;;AACAxC,EAAAA,SAAS,CAAE,MAAM;AAChBuC,IAAAA,oBAAoB,CAAEpB,QAAF,CAApB;AACA,GAFQ,EAEN,CAAEA,QAAF,CAFM,CAAT;;AAIA,MAAK,CAAEU,OAAP,EAAiB;AAChB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,cAAD;AAAgB,IAAA,IAAI,EAAC,MAArB;AAA4B,IAAA,IAAI,EAAC;AAAjC,KACC,cAAC,cAAD;AAAgB,IAAA,IAAI,EAAC,UAArB;AAAgC,IAAA,IAAI,EAAGX,IAAI,CAACM,IAA5C;AAAmD,IAAA,EAAE,EAAGN,IAAI,CAACQ;AAA7D,KACC,cAAC,oBAAD;AAAsB,IAAA,KAAK,EAAGH;AAA9B,KACC,cAAC,mBAAD;AACC,IAAA,KAAK,EAAGU,MADT;AAEC,IAAA,QAAQ,EAAGE,QAFZ;AAGC,IAAA,OAAO,EAAGD,OAHX;AAIC,IAAA,SAAS,EAAGN,SAJb;AAKC,IAAA,QAAQ,EAAGQ,cALZ;AAMC,IAAA,cAAc,EAAG;AANlB,KAQGd,QARH,EASC,cAAC,uBAAD,OATD,CADD,CADD,CADD,CADD;AAmBA;;AAED,eAAeT,oBAAoB,CAAEG,cAAF,CAAnC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n} from '@wordpress/block-editor';\nimport { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\n\nfunction EditorProvider( {\n\t__unstableTemplate,\n\tpost,\n\tsettings,\n\trecovery,\n\tinitialEdits,\n\tchildren,\n} ) {\n\tconst defaultBlockContext = useMemo( () => {\n\t\tif ( post.type === 'wp_template' ) {\n\t\t\treturn {};\n\t\t}\n\t\treturn { postId: post.id, postType: post.type };\n\t}, [ post.id, post.type ] );\n\tconst { selection, isReady } = useSelect( ( select ) => {\n\t\tconst { getEditorSelection, __unstableIsEditorReady } = select(\n\t\t\teditorStore\n\t\t);\n\t\treturn {\n\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\tselection: getEditorSelection(),\n\t\t};\n\t}, [] );\n\tconst { id, type } = __unstableTemplate ?? post;\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\ttype,\n\t\t{ id }\n\t);\n\tconst editorSettings = useBlockEditorSettings(\n\t\tsettings,\n\t\t!! __unstableTemplate\n\t);\n\tconst {\n\t\tupdatePostLock,\n\t\tsetupEditor,\n\t\tupdateEditorSettings,\n\t\t__experimentalTearDownEditor,\n\t} = useDispatch( editorStore );\n\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t// Initialize and tear down the editor.\n\t// Ideally this should be synced on each change and not just something you do once.\n\tuseLayoutEffect( () => {\n\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\tif ( recovery ) {\n\t\t\treturn;\n\t\t}\n\n\t\tupdatePostLock( settings.postLock );\n\t\tsetupEditor( post, initialEdits, settings.template );\n\t\tif ( settings.autosave ) {\n\t\t\tcreateWarningNotice(\n\t\t\t\t__(\n\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn () => {\n\t\t\t__experimentalTearDownEditor();\n\t\t};\n\t}, [] );\n\n\t// Synchronize the editor settings as they change\n\tuseEffect( () => {\n\t\tupdateEditorSettings( settings );\n\t}, [ settings ] );\n\n\tif ( ! isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t<EntityProvider kind=\"postType\" type={ post.type } id={ post.id }>\n\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t<BlockEditorProvider\n\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t<ReusableBlocksMenuItems />\n\t\t\t\t\t</BlockEditorProvider>\n\t\t\t\t</BlockContextProvider>\n\t\t\t</EntityProvider>\n\t\t</EntityProvider>\n\t);\n}\n\nexport default withRegistryProvider( EditorProvider );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/provider/index.js"],"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","ReusableBlocksMenuItems","store","noticesStore","withRegistryProvider","editorStore","useBlockEditorSettings","EditorProvider","__unstableTemplate","post","settings","recovery","initialEdits","children","defaultBlockContext","type","postId","id","postType","selection","isReady","select","getEditorSelection","__unstableIsEditorReady","blocks","onInput","onChange","editorSettings","updatePostLock","setupEditor","updateEditorSettings","__experimentalTearDownEditor","createWarningNotice","postLock","template","autosave","actions","label","url","editLink"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,eAApB,EAAqCC,OAArC,QAAoD,oBAApD;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,EAAyBC,oBAAzB,QAAqD,sBAArD;AACA,SACCC,mBADD,EAECC,oBAFD,QAGO,yBAHP;AAIA,SAASC,uBAAT,QAAwC,4BAAxC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AACA,SAASF,KAAK,IAAIG,WAAlB,QAAqC,aAArC;AACA,OAAOC,sBAAP,MAAmC,6BAAnC;;AAEA,SAASC,cAAT,OAOI;AAAA,MAPqB;AACxBC,IAAAA,kBADwB;AAExBC,IAAAA,IAFwB;AAGxBC,IAAAA,QAHwB;AAIxBC,IAAAA,QAJwB;AAKxBC,IAAAA,YALwB;AAMxBC,IAAAA;AANwB,GAOrB;AACH,QAAMC,mBAAmB,GAAGrB,OAAO,CAAE,MAAM;AAC1C,QAAKgB,IAAI,CAACM,IAAL,KAAc,aAAnB,EAAmC;AAClC,aAAO,EAAP;AACA;;AACD,WAAO;AAAEC,MAAAA,MAAM,EAAEP,IAAI,CAACQ,EAAf;AAAmBC,MAAAA,QAAQ,EAAET,IAAI,CAACM;AAAlC,KAAP;AACA,GALkC,EAKhC,CAAEN,IAAI,CAACQ,EAAP,EAAWR,IAAI,CAACM,IAAhB,CALgC,CAAnC;AAMA,QAAM;AAAEI,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAAyBzB,S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BAAF,CADV;AAEC0C,UAAAA,GAAG,EAAE5B,QAAQ,CAACyB,QAAT,CAAkBI;AAFxB,SADQ;AAFV,OAJkB,CAAnB;AAcA;;AAED,WAAO,MAAM;AACZR,MAAAA,4BAA4B;AAC5B,KAFD;AAGA,GA5Bc,EA4BZ,EA5BY,CAAf,CApCG,CAkEH;;AACAxC,EAAAA,SAAS,CAAE,MAAM;AAChBuC,IAAAA,oBAAoB,CAAEpB,QAAF,CAApB;AACA,GAFQ,EAEN,CAAEA,QAAF,CAFM,CAAT;;AAIA,MAAK,CAAEU,OAAP,EAAiB;AAChB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,cAAD;AAAgB,IAAA,IAAI,EAAC,MAArB;AAA4B,IAAA,IAAI,EAAC;AAAjC,KACC,cAAC,cAAD;AAAgB,IAAA,IAAI,EAAC,UAArB;AAAgC,IAAA,IAAI,EAAGX,IAAI,CAACM,IAA5C;AAAmD,IAAA,EAAE,EAAGN,IAAI,CAACQ;AAA7D,KACC,cAAC,oBAAD;AAAsB,IAAA,KAAK,EAAGH;AAA9B,KACC,cAAC,mBAAD;AACC,IAAA,KAAK,EAAGU,MADT;AAEC,IAAA,QAAQ,EAAGE,QAFZ;AAGC,IAAA,OAAO,EAAGD,OAHX;AAIC,IAAA,SAAS,EAAGN,SAJb;AAKC,IAAA,QAAQ,EAAGQ,cALZ;AAMC,IAAA,cAAc,EAAG;AANlB,KAQGd,QARH,EASC,cAAC,uBAAD,OATD,CADD,CADD,CADD,CADD;AAmBA;;AAED,eAAeT,oBAAoB,CAAEG,cAAF,CAAnC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n} from '@wordpress/block-editor';\nimport { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\n\nfunction EditorProvider( {\n\t__unstableTemplate,\n\tpost,\n\tsettings,\n\trecovery,\n\tinitialEdits,\n\tchildren,\n} ) {\n\tconst defaultBlockContext = useMemo( () => {\n\t\tif ( post.type === 'wp_template' ) {\n\t\t\treturn {};\n\t\t}\n\t\treturn { postId: post.id, postType: post.type };\n\t}, [ post.id, post.type ] );\n\tconst { selection, isReady } = useSelect( ( select ) => {\n\t\tconst { getEditorSelection, __unstableIsEditorReady } = select(\n\t\t\teditorStore\n\t\t);\n\t\treturn {\n\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\tselection: getEditorSelection(),\n\t\t};\n\t}, [] );\n\tconst { id, type } = __unstableTemplate ?? post;\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\ttype,\n\t\t{ id }\n\t);\n\tconst editorSettings = useBlockEditorSettings(\n\t\tsettings,\n\t\t!! __unstableTemplate\n\t);\n\tconst {\n\t\tupdatePostLock,\n\t\tsetupEditor,\n\t\tupdateEditorSettings,\n\t\t__experimentalTearDownEditor,\n\t} = useDispatch( editorStore );\n\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t// Initialize and tear down the editor.\n\t// Ideally this should be synced on each change and not just something you do once.\n\tuseLayoutEffect( () => {\n\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\tif ( recovery ) {\n\t\t\treturn;\n\t\t}\n\n\t\tupdatePostLock( settings.postLock );\n\t\tsetupEditor( post, initialEdits, settings.template );\n\t\tif ( settings.autosave ) {\n\t\t\tcreateWarningNotice(\n\t\t\t\t__(\n\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\treturn () => {\n\t\t\t__experimentalTearDownEditor();\n\t\t};\n\t}, [] );\n\n\t// Synchronize the editor settings as they change\n\tuseEffect( () => {\n\t\tupdateEditorSettings( settings );\n\t}, [ settings ] );\n\n\tif ( ! isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t<EntityProvider kind=\"postType\" type={ post.type } id={ post.id }>\n\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t<BlockEditorProvider\n\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t<ReusableBlocksMenuItems />\n\t\t\t\t\t</BlockEditorProvider>\n\t\t\t\t</BlockContextProvider>\n\t\t\t</EntityProvider>\n\t\t</EntityProvider>\n\t);\n}\n\nexport default withRegistryProvider( EditorProvider );\n"]}
@@ -186,12 +186,13 @@ class NativeEditorProvider extends Component {
186
186
  }
187
187
  }
188
188
 
189
- getThemeColors({
190
- colors,
191
- gradients,
192
- rawStyles,
193
- rawFeatures
194
- }) {
189
+ getThemeColors(_ref) {
190
+ let {
191
+ colors,
192
+ gradients,
193
+ rawStyles,
194
+ rawFeatures
195
+ } = _ref;
195
196
  return { ...(rawStyles && rawFeatures ? getGlobalStyles(rawStyles, rawFeatures) : {
196
197
  colors: validateThemeColors(colors),
197
198
  gradients: validateThemeGradients(gradients)
@@ -203,9 +204,12 @@ class NativeEditorProvider extends Component {
203
204
  if (!prevProps.isReady && this.props.isReady) {
204
205
  const blocks = this.props.blocks;
205
206
 
206
- const isUnsupportedBlock = ({
207
- name
208
- }) => name === getUnregisteredTypeHandlerName();
207
+ const isUnsupportedBlock = _ref2 => {
208
+ let {
209
+ name
210
+ } = _ref2;
211
+ return name === getUnregisteredTypeHandlerName();
212
+ };
209
213
 
210
214
  const unsupportedBlockNames = blocks.filter(isUnsupportedBlock).map(block => block.attributes.originalName);
211
215
  RNReactNativeGutenbergBridge.editorDidMount(unsupportedBlockNames);