@wordpress/editor 13.15.0 → 13.17.0

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 (557) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/autocompleters/index.js +0 -2
  3. package/build/components/autocompleters/index.js.map +1 -1
  4. package/build/components/autocompleters/user.js +2 -9
  5. package/build/components/autocompleters/user.js.map +1 -1
  6. package/build/components/autosave-monitor/index.js +0 -24
  7. package/build/components/autosave-monitor/index.js.map +1 -1
  8. package/build/components/character-count/index.js +1 -4
  9. package/build/components/character-count/index.js.map +1 -1
  10. package/build/components/deprecated.js +1 -11
  11. package/build/components/deprecated.js.map +1 -1
  12. package/build/components/deprecated.native.js +0 -1
  13. package/build/components/deprecated.native.js.map +1 -1
  14. package/build/components/document-outline/check.js +1 -7
  15. package/build/components/document-outline/check.js.map +1 -1
  16. package/build/components/document-outline/index.js +7 -24
  17. package/build/components/document-outline/index.js.map +1 -1
  18. package/build/components/document-outline/item.js +1 -5
  19. package/build/components/document-outline/item.js.map +1 -1
  20. package/build/components/editor-help/add-blocks.native.js +1 -8
  21. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  22. package/build/components/editor-help/customize-blocks.native.js +1 -8
  23. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  24. package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -13
  25. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  26. package/build/components/editor-help/help-get-support-button.native.js +1 -7
  27. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  28. package/build/components/editor-help/help-section-title.native.js +1 -7
  29. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  30. package/build/components/editor-help/help-topic-row.native.js +1 -8
  31. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  32. package/build/components/editor-help/icon-move-blocks.native.js +0 -4
  33. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/index.native.js +8 -29
  35. package/build/components/editor-help/index.native.js.map +1 -1
  36. package/build/components/editor-help/intro-to-blocks.native.js +1 -9
  37. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  38. package/build/components/editor-help/move-blocks.native.js +1 -8
  39. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  40. package/build/components/editor-help/remove-blocks.native.js +1 -8
  41. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/view-sections.native.js +1 -12
  43. package/build/components/editor-help/view-sections.native.js.map +1 -1
  44. package/build/components/editor-history/redo.js +6 -14
  45. package/build/components/editor-history/redo.js.map +1 -1
  46. package/build/components/editor-history/undo.js +6 -14
  47. package/build/components/editor-history/undo.js.map +1 -1
  48. package/build/components/editor-notices/index.js +1 -10
  49. package/build/components/editor-notices/index.js.map +1 -1
  50. package/build/components/editor-snackbars/index.js +1 -5
  51. package/build/components/editor-snackbars/index.js.map +1 -1
  52. package/build/components/entities-saved-states/entity-record-item.js +3 -10
  53. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  54. package/build/components/entities-saved-states/entity-type-list.js +3 -15
  55. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  56. package/build/components/entities-saved-states/hooks/use-is-dirty.js +5 -14
  57. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  58. package/build/components/entities-saved-states/index.js +8 -27
  59. package/build/components/entities-saved-states/index.js.map +1 -1
  60. package/build/components/error-boundary/index.js +1 -18
  61. package/build/components/error-boundary/index.js.map +1 -1
  62. package/build/components/global-keyboard-shortcuts/index.js +5 -9
  63. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  64. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -8
  65. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  66. package/build/components/index.js +4 -76
  67. package/build/components/index.js.map +1 -1
  68. package/build/components/index.native.js +0 -9
  69. package/build/components/index.native.js.map +1 -1
  70. package/build/components/local-autosave-monitor/index.js +6 -31
  71. package/build/components/local-autosave-monitor/index.js.map +1 -1
  72. package/build/components/media-categories/index.js +30 -45
  73. package/build/components/media-categories/index.js.map +1 -1
  74. package/build/components/page-attributes/check.js +3 -7
  75. package/build/components/page-attributes/check.js.map +1 -1
  76. package/build/components/page-attributes/order.js +17 -42
  77. package/build/components/page-attributes/order.js.map +1 -1
  78. package/build/components/page-attributes/parent.js +8 -34
  79. package/build/components/page-attributes/parent.js.map +1 -1
  80. package/build/components/post-author/check.js +1 -11
  81. package/build/components/post-author/check.js.map +1 -1
  82. package/build/components/post-author/combobox.js +7 -23
  83. package/build/components/post-author/combobox.js.map +1 -1
  84. package/build/components/post-author/constants.js +0 -1
  85. package/build/components/post-author/constants.js.map +1 -1
  86. package/build/components/post-author/index.js +1 -12
  87. package/build/components/post-author/index.js.map +1 -1
  88. package/build/components/post-author/select.js +1 -12
  89. package/build/components/post-author/select.js.map +1 -1
  90. package/build/components/post-comments/index.js +11 -23
  91. package/build/components/post-comments/index.js.map +1 -1
  92. package/build/components/post-excerpt/check.js +6 -8
  93. package/build/components/post-excerpt/check.js.map +1 -1
  94. package/build/components/post-excerpt/index.js +10 -27
  95. package/build/components/post-excerpt/index.js.map +1 -1
  96. package/build/components/post-featured-image/check.js +6 -9
  97. package/build/components/post-featured-image/check.js.map +1 -1
  98. package/build/components/post-featured-image/index.js +13 -42
  99. package/build/components/post-featured-image/index.js.map +1 -1
  100. package/build/components/post-format/check.js +9 -18
  101. package/build/components/post-format/check.js.map +1 -1
  102. package/build/components/post-format/index.js +2 -20
  103. package/build/components/post-format/index.js.map +1 -1
  104. package/build/components/post-last-revision/check.js +15 -22
  105. package/build/components/post-last-revision/check.js.map +1 -1
  106. package/build/components/post-last-revision/index.js +17 -28
  107. package/build/components/post-last-revision/index.js.map +1 -1
  108. package/build/components/post-locked-modal/index.js +8 -28
  109. package/build/components/post-locked-modal/index.js.map +1 -1
  110. package/build/components/post-pending-status/check.js +16 -24
  111. package/build/components/post-pending-status/check.js.map +1 -1
  112. package/build/components/post-pending-status/index.js +10 -28
  113. package/build/components/post-pending-status/index.js.map +1 -1
  114. package/build/components/post-pingbacks/index.js +11 -23
  115. package/build/components/post-pingbacks/index.js.map +1 -1
  116. package/build/components/post-preview-button/index.js +11 -22
  117. package/build/components/post-preview-button/index.js.map +1 -1
  118. package/build/components/post-publish-button/index.js +6 -32
  119. package/build/components/post-publish-button/index.js.map +1 -1
  120. package/build/components/post-publish-button/label.js +1 -10
  121. package/build/components/post-publish-button/label.js.map +1 -1
  122. package/build/components/post-publish-panel/index.js +1 -22
  123. package/build/components/post-publish-panel/index.js.map +1 -1
  124. package/build/components/post-publish-panel/maybe-category-panel.js +4 -14
  125. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  126. package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -18
  127. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  128. package/build/components/post-publish-panel/maybe-tags-panel.js +2 -17
  129. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  130. package/build/components/post-publish-panel/maybe-upload-media.js +1 -18
  131. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  132. package/build/components/post-publish-panel/postpublish.js +3 -27
  133. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  134. package/build/components/post-publish-panel/prepublish.js +1 -26
  135. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  136. package/build/components/post-saved-state/index.js +12 -29
  137. package/build/components/post-saved-state/index.js.map +1 -1
  138. package/build/components/post-schedule/check.js +1 -8
  139. package/build/components/post-schedule/check.js.map +1 -1
  140. package/build/components/post-schedule/index.js +7 -13
  141. package/build/components/post-schedule/index.js.map +1 -1
  142. package/build/components/post-schedule/label.js +18 -29
  143. package/build/components/post-schedule/label.js.map +1 -1
  144. package/build/components/post-slug/check.js +1 -4
  145. package/build/components/post-slug/check.js.map +1 -1
  146. package/build/components/post-slug/index.js +1 -19
  147. package/build/components/post-slug/index.js.map +1 -1
  148. package/build/components/post-sticky/check.js +1 -8
  149. package/build/components/post-sticky/check.js.map +1 -1
  150. package/build/components/post-sticky/index.js +1 -12
  151. package/build/components/post-sticky/index.js.map +1 -1
  152. package/build/components/post-switch-to-draft-button/index.js +1 -14
  153. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  154. package/build/components/post-sync-status/index.js +5 -18
  155. package/build/components/post-sync-status/index.js.map +1 -1
  156. package/build/components/post-taxonomies/check.js +1 -9
  157. package/build/components/post-taxonomies/check.js.map +1 -1
  158. package/build/components/post-taxonomies/flat-term-selector.js +15 -50
  159. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  160. package/build/components/post-taxonomies/hierarchical-term-selector.js +27 -79
  161. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  162. package/build/components/post-taxonomies/index.js +3 -13
  163. package/build/components/post-taxonomies/index.js.map +1 -1
  164. package/build/components/post-taxonomies/most-used-terms.js +1 -9
  165. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  166. package/build/components/post-template/index.js +1 -11
  167. package/build/components/post-template/index.js.map +1 -1
  168. package/build/components/post-text-editor/index.js +3 -17
  169. package/build/components/post-text-editor/index.js.map +1 -1
  170. package/build/components/post-title/index.js +14 -46
  171. package/build/components/post-title/index.js.map +1 -1
  172. package/build/components/post-title/index.native.js +7 -44
  173. package/build/components/post-title/index.native.js.map +1 -1
  174. package/build/components/post-trash/check.js +1 -7
  175. package/build/components/post-trash/check.js.map +1 -1
  176. package/build/components/post-trash/index.js +1 -8
  177. package/build/components/post-trash/index.js.map +1 -1
  178. package/build/components/post-type-support-check/index.js +10 -23
  179. package/build/components/post-type-support-check/index.js.map +1 -1
  180. package/build/components/post-url/check.js +1 -12
  181. package/build/components/post-url/check.js.map +1 -1
  182. package/build/components/post-url/index.js +3 -15
  183. package/build/components/post-url/index.js.map +1 -1
  184. package/build/components/post-url/label.js +1 -5
  185. package/build/components/post-url/label.js.map +1 -1
  186. package/build/components/post-visibility/check.js +1 -7
  187. package/build/components/post-visibility/check.js.map +1 -1
  188. package/build/components/post-visibility/index.js +1 -17
  189. package/build/components/post-visibility/index.js.map +1 -1
  190. package/build/components/post-visibility/label.js +1 -5
  191. package/build/components/post-visibility/label.js.map +1 -1
  192. package/build/components/post-visibility/utils.js +1 -2
  193. package/build/components/post-visibility/utils.js.map +1 -1
  194. package/build/components/provider/index.js +13 -27
  195. package/build/components/provider/index.js.map +1 -1
  196. package/build/components/provider/index.native.js +18 -70
  197. package/build/components/provider/index.native.js.map +1 -1
  198. package/build/components/provider/use-block-editor-settings.js +9 -20
  199. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  200. package/build/components/provider/use-block-editor-settings.native.js +5 -11
  201. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  202. package/build/components/provider/with-registry-provider.js +5 -12
  203. package/build/components/provider/with-registry-provider.js.map +1 -1
  204. package/build/components/table-of-contents/index.js +4 -14
  205. package/build/components/table-of-contents/index.js.map +1 -1
  206. package/build/components/table-of-contents/panel.js +1 -13
  207. package/build/components/table-of-contents/panel.js.map +1 -1
  208. package/build/components/template-validation-notice/index.js +3 -12
  209. package/build/components/template-validation-notice/index.js.map +1 -1
  210. package/build/components/theme-support-check/index.js +3 -12
  211. package/build/components/theme-support-check/index.js.map +1 -1
  212. package/build/components/time-to-read/index.js +2 -10
  213. package/build/components/time-to-read/index.js.map +1 -1
  214. package/build/components/unsaved-changes-warning/index.js +21 -35
  215. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  216. package/build/components/word-count/index.js +2 -7
  217. package/build/components/word-count/index.js.map +1 -1
  218. package/build/hooks/custom-sources-backwards-compatibility.js +8 -42
  219. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  220. package/build/hooks/default-autocompleters.js +3 -4
  221. package/build/hooks/default-autocompleters.js.map +1 -1
  222. package/build/hooks/index.js +0 -1
  223. package/build/hooks/index.js.map +1 -1
  224. package/build/hooks/index.native.js.map +1 -1
  225. package/build/index.js +0 -9
  226. package/build/index.js.map +1 -1
  227. package/build/index.native.js +0 -11
  228. package/build/index.native.js.map +1 -1
  229. package/build/lock-unlock.js +1 -2
  230. package/build/lock-unlock.js.map +1 -1
  231. package/build/private-apis.js +1 -4
  232. package/build/private-apis.js.map +1 -1
  233. package/build/store/actions.js +61 -130
  234. package/build/store/actions.js.map +1 -1
  235. package/build/store/actions.native.js +1 -8
  236. package/build/store/actions.native.js.map +1 -1
  237. package/build/store/constants.js +1 -2
  238. package/build/store/constants.js.map +1 -1
  239. package/build/store/defaults.js +2 -3
  240. package/build/store/defaults.js.map +1 -1
  241. package/build/store/index.js +3 -11
  242. package/build/store/index.js.map +1 -1
  243. package/build/store/local-autosave.js +0 -4
  244. package/build/store/local-autosave.js.map +1 -1
  245. package/build/store/reducer.js +19 -49
  246. package/build/store/reducer.js.map +1 -1
  247. package/build/store/reducer.native.js +3 -17
  248. package/build/store/reducer.native.js.map +1 -1
  249. package/build/store/selectors.js +170 -296
  250. package/build/store/selectors.js.map +1 -1
  251. package/build/store/selectors.native.js +4 -11
  252. package/build/store/selectors.native.js.map +1 -1
  253. package/build/store/utils/notice-builder.js +13 -24
  254. package/build/store/utils/notice-builder.js.map +1 -1
  255. package/build/utils/get-template-part-icon.js +0 -3
  256. package/build/utils/get-template-part-icon.js.map +1 -1
  257. package/build/utils/index.js +0 -4
  258. package/build/utils/index.js.map +1 -1
  259. package/build/utils/index.native.js +0 -2
  260. package/build/utils/index.native.js.map +1 -1
  261. package/build/utils/media-upload/index.js +2 -6
  262. package/build/utils/media-upload/index.js.map +1 -1
  263. package/build/utils/media-upload/index.native.js +0 -1
  264. package/build/utils/media-upload/index.native.js.map +1 -1
  265. package/build/utils/terms.js +8 -18
  266. package/build/utils/terms.js.map +1 -1
  267. package/build/utils/url.js +0 -4
  268. package/build/utils/url.js.map +1 -1
  269. package/build-module/components/autocompleters/index.js.map +1 -1
  270. package/build-module/components/autocompleters/user.js +2 -5
  271. package/build-module/components/autocompleters/user.js.map +1 -1
  272. package/build-module/components/autosave-monitor/index.js +2 -17
  273. package/build-module/components/autosave-monitor/index.js.map +1 -1
  274. package/build-module/components/character-count/index.js +1 -1
  275. package/build-module/components/character-count/index.js.map +1 -1
  276. package/build-module/components/deprecated.js +0 -4
  277. package/build-module/components/deprecated.js.map +1 -1
  278. package/build-module/components/deprecated.native.js +0 -1
  279. package/build-module/components/deprecated.native.js.map +1 -1
  280. package/build-module/components/document-outline/check.js +0 -4
  281. package/build-module/components/document-outline/check.js.map +1 -1
  282. package/build-module/components/document-outline/index.js +9 -13
  283. package/build-module/components/document-outline/index.js.map +1 -1
  284. package/build-module/components/document-outline/item.js +0 -3
  285. package/build-module/components/document-outline/item.js.map +1 -1
  286. package/build-module/components/editor-help/add-blocks.native.js +2 -5
  287. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  288. package/build-module/components/editor-help/customize-blocks.native.js +2 -5
  289. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  290. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +6 -8
  291. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  292. package/build-module/components/editor-help/help-get-support-button.native.js +2 -5
  293. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  294. package/build-module/components/editor-help/help-section-title.native.js +2 -5
  295. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  296. package/build-module/components/editor-help/help-topic-row.native.js +1 -6
  297. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  298. package/build-module/components/editor-help/icon-move-blocks.native.js +0 -1
  299. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  300. package/build-module/components/editor-help/index.native.js +9 -9
  301. package/build-module/components/editor-help/index.native.js.map +1 -1
  302. package/build-module/components/editor-help/intro-to-blocks.native.js +2 -5
  303. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  304. package/build-module/components/editor-help/move-blocks.native.js +2 -5
  305. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  306. package/build-module/components/editor-help/remove-blocks.native.js +2 -5
  307. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  308. package/build-module/components/editor-help/view-sections.native.js +2 -4
  309. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  310. package/build-module/components/editor-history/redo.js +6 -8
  311. package/build-module/components/editor-history/redo.js.map +1 -1
  312. package/build-module/components/editor-history/undo.js +6 -8
  313. package/build-module/components/editor-history/undo.js.map +1 -1
  314. package/build-module/components/editor-notices/index.js +1 -2
  315. package/build-module/components/editor-notices/index.js.map +1 -1
  316. package/build-module/components/editor-snackbars/index.js +0 -1
  317. package/build-module/components/editor-snackbars/index.js.map +1 -1
  318. package/build-module/components/entities-saved-states/entity-record-item.js +3 -4
  319. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  320. package/build-module/components/entities-saved-states/entity-type-list.js +3 -10
  321. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  322. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +4 -7
  323. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  324. package/build-module/components/entities-saved-states/index.js +8 -16
  325. package/build-module/components/entities-saved-states/index.js.map +1 -1
  326. package/build-module/components/error-boundary/index.js +1 -12
  327. package/build-module/components/error-boundary/index.js.map +1 -1
  328. package/build-module/components/global-keyboard-shortcuts/index.js +5 -6
  329. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  330. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +0 -3
  331. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  332. package/build-module/components/index.js +6 -3
  333. package/build-module/components/index.js.map +1 -1
  334. package/build-module/components/index.native.js +4 -2
  335. package/build-module/components/index.native.js.map +1 -1
  336. package/build-module/components/local-autosave-monitor/index.js +6 -21
  337. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  338. package/build-module/components/media-categories/index.js +31 -41
  339. package/build-module/components/media-categories/index.js.map +1 -1
  340. package/build-module/components/page-attributes/check.js +3 -3
  341. package/build-module/components/page-attributes/check.js.map +1 -1
  342. package/build-module/components/page-attributes/order.js +17 -31
  343. package/build-module/components/page-attributes/order.js.map +1 -1
  344. package/build-module/components/page-attributes/parent.js +9 -23
  345. package/build-module/components/page-attributes/parent.js.map +1 -1
  346. package/build-module/components/post-author/check.js +1 -5
  347. package/build-module/components/post-author/check.js.map +1 -1
  348. package/build-module/components/post-author/combobox.js +7 -16
  349. package/build-module/components/post-author/combobox.js.map +1 -1
  350. package/build-module/components/post-author/constants.js +0 -1
  351. package/build-module/components/post-author/constants.js.map +1 -1
  352. package/build-module/components/post-author/index.js +1 -6
  353. package/build-module/components/post-author/index.js.map +1 -1
  354. package/build-module/components/post-author/select.js +1 -6
  355. package/build-module/components/post-author/select.js.map +1 -1
  356. package/build-module/components/post-comments/index.js +12 -19
  357. package/build-module/components/post-comments/index.js.map +1 -1
  358. package/build-module/components/post-excerpt/check.js +5 -6
  359. package/build-module/components/post-excerpt/check.js.map +1 -1
  360. package/build-module/components/post-excerpt/index.js +11 -23
  361. package/build-module/components/post-excerpt/index.js.map +1 -1
  362. package/build-module/components/post-featured-image/check.js +5 -6
  363. package/build-module/components/post-featured-image/check.js.map +1 -1
  364. package/build-module/components/post-featured-image/index.js +13 -31
  365. package/build-module/components/post-featured-image/index.js.map +1 -1
  366. package/build-module/components/post-format/check.js +10 -15
  367. package/build-module/components/post-format/check.js.map +1 -1
  368. package/build-module/components/post-format/index.js +4 -12
  369. package/build-module/components/post-format/index.js.map +1 -1
  370. package/build-module/components/post-last-revision/check.js +17 -17
  371. package/build-module/components/post-last-revision/check.js.map +1 -1
  372. package/build-module/components/post-last-revision/index.js +18 -21
  373. package/build-module/components/post-last-revision/index.js.map +1 -1
  374. package/build-module/components/post-locked-modal/index.js +8 -22
  375. package/build-module/components/post-locked-modal/index.js.map +1 -1
  376. package/build-module/components/post-pending-status/check.js +17 -20
  377. package/build-module/components/post-pending-status/check.js.map +1 -1
  378. package/build-module/components/post-pending-status/index.js +11 -20
  379. package/build-module/components/post-pending-status/index.js.map +1 -1
  380. package/build-module/components/post-pingbacks/index.js +12 -19
  381. package/build-module/components/post-pingbacks/index.js.map +1 -1
  382. package/build-module/components/post-preview-button/index.js +11 -17
  383. package/build-module/components/post-preview-button/index.js.map +1 -1
  384. package/build-module/components/post-publish-button/index.js +7 -23
  385. package/build-module/components/post-publish-button/index.js.map +1 -1
  386. package/build-module/components/post-publish-button/label.js +1 -4
  387. package/build-module/components/post-publish-button/label.js.map +1 -1
  388. package/build-module/components/post-publish-panel/index.js +1 -8
  389. package/build-module/components/post-publish-panel/index.js.map +1 -1
  390. package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -8
  391. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  392. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -12
  393. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  394. package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -9
  395. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  396. package/build-module/components/post-publish-panel/maybe-upload-media.js +1 -12
  397. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  398. package/build-module/components/post-publish-panel/postpublish.js +3 -16
  399. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  400. package/build-module/components/post-publish-panel/prepublish.js +1 -10
  401. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  402. package/build-module/components/post-saved-state/index.js +15 -23
  403. package/build-module/components/post-saved-state/index.js.map +1 -1
  404. package/build-module/components/post-schedule/check.js +1 -3
  405. package/build-module/components/post-schedule/check.js.map +1 -1
  406. package/build-module/components/post-schedule/index.js +8 -8
  407. package/build-module/components/post-schedule/index.js.map +1 -1
  408. package/build-module/components/post-schedule/label.js +18 -22
  409. package/build-module/components/post-schedule/label.js.map +1 -1
  410. package/build-module/components/post-slug/check.js +0 -1
  411. package/build-module/components/post-slug/check.js.map +1 -1
  412. package/build-module/components/post-slug/index.js +1 -8
  413. package/build-module/components/post-slug/index.js.map +1 -1
  414. package/build-module/components/post-sticky/check.js +1 -3
  415. package/build-module/components/post-sticky/check.js.map +1 -1
  416. package/build-module/components/post-sticky/index.js +1 -3
  417. package/build-module/components/post-sticky/index.js.map +1 -1
  418. package/build-module/components/post-switch-to-draft-button/index.js +1 -9
  419. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  420. package/build-module/components/post-sync-status/index.js +5 -11
  421. package/build-module/components/post-sync-status/index.js.map +1 -1
  422. package/build-module/components/post-taxonomies/check.js +1 -3
  423. package/build-module/components/post-taxonomies/check.js.map +1 -1
  424. package/build-module/components/post-taxonomies/flat-term-selector.js +17 -39
  425. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  426. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +29 -66
  427. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  428. package/build-module/components/post-taxonomies/index.js +3 -5
  429. package/build-module/components/post-taxonomies/index.js.map +1 -1
  430. package/build-module/components/post-taxonomies/most-used-terms.js +1 -4
  431. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  432. package/build-module/components/post-template/index.js +1 -5
  433. package/build-module/components/post-template/index.js.map +1 -1
  434. package/build-module/components/post-text-editor/index.js +4 -9
  435. package/build-module/components/post-text-editor/index.js.map +1 -1
  436. package/build-module/components/post-title/index.js +17 -35
  437. package/build-module/components/post-title/index.js.map +1 -1
  438. package/build-module/components/post-title/index.native.js +8 -33
  439. package/build-module/components/post-title/index.native.js.map +1 -1
  440. package/build-module/components/post-trash/check.js +1 -4
  441. package/build-module/components/post-trash/check.js.map +1 -1
  442. package/build-module/components/post-trash/index.js +1 -4
  443. package/build-module/components/post-trash/index.js.map +1 -1
  444. package/build-module/components/post-type-support-check/index.js +14 -20
  445. package/build-module/components/post-type-support-check/index.js.map +1 -1
  446. package/build-module/components/post-url/check.js +1 -9
  447. package/build-module/components/post-url/check.js.map +1 -1
  448. package/build-module/components/post-url/index.js +3 -8
  449. package/build-module/components/post-url/index.js.map +1 -1
  450. package/build-module/components/post-url/label.js +1 -1
  451. package/build-module/components/post-url/label.js.map +1 -1
  452. package/build-module/components/post-visibility/check.js +1 -2
  453. package/build-module/components/post-visibility/check.js.map +1 -1
  454. package/build-module/components/post-visibility/index.js +1 -10
  455. package/build-module/components/post-visibility/index.js.map +1 -1
  456. package/build-module/components/post-visibility/label.js +1 -1
  457. package/build-module/components/post-visibility/label.js.map +1 -1
  458. package/build-module/components/post-visibility/utils.js.map +1 -1
  459. package/build-module/components/provider/index.js +13 -14
  460. package/build-module/components/provider/index.js.map +1 -1
  461. package/build-module/components/provider/index.native.js +21 -52
  462. package/build-module/components/provider/index.native.js.map +1 -1
  463. package/build-module/components/provider/use-block-editor-settings.js +9 -12
  464. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  465. package/build-module/components/provider/use-block-editor-settings.native.js +5 -5
  466. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  467. package/build-module/components/provider/with-registry-provider.js +5 -8
  468. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  469. package/build-module/components/table-of-contents/index.js +4 -7
  470. package/build-module/components/table-of-contents/index.js.map +1 -1
  471. package/build-module/components/table-of-contents/panel.js +1 -5
  472. package/build-module/components/table-of-contents/panel.js.map +1 -1
  473. package/build-module/components/template-validation-notice/index.js +2 -6
  474. package/build-module/components/template-validation-notice/index.js.map +1 -1
  475. package/build-module/components/theme-support-check/index.js +3 -7
  476. package/build-module/components/theme-support-check/index.js.map +1 -1
  477. package/build-module/components/time-to-read/index.js +4 -7
  478. package/build-module/components/time-to-read/index.js.map +1 -1
  479. package/build-module/components/unsaved-changes-warning/index.js +22 -31
  480. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  481. package/build-module/components/word-count/index.js +2 -4
  482. package/build-module/components/word-count/index.js.map +1 -1
  483. package/build-module/hooks/custom-sources-backwards-compatibility.js +11 -39
  484. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  485. package/build-module/hooks/default-autocompleters.js +3 -4
  486. package/build-module/hooks/default-autocompleters.js.map +1 -1
  487. package/build-module/hooks/index.js.map +1 -1
  488. package/build-module/hooks/index.native.js.map +1 -1
  489. package/build-module/index.js +1 -1
  490. package/build-module/index.js.map +1 -1
  491. package/build-module/index.native.js +1 -1
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/lock-unlock.js.map +1 -1
  494. package/build-module/private-apis.js.map +1 -1
  495. package/build-module/store/actions.js +63 -85
  496. package/build-module/store/actions.js.map +1 -1
  497. package/build-module/store/actions.native.js +2 -2
  498. package/build-module/store/actions.native.js.map +1 -1
  499. package/build-module/store/constants.js +1 -1
  500. package/build-module/store/constants.js.map +1 -1
  501. package/build-module/store/defaults.js +3 -2
  502. package/build-module/store/defaults.js.map +1 -1
  503. package/build-module/store/index.js +5 -4
  504. package/build-module/store/index.js.map +1 -1
  505. package/build-module/store/local-autosave.js +0 -1
  506. package/build-module/store/local-autosave.js.map +1 -1
  507. package/build-module/store/reducer.js +21 -33
  508. package/build-module/store/reducer.js.map +1 -1
  509. package/build-module/store/reducer.native.js +4 -10
  510. package/build-module/store/reducer.native.js.map +1 -1
  511. package/build-module/store/selectors.js +173 -223
  512. package/build-module/store/selectors.js.map +1 -1
  513. package/build-module/store/selectors.native.js +6 -8
  514. package/build-module/store/selectors.native.js.map +1 -1
  515. package/build-module/store/utils/notice-builder.js +15 -21
  516. package/build-module/store/utils/notice-builder.js.map +1 -1
  517. package/build-module/utils/get-template-part-icon.js +0 -2
  518. package/build-module/utils/get-template-part-icon.js.map +1 -1
  519. package/build-module/utils/index.js.map +1 -1
  520. package/build-module/utils/index.native.js.map +1 -1
  521. package/build-module/utils/media-upload/index.js +2 -4
  522. package/build-module/utils/media-upload/index.js.map +1 -1
  523. package/build-module/utils/media-upload/index.native.js.map +1 -1
  524. package/build-module/utils/terms.js +9 -11
  525. package/build-module/utils/terms.js.map +1 -1
  526. package/build-module/utils/url.js +1 -1
  527. package/build-module/utils/url.js.map +1 -1
  528. package/build-style/style-rtl.css +10 -17
  529. package/build-style/style.css +10 -17
  530. package/package.json +32 -31
  531. package/src/components/editor-help/index.native.js +1 -1
  532. package/src/components/editor-help/style.scss +5 -0
  533. package/src/components/page-attributes/order.js +15 -23
  534. package/src/components/page-attributes/test/order.js +46 -15
  535. package/src/components/post-author/test/check.js +18 -12
  536. package/src/components/post-comments/index.js +11 -17
  537. package/src/components/post-excerpt/check.js +6 -2
  538. package/src/components/post-excerpt/index.js +10 -16
  539. package/src/components/post-featured-image/check.js +4 -2
  540. package/src/components/post-format/check.js +16 -11
  541. package/src/components/post-last-revision/check.js +12 -14
  542. package/src/components/post-last-revision/index.js +12 -10
  543. package/src/components/post-last-revision/test/check.js +28 -16
  544. package/src/components/post-pending-status/check.js +13 -19
  545. package/src/components/post-pending-status/index.js +9 -14
  546. package/src/components/post-pending-status/test/check.js +32 -10
  547. package/src/components/post-pingbacks/index.js +11 -15
  548. package/src/components/post-publish-panel/style.scss +12 -25
  549. package/src/components/post-sync-status/style.scss +4 -1
  550. package/src/components/post-type-support-check/index.js +8 -10
  551. package/src/components/post-type-support-check/test/index.js +36 -20
  552. package/src/components/provider/index.js +3 -2
  553. package/src/components/unsaved-changes-warning/index.js +22 -27
  554. package/src/hooks/custom-sources-backwards-compatibility.js +1 -25
  555. package/src/store/actions.js +1 -1
  556. package/src/store/selectors.js +2 -2
  557. package/src/store/test/selectors.js +13 -13
@@ -1,22 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _data = require("@wordpress/data");
13
-
14
10
  var _coreData = require("@wordpress/core-data");
15
-
16
11
  var _useBlockEditorSettings = _interopRequireDefault(require("./use-block-editor-settings.js"));
17
-
18
12
  var _store = require("../../store");
19
-
20
13
  /**
21
14
  * WordPress dependencies
22
15
  */
@@ -24,8 +17,8 @@ var _store = require("../../store");
24
17
  /**
25
18
  * Internal dependencies
26
19
  */
27
- const EMPTY_BLOCKS_LIST = [];
28
20
 
21
+ const EMPTY_BLOCKS_LIST = [];
29
22
  function useNativeBlockEditorSettings(settings, hasTemplate) {
30
23
  const editorSettings = (0, _useBlockEditorSettings.default)(settings, hasTemplate);
31
24
  const supportReusableBlock = settings.capabilities?.reusableBlock === true;
@@ -34,7 +27,8 @@ function useNativeBlockEditorSettings(settings, hasTemplate) {
34
27
  isTitleSelected
35
28
  } = (0, _data.useSelect)(select => {
36
29
  return {
37
- reusableBlocks: supportReusableBlock ? select(_coreData.store).getEntityRecords('postType', 'wp_block', // Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.
30
+ reusableBlocks: supportReusableBlock ? select(_coreData.store).getEntityRecords('postType', 'wp_block',
31
+ // Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.
38
32
  // Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661
39
33
  {
40
34
  per_page: 100
@@ -42,12 +36,12 @@ function useNativeBlockEditorSettings(settings, hasTemplate) {
42
36
  isTitleSelected: select(_store.store).isPostTitleSelected()
43
37
  };
44
38
  }, [supportReusableBlock]);
45
- return (0, _element.useMemo)(() => ({ ...editorSettings,
39
+ return (0, _element.useMemo)(() => ({
40
+ ...editorSettings,
46
41
  __experimentalReusableBlocks: reusableBlocks,
47
42
  __experimentalShouldInsertAtTheTop: isTitleSelected
48
43
  }), [editorSettings, reusableBlocks, isTitleSelected]);
49
44
  }
50
-
51
45
  var _default = useNativeBlockEditorSettings;
52
46
  exports.default = _default;
53
47
  //# sourceMappingURL=use-block-editor-settings.native.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.native.js"],"names":["EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","hasTemplate","editorSettings","supportReusableBlock","capabilities","reusableBlock","reusableBlocks","isTitleSelected","select","coreStore","getEntityRecords","per_page","editorStore","isPostTitleSelected","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAMA,iBAAiB,GAAG,EAA1B;;AAEA,SAASC,4BAAT,CAAuCC,QAAvC,EAAiDC,WAAjD,EAA+D;AAC9D,QAAMC,cAAc,GAAG,qCAAwBF,QAAxB,EAAkCC,WAAlC,CAAvB;AACA,QAAME,oBAAoB,GAAGH,QAAQ,CAACI,YAAT,EAAuBC,aAAvB,KAAyC,IAAtE;AAEA,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAsC,qBACzCC,MAAF,IAAc;AACb,WAAO;AACNF,MAAAA,cAAc,EAAEH,oBAAoB,GACjCK,MAAM,CAAEC,eAAF,CAAN,CAAoBC,gBAApB,CACA,UADA,EAEA,UAFA,EAGA;AACA;AACA;AAAEC,QAAAA,QAAQ,EAAE;AAAZ,OALA,CADiC,GAQjCb,iBATG;AAUNS,MAAAA,eAAe,EAAEC,MAAM,CAAEI,YAAF,CAAN,CAAsBC,mBAAtB;AAVX,KAAP;AAYA,GAd0C,EAe3C,CAAEV,oBAAF,CAf2C,CAA5C;AAkBA,SAAO,sBACN,OAAQ,EACP,GAAGD,cADI;AAEPY,IAAAA,4BAA4B,EAAER,cAFvB;AAGPS,IAAAA,kCAAkC,EAAER;AAH7B,GAAR,CADM,EAMN,CAAEL,cAAF,EAAkBI,cAAlB,EAAkCC,eAAlC,CANM,CAAP;AAQA;;eAEcR,4B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useBlockEditorSettings from './use-block-editor-settings.js';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction useNativeBlockEditorSettings( settings, hasTemplate ) {\n\tconst editorSettings = useBlockEditorSettings( settings, hasTemplate );\n\tconst supportReusableBlock = settings.capabilities?.reusableBlock === true;\n\n\tconst { reusableBlocks, isTitleSelected } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\treusableBlocks: supportReusableBlock\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t\t// Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.\n\t\t\t\t\t\t\t// Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661\n\t\t\t\t\t\t\t{ per_page: 100 }\n\t\t\t\t\t )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST,\n\t\t\t\tisTitleSelected: select( editorStore ).isPostTitleSelected(),\n\t\t\t};\n\t\t},\n\t\t[ supportReusableBlock ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalShouldInsertAtTheTop: isTitleSelected,\n\t\t} ),\n\t\t[ editorSettings, reusableBlocks, isTitleSelected ]\n\t);\n}\n\nexport default useNativeBlockEditorSettings;\n"]}
1
+ {"version":3,"names":["_element","require","_data","_coreData","_useBlockEditorSettings","_interopRequireDefault","_store","EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","hasTemplate","editorSettings","useBlockEditorSettings","supportReusableBlock","capabilities","reusableBlock","reusableBlocks","isTitleSelected","useSelect","select","coreStore","getEntityRecords","per_page","editorStore","isPostTitleSelected","useMemo","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useBlockEditorSettings from './use-block-editor-settings.js';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction useNativeBlockEditorSettings( settings, hasTemplate ) {\n\tconst editorSettings = useBlockEditorSettings( settings, hasTemplate );\n\tconst supportReusableBlock = settings.capabilities?.reusableBlock === true;\n\n\tconst { reusableBlocks, isTitleSelected } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\treusableBlocks: supportReusableBlock\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t\t// Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.\n\t\t\t\t\t\t\t// Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661\n\t\t\t\t\t\t\t{ per_page: 100 }\n\t\t\t\t\t )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST,\n\t\t\t\tisTitleSelected: select( editorStore ).isPostTitleSelected(),\n\t\t\t};\n\t\t},\n\t\t[ supportReusableBlock ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalShouldInsertAtTheTop: isTitleSelected,\n\t\t} ),\n\t\t[ editorSettings, reusableBlocks, isTitleSelected ]\n\t);\n}\n\nexport default useNativeBlockEditorSettings;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,uBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,MAAMM,iBAAiB,GAAG,EAAE;AAE5B,SAASC,4BAA4BA,CAAEC,QAAQ,EAAEC,WAAW,EAAG;EAC9D,MAAMC,cAAc,GAAG,IAAAC,+BAAsB,EAAEH,QAAQ,EAAEC,WAAY,CAAC;EACtE,MAAMG,oBAAoB,GAAGJ,QAAQ,CAACK,YAAY,EAAEC,aAAa,KAAK,IAAI;EAE1E,MAAM;IAAEC,cAAc;IAAEC;EAAgB,CAAC,GAAG,IAAAC,eAAS,EAClDC,MAAM,IAAM;IACb,OAAO;MACNH,cAAc,EAAEH,oBAAoB,GACjCM,MAAM,CAAEC,eAAU,CAAC,CAACC,gBAAgB,CACpC,UAAU,EACV,UAAU;MACV;MACA;MACA;QAAEC,QAAQ,EAAE;MAAI,CAChB,CAAC,GACDf,iBAAiB;MACpBU,eAAe,EAAEE,MAAM,CAAEI,YAAY,CAAC,CAACC,mBAAmB,CAAC;IAC5D,CAAC;EACF,CAAC,EACD,CAAEX,oBAAoB,CACvB,CAAC;EAED,OAAO,IAAAY,gBAAO,EACb,OAAQ;IACP,GAAGd,cAAc;IACjBe,4BAA4B,EAAEV,cAAc;IAC5CW,kCAAkC,EAAEV;EACrC,CAAC,CAAE,EACH,CAAEN,cAAc,EAAEK,cAAc,EAAEC,eAAe,CAClD,CAAC;AACF;AAAC,IAAAW,QAAA,GAEcpB,4BAA4B;AAAAqB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _data = require("@wordpress/data");
11
-
12
9
  var _compose = require("@wordpress/compose");
13
-
14
10
  var _blockEditor = require("@wordpress/block-editor");
15
-
16
11
  var _store = require("../../store");
17
-
18
12
  /**
19
13
  * WordPress dependencies
20
14
  */
@@ -22,18 +16,18 @@ var _store = require("../../store");
22
16
  /**
23
17
  * Internal dependencies
24
18
  */
19
+
25
20
  const withRegistryProvider = (0, _compose.createHigherOrderComponent)(WrappedComponent => (0, _data.withRegistry)(props => {
26
21
  const {
27
22
  useSubRegistry = true,
28
23
  registry,
29
24
  ...additionalProps
30
25
  } = props;
31
-
32
26
  if (!useSubRegistry) {
33
- return (0, _element.createElement)(WrappedComponent, { ...additionalProps
27
+ return (0, _element.createElement)(WrappedComponent, {
28
+ ...additionalProps
34
29
  });
35
30
  }
36
-
37
31
  const [subRegistry, setSubRegistry] = (0, _element.useState)(null);
38
32
  (0, _element.useEffect)(() => {
39
33
  const newRegistry = (0, _data.createRegistry)({
@@ -42,14 +36,13 @@ const withRegistryProvider = (0, _compose.createHigherOrderComponent)(WrappedCom
42
36
  newRegistry.registerStore('core/editor', _store.storeConfig);
43
37
  setSubRegistry(newRegistry);
44
38
  }, [registry]);
45
-
46
39
  if (!subRegistry) {
47
40
  return null;
48
41
  }
49
-
50
42
  return (0, _element.createElement)(_data.RegistryProvider, {
51
43
  value: subRegistry
52
- }, (0, _element.createElement)(WrappedComponent, { ...additionalProps
44
+ }, (0, _element.createElement)(WrappedComponent, {
45
+ ...additionalProps
53
46
  }));
54
47
  }), 'withRegistryProvider');
55
48
  var _default = withRegistryProvider;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/with-registry-provider.js"],"names":["withRegistryProvider","WrappedComponent","props","useSubRegistry","registry","additionalProps","subRegistry","setSubRegistry","newRegistry","blockEditorStoreConfig","registerStore","storeConfig"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGA,MAAMA,oBAAoB,GAAG,yCAC1BC,gBAAF,IACC,wBAAgBC,KAAF,IAAa;AAC1B,QAAM;AACLC,IAAAA,cAAc,GAAG,IADZ;AAELC,IAAAA,QAFK;AAGL,OAAGC;AAHE,MAIFH,KAJJ;;AAKA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,4BAAC,gBAAD,OAAuBE;AAAvB,MAAP;AACA;;AAED,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,IAAV,CAAxC;AACA,0BAAW,MAAM;AAChB,UAAMC,WAAW,GAAG,0BACnB;AACC,2BAAqBC;AADtB,KADmB,EAInBL,QAJmB,CAApB;AAMAI,IAAAA,WAAW,CAACE,aAAZ,CAA2B,aAA3B,EAA0CC,kBAA1C;AACAJ,IAAAA,cAAc,CAAEC,WAAF,CAAd;AACA,GATD,EASG,CAAEJ,QAAF,CATH;;AAWA,MAAK,CAAEE,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,sBAAD;AAAkB,IAAA,KAAK,EAAGA;AAA1B,KACC,4BAAC,gBAAD,OAAuBD;AAAvB,IADD,CADD;AAKA,CA/BD,CAF2B,EAkC5B,sBAlC4B,CAA7B;eAqCeL,oB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\twithRegistry,\n\tcreateRegistry,\n\tRegistryProvider,\n} from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { storeConfig as blockEditorStoreConfig } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { storeConfig } from '../../store';\n\nconst withRegistryProvider = createHigherOrderComponent(\n\t( WrappedComponent ) =>\n\t\twithRegistry( ( props ) => {\n\t\t\tconst {\n\t\t\t\tuseSubRegistry = true,\n\t\t\t\tregistry,\n\t\t\t\t...additionalProps\n\t\t\t} = props;\n\t\t\tif ( ! useSubRegistry ) {\n\t\t\t\treturn <WrappedComponent { ...additionalProps } />;\n\t\t\t}\n\n\t\t\tconst [ subRegistry, setSubRegistry ] = useState( null );\n\t\t\tuseEffect( () => {\n\t\t\t\tconst newRegistry = createRegistry(\n\t\t\t\t\t{\n\t\t\t\t\t\t'core/block-editor': blockEditorStoreConfig,\n\t\t\t\t\t},\n\t\t\t\t\tregistry\n\t\t\t\t);\n\t\t\t\tnewRegistry.registerStore( 'core/editor', storeConfig );\n\t\t\t\tsetSubRegistry( newRegistry );\n\t\t\t}, [ registry ] );\n\n\t\t\tif ( ! subRegistry ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<RegistryProvider value={ subRegistry }>\n\t\t\t\t\t<WrappedComponent { ...additionalProps } />\n\t\t\t\t</RegistryProvider>\n\t\t\t);\n\t\t} ),\n\t'withRegistryProvider'\n);\n\nexport default withRegistryProvider;\n"]}
1
+ {"version":3,"names":["_element","require","_data","_compose","_blockEditor","_store","withRegistryProvider","createHigherOrderComponent","WrappedComponent","withRegistry","props","useSubRegistry","registry","additionalProps","createElement","subRegistry","setSubRegistry","useState","useEffect","newRegistry","createRegistry","blockEditorStoreConfig","registerStore","storeConfig","RegistryProvider","value","_default","exports","default"],"sources":["@wordpress/editor/src/components/provider/with-registry-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\twithRegistry,\n\tcreateRegistry,\n\tRegistryProvider,\n} from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { storeConfig as blockEditorStoreConfig } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { storeConfig } from '../../store';\n\nconst withRegistryProvider = createHigherOrderComponent(\n\t( WrappedComponent ) =>\n\t\twithRegistry( ( props ) => {\n\t\t\tconst {\n\t\t\t\tuseSubRegistry = true,\n\t\t\t\tregistry,\n\t\t\t\t...additionalProps\n\t\t\t} = props;\n\t\t\tif ( ! useSubRegistry ) {\n\t\t\t\treturn <WrappedComponent { ...additionalProps } />;\n\t\t\t}\n\n\t\t\tconst [ subRegistry, setSubRegistry ] = useState( null );\n\t\t\tuseEffect( () => {\n\t\t\t\tconst newRegistry = createRegistry(\n\t\t\t\t\t{\n\t\t\t\t\t\t'core/block-editor': blockEditorStoreConfig,\n\t\t\t\t\t},\n\t\t\t\t\tregistry\n\t\t\t\t);\n\t\t\t\tnewRegistry.registerStore( 'core/editor', storeConfig );\n\t\t\t\tsetSubRegistry( newRegistry );\n\t\t\t}, [ registry ] );\n\n\t\t\tif ( ! subRegistry ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<RegistryProvider value={ subRegistry }>\n\t\t\t\t\t<WrappedComponent { ...additionalProps } />\n\t\t\t\t</RegistryProvider>\n\t\t\t);\n\t\t} ),\n\t'withRegistryProvider'\n);\n\nexport default withRegistryProvider;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAMK,oBAAoB,GAAG,IAAAC,mCAA0B,EACpDC,gBAAgB,IACjB,IAAAC,kBAAY,EAAIC,KAAK,IAAM;EAC1B,MAAM;IACLC,cAAc,GAAG,IAAI;IACrBC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGH,KAAK;EACT,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAO,IAAAX,QAAA,CAAAc,aAAA,EAACN,gBAAgB;MAAA,GAAMK;IAAe,CAAI,CAAC;EACnD;EAEA,MAAM,CAAEE,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EACxD,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAMC,WAAW,GAAG,IAAAC,oBAAc,EACjC;MACC,mBAAmB,EAAEC;IACtB,CAAC,EACDT,QACD,CAAC;IACDO,WAAW,CAACG,aAAa,CAAE,aAAa,EAAEC,kBAAY,CAAC;IACvDP,cAAc,CAAEG,WAAY,CAAC;EAC9B,CAAC,EAAE,CAAEP,QAAQ,CAAG,CAAC;EAEjB,IAAK,CAAEG,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAf,QAAA,CAAAc,aAAA,EAACZ,KAAA,CAAAsB,gBAAgB;IAACC,KAAK,EAAGV;EAAa,GACtC,IAAAf,QAAA,CAAAc,aAAA,EAACN,gBAAgB;IAAA,GAAMK;EAAe,CAAI,CACzB,CAAC;AAErB,CAAE,CAAC,EACJ,sBACD,CAAC;AAAC,IAAAa,QAAA,GAEapB,oBAAoB;AAAAqB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -1,26 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _i18n = require("@wordpress/i18n");
13
-
14
10
  var _components = require("@wordpress/components");
15
-
16
11
  var _data = require("@wordpress/data");
17
-
18
12
  var _icons = require("@wordpress/icons");
19
-
20
13
  var _blockEditor = require("@wordpress/block-editor");
21
-
22
14
  var _panel = _interopRequireDefault(require("./panel"));
23
-
24
15
  /**
25
16
  * WordPress dependencies
26
17
  */
@@ -28,6 +19,7 @@ var _panel = _interopRequireDefault(require("./panel"));
28
19
  /**
29
20
  * Internal dependencies
30
21
  */
22
+
31
23
  function TableOfContents({
32
24
  hasOutlineItemsDisabled,
33
25
  repositionDropdown,
@@ -43,14 +35,14 @@ function TableOfContents({
43
35
  renderToggle: ({
44
36
  isOpen,
45
37
  onToggle
46
- }) => (0, _element.createElement)(_components.Button, { ...props,
38
+ }) => (0, _element.createElement)(_components.Button, {
39
+ ...props,
47
40
  ref: ref,
48
41
  onClick: hasBlocks ? onToggle : undefined,
49
42
  icon: _icons.info,
50
43
  "aria-expanded": isOpen,
51
44
  "aria-haspopup": "true"
52
- /* translators: button label text should, if possible, be under 16 characters. */
53
- ,
45
+ /* translators: button label text should, if possible, be under 16 characters. */,
54
46
  label: (0, _i18n.__)('Details'),
55
47
  tooltipPosition: "bottom",
56
48
  "aria-disabled": !hasBlocks
@@ -63,8 +55,6 @@ function TableOfContents({
63
55
  })
64
56
  });
65
57
  }
66
-
67
58
  var _default = (0, _element.forwardRef)(TableOfContents);
68
-
69
59
  exports.default = _default;
70
60
  //# sourceMappingURL=index.js.map
@@ -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","placement","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,YAAY,EAAG;AACdC,MAAAA,SAAS,EAAEP,kBAAkB,GAAG,OAAH,GAAa;AAD5B,KADhB;AAIC,IAAA,SAAS,EAAC,mBAJX;AAKC,IAAA,gBAAgB,EAAC,4BALlB;AAMC,IAAA,YAAY,EAAG,CAAE;AAAEQ,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,4BAAC,kBAAD,OACMR,KADN;AAEC,MAAA,GAAG,EAAGC,GAFP;AAGC,MAAA,OAAO,EAAGC,SAAS,GAAGM,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,CAAEL;AAVnB,MAPF;AAoBC,IAAA,aAAa,EAAG,CAAE;AAAES,MAAAA;AAAF,KAAF,KACf,4BAAC,cAAD;AACC,MAAA,cAAc,EAAGA,OADlB;AAEC,MAAA,uBAAuB,EAAGb;AAF3B;AArBF,IADD;AA6BA;;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\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\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,"names":["_element","require","_i18n","_components","_data","_icons","_blockEditor","_panel","_interopRequireDefault","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","useSelect","select","blockEditorStore","getBlockCount","createElement","Dropdown","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","Button","onClick","undefined","icon","info","label","__","tooltipPosition","renderContent","onClose","default","onRequestClose","_default","forwardRef","exports"],"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"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\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\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"],"mappings":";;;;;;;AAOA,IAAAA,QAAA,GAAAC,OAAA;AAJA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAC,sBAAA,CAAAP,OAAA;AAbA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASQ,eAAeA,CACvB;EAAEC,uBAAuB;EAAEC,kBAAkB;EAAE,GAAGC;AAAM,CAAC,EACzDC,GAAG,EACF;EACD,MAAMC,SAAS,GAAG,IAAAC,eAAS,EACxBC,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,aAAa,CAAC,CAAC,EAC3D,EACD,CAAC;EACD,OACC,IAAAlB,QAAA,CAAAmB,aAAA,EAAChB,WAAA,CAAAiB,QAAQ;IACRC,YAAY,EAAG;MACdC,SAAS,EAAEX,kBAAkB,GAAG,OAAO,GAAG;IAC3C,CAAG;IACHY,SAAS,EAAC,mBAAmB;IAC7BC,gBAAgB,EAAC,4BAA4B;IAC7CC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpC,IAAA3B,QAAA,CAAAmB,aAAA,EAAChB,WAAA,CAAAyB,MAAM;MAAA,GACDhB,KAAK;MACVC,GAAG,EAAGA,GAAK;MACXgB,OAAO,EAAGf,SAAS,GAAGa,QAAQ,GAAGG,SAAW;MAC5CC,IAAI,EAAGC,WAAM;MACb,iBAAgBN,MAAQ;MACxB,iBAAc;MACd;MACAO,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;MACzBC,eAAe,EAAC,QAAQ;MACxB,iBAAgB,CAAErB;IAAW,CAC7B,CACC;IACHsB,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KAC5B,IAAArC,QAAA,CAAAmB,aAAA,EAACZ,MAAA,CAAA+B,OAAoB;MACpBC,cAAc,EAAGF,OAAS;MAC1B3B,uBAAuB,EAAGA;IAAyB,CACnD;EACC,CACH,CAAC;AAEJ;AAAC,IAAA8B,QAAA,GAEc,IAAAC,mBAAU,EAAEhC,eAAgB,CAAC;AAAAiC,OAAA,CAAAJ,OAAA,GAAAE,QAAA"}
@@ -1,28 +1,18 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _i18n = require("@wordpress/i18n");
13
-
14
10
  var _data = require("@wordpress/data");
15
-
16
11
  var _blockEditor = require("@wordpress/block-editor");
17
-
18
12
  var _wordCount = _interopRequireDefault(require("../word-count"));
19
-
20
13
  var _timeToRead = _interopRequireDefault(require("../time-to-read"));
21
-
22
14
  var _documentOutline = _interopRequireDefault(require("../document-outline"));
23
-
24
15
  var _characterCount = _interopRequireDefault(require("../character-count"));
25
-
26
16
  /**
27
17
  * WordPress dependencies
28
18
  */
@@ -30,6 +20,7 @@ var _characterCount = _interopRequireDefault(require("../character-count"));
30
20
  /**
31
21
  * Internal dependencies
32
22
  */
23
+
33
24
  function TableOfContentsPanel({
34
25
  hasOutlineItemsDisabled,
35
26
  onRequestClose
@@ -53,7 +44,6 @@ function TableOfContentsPanel({
53
44
  * Disable reason: The `list` ARIA role is redundant but
54
45
  * Safari+VoiceOver won't announce the list otherwise.
55
46
  */
56
-
57
47
  /* eslint-disable jsx-a11y/no-redundant-roles */
58
48
  (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", {
59
49
  className: "table-of-contents__wrapper",
@@ -90,10 +80,8 @@ function TableOfContentsPanel({
90
80
  hasOutlineItemsDisabled: hasOutlineItemsDisabled
91
81
  })))
92
82
  /* eslint-enable jsx-a11y/no-redundant-roles */
93
-
94
83
  );
95
84
  }
96
-
97
85
  var _default = TableOfContentsPanel;
98
86
  exports.default = _default;
99
87
  //# sourceMappingURL=panel.js.map
@@ -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;;AACA;;AAbA;AACA;AACA;;AAKA;AACA;AACA;AAMA,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,OAAJ,CADH,EAEC,4BAAC,kBAAD,OAFD,CADD,EAKC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,YAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,4BAAC,uBAAD,OADD,CAFD,CALD,EAWC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,cAAJ,CADH,EAEC,4BAAC,mBAAD,OAFD,CAXD,EAeC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,UAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGJ,YADH,CAFD,CAfD,EAqBC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,YAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGC,cADH,CAFD,CArBD,EA2BC;AAAI,MAAA,SAAS,EAAC;AAAd,OACG,cAAI,QAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGC,cADH,CAFD,CA3BD,CAND,CADD,EA0CGF,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,CA3CF;AAuDA;;AA7DD;AA+DA;;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 TimeToRead from '../time-to-read';\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{ __( '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{ __( '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{ __( 'Time to read' ) }\n\t\t\t\t\t\t<TimeToRead />\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,"names":["_i18n","require","_data","_blockEditor","_wordCount","_interopRequireDefault","_timeToRead","_documentOutline","_characterCount","TableOfContentsPanel","hasOutlineItemsDisabled","onRequestClose","headingCount","paragraphCount","numberOfBlocks","useSelect","select","getGlobalBlockCount","blockEditorStore","_element","createElement","Fragment","className","role","__","tabIndex","default","onSelect","_default","exports"],"sources":["@wordpress/editor/src/components/table-of-contents/panel.js"],"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 TimeToRead from '../time-to-read';\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{ __( '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{ __( '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{ __( 'Time to read' ) }\n\t\t\t\t\t\t<TimeToRead />\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"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,gBAAA,GAAAF,sBAAA,CAAAJ,OAAA;AACA,IAAAO,eAAA,GAAAH,sBAAA,CAAAJ,OAAA;AAbA;AACA;AACA;;AAKA;AACA;AACA;;AAMA,SAASQ,oBAAoBA,CAAE;EAAEC,uBAAuB;EAAEC;AAAe,CAAC,EAAG;EAC5E,MAAM;IAAEC,YAAY;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAG,IAAAC,eAAS,EAC/DC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAC1D,OAAO;MACNN,YAAY,EAAEK,mBAAmB,CAAE,cAAe,CAAC;MACnDJ,cAAc,EAAEI,mBAAmB,CAAE,gBAAiB,CAAC;MACvDH,cAAc,EAAEG,mBAAmB,CAAC;IACrC,CAAC;EACF,CAAC,EACD,EACD,CAAC;EACD;IACC;AACF;AACA;AACA;IACE;IACA,IAAAE,QAAA,CAAAC,aAAA,EAAAD,QAAA,CAAAE,QAAA,QACC,IAAAF,QAAA,CAAAC,aAAA;MACCE,SAAS,EAAC,4BAA4B;MACtCC,IAAI,EAAC,MAAM;MACX,cAAa,IAAAC,QAAE,EAAE,qBAAsB,CAAG;MAC1CC,QAAQ,EAAC;IAAG,GAEZ,IAAAN,QAAA,CAAAC,aAAA;MAAIG,IAAI,EAAC,MAAM;MAACD,SAAS,EAAC;IAA2B,GACpD,IAAAH,QAAA,CAAAC,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrC,IAAAE,QAAE,EAAE,OAAQ,CAAC,EACf,IAAAL,QAAA,CAAAC,aAAA,EAAChB,UAAA,CAAAsB,OAAS,MAAE,CACT,CAAC,EACL,IAAAP,QAAA,CAAAC,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrC,IAAAE,QAAE,EAAE,YAAa,CAAC,EACpB,IAAAL,QAAA,CAAAC,aAAA;MAAME,SAAS,EAAC;IAA2B,GAC1C,IAAAH,QAAA,CAAAC,aAAA,EAACZ,eAAA,CAAAkB,OAAc,MAAE,CACZ,CACH,CAAC,EACL,IAAAP,QAAA,CAAAC,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrC,IAAAE,QAAE,EAAE,cAAe,CAAC,EACtB,IAAAL,QAAA,CAAAC,aAAA,EAACd,WAAA,CAAAoB,OAAU,MAAE,CACV,CAAC,EACL,IAAAP,QAAA,CAAAC,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrC,IAAAE,QAAE,EAAE,UAAW,CAAC,EAClB,IAAAL,QAAA,CAAAC,aAAA;MAAME,SAAS,EAAC;IAA2B,GACxCV,YACG,CACH,CAAC,EACL,IAAAO,QAAA,CAAAC,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrC,IAAAE,QAAE,EAAE,YAAa,CAAC,EACpB,IAAAL,QAAA,CAAAC,aAAA;MAAME,SAAS,EAAC;IAA2B,GACxCT,cACG,CACH,CAAC,EACL,IAAAM,QAAA,CAAAC,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrC,IAAAE,QAAE,EAAE,QAAS,CAAC,EAChB,IAAAL,QAAA,CAAAC,aAAA;MAAME,SAAS,EAAC;IAA2B,GACxCR,cACG,CACH,CACD,CACA,CAAC,EACJF,YAAY,GAAG,CAAC,IACjB,IAAAO,QAAA,CAAAC,aAAA,EAAAD,QAAA,CAAAE,QAAA,QACC,IAAAF,QAAA,CAAAC,aAAA,YAAK,CAAC,EACN,IAAAD,QAAA,CAAAC,aAAA;MAAIE,SAAS,EAAC;IAA0B,GACrC,IAAAE,QAAE,EAAE,kBAAmB,CACtB,CAAC,EACL,IAAAL,QAAA,CAAAC,aAAA,EAACb,gBAAA,CAAAmB,OAAe;MACfC,QAAQ,EAAGhB,cAAgB;MAC3BD,uBAAuB,EAAGA;IAAyB,CACnD,CACA,CAEF;IACF;EAAA;AAEF;AAAC,IAAAkB,QAAA,GAEcnB,oBAAoB;AAAAoB,OAAA,CAAAH,OAAA,GAAAE,QAAA"}
@@ -4,22 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _components = require("@wordpress/components");
11
-
12
9
  var _i18n = require("@wordpress/i18n");
13
-
14
10
  var _data = require("@wordpress/data");
15
-
16
11
  var _compose = require("@wordpress/compose");
17
-
18
12
  var _blockEditor = require("@wordpress/block-editor");
19
-
20
13
  /**
21
14
  * WordPress dependencies
22
15
  */
16
+
23
17
  function TemplateValidationNotice({
24
18
  isValid,
25
19
  ...props
@@ -27,14 +21,13 @@ function TemplateValidationNotice({
27
21
  if (isValid) {
28
22
  return null;
29
23
  }
30
-
31
24
  const confirmSynchronization = () => {
32
- if ( // eslint-disable-next-line no-alert
25
+ if (
26
+ // eslint-disable-next-line no-alert
33
27
  window.confirm((0, _i18n.__)('Resetting the template may result in loss of content, do you want to continue?'))) {
34
28
  props.synchronizeTemplate();
35
29
  }
36
30
  };
37
-
38
31
  return (0, _element.createElement)(_components.Notice, {
39
32
  className: "editor-template-validation-notice",
40
33
  isDismissible: false,
@@ -48,7 +41,6 @@ function TemplateValidationNotice({
48
41
  }]
49
42
  }, (0, _i18n.__)('The content of your post doesn’t match the template assigned to your post type.'));
50
43
  }
51
-
52
44
  var _default = (0, _compose.compose)([(0, _data.withSelect)(select => ({
53
45
  isValid: select(_blockEditor.store).isValidTemplate()
54
46
  })), (0, _data.withDispatch)(dispatch => {
@@ -61,6 +53,5 @@ var _default = (0, _compose.compose)([(0, _data.withSelect)(select => ({
61
53
  synchronizeTemplate
62
54
  };
63
55
  })])(TemplateValidationNotice);
64
-
65
56
  exports.default = _default;
66
57
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"names":["TemplateValidationNotice","isValid","props","confirmSynchronization","window","confirm","synchronizeTemplate","label","onClick","resetTemplateValidity","select","blockEditorStore","isValidTemplate","dispatch","setTemplateValidity"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;AAOA,SAASA,wBAAT,CAAmC;AAAEC,EAAAA,OAAF;AAAW,KAAGC;AAAd,CAAnC,EAA2D;AAC1D,MAAKD,OAAL,EAAe;AACd,WAAO,IAAP;AACA;;AAED,QAAME,sBAAsB,GAAG,MAAM;AACpC,SACC;AACAC,IAAAA,MAAM,CAACC,OAAP,CACC,cACC,gFADD,CADD,CAFD,EAOE;AACDH,MAAAA,KAAK,CAACI,mBAAN;AACA;AACD,GAXD;;AAaA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,aAAa,EAAG,KAFjB;AAGC,IAAA,MAAM,EAAC,SAHR;AAIC,IAAA,OAAO,EAAG,CACT;AACCC,MAAAA,KAAK,EAAE,cAAI,eAAJ,CADR;AAECC,MAAAA,OAAO,EAAEN,KAAK,CAACO;AAFhB,KADS,EAKT;AACCF,MAAAA,KAAK,EAAE,cAAI,oBAAJ,CADR;AAECC,MAAAA,OAAO,EAAEL;AAFV,KALS;AAJX,KAeG,cACD,iFADC,CAfH,CADD;AAqBA;;eAEc,sBAAS,CACvB,sBAAcO,MAAF,KAAgB;AAC3BT,EAAAA,OAAO,EAAES,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,eAA3B;AADkB,CAAhB,CAAZ,CADuB,EAIvB,wBAAgBC,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,mBAAF;AAAuBR,IAAAA;AAAvB,MACLO,QAAQ,CAAEF,kBAAF,CADT;AAEA,SAAO;AACNF,IAAAA,qBAAqB,EAAE,MAAMK,mBAAmB,CAAE,IAAF,CAD1C;AAENR,IAAAA;AAFM,GAAP;AAIA,CAPD,CAJuB,CAAT,EAYVN,wBAZU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction TemplateValidationNotice( { isValid, ...props } ) {\n\tif ( isValid ) {\n\t\treturn null;\n\t}\n\n\tconst confirmSynchronization = () => {\n\t\tif (\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\twindow.confirm(\n\t\t\t\t__(\n\t\t\t\t\t'Resetting the template may result in loss of content, do you want to continue?'\n\t\t\t\t)\n\t\t\t)\n\t\t) {\n\t\t\tprops.synchronizeTemplate();\n\t\t}\n\t};\n\n\treturn (\n\t\t<Notice\n\t\t\tclassName=\"editor-template-validation-notice\"\n\t\t\tisDismissible={ false }\n\t\t\tstatus=\"warning\"\n\t\t\tactions={ [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Keep it as is' ),\n\t\t\t\t\tonClick: props.resetTemplateValidity,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Reset the template' ),\n\t\t\t\t\tonClick: confirmSynchronization,\n\t\t\t\t},\n\t\t\t] }\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'The content of your post doesn’t match the template assigned to your post type.'\n\t\t\t) }\n\t\t</Notice>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tisValid: select( blockEditorStore ).isValidTemplate(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { setTemplateValidity, synchronizeTemplate } =\n\t\t\tdispatch( blockEditorStore );\n\t\treturn {\n\t\t\tresetTemplateValidity: () => setTemplateValidity( true ),\n\t\t\tsynchronizeTemplate,\n\t\t};\n\t} ),\n] )( TemplateValidationNotice );\n"]}
1
+ {"version":3,"names":["_components","require","_i18n","_data","_compose","_blockEditor","TemplateValidationNotice","isValid","props","confirmSynchronization","window","confirm","__","synchronizeTemplate","_element","createElement","Notice","className","isDismissible","status","actions","label","onClick","resetTemplateValidity","_default","compose","withSelect","select","blockEditorStore","isValidTemplate","withDispatch","dispatch","setTemplateValidity","exports","default"],"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction TemplateValidationNotice( { isValid, ...props } ) {\n\tif ( isValid ) {\n\t\treturn null;\n\t}\n\n\tconst confirmSynchronization = () => {\n\t\tif (\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\twindow.confirm(\n\t\t\t\t__(\n\t\t\t\t\t'Resetting the template may result in loss of content, do you want to continue?'\n\t\t\t\t)\n\t\t\t)\n\t\t) {\n\t\t\tprops.synchronizeTemplate();\n\t\t}\n\t};\n\n\treturn (\n\t\t<Notice\n\t\t\tclassName=\"editor-template-validation-notice\"\n\t\t\tisDismissible={ false }\n\t\t\tstatus=\"warning\"\n\t\t\tactions={ [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Keep it as is' ),\n\t\t\t\t\tonClick: props.resetTemplateValidity,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Reset the template' ),\n\t\t\t\t\tonClick: confirmSynchronization,\n\t\t\t\t},\n\t\t\t] }\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'The content of your post doesn’t match the template assigned to your post type.'\n\t\t\t) }\n\t\t</Notice>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tisValid: select( blockEditorStore ).isValidTemplate(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { setTemplateValidity, synchronizeTemplate } =\n\t\t\tdispatch( blockEditorStore );\n\t\treturn {\n\t\t\tresetTemplateValidity: () => setTemplateValidity( true ),\n\t\t\tsynchronizeTemplate,\n\t\t};\n\t} ),\n] )( TemplateValidationNotice );\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA,SAASK,wBAAwBA,CAAE;EAAEC,OAAO;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC1D,IAAKD,OAAO,EAAG;IACd,OAAO,IAAI;EACZ;EAEA,MAAME,sBAAsB,GAAGA,CAAA,KAAM;IACpC;IACC;IACAC,MAAM,CAACC,OAAO,CACb,IAAAC,QAAE,EACD,gFACD,CACD,CAAC,EACA;MACDJ,KAAK,CAACK,mBAAmB,CAAC,CAAC;IAC5B;EACD,CAAC;EAED,OACC,IAAAC,QAAA,CAAAC,aAAA,EAACf,WAAA,CAAAgB,MAAM;IACNC,SAAS,EAAC,mCAAmC;IAC7CC,aAAa,EAAG,KAAO;IACvBC,MAAM,EAAC,SAAS;IAChBC,OAAO,EAAG,CACT;MACCC,KAAK,EAAE,IAAAT,QAAE,EAAE,eAAgB,CAAC;MAC5BU,OAAO,EAAEd,KAAK,CAACe;IAChB,CAAC,EACD;MACCF,KAAK,EAAE,IAAAT,QAAE,EAAE,oBAAqB,CAAC;MACjCU,OAAO,EAAEb;IACV,CAAC;EACC,GAED,IAAAG,QAAE,EACH,iFACD,CACO,CAAC;AAEX;AAAC,IAAAY,QAAA,GAEc,IAAAC,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,KAAQ;EAC3BpB,OAAO,EAAEoB,MAAM,CAAEC,kBAAiB,CAAC,CAACC,eAAe,CAAC;AACrD,CAAC,CAAG,CAAC,EACL,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC,mBAAmB;IAAEnB;EAAoB,CAAC,GACjDkB,QAAQ,CAAEH,kBAAiB,CAAC;EAC7B,OAAO;IACNL,qBAAqB,EAAEA,CAAA,KAAMS,mBAAmB,CAAE,IAAK,CAAC;IACxDnB;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEP,wBAAyB,CAAC;AAAA2B,OAAA,CAAAC,OAAA,GAAAV,QAAA"}
@@ -5,13 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ThemeSupportCheck = ThemeSupportCheck;
7
7
  exports.default = void 0;
8
-
9
8
  var _data = require("@wordpress/data");
10
-
11
9
  var _coreData = require("@wordpress/core-data");
12
-
13
10
  var _store = require("../../store");
14
-
15
11
  /**
16
12
  * WordPress dependencies
17
13
  */
@@ -19,6 +15,7 @@ var _store = require("../../store");
19
15
  /**
20
16
  * Internal dependencies
21
17
  */
18
+
22
19
  function ThemeSupportCheck({
23
20
  themeSupports,
24
21
  children,
@@ -27,26 +24,21 @@ function ThemeSupportCheck({
27
24
  }) {
28
25
  const isSupported = (Array.isArray(supportKeys) ? supportKeys : [supportKeys]).some(key => {
29
26
  var _themeSupports$key;
30
-
31
- const supported = (_themeSupports$key = themeSupports?.[key]) !== null && _themeSupports$key !== void 0 ? _themeSupports$key : false; // 'post-thumbnails' can be boolean or an array of post types.
27
+ const supported = (_themeSupports$key = themeSupports?.[key]) !== null && _themeSupports$key !== void 0 ? _themeSupports$key : false;
28
+ // 'post-thumbnails' can be boolean or an array of post types.
32
29
  // In the latter case, we need to verify `postType` exists
33
30
  // within `supported`. If `postType` isn't passed, then the check
34
31
  // should fail.
35
-
36
32
  if ('post-thumbnails' === key && Array.isArray(supported)) {
37
33
  return supported.includes(postType);
38
34
  }
39
-
40
35
  return supported;
41
36
  });
42
-
43
37
  if (!isSupported) {
44
38
  return null;
45
39
  }
46
-
47
40
  return children;
48
41
  }
49
-
50
42
  var _default = (0, _data.withSelect)(select => {
51
43
  const {
52
44
  getThemeSupports
@@ -59,6 +51,5 @@ var _default = (0, _data.withSelect)(select => {
59
51
  themeSupports: getThemeSupports()
60
52
  };
61
53
  })(ThemeSupportCheck);
62
-
63
54
  exports.default = _default;
64
55
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"names":["ThemeSupportCheck","themeSupports","children","postType","supportKeys","isSupported","Array","isArray","some","key","supported","includes","select","getThemeSupports","coreStore","getEditedPostAttribute","editorStore"],"mappings":";;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGO,SAASA,iBAAT,CAA4B;AAClCC,EAAAA,aADkC;AAElCC,EAAAA,QAFkC;AAGlCC,EAAAA,QAHkC;AAIlCC,EAAAA;AAJkC,CAA5B,EAKH;AACH,QAAMC,WAAW,GAAG,CACnBC,KAAK,CAACC,OAAN,CAAeH,WAAf,IAA+BA,WAA/B,GAA6C,CAAEA,WAAF,CAD1B,EAElBI,IAFkB,CAEVC,GAAF,IAAW;AAAA;;AAClB,UAAMC,SAAS,yBAAGT,aAAa,GAAIQ,GAAJ,CAAhB,mEAA6B,KAA5C,CADkB,CAElB;AACA;AACA;AACA;;AACA,QAAK,sBAAsBA,GAAtB,IAA6BH,KAAK,CAACC,OAAN,CAAeG,SAAf,CAAlC,EAA+D;AAC9D,aAAOA,SAAS,CAACC,QAAV,CAAoBR,QAApB,CAAP;AACA;;AACD,WAAOO,SAAP;AACA,GAZmB,CAApB;;AAcA,MAAK,CAAEL,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOH,QAAP;AACA;;eAEc,sBAAcU,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAAuBD,MAAM,CAAEE,eAAF,CAAnC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA6BH,MAAM,CAAEI,YAAF,CAAzC;AACA,SAAO;AACNb,IAAAA,QAAQ,EAAEY,sBAAsB,CAAE,MAAF,CAD1B;AAENd,IAAAA,aAAa,EAAEY,gBAAgB;AAFzB,GAAP;AAIA,CAPc,EAOVb,iBAPU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function ThemeSupportCheck( {\n\tthemeSupports,\n\tchildren,\n\tpostType,\n\tsupportKeys,\n} ) {\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getThemeSupports } = select( coreStore );\n\tconst { getEditedPostAttribute } = select( editorStore );\n\treturn {\n\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\tthemeSupports: getThemeSupports(),\n\t};\n} )( ThemeSupportCheck );\n"]}
1
+ {"version":3,"names":["_data","require","_coreData","_store","ThemeSupportCheck","themeSupports","children","postType","supportKeys","isSupported","Array","isArray","some","key","_themeSupports$key","supported","includes","_default","withSelect","select","getThemeSupports","coreStore","getEditedPostAttribute","editorStore","exports","default"],"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function ThemeSupportCheck( {\n\tthemeSupports,\n\tchildren,\n\tpostType,\n\tsupportKeys,\n} ) {\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getThemeSupports } = select( coreStore );\n\tconst { getEditedPostAttribute } = select( editorStore );\n\treturn {\n\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\tthemeSupports: getThemeSupports(),\n\t};\n} )( ThemeSupportCheck );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGO,SAASG,iBAAiBA,CAAE;EAClCC,aAAa;EACbC,QAAQ;EACRC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAMC,WAAW,GAAG,CACnBC,KAAK,CAACC,OAAO,CAAEH,WAAY,CAAC,GAAGA,WAAW,GAAG,CAAEA,WAAW,CAAE,EAC3DI,IAAI,CAAIC,GAAG,IAAM;IAAA,IAAAC,kBAAA;IAClB,MAAMC,SAAS,IAAAD,kBAAA,GAAGT,aAAa,GAAIQ,GAAG,CAAE,cAAAC,kBAAA,cAAAA,kBAAA,GAAI,KAAK;IACjD;IACA;IACA;IACA;IACA,IAAK,iBAAiB,KAAKD,GAAG,IAAIH,KAAK,CAACC,OAAO,CAAEI,SAAU,CAAC,EAAG;MAC9D,OAAOA,SAAS,CAACC,QAAQ,CAAET,QAAS,CAAC;IACtC;IACA,OAAOQ,SAAS;EACjB,CAAE,CAAC;EAEH,IAAK,CAAEN,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAOH,QAAQ;AAChB;AAAC,IAAAW,QAAA,GAEc,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACxC,MAAM;IAAEC;EAAiB,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;EAChD,MAAM;IAAEC;EAAuB,CAAC,GAAGH,MAAM,CAAEI,YAAY,CAAC;EACxD,OAAO;IACNhB,QAAQ,EAAEe,sBAAsB,CAAE,MAAO,CAAC;IAC1CjB,aAAa,EAAEe,gBAAgB,CAAC;EACjC,CAAC;AACF,CAAE,CAAC,CAAEhB,iBAAkB,CAAC;AAAAoB,OAAA,CAAAC,OAAA,GAAAR,QAAA"}
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = TimeToRead;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _data = require("@wordpress/data");
11
-
12
9
  var _i18n = require("@wordpress/i18n");
13
-
14
10
  var _wordcount = require("@wordpress/wordcount");
15
-
16
11
  var _store = require("../../store");
17
-
18
12
  /**
19
13
  * WordPress dependencies
20
14
  */
@@ -31,21 +25,19 @@ var _store = require("../../store");
31
25
  * @type {number} A rough estimate of the average reading rate across multiple languages.
32
26
  */
33
27
  const AVERAGE_READING_RATE = 189;
34
-
35
28
  function TimeToRead() {
36
29
  const content = (0, _data.useSelect)(select => select(_store.store).getEditedPostAttribute('content'), []);
30
+
37
31
  /*
38
32
  * translators: If your word count is based on single characters (e.g. East Asian characters),
39
33
  * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
40
34
  * Do not translate into your own language.
41
35
  */
42
-
43
36
  const wordCountType = (0, _i18n._x)('words', 'Word count type. Do not translate!');
44
37
  const minutesToRead = Math.round((0, _wordcount.count)(content, wordCountType) / AVERAGE_READING_RATE);
45
38
  const minutesToReadString = minutesToRead === 0 ? (0, _element.createInterpolateElement)((0, _i18n.__)('<span>< 1</span> minute'), {
46
39
  span: (0, _element.createElement)("span", null)
47
- }) : (0, _element.createInterpolateElement)((0, _i18n.sprintf)(
48
- /* translators: %s is the number of minutes the post will take to read. */
40
+ }) : (0, _element.createInterpolateElement)((0, _i18n.sprintf)( /* translators: %s is the number of minutes the post will take to read. */
49
41
  (0, _i18n._n)('<span>%d</span> minute', '<span>%d</span> minutes', minutesToRead), minutesToRead), {
50
42
  span: (0, _element.createElement)("span", null)
51
43
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"names":["AVERAGE_READING_RATE","TimeToRead","content","select","editorStore","getEditedPostAttribute","wordCountType","minutesToRead","Math","round","minutesToReadString","span"],"mappings":";;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAMA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,oBAAoB,GAAG,GAA7B;;AAEe,SAASC,UAAT,GAAsB;AACpC,QAAMC,OAAO,GAAG,qBACbC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAsBC,sBAAtB,CAA8C,SAA9C,CADC,EAEf,EAFe,CAAhB;AAKA;AACD;AACA;AACA;AACA;;AACC,QAAMC,aAAa,GAAG,cAAI,OAAJ,EAAa,oCAAb,CAAtB;AACA,QAAMC,aAAa,GAAGC,IAAI,CAACC,KAAL,CACrB,sBAAWP,OAAX,EAAoBI,aAApB,IAAsCN,oBADjB,CAAtB;AAGA,QAAMU,mBAAmB,GACxBH,aAAa,KAAK,CAAlB,GACG,uCAA0B,cAAI,yBAAJ,CAA1B,EAA2D;AAC3DI,IAAAA,IAAI,EAAE;AADqD,GAA3D,CADH,GAIG,uCACA;AACC;AACA,gBACC,wBADD,EAEC,yBAFD,EAGCJ,aAHD,CAFD,EAOCA,aAPD,CADA,EAUA;AACCI,IAAAA,IAAI,EAAE;AADP,GAVA,CALJ;AAoBA,SAAO;AAAM,IAAA,SAAS,EAAC;AAAhB,KAAiCD,mBAAjC,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s is the number of minutes the post will take to read. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<span>%d</span> minute',\n\t\t\t\t\t\t\t'<span>%d</span> minutes',\n\t\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t\t),\n\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t}\n\t\t\t );\n\n\treturn <span className=\"time-to-read\">{ minutesToReadString }</span>;\n}\n"]}
1
+ {"version":3,"names":["_element","require","_data","_i18n","_wordcount","_store","AVERAGE_READING_RATE","TimeToRead","content","useSelect","select","editorStore","getEditedPostAttribute","wordCountType","_x","minutesToRead","Math","round","wordCount","minutesToReadString","createInterpolateElement","__","span","createElement","sprintf","_n","className"],"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s is the number of minutes the post will take to read. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<span>%d</span> minute',\n\t\t\t\t\t\t\t'<span>%d</span> minutes',\n\t\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t\t),\n\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t}\n\t\t\t );\n\n\treturn <span className=\"time-to-read\">{ minutesToReadString }</span>;\n}\n"],"mappings":";;;;;;AAMA,IAAAA,QAAA,GAAAC,OAAA;AAHA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAMA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,oBAAoB,GAAG,GAAG;AAEjB,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAMC,OAAO,GAAG,IAAAC,eAAS,EACtBC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAG,IAAAC,QAAE,EAAE,OAAO,EAAE,oCAAqC,CAAC;EACzE,MAAMC,aAAa,GAAGC,IAAI,CAACC,KAAK,CAC/B,IAAAC,gBAAS,EAAEV,OAAO,EAAEK,aAAc,CAAC,GAAGP,oBACvC,CAAC;EACD,MAAMa,mBAAmB,GACxBJ,aAAa,KAAK,CAAC,GAChB,IAAAK,iCAAwB,EAAE,IAAAC,QAAE,EAAE,yBAA0B,CAAC,EAAE;IAC3DC,IAAI,EAAE,IAAAtB,QAAA,CAAAuB,aAAA,cAAO;EACb,CAAE,CAAC,GACH,IAAAH,iCAAwB,EACxB,IAAAI,aAAO,GACN;EACA,IAAAC,QAAE,EACD,wBAAwB,EACxB,yBAAyB,EACzBV,aACD,CAAC,EACDA,aACD,CAAC,EACD;IACCO,IAAI,EAAE,IAAAtB,QAAA,CAAAuB,aAAA,cAAO;EACd,CACA,CAAC;EAEL,OAAO,IAAAvB,QAAA,CAAAuB,aAAA;IAAMG,SAAS,EAAC;EAAc,GAAGP,mBAA2B,CAAC;AACrE"}
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = UnsavedChangesWarning;
7
-
8
7
  var _i18n = require("@wordpress/i18n");
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _data = require("@wordpress/data");
13
-
14
10
  var _coreData = require("@wordpress/core-data");
15
-
16
11
  /**
17
12
  * WordPress dependencies
18
13
  */
@@ -24,42 +19,33 @@ var _coreData = require("@wordpress/core-data");
24
19
  * @return {WPComponent} The component.
25
20
  */
26
21
  function UnsavedChangesWarning() {
27
- const isDirty = (0, _data.useSelect)(select => {
28
- return () => {
29
- const {
30
- __experimentalGetDirtyEntityRecords
31
- } = select(_coreData.store);
32
-
22
+ const {
23
+ __experimentalGetDirtyEntityRecords
24
+ } = (0, _data.useSelect)(_coreData.store);
25
+ (0, _element.useEffect)(() => {
26
+ /**
27
+ * Warns the user if there are unsaved changes before leaving the editor.
28
+ *
29
+ * @param {Event} event `beforeunload` event.
30
+ *
31
+ * @return {string | undefined} Warning prompt message, if unsaved changes exist.
32
+ */
33
+ const warnIfUnsavedChanges = event => {
34
+ // We need to call the selector directly in the listener to avoid race
35
+ // conditions with `BrowserURL` where `componentDidUpdate` gets the
36
+ // new value of `isEditedPostDirty` before this component does,
37
+ // causing this component to incorrectly think a trashed post is still dirty.
33
38
  const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
34
-
35
- return dirtyEntityRecords.length > 0;
39
+ if (dirtyEntityRecords.length > 0) {
40
+ event.returnValue = (0, _i18n.__)('You have unsaved changes. If you proceed, they will be lost.');
41
+ return event.returnValue;
42
+ }
36
43
  };
37
- }, []);
38
- /**
39
- * Warns the user if there are unsaved changes before leaving the editor.
40
- *
41
- * @param {Event} event `beforeunload` event.
42
- *
43
- * @return {string | undefined} Warning prompt message, if unsaved changes exist.
44
- */
45
-
46
- const warnIfUnsavedChanges = event => {
47
- // We need to call the selector directly in the listener to avoid race
48
- // conditions with `BrowserURL` where `componentDidUpdate` gets the
49
- // new value of `isEditedPostDirty` before this component does,
50
- // causing this component to incorrectly think a trashed post is still dirty.
51
- if (isDirty()) {
52
- event.returnValue = (0, _i18n.__)('You have unsaved changes. If you proceed, they will be lost.');
53
- return event.returnValue;
54
- }
55
- };
56
-
57
- (0, _element.useEffect)(() => {
58
44
  window.addEventListener('beforeunload', warnIfUnsavedChanges);
59
45
  return () => {
60
46
  window.removeEventListener('beforeunload', warnIfUnsavedChanges);
61
47
  };
62
- }, []);
48
+ }, [__experimentalGetDirtyEntityRecords]);
63
49
  return null;
64
50
  }
65
51
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/unsaved-changes-warning/index.js"],"names":["UnsavedChangesWarning","isDirty","select","__experimentalGetDirtyEntityRecords","coreStore","dirtyEntityRecords","length","warnIfUnsavedChanges","event","returnValue","window","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,GAAiC;AAC/C,QAAMC,OAAO,GAAG,qBAAaC,MAAF,IAAc;AACxC,WAAO,MAAM;AACZ,YAAM;AAAEC,QAAAA;AAAF,UAA0CD,MAAM,CAAEE,eAAF,CAAtD;;AACA,YAAMC,kBAAkB,GAAGF,mCAAmC,EAA9D;;AACA,aAAOE,kBAAkB,CAACC,MAAnB,GAA4B,CAAnC;AACA,KAJD;AAKA,GANe,EAMb,EANa,CAAhB;AAQA;AACD;AACA;AACA;AACA;AACA;AACA;;AACC,QAAMC,oBAAoB,GAAKC,KAAF,IAAa;AACzC;AACA;AACA;AACA;AACA,QAAKP,OAAO,EAAZ,EAAiB;AAChBO,MAAAA,KAAK,CAACC,WAAN,GAAoB,cACnB,8DADmB,CAApB;AAGA,aAAOD,KAAK,CAACC,WAAb;AACA;AACD,GAXD;;AAaA,0BAAW,MAAM;AAChBC,IAAAA,MAAM,CAACC,gBAAP,CAAyB,cAAzB,EAAyCJ,oBAAzC;AAEA,WAAO,MAAM;AACZG,MAAAA,MAAM,CAACE,mBAAP,CAA4B,cAA5B,EAA4CL,oBAA5C;AACA,KAFD;AAGA,GAND,EAMG,EANH;AAQA,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n * Compatible with Post Editor and Site Editor.\n *\n * @return {WPComponent} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst isDirty = useSelect( ( select ) => {\n\t\treturn () => {\n\t\t\tconst { __experimentalGetDirtyEntityRecords } = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\treturn dirtyEntityRecords.length > 0;\n\t\t};\n\t}, [] );\n\n\t/**\n\t * Warns the user if there are unsaved changes before leaving the editor.\n\t *\n\t * @param {Event} event `beforeunload` event.\n\t *\n\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t */\n\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t// We need to call the selector directly in the listener to avoid race\n\t\t// conditions with `BrowserURL` where `componentDidUpdate` gets the\n\t\t// new value of `isEditedPostDirty` before this component does,\n\t\t// causing this component to incorrectly think a trashed post is still dirty.\n\t\tif ( isDirty() ) {\n\t\t\tevent.returnValue = __(\n\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t);\n\t\t\treturn event.returnValue;\n\t\t}\n\t};\n\n\tuseEffect( () => {\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [] );\n\n\treturn null;\n}\n"]}
1
+ {"version":3,"names":["_i18n","require","_element","_data","_coreData","UnsavedChangesWarning","__experimentalGetDirtyEntityRecords","useSelect","coreStore","useEffect","warnIfUnsavedChanges","event","dirtyEntityRecords","length","returnValue","__","window","addEventListener","removeEventListener"],"sources":["@wordpress/editor/src/components/unsaved-changes-warning/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n * Compatible with Post Editor and Site Editor.\n *\n * @return {WPComponent} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst { __experimentalGetDirtyEntityRecords } = useSelect( coreStore );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\t// We need to call the selector directly in the listener to avoid race\n\t\t\t// conditions with `BrowserURL` where `componentDidUpdate` gets the\n\t\t\t// new value of `isEditedPostDirty` before this component does,\n\t\t\t// causing this component to incorrectly think a trashed post is still dirty.\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tif ( dirtyEntityRecords.length > 0 ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ __experimentalGetDirtyEntityRecords ] );\n\n\treturn null;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACe,SAASI,qBAAqBA,CAAA,EAAG;EAC/C,MAAM;IAAEC;EAAoC,CAAC,GAAG,IAAAC,eAAS,EAAEC,eAAU,CAAC;EAEtE,IAAAC,kBAAS,EAAE,MAAM;IAChB;AACF;AACA;AACA;AACA;AACA;AACA;IACE,MAAMC,oBAAoB,GAAKC,KAAK,IAAM;MACzC;MACA;MACA;MACA;MACA,MAAMC,kBAAkB,GAAGN,mCAAmC,CAAC,CAAC;MAChE,IAAKM,kBAAkB,CAACC,MAAM,GAAG,CAAC,EAAG;QACpCF,KAAK,CAACG,WAAW,GAAG,IAAAC,QAAE,EACrB,8DACD,CAAC;QACD,OAAOJ,KAAK,CAACG,WAAW;MACzB;IACD,CAAC;IAEDE,MAAM,CAACC,gBAAgB,CAAE,cAAc,EAAEP,oBAAqB,CAAC;IAE/D,OAAO,MAAM;MACZM,MAAM,CAACE,mBAAmB,CAAE,cAAc,EAAER,oBAAqB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,CAAEJ,mCAAmC,CAAG,CAAC;EAE5C,OAAO,IAAI;AACZ"}