@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
@@ -39,11 +39,12 @@ var _store = require("../../store");
39
39
  *
40
40
  * @return {WPComponent} The component to be rendered.
41
41
  */
42
- function PostTypeSupportCheck({
43
- postType,
44
- children,
45
- supportKeys
46
- }) {
42
+ function PostTypeSupportCheck(_ref) {
43
+ let {
44
+ postType,
45
+ children,
46
+ supportKeys
47
+ } = _ref;
47
48
  let isSupported = true;
48
49
 
49
50
  if (postType) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-type-support-check/index.js"],"names":["PostTypeSupportCheck","postType","children","supportKeys","isSupported","key","supports","select","getEditedPostAttribute","editorStore","getPostType","coreStore"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,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,GAAG,kBACb,uBAAWD,WAAX,CADa,EAEXE,GAAF,IAAW,CAAC,CAAEJ,QAAQ,CAACK,QAAT,CAAmBD,GAAnB,CAFD,CAAd;AAIA;;AAED,MAAK,CAAED,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOF,QAAP;AACA;;eAEc,sBAAcK,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAEE,YAAF,CAAzC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAkBH,MAAM,CAAEI,eAAF,CAA9B;AACA,SAAO;AACNV,IAAAA,QAAQ,EAAES,WAAW,CAAEF,sBAAsB,CAAE,MAAF,CAAxB;AADf,GAAP;AAGA,CANc,EAMVR,oBANU,C","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":["PostTypeSupportCheck","postType","children","supportKeys","isSupported","key","supports","select","getEditedPostAttribute","editorStore","getPostType","coreStore"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,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,GAAG,kBACb,uBAAWD,WAAX,CADa,EAEXE,GAAF,IAAW,CAAC,CAAEJ,QAAQ,CAACK,QAAT,CAAmBD,GAAnB,CAFD,CAAd;AAIA;;AAED,MAAK,CAAED,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOF,QAAP;AACA;;eAEc,sBAAcK,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAEE,YAAF,CAAzC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAkBH,MAAM,CAAEI,eAAF,CAA9B;AACA,SAAO;AACNV,IAAAA,QAAQ,EAAES,WAAW,CAAEF,sBAAsB,CAAE,MAAF,CAAxB;AADf,GAAP;AAGA,CANc,EAMVR,oBANU,C","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"]}
@@ -25,10 +25,11 @@ var _store = require("../../store");
25
25
  /**
26
26
  * Internal dependencies
27
27
  */
28
- function PostVisibilityCheck({
29
- hasPublishAction,
30
- render
31
- }) {
28
+ function PostVisibilityCheck(_ref) {
29
+ let {
30
+ hasPublishAction,
31
+ render
32
+ } = _ref;
32
33
  const canEdit = hasPublishAction;
33
34
  return render({
34
35
  canEdit
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"names":["PostVisibilityCheck","hasPublishAction","render","canEdit","select","getCurrentPost","getCurrentPostType","editorStore","postType"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAGO,SAASA,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;;eAEc,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAyCF,MAAM,CAAEG,YAAF,CAArD;AACA,SAAO;AACNN,IAAAA,gBAAgB,EAAE,iBACjBI,cAAc,EADG,EAEjB,CAAE,QAAF,EAAY,mBAAZ,CAFiB,EAGjB,KAHiB,CADZ;AAMNG,IAAAA,QAAQ,EAAEF,kBAAkB;AANtB,GAAP;AAQA,CAVD,CADuB,CAAT,EAYVN,mBAZU,C","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":["PostVisibilityCheck","hasPublishAction","render","canEdit","select","getCurrentPost","getCurrentPostType","editorStore","postType"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAGO,SAASA,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;;eAEc,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAyCF,MAAM,CAAEG,YAAF,CAArD;AACA,SAAO;AACNN,IAAAA,gBAAgB,EAAE,iBACjBI,cAAc,EADG,EAEjB,CAAE,QAAF,EAAY,mBAAZ,CAFiB,EAGjB,KAHiB,CADZ;AAMNG,IAAAA,QAAQ,EAAEF,kBAAkB;AANtB,GAAP;AAQA,CAVD,CADuB,CAAT,EAYVN,mBAZU,C","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"]}
@@ -113,29 +113,32 @@ class PostVisibility extends _element.Component {
113
113
  className: "editor-post-visibility__dialog-fieldset"
114
114
  }, (0, _element.createElement)("legend", {
115
115
  className: "editor-post-visibility__dialog-legend"
116
- }, (0, _i18n.__)('Post Visibility')), _utils.visibilityOptions.map(({
117
- value,
118
- label,
119
- info
120
- }) => (0, _element.createElement)("div", {
121
- key: value,
122
- className: "editor-post-visibility__choice"
123
- }, (0, _element.createElement)("input", {
124
- type: "radio",
125
- name: `editor-post-visibility__setting-${instanceId}`,
126
- value: value,
127
- onChange: visibilityHandlers[value].onSelect,
128
- checked: visibilityHandlers[value].checked,
129
- id: `editor-post-${value}-${instanceId}`,
130
- "aria-describedby": `editor-post-${value}-${instanceId}-description`,
131
- className: "editor-post-visibility__dialog-radio"
132
- }), (0, _element.createElement)("label", {
133
- htmlFor: `editor-post-${value}-${instanceId}`,
134
- className: "editor-post-visibility__dialog-label"
135
- }, label), (0, _element.createElement)("p", {
136
- id: `editor-post-${value}-${instanceId}-description`,
137
- className: "editor-post-visibility__dialog-info"
138
- }, info)))), this.state.hasPassword && (0, _element.createElement)("div", {
116
+ }, (0, _i18n.__)('Post Visibility')), _utils.visibilityOptions.map(_ref => {
117
+ let {
118
+ value,
119
+ label,
120
+ info
121
+ } = _ref;
122
+ return (0, _element.createElement)("div", {
123
+ key: value,
124
+ className: "editor-post-visibility__choice"
125
+ }, (0, _element.createElement)("input", {
126
+ type: "radio",
127
+ name: `editor-post-visibility__setting-${instanceId}`,
128
+ value: value,
129
+ onChange: visibilityHandlers[value].onSelect,
130
+ checked: visibilityHandlers[value].checked,
131
+ id: `editor-post-${value}-${instanceId}`,
132
+ "aria-describedby": `editor-post-${value}-${instanceId}-description`,
133
+ className: "editor-post-visibility__dialog-radio"
134
+ }), (0, _element.createElement)("label", {
135
+ htmlFor: `editor-post-${value}-${instanceId}`,
136
+ className: "editor-post-visibility__dialog-label"
137
+ }, label), (0, _element.createElement)("p", {
138
+ id: `editor-post-${value}-${instanceId}-description`,
139
+ className: "editor-post-visibility__dialog-info"
140
+ }, info));
141
+ })), this.state.hasPassword && (0, _element.createElement)("div", {
139
142
  className: "editor-post-visibility__dialog-password",
140
143
  key: "password-selector"
141
144
  }, (0, _element.createElement)(_components.VisuallyHidden, {
@@ -173,7 +176,8 @@ var _default = (0, _compose.compose)([(0, _data.withSelect)(select => {
173
176
  return {
174
177
  onSave: savePost,
175
178
 
176
- onUpdateVisibility(status, password = '') {
179
+ onUpdateVisibility(status) {
180
+ let password = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
177
181
  editPost({
178
182
  status,
179
183
  password
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"names":["PostVisibility","Component","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","visibilityOptions","map","label","info","select","getEditedPostAttribute","getEditedPostVisibility","editorStore","dispatch","savePost","editPost","withInstanceId"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;AAIO,MAAMA,cAAN,SAA6BC,kBAA7B,CAAuC;AAC7CC,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAO,GAAGC,SAAV;AAEA,SAAKC,SAAL,GAAiB,KAAKA,SAAL,CAAeC,IAAf,CAAqB,IAArB,CAAjB;AACA,SAAKC,UAAL,GAAkB,KAAKA,UAAL,CAAgBD,IAAhB,CAAsB,IAAtB,CAAlB;AACA,SAAKE,oBAAL,GAA4B,KAAKA,oBAAL,CAA0BF,IAA1B,CAAgC,IAAhC,CAA5B;AACA,SAAKG,cAAL,GAAsB,KAAKA,cAAL,CAAoBH,IAApB,CAA0B,IAA1B,CAAtB;AAEA,SAAKI,KAAL,GAAa;AACZC,MAAAA,WAAW,EAAE,CAAC,CAAER,KAAK,CAACS;AADV,KAAb;AAGA;;AAEDP,EAAAA,SAAS,GAAG;AACX,UAAM;AAAEQ,MAAAA,UAAF;AAAcC,MAAAA,kBAAd;AAAkCC,MAAAA;AAAlC,QAA6C,KAAKZ,KAAxD;AAEAW,IAAAA,kBAAkB,CAAED,UAAU,KAAK,SAAf,GAA2B,OAA3B,GAAqCE,MAAvC,CAAlB;AACA,SAAKC,QAAL,CAAe;AAAEL,MAAAA,WAAW,EAAE;AAAf,KAAf;AACA;;AAEDJ,EAAAA,UAAU,GAAG;AACZ,SACC;AACA,KAAEU,MAAM,CAACC,OAAP,CACD,cAAI,oDAAJ,CADC,CAFH,EAKE;AACD;AACA;;AAED,UAAM;AAAEJ,MAAAA,kBAAF;AAAsBK,MAAA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AAS,EAAC,+CADX;AAEC,MAAA,EAAE,EAAI,iDAAiDA,UAAY,EAFpE;AAGC,MAAA,IAAI,EAAC,MAHN;AAIC,MAAA,QAAQ,EAAG,KAAKf,cAJjB;AAKC,MAAA,KAAK,EAAGG,QALT;AAMC,MAAA,WAAW,EAAG,cAAI,uBAAJ;AANf,MAVD,CAzCK,CAAP;AA8DA;;AArI4C;;;;eAwI/B,sBAAS,CACvB,sBAAcsB,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,sBAAF;AAA0BC,IAAAA;AAA1B,MAAsDF,MAAM,CACjEG,YADiE,CAAlE;AAGA,SAAO;AACNtB,IAAAA,MAAM,EAAEoB,sBAAsB,CAAE,QAAF,CADxB;AAENtB,IAAAA,UAAU,EAAEuB,uBAAuB,EAF7B;AAGNxB,IAAAA,QAAQ,EAAEuB,sBAAsB,CAAE,UAAF;AAH1B,GAAP;AAKA,CATD,CADuB,EAWvB,wBAAgBG,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAED,YAAF,CAAvC;AACA,SAAO;AACNlB,IAAAA,MAAM,EAAEoB,QADF;;AAENzB,IAAAA,kBAAkB,CAAEC,MAAF,EAAUH,QAAQ,GAAG,EAArB,EAA0B;AAC3C4B,MAAAA,QAAQ,CAAE;AAAEzB,QAAAA,MAAF;AAAUH,QAAAA;AAAV,OAAF,CAAR;AACA;;AAJK,GAAP;AAMA,CARD,CAXuB,EAoBvB6B,uBApBuB,CAAT,EAqBVzC,cArBU,C","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":["PostVisibility","Component","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","visibilityOptions","map","label","info","select","getEditedPostAttribute","getEditedPostVisibility","editorStore","dispatch","savePost","editPost","withInstan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;AAMC,MAAA,WAAW,EAAG,cAAI,uBAAJ;AANf,MAVD,CAzCK,CAAP;AA8DA;;AArI4C;;;;eAwI/B,sBAAS,CACvB,sBAAcsB,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,sBAAF;AAA0BC,IAAAA;AAA1B,MAAsDF,MAAM,CACjEG,YADiE,CAAlE;AAGA,SAAO;AACNtB,IAAAA,MAAM,EAAEoB,sBAAsB,CAAE,QAAF,CADxB;AAENtB,IAAAA,UAAU,EAAEuB,uBAAuB,EAF7B;AAGNxB,IAAAA,QAAQ,EAAEuB,sBAAsB,CAAE,UAAF;AAH1B,GAAP;AAKA,CATD,CADuB,EAWvB,wBAAgBG,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAED,YAAF,CAAvC;AACA,SAAO;AACNlB,IAAAA,MAAM,EAAEoB,QADF;;AAENzB,IAAAA,kBAAkB,CAAEC,MAAF,EAA0B;AAAA,UAAhBH,QAAgB,uEAAL,EAAK;AAC3C4B,MAAAA,QAAQ,CAAE;AAAEzB,QAAAA,MAAF;AAAUH,QAAAA;AAAV,OAAF,CAAR;AACA;;AAJK,GAAP;AAMA,CARD,CAXuB,EAoBvB6B,uBApBuB,CAAT,EAqBVzC,cArBU,C","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"]}
@@ -24,9 +24,11 @@ var _store = require("../../store");
24
24
  /**
25
25
  * Internal dependencies
26
26
  */
27
- function PostVisibilityLabel({
28
- visibility
29
- }) {
27
+ function PostVisibilityLabel(_ref) {
28
+ let {
29
+ visibility
30
+ } = _ref;
31
+
30
32
  const getVisibilityLabel = () => (0, _lodash.find)(_utils.visibilityOptions, {
31
33
  value: visibility
32
34
  }).label;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"names":["PostVisibilityLabel","visibility","getVisibilityLabel","visibilityOptions","value","label","select","editorStore","getEditedPostVisibility"],"mappings":";;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,mBAAT,CAA8B;AAAEC,EAAAA;AAAF,CAA9B,EAA+C;AAC9C,QAAMC,kBAAkB,GAAG,MAC1B,kBAAMC,wBAAN,EAAyB;AAAEC,IAAAA,KAAK,EAAEH;AAAT,GAAzB,EAAiDI,KADlD;;AAGA,SAAOH,kBAAkB,CAAED,UAAF,CAAzB;AACA;;eAEc,sBAAcK,MAAF,KAAgB;AAC1CL,EAAAA,UAAU,EAAEK,MAAM,CAAEC,YAAF,CAAN,CAAsBC,uBAAtB;AAD8B,CAAhB,CAAZ,EAERR,mBAFQ,C","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":["PostVisibilityLabel","visibility","getVisibilityLabel","visibilityOptions","value","label","select","editorStore","getEditedPostVisibility"],"mappings":";;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,mBAAT,OAA+C;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;;AAC9C,QAAMC,kBAAkB,GAAG,MAC1B,kBAAMC,wBAAN,EAAyB;AAAEC,IAAAA,KAAK,EAAEH;AAAT,GAAzB,EAAiDI,KADlD;;AAGA,SAAOH,kBAAkB,CAAED,UAAF,CAAzB;AACA;;eAEc,sBAAcK,MAAF,KAAgB;AAC1CL,EAAAA,UAAU,EAAEK,MAAM,CAAEC,YAAF,CAAN,CAAsBC,uBAAtB;AAD8B,CAAhB,CAAZ,EAERR,mBAFQ,C","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"]}
@@ -34,14 +34,15 @@ var _useBlockEditorSettings = _interopRequireDefault(require("./use-block-editor
34
34
  /**
35
35
  * Internal dependencies
36
36
  */
37
- function EditorProvider({
38
- __unstableTemplate,
39
- post,
40
- settings,
41
- recovery,
42
- initialEdits,
43
- children
44
- }) {
37
+ function EditorProvider(_ref) {
38
+ let {
39
+ __unstableTemplate,
40
+ post,
41
+ settings,
42
+ recovery,
43
+ initialEdits,
44
+ children
45
+ } = _ref;
45
46
  const defaultBlockContext = (0, _element.useMemo)(() => {
46
47
  if (post.type === 'wp_template') {
47
48
  return {};
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/index.js"],"names":["EditorProvider","__unstableTemplate","post","settings","recovery","initialEdits","children","defaultBlockContext","type","postId","id","postType","selection","isReady","select","getEditorSelection","__unstableIsEditorReady","editorStore","blocks","onInput","onChange","editorSettings","updatePostLock","setupEditor","updateEditorSettings","__experimentalTearDownEditor","createWarningNotice","noticesStore","postLock","template","autosave","actions","label","url","editLink"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AAKA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAYA;AACA;AACA;AAKA,SAASA,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AAA,SAAS,EAAGP,SAJb;AAKC,IAAA,QAAQ,EAAGS,cALZ;AAMC,IAAA,cAAc,EAAG;AANlB,KAQGf,QARH,EASC,4BAAC,uCAAD,OATD,CADD,CADD,CADD,CADD;AAmBA;;eAEc,mCAAsBN,cAAtB,C","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":["EditorProvider","__unstableTemplate","post","settings","recovery","initialEdits","children","defaultBlockContext","type","postId","id","postType","selection","isReady","select","getEditorSelection","__unstableIsEditorReady","editorStore","blocks","onInput","onChange","editorSettings","updatePostLock","setupEditor","updateEditorSettings","__experimentalTearDownEditor","createWarningNotice","noticesStore","postLock","template","autosave","actions","label","url","editLink"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAIA;;AACA;;AAKA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAYA;AACA;AACA;AAKA,SAASA,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,GAAG,sBAAS,MAAM;AAC1C,QAAKL,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,GAL2B,EAKzB,CAAEN,IAAI,CAACQ,EAAP,EAAWR,IAAI,CAACM,IAAhB,CALyB,CAA5B;AAMA,QAAM;AAAEI,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAAyB,qBAAaC,MAAF,IAAc;AACvD,UAAM;AAAEC,MAAAA,kBAAF;AAAsBC,MAAAA;AAAtB,QAAkDF,MAAM,CAC7DG,YAD6D,CAA9D;AAGA,WAAO;AACNJ,MAAAA,OAAO,EAAEG,uBAAuB,EAD1B;AAENJ,MAAAA,SAAS,EAAEG,kBAAkB;AAFvB,KAAP;AAIA,GAR8B,EAQ5B,EAR4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AAK,CAAEU,OAAP,EAAiB;AAChB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,wBAAD;AAAgB,IAAA,IAAI,EAAC,MAArB;AAA4B,IAAA,IAAI,EAAC;AAAjC,KACC,4BAAC,wBAAD;AAAgB,IAAA,IAAI,EAAC,UAArB;AAAgC,IAAA,IAAI,EAAGX,IAAI,CAACM,IAA5C;AAAmD,IAAA,EAAE,EAAGN,IAAI,CAACQ;AAA7D,KACC,4BAAC,iCAAD;AAAsB,IAAA,KAAK,EAAGH;AAA9B,KACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAGW,MADT;AAEC,IAAA,QAAQ,EAAGE,QAFZ;AAGC,IAAA,OAAO,EAAGD,OAHX;AAIC,IAAA,SAAS,EAAGP,SAJb;AAKC,IAAA,QAAQ,EAAGS,cALZ;AAMC,IAAA,cAAc,EAAG;AANlB,KAQGf,QARH,EASC,4BAAC,uCAAD,OATD,CADD,CADD,CADD,CADD;AAmBA;;eAEc,mCAAsBN,cAAtB,C","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,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
4
 
7
5
  Object.defineProperty(exports, "__esModule", {
@@ -37,6 +35,10 @@ var _editor = require("@wordpress/editor");
37
35
 
38
36
  var _index = _interopRequireDefault(require("./index.js"));
39
37
 
38
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
39
+
40
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
+
40
42
  /**
41
43
  * External dependencies
42
44
  */
@@ -205,12 +207,13 @@ class NativeEditorProvider extends _element.Component {
205
207
  }
206
208
  }
207
209
 
208
- getThemeColors({
209
- colors,
210
- gradients,
211
- rawStyles,
212
- rawFeatures
213
- }) {
210
+ getThemeColors(_ref) {
211
+ let {
212
+ colors,
213
+ gradients,
214
+ rawStyles,
215
+ rawFeatures
216
+ } = _ref;
214
217
  return { ...(rawStyles && rawFeatures ? (0, _components.getGlobalStyles)(rawStyles, rawFeatures) : {
215
218
  colors: (0, _blockEditor.validateThemeColors)(colors),
216
219
  gradients: (0, _blockEditor.validateThemeGradients)(gradients)
@@ -222,9 +225,12 @@ class NativeEditorProvider extends _element.Component {
222
225
  if (!prevProps.isReady && this.props.isReady) {
223
226
  const blocks = this.props.blocks;
224
227
 
225
- const isUnsupportedBlock = ({
226
- name
227
- }) => name === (0, _blocks.getUnregisteredTypeHandlerName)();
228
+ const isUnsupportedBlock = _ref2 => {
229
+ let {
230
+ name
231
+ } = _ref2;
232
+ return name === (0, _blocks.getUnregisteredTypeHandlerName)();
233
+ };
228
234
 
229
235
  const unsupportedBlockNames = blocks.filter(isUnsupportedBlock).map(block => block.attributes.originalName);
230
236
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/index.native.js"],"names":["postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","NativeEditorProvider","Component","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","updateSettings","galleryWithImageBlocks","__unstableGalleryWithImageBlocks","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","editorSettings","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","NEW_BLOCK_TYPES","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","colors","gradients","rawStyles","rawFeatures","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","RNReactNativeGutenbergBridge","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","wordCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","clearSelectedBlock","render","children","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","getSettings","getBlockEditorSettings","blockEditorStore","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","__unstableShouldCreateUndoLevel"],"mappings":";;;;;;;;;;;AAsBA;;;;AAnBA;;AAKA;;AAeA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAmBA;;AAKA;;AA/DA;AACA;AACA;;AAGA;AACA;AACA;AAkCA,MAAMA,gBAAgB,GAAG,CACxB;AAAEC,EAAAA,IAAI,EAAE,MAAR;AAAgBC,EAAAA,OAAO,EAAE;AAAzB,CADwB,EAExB;AAAED,EAAAA,IAAI,EAAE,MAAR;AAAgBC,EAAAA,OAAO,EAAE;AAAzB,CAFwB,EAGxB;AAAED,EAAAA,IAAI,EAAE,YAAR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,QAAQ,CAAEF,kBAAF,CALZ;AAMA,QAAM;AAAEK,IAAAA;AAAF,MAAuBH,QAAQ,CAAE,gBAAF,CAArC;AACA,QAAM;AAAE5G,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAAwC2G,QAAQ,CAAE,MAAF,CAAtD;AACA,QAAM;AAAE9D,IAAAA;AAAF,MAA0B8D,QAAQ,CAAE,cAAF,CAAxC;AAEA,SAAO;AACNjG,IAAAA,cADM;AAENX,IAAAA,WAFM;AAGN2F,IAAAA,kBAHM;AAINnD,IAAAA,WAJM;AAKNM,IAAAA,mBALM;;AAMNzB,IAAAA,SAAS,CAAEC,KAAF,EAAU;AAClBuF,MAAAA,QAAQ,CAAE;AAAEvF,QAAAA;AAAF,OAAF,CAAR;AACA,KARK;;AASNrB,IAAAA,oBATM;;AAUNsF,IAAAA,iCAAiC,CAAElG,MAAF,EAAW;AAC3CyH,MAAAA,iBAAiB,CAAEzH,MAAF,EAAU;AAC1B2H,QAAAA,+BAA+B,EAAE;AADP,OAAV,CAAjB;AAGA,KAdK;;AAeNtB,IAAAA,UAAU,CAAEb,IAAF,EAAS;AAClBkC,MAAAA,gBAAgB,CAAElC,IAAF,CAAhB;AACA,KAjBK;;AAkBNY,IAAAA;AAlBM,GAAP;AAoBA,CAhCD,CA9BuB,CAAT,EA+DV/F,oBA/DU,C","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tvalidateThemeColors,\n\tvalidateThemeGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { getGlobalStyles } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tlocale,\n\t\t\tupdateSettings,\n\t\t\tgalleryWithImageBlocks,\n\t\t} = this.props;\n\n\t\tupdateSettings( {\n\t\t\t...capabilities,\n\t\t\t...{ __unstableGalleryWithImageBlocks: galleryWithImageBlocks },\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image'\n\t\t\t\t\t\t? 'url'\n\t\t\t\t\t\t: 'src' ]: payload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings(\n\t\t\t( editorSettings ) => {\n\t\t\t\tupdateSettings( {\n\t\t\t\t\t...{\n\t\t\t\t\t\t__unstableGalleryWithImageBlocks:\n\t\t\t\t\t\t\teditorSettings.galleryWithImageBlocks,\n\t\t\t\t\t},\n\t\t\t\t\t...this.getThemeColors( editorSettings ),\n\t\t\t\t} );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store\n\t\t\tupdateSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { colors, gradients, rawStyles, rawFeatures } ) {\n\t\treturn {\n\t\t\t...( rawStyles && rawFeatures\n\t\t\t\t? getGlobalStyles( rawStyles, rawFeatures )\n\t\t\t\t: {\n\t\t\t\t\t\tcolors: validateThemeColors( colors ),\n\t\t\t\t\t\tgradients: validateThemeGradients( gradients ),\n\t\t\t\t } ),\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// refresh html content first\n\t\tthis.serializeToNativeAction();\n\t\t// make sure to blur the selected block and dismiss the keyboard\n\t\tthis.props.clearSelectedBlock();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateSettings( capabilities );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tpost, // eslint-disable-line no-unused-vars\n\t\t\tcapabilities,\n\t\t\tsettings,\n\t\t\t...props\n\t\t} = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t} = select( 'core/editor' );\n\t\tconst { getEditorMode } = select( 'core/edit-post' );\n\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetGlobalBlockCount,\n\t\t\tgetSettings: getBlockEditorSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tgetBlockEditorSettings,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\tconst {\n\t\t\tupdateSettings,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( 'core/edit-post' );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( 'core' );\n\t\tconst { createSuccessNotice } = dispatch( 'core/notices' );\n\n\t\treturn {\n\t\t\tupdateSettings,\n\t\t\taddEntities,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/provider/index.native.js"],"names":["postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","NativeEditorProvider","Component","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","updateSettings","galleryWithImageBlocks","__unstableGalleryWithImageBlocks","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","editorSettings","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","NEW_BLOCK_TYPES","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","colors","gradients","rawStyles","rawFeatures","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","RNReactNativeGutenbergBridge","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","wordCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","clearSelectedBlock","render","children","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","getSettings","getBlockEditorSettings","blockEditorStore","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","__unstableShouldCreateUndoLevel"],"mappings":";;;;;;;;;AAsBA;;;;AAnBA;;AAKA;;AAeA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAmBA;;AAKA;;;;;;AA/DA;AACA;AACA;;AAGA;AACA;AACA;AAkCA,MAAMA,gBAAgB,GAAG,CACxB;AAAEC,EAAAA,IAAI,EAAE,MAAR;AAAgBC,EAAAA,OAAO,EAAE;AAAzB,CADwB,EAExB;AAAED,EAAAA,IAAI,EAAE,MAAR;AAAgBC,EAAAA,OAAO,EAAE;AAAzB,CAFwB,EAGxB;AAAED,EAAAA,IAAI,EAAE,YAAR;AAAsBC,EAAAA,OAAO,EAAE;AAA/B,CAHwB,EAIxB;AAAED,EAAAA,IAAI,EAAE,UAAR;AAAoBC,EAAAA,OAAO,EAAE;AAA7B,CAJwB,EAKvBC,GALuB,CAKhBC,cAAF,KAAwB;AAC9BC,EAAAA,IAAI,EAAE,UADwB;AAE9B,KAAGD,cAF2B;AAG9BE,EAAAA,cAAc,EAAE;AACfC,IAAAA,MAAM,EAAE,IADO;AAEfC,IAAAA,SAAS,EAAE;AAFI,GAHc;AAO9BC,EAAAA,WAAW,EAAE;AACZC,IAAAA,IAAI,EAAE;AADM,GAPiB;AAU9BC,EAAAA,aAAa,EAAE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;AAMNzB,IAAAA,SAAS,CAAEC,KAAF,EAAU;AAClBuF,MAAAA,QAAQ,CAAE;AAAEvF,QAAAA;AAAF,OAAF,CAAR;AACA,KARK;;AASNrB,IAAAA,oBATM;;AAUNsF,IAAAA,iCAAiC,CAAElG,MAAF,EAAW;AAC3CyH,MAAAA,iBAAiB,CAAEzH,MAAF,EAAU;AAC1B2H,QAAAA,+BAA+B,EAAE;AADP,OAAV,CAAjB;AAGA,KAdK;;AAeNtB,IAAAA,UAAU,CAAEb,IAAF,EAAS;AAClBkC,MAAAA,gBAAgB,CAAElC,IAAF,CAAhB;AACA,KAjBK;;AAkBNY,IAAAA;AAlBM,GAAP;AAoBA,CAhCD,CA9BuB,CAAT,EA+DV/F,oBA/DU,C","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tvalidateThemeColors,\n\tvalidateThemeGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { getGlobalStyles } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tlocale,\n\t\t\tupdateSettings,\n\t\t\tgalleryWithImageBlocks,\n\t\t} = this.props;\n\n\t\tupdateSettings( {\n\t\t\t...capabilities,\n\t\t\t...{ __unstableGalleryWithImageBlocks: galleryWithImageBlocks },\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image'\n\t\t\t\t\t\t? 'url'\n\t\t\t\t\t\t: 'src' ]: payload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings(\n\t\t\t( editorSettings ) => {\n\t\t\t\tupdateSettings( {\n\t\t\t\t\t...{\n\t\t\t\t\t\t__unstableGalleryWithImageBlocks:\n\t\t\t\t\t\t\teditorSettings.galleryWithImageBlocks,\n\t\t\t\t\t},\n\t\t\t\t\t...this.getThemeColors( editorSettings ),\n\t\t\t\t} );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store\n\t\t\tupdateSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { colors, gradients, rawStyles, rawFeatures } ) {\n\t\treturn {\n\t\t\t...( rawStyles && rawFeatures\n\t\t\t\t? getGlobalStyles( rawStyles, rawFeatures )\n\t\t\t\t: {\n\t\t\t\t\t\tcolors: validateThemeColors( colors ),\n\t\t\t\t\t\tgradients: validateThemeGradients( gradients ),\n\t\t\t\t } ),\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// refresh html content first\n\t\tthis.serializeToNativeAction();\n\t\t// make sure to blur the selected block and dismiss the keyboard\n\t\tthis.props.clearSelectedBlock();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateSettings( capabilities );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tchildren,\n\t\t\tpost, // eslint-disable-line no-unused-vars\n\t\t\tcapabilities,\n\t\t\tsettings,\n\t\t\t...props\n\t\t} = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t} = select( 'core/editor' );\n\t\tconst { getEditorMode } = select( 'core/edit-post' );\n\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetGlobalBlockCount,\n\t\t\tgetSettings: getBlockEditorSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tgetBlockEditorSettings,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks } = dispatch( 'core/editor' );\n\t\tconst {\n\t\t\tupdateSettings,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( 'core/edit-post' );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( 'core' );\n\t\tconst { createSuccessNotice } = dispatch( 'core/notices' );\n\n\t\treturn {\n\t\t\tupdateSettings,\n\t\t\taddEntities,\n\t\t\tclearSelectedBlock,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n"]}
@@ -30,37 +30,44 @@ var _panel = _interopRequireDefault(require("./panel"));
30
30
  /**
31
31
  * Internal dependencies
32
32
  */
33
- function TableOfContents({
34
- hasOutlineItemsDisabled,
35
- repositionDropdown,
36
- ...props
37
- }, ref) {
33
+ function TableOfContents(_ref, ref) {
34
+ let {
35
+ hasOutlineItemsDisabled,
36
+ repositionDropdown,
37
+ ...props
38
+ } = _ref;
38
39
  const hasBlocks = (0, _data.useSelect)(select => !!select(_blockEditor.store).getBlockCount(), []);
39
40
  return (0, _element.createElement)(_components.Dropdown, {
40
41
  position: repositionDropdown ? 'middle right right' : 'bottom',
41
42
  className: "table-of-contents",
42
43
  contentClassName: "table-of-contents__popover",
43
- renderToggle: ({
44
- isOpen,
45
- onToggle
46
- }) => (0, _element.createElement)(_components.Button, (0, _extends2.default)({}, props, {
47
- ref: ref,
48
- onClick: hasBlocks ? onToggle : undefined,
49
- icon: _icons.info,
50
- "aria-expanded": isOpen,
51
- "aria-haspopup": "true"
52
- /* translators: button label text should, if possible, be under 16 characters. */
53
- ,
54
- label: (0, _i18n.__)('Details'),
55
- tooltipPosition: "bottom",
56
- "aria-disabled": !hasBlocks
57
- })),
58
- renderContent: ({
59
- onClose
60
- }) => (0, _element.createElement)(_panel.default, {
61
- onRequestClose: onClose,
62
- hasOutlineItemsDisabled: hasOutlineItemsDisabled
63
- })
44
+ renderToggle: _ref2 => {
45
+ let {
46
+ isOpen,
47
+ onToggle
48
+ } = _ref2;
49
+ return (0, _element.createElement)(_components.Button, (0, _extends2.default)({}, props, {
50
+ ref: ref,
51
+ onClick: hasBlocks ? onToggle : undefined,
52
+ icon: _icons.info,
53
+ "aria-expanded": isOpen,
54
+ "aria-haspopup": "true"
55
+ /* translators: button label text should, if possible, be under 16 characters. */
56
+ ,
57
+ label: (0, _i18n.__)('Details'),
58
+ tooltipPosition: "bottom",
59
+ "aria-disabled": !hasBlocks
60
+ }));
61
+ },
62
+ renderContent: _ref3 => {
63
+ let {
64
+ onClose
65
+ } = _ref3;
66
+ return (0, _element.createElement)(_panel.default, {
67
+ onRequestClose: onClose,
68
+ hasOutlineItemsDisabled: hasOutlineItemsDisabled
69
+ });
70
+ }
64
71
  });
65
72
  }
66
73
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"names":["TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","blockEditorStore","getBlockCount","isOpen","onToggle","undefined","info","onClose"],"mappings":";;;;;;;;;AAOA;;;;AAJA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,SAASA,eAAT,CACC;AAAEC,EAAAA,uBAAF;AAA2BC,EAAAA,kBAA3B;AAA+C,KAAGC;AAAlD,CADD,EAECC,GAFD,EAGE;AACD,QAAMC,SAAS,GAAG,qBACfC,MAAF,IAAc,CAAC,CAAEA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,aAA3B,EADA,EAEjB,EAFiB,CAAlB;AAIA,SACC,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAGN,kBAAkB,GAAG,oBAAH,GAA0B,QADxD;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,gBAAgB,EAAC,4BAHlB;AAIC,IAAA,YAAY,EAAG,CAAE;AAAEO,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,4BAAC,kBAAD,6BACMP,KADN;AAEC,MAAA,GAAG,EAAGC,GAFP;AAGC,MAAA,OAAO,EAAGC,SAAS,GAAGK,QAAH,GAAcC,SAHlC;AAIC,MAAA,IAAI,EAAGC,WAJR;AAKC,uBAAgBH,MALjB;AAMC,uBAAc;AACd;AAPD;AAQC,MAAA,KAAK,EAAG,cAAI,SAAJ,CART;AASC,MAAA,eAAe,EAAC,QATjB;AAUC,uBAAgB,CAAEJ;AAVnB,OALF;AAkBC,IAAA,aAAa,EAAG,CAAE;AAAEQ,MAAAA;AAAF,KAAF,KACf,4BAAC,cAAD;AACC,MAAA,cAAc,EAAGA,OADlB;AAEC,MAAA,uBAAuB,EAAGZ;AAF3B;AAnBF,IADD;AA2BA;;eAEc,yBAAYD,eAAZ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tposition={ repositionDropdown ? 'middle right right' : 'bottom' }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfContents );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"names":["TableOfContents","ref","hasOutlineItemsDisabled","repositionDropdown","props","hasBlocks","select","blockEditorStore","getBlockCount","isOpen","onToggle","undefined","info","onClose"],"mappings":";;;;;;;;;AAOA;;;;AAJA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,SAASA,eAAT,OAECC,GAFD,EAGE;AAAA,MAFD;AAAEC,IAAAA,uBAAF;AAA2BC,IAAAA,kBAA3B;AAA+C,OAAGC;AAAlD,GAEC;AACD,QAAMC,SAAS,GAAG,qBACfC,MAAF,IAAc,CAAC,CAAEA,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,aAA3B,EADA,EAEjB,EAFiB,CAAlB;AAIA,SACC,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAGL,kBAAkB,GAAG,oBAAH,GAA0B,QADxD;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,gBAAgB,EAAC,4BAHlB;AAIC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEM,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd,4BAAC,kBAAD,6BACMN,KADN;AAEC,QAAA,GAAG,EAAGH,GAFP;AAGC,QAAA,OAAO,EAAGI,SAAS,GAAGK,QAAH,GAAcC,SAHlC;AAIC,QAAA,IAAI,EAAGC,WAJR;AAKC,yBAAgBH,MALjB;AAMC,yBAAc;AACd;AAPD;AAQC,QAAA,KAAK,EAAG,cAAI,SAAJ,CART;AASC,QAAA,eAAe,EAAC,QATjB;AAUC,yBAAgB,CAAEJ;AAVnB,SADc;AAAA,KAJhB;AAkBC,IAAA,aAAa,EAAG;AAAA,UAAE;AAAEQ,QAAAA;AAAF,OAAF;AAAA,aACf,4BAAC,cAAD;AACC,QAAA,cAAc,EAAGA,OADlB;AAEC,QAAA,uBAAuB,EAAGX;AAF3B,QADe;AAAA;AAlBjB,IADD;AA2BA;;eAEc,yBAAYF,eAAZ,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tposition={ repositionDropdown ? 'middle right right' : 'bottom' }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( TableOfContents );\n"]}
@@ -28,10 +28,11 @@ var _characterCount = _interopRequireDefault(require("../character-count"));
28
28
  /**
29
29
  * Internal dependencies
30
30
  */
31
- function TableOfContentsPanel({
32
- hasOutlineItemsDisabled,
33
- onRequestClose
34
- }) {
31
+ function TableOfContentsPanel(_ref) {
32
+ let {
33
+ hasOutlineItemsDisabled,
34
+ onRequestClose
35
+ } = _ref;
35
36
  const {
36
37
  headingCount,
37
38
  paragraphCount,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/panel.js"],"names":["TableOfContentsPanel","hasOutlineItemsDisabled","onRequestClose","headingCount","paragraphCount","numberOfBlocks","select","getGlobalBlockCount","blockEditorStore"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAZA;AACA;AACA;;AAKA;AACA;AACA;AAKA,SAASA,oBAAT,CAA+B;AAAEC,EAAAA,uBAAF;AAA2BC,EAAAA;AAA3B,CAA/B,EAA6E;AAC5E,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,cAAhB;AAAgCC,IAAAA;AAAhC,MAAmD,qBACtDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAA0BD,MAAM,CAAEE,kBAAF,CAAtC;AACA,WAAO;AACNL,MAAAA,YAAY,EAAEI,mBAAmB,CAAE,cAAF,CAD3B;AAENH,MAAAA,cAAc,EAAEG,mBAAmB,CAAE,gBAAF,CAF7B;AAGNF,MAAAA,cAAc,EAAEE,mBAAmB;AAH7B,KAAP;AAKA,GARuD,EASxD,EATwD,CAAzD;AAWA;AACC;AACF;AACA;AACA;;AACE;AACA,yDACC;AACC,MAAA,SAAS,EAAC,4BADX;AAEC,MAAA,IAAI,EAAC,MAFN;AAGC,oBAAa,cAAI,qBAAJ,CAHd;AAIC,MAAA,QAAQ,EAAC;AAJV,OAMC;AAAI,MAAA,IAAI,EAAC,MAAT;AAAgB,MAAA,SAAS,EAAC;AAA1B,OACC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,YAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,4BAAC,uBAAD,OADD,CAFD,CADD,EAOC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,OAAJ,CADH,EAEC,4BAAC,kBAAD,OAFD,CAPD,EAWC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,UAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGJ,YADH,CAFD,CAXD,EAiBC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,YAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGC,cADH,CAFD,CAjBD,EAuBC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,QAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGC,cADH,CAFD,CAvBD,CAND,CADD,EAsCGF,YAAY,GAAG,CAAf,IACD,qDACC,uCADD,EAEC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,kBAAJ,CADH,CAFD,EAKC,4BAAC,wBAAD;AACC,MAAA,QAAQ,EAAGD,cADZ;AAEC,MAAA,uBAAuB,EAAGD;AAF3B,MALD,CAvCF;AAmDA;;AAzDD;AA2DA;;eAEcD,oB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport WordCount from '../word-count';\nimport DocumentOutline from '../document-outline';\nimport CharacterCount from '../character-count';\n\nfunction TableOfContentsPanel( { hasOutlineItemsDisabled, onRequestClose } ) {\n\tconst { headingCount, paragraphCount, numberOfBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\theadingCount: getGlobalBlockCount( 'core/heading' ),\n\t\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t\t\tnumberOfBlocks: getGlobalBlockCount(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn (\n\t\t/*\n\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t */\n\t\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName=\"table-of-contents__wrapper\"\n\t\t\t\trole=\"note\"\n\t\t\t\taria-label={ __( 'Document Statistics' ) }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t>\n\t\t\t\t<ul role=\"list\" className=\"table-of-contents__counts\">\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Characters' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Words' ) }\n\t\t\t\t\t\t<WordCount />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Headings' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ headingCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Paragraphs' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ paragraphCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Blocks' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ numberOfBlocks }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t{ headingCount > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<hr />\n\t\t\t\t\t<h2 className=\"table-of-contents__title\">\n\t\t\t\t\t\t{ __( 'Document Outline' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<DocumentOutline\n\t\t\t\t\t\tonSelect={ onRequestClose }\n\t\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t\t/* eslint-enable jsx-a11y/no-redundant-roles */\n\t);\n}\n\nexport default TableOfContentsPanel;\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/panel.js"],"names":["TableOfContentsPanel","hasOutlineItemsDisabled","onRequestClose","headingCount","paragraphCount","numberOfBlocks","select","getGlobalBlockCount","blockEditorStore"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAZA;AACA;AACA;;AAKA;AACA;AACA;AAKA,SAASA,oBAAT,OAA6E;AAAA,MAA9C;AAAEC,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,GAA8C;AAC5E,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,cAAhB;AAAgCC,IAAAA;AAAhC,MAAmD,qBACtDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAA0BD,MAAM,CAAEE,kBAAF,CAAtC;AACA,WAAO;AACNL,MAAAA,YAAY,EAAEI,mBAAmB,CAAE,cAAF,CAD3B;AAENH,MAAAA,cAAc,EAAEG,mBAAmB,CAAE,gBAAF,CAF7B;AAGNF,MAAAA,cAAc,EAAEE,mBAAmB;AAH7B,KAAP;AAKA,GARuD,EASxD,EATwD,CAAzD;AAWA;AACC;AACF;AACA;AACA;;AACE;AACA,yDACC;AACC,MAAA,SAAS,EAAC,4BADX;AAEC,MAAA,IAAI,EAAC,MAFN;AAGC,oBAAa,cAAI,qBAAJ,CAHd;AAIC,MAAA,QAAQ,EAAC;AAJV,OAMC;AAAI,MAAA,IAAI,EAAC,MAAT;AAAgB,MAAA,SAAS,EAAC;AAA1B,OACC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,YAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,4BAAC,uBAAD,OADD,CAFD,CADD,EAOC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,OAAJ,CADH,EAEC,4BAAC,kBAAD,OAFD,CAPD,EAWC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,UAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGJ,YADH,CAFD,CAXD,EAiBC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,YAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGC,cADH,CAFD,CAjBD,EAuBC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,QAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGC,cADH,CAFD,CAvBD,CAND,CADD,EAsCGF,YAAY,GAAG,CAAf,IACD,qDACC,uCADD,EAEC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,kBAAJ,CADH,CAFD,EAKC,4BAAC,wBAAD;AACC,MAAA,QAAQ,EAAGD,cADZ;AAEC,MAAA,uBAAuB,EAAGD;AAF3B,MALD,CAvCF;AAmDA;;AAzDD;AA2DA;;eAEcD,oB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport WordCount from '../word-count';\nimport DocumentOutline from '../document-outline';\nimport CharacterCount from '../character-count';\n\nfunction TableOfContentsPanel( { hasOutlineItemsDisabled, onRequestClose } ) {\n\tconst { headingCount, paragraphCount, numberOfBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\theadingCount: getGlobalBlockCount( 'core/heading' ),\n\t\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t\t\tnumberOfBlocks: getGlobalBlockCount(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\treturn (\n\t\t/*\n\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t */\n\t\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName=\"table-of-contents__wrapper\"\n\t\t\t\trole=\"note\"\n\t\t\t\taria-label={ __( 'Document Statistics' ) }\n\t\t\t\ttabIndex=\"0\"\n\t\t\t>\n\t\t\t\t<ul role=\"list\" className=\"table-of-contents__counts\">\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Characters' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Words' ) }\n\t\t\t\t\t\t<WordCount />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Headings' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ headingCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Paragraphs' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ paragraphCount }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li className=\"table-of-contents__count\">\n\t\t\t\t\t\t{ __( 'Blocks' ) }\n\t\t\t\t\t\t<span className=\"table-of-contents__number\">\n\t\t\t\t\t\t\t{ numberOfBlocks }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t{ headingCount > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<hr />\n\t\t\t\t\t<h2 className=\"table-of-contents__title\">\n\t\t\t\t\t\t{ __( 'Document Outline' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<DocumentOutline\n\t\t\t\t\t\tonSelect={ onRequestClose }\n\t\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t\t/* eslint-enable jsx-a11y/no-redundant-roles */\n\t);\n}\n\nexport default TableOfContentsPanel;\n"]}
@@ -20,10 +20,12 @@ var _blockEditor = require("@wordpress/block-editor");
20
20
  /**
21
21
  * WordPress dependencies
22
22
  */
23
- function TemplateValidationNotice({
24
- isValid,
25
- ...props
26
- }) {
23
+ function TemplateValidationNotice(_ref) {
24
+ let {
25
+ isValid,
26
+ ...props
27
+ } = _ref;
28
+
27
29
  if (isValid) {
28
30
  return null;
29
31
  }