@wordpress/editor 13.16.0 → 13.17.1

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 (550) hide show
  1. package/CHANGELOG.md +2 -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 +20 -24
  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 +1 -10
  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 +1 -7
  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 +1 -10
  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 +0 -9
  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 +7 -18
  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 +60 -129
  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 +169 -295
  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 +20 -18
  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 +1 -7
  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 +1 -4
  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 +1 -7
  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 +3 -6
  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 +9 -15
  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 +62 -84
  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 +172 -222
  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/entities-saved-states/hooks/use-is-dirty.js +16 -20
  534. package/src/components/page-attributes/order.js +15 -23
  535. package/src/components/page-attributes/test/order.js +46 -15
  536. package/src/components/post-excerpt/check.js +6 -2
  537. package/src/components/post-featured-image/check.js +4 -2
  538. package/src/components/post-format/check.js +16 -11
  539. package/src/components/post-last-revision/check.js +12 -14
  540. package/src/components/post-last-revision/index.js +12 -10
  541. package/src/components/post-last-revision/test/check.js +28 -16
  542. package/src/components/post-pending-status/check.js +13 -19
  543. package/src/components/post-pending-status/index.js +9 -14
  544. package/src/components/post-pending-status/test/check.js +32 -10
  545. package/src/components/post-publish-panel/style.scss +12 -25
  546. package/src/components/post-sync-status/style.scss +4 -1
  547. package/src/components/post-type-support-check/index.js +1 -1
  548. package/src/components/post-type-support-check/test/index.js +1 -1
  549. package/src/components/provider/index.js +3 -2
  550. package/src/components/unsaved-changes-warning/index.js +22 -27
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/index.native.js"],"names":["memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","createBlock","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","editPostStore","EditorProvider","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","supportSection","ComposedNativeProvider","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","updateSettings","switchEditorMode","__unstableShouldCreateUndoLevel","ExperimentalEditorProvider"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AACA,SAASC,gBAAT,QAAiC,gCAAjC;AAEA;AACA;AACA;;AACA,OAAOC,4BAAP,IACCC,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,IAAF,EAAS;AAClBkC,MAAAA,gBAAgB,CAAElC,IAAF,CAAhB;AACA,KAjBK;;AAkBNW,IAAAA;AAlBM,GAAP;AAoBA,CA7BW,CAhC2B,CAAF,CAAP,CA8D1B/F,oBA9D0B,CAA/B;AAgEA,eAAeoG,sBAAf;AACA,SAASA,sBAAsB,IAAIoB,0BAAnC","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getGlobalStyles, getColorsAndGradients } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n// eslint-disable-next-line no-restricted-imports\nimport { store as editPostStore } from '@wordpress/edit-post';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings(\n\t\t\t\t( { galleryWithImageBlocks, ...editorSettings } ) => {\n\t\t\t\t\tif ( typeof galleryWithImageBlocks === 'boolean' ) {\n\t\t\t\t\t\twindow.wp.galleryBlockV2Enabled =\n\t\t\t\t\t\t\tgalleryWithImageBlocks;\n\t\t\t\t\t}\n\t\t\t\t\tupdateEditorSettings(\n\t\t\t\t\t\tthis.getThemeColors( editorSettings )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks, updateEditorSettings } =\n\t\t\tdispatch( editorStore );\n\t\tconst { updateSettings, insertBlock, replaceBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( editPostStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice } = dispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"]}
1
+ {"version":3,"names":["memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","createBlock","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","editPostStore","EditorProvider","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","createElement","Fragment","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","updateSettings","switchEditorMode","__unstableShouldCreateUndoLevel","ExperimentalEditorProvider"],"sources":["@wordpress/editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tcreateBlock,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getGlobalStyles, getColorsAndGradients } from '@wordpress/components';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n// eslint-disable-next-line no-restricted-imports\nimport { store as editPostStore } from '@wordpress/edit-post';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst newBlock = createBlock( blockName, {\n\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t} );\n\n\t\t\t\tconst indexAfterSelected = this.props.selectedBlockIndex + 1;\n\t\t\t\tconst insertionIndex =\n\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings(\n\t\t\t\t( { galleryWithImageBlocks, ...editorSettings } ) => {\n\t\t\t\t\tif ( typeof galleryWithImageBlocks === 'boolean' ) {\n\t\t\t\t\t\twindow.wp.galleryBlockV2Enabled =\n\t\t\t\t\t\t\tgalleryWithImageBlocks;\n\t\t\t\t\t}\n\t\t\t\t\tupdateEditorSettings(\n\t\t\t\t\t\tthis.getThemeColors( editorSettings )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getEditorMode } = select( editPostStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost, resetEditorBlocks, updateEditorSettings } =\n\t\t\tdispatch( editorStore );\n\t\tconst { updateSettings, insertBlock, replaceBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { switchEditorMode } = dispatch( editPostStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice } = dispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tinsertBlock,\n\t\t\tcreateSuccessNotice,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,QAAQ;AAC3B,SAASC,gBAAgB,QAAQ,gCAAgC;;AAEjE;AACA;AACA;AACA,OAAOC,4BAA4B,IAClCC,2BAA2B,EAC3BC,uBAAuB,EACvBC,sBAAsB,EACtBC,6BAA6B,EAC7BC,mBAAmB,EACnBC,iBAAiB,EACjBC,oBAAoB,EACpBC,qBAAqB,EACrBC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mBAAmB,EACnBC,uBAAuB,QACjB,gCAAgC;AACvC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,KAAK,EACLC,SAAS,EACTC,8BAA8B,EAC9BC,WAAW,QACL,mBAAmB;AAC1B,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,eAAe,EAAEC,qBAAqB,QAAQ,uBAAuB;AAC9E,SAASC,eAAe,QAAQ,0BAA0B;AAE1D,MA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AiB,CAAC;EAC7B,MAAM;IAAEoJ;EAAiB,CAAC,GAAGJ,QAAQ,CAAE5H,aAAc,CAAC;EACtD,MAAM;IAAEO,WAAW;IAAEC;EAAqB,CAAC,GAAGoH,QAAQ,CAAE7H,SAAU,CAAC;EACnE,MAAM;IAAE0D;EAAoB,CAAC,GAAGmE,QAAQ,CAAE9H,YAAa,CAAC;EAExD,OAAO;IACNsB,yBAAyB,EAAE2G,cAAc;IACzC5G,oBAAoB;IACpBZ,WAAW;IACXwC,WAAW;IACXU,mBAAmB;IACnB7B,SAASA,CAAEC,KAAK,EAAG;MAClBgG,QAAQ,CAAE;QAAEhG;MAAM,CAAE,CAAC;IACtB,CAAC;IACDrB,oBAAoB;IACpBuF,iCAAiCA,CAAExG,MAAM,EAAG;MAC3CuI,iBAAiB,CAAEvI,MAAM,EAAE;QAC1B0I,+BAA+B,EAAE;MAClC,CAAE,CAAC;IACJ,CAAC;IACD/B,UAAUA,CAAEZ,IAAI,EAAG;MAClB0C,gBAAgB,CAAE1C,IAAK,CAAC;IACzB,CAAC;IACDW;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAE/F,oBAAqB,CAAC;AAE3B,eAAe0G,sBAAsB;AACrC,SAASA,sBAAsB,IAAIsB,0BAA0B"}
@@ -5,15 +5,16 @@ import { Platform, useMemo } from '@wordpress/element';
5
5
  import { useDispatch, useSelect } from '@wordpress/data';
6
6
  import { store as coreStore, __experimentalFetchLinkSuggestions as fetchLinkSuggestions, __experimentalFetchUrlData as fetchUrlData } from '@wordpress/core-data';
7
7
  import { __ } from '@wordpress/i18n';
8
+
8
9
  /**
9
10
  * Internal dependencies
10
11
  */
11
-
12
12
  import inserterMediaCategories from '../media-categories';
13
13
  import { mediaUpload } from '../../utils';
14
14
  import { store as editorStore } from '../../store';
15
15
  const EMPTY_BLOCKS_LIST = [];
16
16
  const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__experimentalPreferredStyleVariations', '__experimentalSetIsInserterOpened', '__unstableGalleryWithImageBlocks', 'alignWide', 'allowedBlockTypes', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'focusMode', 'distractionFree', 'fontSizes', 'gradients', 'generateAnchors', 'hasFixedToolbar', 'hasInlineToolbar', 'isDistractionFree', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'keepCaretInsideBlock', 'locale', 'maxWidth', 'onUpdateDefaultBlockStyles', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'template', 'templateLock', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', 'behaviors'];
17
+
17
18
  /**
18
19
  * React hook used to compute the block editor settings to use for the post editor.
19
20
  *
@@ -22,10 +23,8 @@ const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDi
22
23
  *
23
24
  * @return {Object} Block Editor Settings.
24
25
  */
25
-
26
26
  function useBlockEditorSettings(settings, hasTemplate) {
27
27
  var _settings$__experimen, _settings$__experimen2;
28
-
29
28
  const {
30
29
  reusableBlocks,
31
30
  hasUploadPermissions,
@@ -35,7 +34,6 @@ function useBlockEditorSettings(settings, hasTemplate) {
35
34
  postType
36
35
  } = useSelect(select => {
37
36
  var _canUser;
38
-
39
37
  const {
40
38
  canUserUseUnfilteredHTML,
41
39
  getCurrentPostType
@@ -58,10 +56,11 @@ function useBlockEditorSettings(settings, hasTemplate) {
58
56
  postType: getCurrentPostType()
59
57
  };
60
58
  }, []);
61
- const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : // WP 6.0
59
+ const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen :
60
+ // WP 6.0
62
61
  settings.__experimentalBlockPatterns; // WP 5.9
63
-
64
- const settingsBlockPatternCategories = (_settings$__experimen2 = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen2 !== void 0 ? _settings$__experimen2 : // WP 6.0
62
+ const settingsBlockPatternCategories = (_settings$__experimen2 = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen2 !== void 0 ? _settings$__experimen2 :
63
+ // WP 6.0
65
64
  settings.__experimentalBlockPatternCategories; // WP 5.9
66
65
 
67
66
  const {
@@ -83,6 +82,7 @@ function useBlockEditorSettings(settings, hasTemplate) {
83
82
  const {
84
83
  saveEntityRecord
85
84
  } = useDispatch(coreStore);
85
+
86
86
  /**
87
87
  * Creates a Post entity.
88
88
  * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.
@@ -90,18 +90,16 @@ function useBlockEditorSettings(settings, hasTemplate) {
90
90
  * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.
91
91
  * @return {Object} the post type object that was created.
92
92
  */
93
-
94
93
  const createPageEntity = options => {
95
94
  if (!userCanCreatePages) {
96
95
  return Promise.reject({
97
96
  message: __('You do not have permission to create Pages.')
98
97
  });
99
98
  }
100
-
101
99
  return saveEntityRecord('postType', 'page', options);
102
100
  };
103
-
104
- return useMemo(() => ({ ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
101
+ return useMemo(() => ({
102
+ ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
105
103
  mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
106
104
  __experimentalReusableBlocks: reusableBlocks,
107
105
  __experimentalBlockPatterns: blockPatterns,
@@ -118,6 +116,5 @@ function useBlockEditorSettings(settings, hasTemplate) {
118
116
  __experimentalPreferPatternsOnRoot: hasTemplate
119
117
  }), [settings, hasUploadPermissions, reusableBlocks, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, hasTemplate, userCanCreatePages, pageOnFront]);
120
118
  }
121
-
122
119
  export default useBlockEditorSettings;
123
120
  //# sourceMappingURL=use-block-editor-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"names":["Platform","useMemo","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","__","inserterMediaCategories","mediaUpload","editorStore","EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","hasTemplate","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","postType","select","canUserUseUnfilteredHTML","getCurrentPostType","isWeb","OS","canUser","getEntityRecord","siteSettings","undefined","getEntityRecords","per_page","page_on_front","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","restBlockPatterns","restBlockPatternCategories","getBlockPatterns","getBlockPatternCategories","blockPatterns","filter","x","index","arr","findIndex","y","name","postTypes","Array","isArray","includes","blockPatternCategories","undo","saveEntityRecord","createPageEntity","options","Promise","reject","message","Object","fromEntries","entries","key","__experimentalReusableBlocks","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,OAAnB,QAAkC,oBAAlC;AACA,SAASC,WAA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AA,8BAA8B,EAAEjE,YAbzB;AAcPkE,IAAAA,sCAAsC,EAAEtD,oBAdjC;AAePuD,IAAAA,kBAAkB,EAAEhB,IAfb;AAgBPiB,IAAAA,WAAW,EAAE3D,WAhBN;AAiBP4D,IAAAA,8BAA8B,EAAEhB,gBAjBzB;AAkBPiB,IAAAA,gCAAgC,EAAEzD,kBAlB3B;AAmBPC,IAAAA,WAnBO;AAoBPyD,IAAAA,kCAAkC,EAAE9D;AApB7B,GAAR,CADa,EAuBb,CACCD,QADD,EAECG,oBAFD,EAGCD,cAHD,EAIC4B,aAJD,EAKCY,sBALD,EAMCtC,oBAND,EAOCuC,IAPD,EAQC1C,WARD,EASCI,kBATD,EAUCC,WAVD,CAvBa,CAAd;AAoCA;;AAED,eAAeP,sBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__experimentalPreferredStyleVariations',\n\t'__experimentalSetIsInserterOpened',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\n\t'allowedBlockTypes',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'focusMode',\n\t'distractionFree',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'hasFixedToolbar',\n\t'hasInlineToolbar',\n\t'isDistractionFree',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'keepCaretInsideBlock',\n\t'locale',\n\t'maxWidth',\n\t'onUpdateDefaultBlockStyles',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'template',\n\t'templateLock',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'behaviors',\n];\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {boolean} hasTemplate Whether template mode is enabled.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, hasTemplate ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUserUseUnfilteredHTML, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst isWeb = Platform.OS === 'web';\n\t\tconst { canUser, getEntityRecord } = select( coreStore );\n\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanUseUnfilteredHTML: canUserUseUnfilteredHTML(),\n\t\t\treusableBlocks: isWeb\n\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t{ per_page: -1 }\n\t\t\t\t )\n\t\t\t\t: EMPTY_BLOCKS_LIST, // Reusable blocks are fetched in the native version of this hook.\n\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst { restBlockPatterns, restBlockPatternCategories } = useSelect(\n\t\t( select ) => ( {\n\t\t\trestBlockPatterns: select( coreStore ).getBlockPatterns(),\n\t\t\trestBlockPatternCategories:\n\t\t\t\tselect( coreStore ).getBlockPatternCategories(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatterns || [] ),\n\t\t\t\t...( restBlockPatterns || [] ),\n\t\t\t]\n\t\t\t\t.filter(\n\t\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t\t)\n\t\t\t\t.filter( ( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t[ settingsBlockPatterns, restBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = ( options ) => {\n\t\tif ( ! userCanCreatePages ) {\n\t\t\treturn Promise.reject( {\n\t\t\t\tmessage: __( 'You do not have permission to create Pages.' ),\n\t\t\t} );\n\t\t}\n\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t};\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t__experimentalUndo: undo,\n\t\t\toutlineMode: hasTemplate,\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\t__experimentalPreferPatternsOnRoot: hasTemplate,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\thasTemplate,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"]}
1
+ {"version":3,"names":["Platform","useMemo","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","__","inserterMediaCategories","mediaUpload","editorStore","EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","hasTemplate","_settings$__experimen","_settings$__experimen2","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","postType","select","_canUser","canUserUseUnfilteredHTML","getCurrentPostType","isWeb","OS","canUser","getEntityRecord","siteSettings","undefined","getEntityRecords","per_page","page_on_front","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","restBlockPatterns","restBlockPatternCategories","getBlockPatterns","getBlockPatternCategories","blockPatterns","filter","x","index","arr","findIndex","y","name","postTypes","Array","isArray","includes","blockPatternCategories","undo","saveEntityRecord","createPageEntity","options","Promise","reject","message","Object","fromEntries","entries","key","__experimentalReusableBlocks","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__experimentalPreferredStyleVariations',\n\t'__experimentalSetIsInserterOpened',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\n\t'allowedBlockTypes',\n\t'blockInspectorTabs',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'focusMode',\n\t'distractionFree',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'hasFixedToolbar',\n\t'hasInlineToolbar',\n\t'isDistractionFree',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'keepCaretInsideBlock',\n\t'locale',\n\t'maxWidth',\n\t'onUpdateDefaultBlockStyles',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'template',\n\t'templateLock',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'behaviors',\n];\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {boolean} hasTemplate Whether template mode is enabled.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, hasTemplate ) {\n\tconst {\n\t\treusableBlocks,\n\t\thasUploadPermissions,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUserUseUnfilteredHTML, getCurrentPostType } =\n\t\t\tselect( editorStore );\n\t\tconst isWeb = Platform.OS === 'web';\n\t\tconst { canUser, getEntityRecord } = select( coreStore );\n\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanUseUnfilteredHTML: canUserUseUnfilteredHTML(),\n\t\t\treusableBlocks: isWeb\n\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t{ per_page: -1 }\n\t\t\t\t )\n\t\t\t\t: EMPTY_BLOCKS_LIST, // Reusable blocks are fetched in the native version of this hook.\n\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst { restBlockPatterns, restBlockPatternCategories } = useSelect(\n\t\t( select ) => ( {\n\t\t\trestBlockPatterns: select( coreStore ).getBlockPatterns(),\n\t\t\trestBlockPatternCategories:\n\t\t\t\tselect( coreStore ).getBlockPatternCategories(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatterns || [] ),\n\t\t\t\t...( restBlockPatterns || [] ),\n\t\t\t]\n\t\t\t\t.filter(\n\t\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t\t)\n\t\t\t\t.filter( ( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t} ),\n\t\t[ settingsBlockPatterns, restBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = ( options ) => {\n\t\tif ( ! userCanCreatePages ) {\n\t\t\treturn Promise.reject( {\n\t\t\t\tmessage: __( 'You do not have permission to create Pages.' ),\n\t\t\t} );\n\t\t}\n\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t};\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t__experimentalUndo: undo,\n\t\t\toutlineMode: hasTemplate,\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\t__experimentalPreferPatternsOnRoot: hasTemplate,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\treusableBlocks,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\thasTemplate,\n\t\t\tuserCanCreatePages,\n\t\t\tpageOnFront,\n\t\t]\n\t);\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,IAAIC,SAAS,EAClBC,kCAAkC,IAAIC,oBAAoB,EAC1DC,0BAA0B,IAAIC,YAAY,QACpC,sBAAsB;AAC7B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,qBA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,13 @@
4
4
  import { useMemo } from '@wordpress/element';
5
5
  import { useSelect } from '@wordpress/data';
6
6
  import { store as coreStore } from '@wordpress/core-data';
7
+
7
8
  /**
8
9
  * Internal dependencies
9
10
  */
10
-
11
11
  import useBlockEditorSettings from './use-block-editor-settings.js';
12
12
  import { store as editorStore } from '../../store';
13
13
  const EMPTY_BLOCKS_LIST = [];
14
-
15
14
  function useNativeBlockEditorSettings(settings, hasTemplate) {
16
15
  const editorSettings = useBlockEditorSettings(settings, hasTemplate);
17
16
  const supportReusableBlock = settings.capabilities?.reusableBlock === true;
@@ -20,7 +19,8 @@ function useNativeBlockEditorSettings(settings, hasTemplate) {
20
19
  isTitleSelected
21
20
  } = useSelect(select => {
22
21
  return {
23
- reusableBlocks: supportReusableBlock ? select(coreStore).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.
22
+ reusableBlocks: supportReusableBlock ? select(coreStore).getEntityRecords('postType', 'wp_block',
23
+ // Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.
24
24
  // Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661
25
25
  {
26
26
  per_page: 100
@@ -28,11 +28,11 @@ function useNativeBlockEditorSettings(settings, hasTemplate) {
28
28
  isTitleSelected: select(editorStore).isPostTitleSelected()
29
29
  };
30
30
  }, [supportReusableBlock]);
31
- return useMemo(() => ({ ...editorSettings,
31
+ return useMemo(() => ({
32
+ ...editorSettings,
32
33
  __experimentalReusableBlocks: reusableBlocks,
33
34
  __experimentalShouldInsertAtTheTop: isTitleSelected
34
35
  }), [editorSettings, reusableBlocks, isTitleSelected]);
35
36
  }
36
-
37
37
  export default useNativeBlockEditorSettings;
38
38
  //# 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":["useMemo","useSelect","store","coreStore","useBlockEditorSettings","editorStore","EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","hasTemplate","editorSettings","supportReusableBlock","capabilities","reusableBlock","reusableBlocks","isTitleSelected","select","getEntityRecords","per_page","isPostTitleSelected","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,sBAAP,MAAmC,gCAAnC;AACA,SAASF,KAAK,IAAIG,WAAlB,QAAqC,aAArC;AAEA,MAAMC,iBAAiB,GAAG,EAA1B;;AAEA,SAASC,4BAAT,CAAuCC,QAAvC,EAAiDC,WAAjD,EAA+D;AAC9D,QAAMC,cAAc,GAAGN,sBAAsB,CAAEI,QAAF,EAAYC,WAAZ,CAA7C;AACA,QAAME,oBAAoB,GAAGH,QAAQ,CAACI,YAAT,EAAuBC,aAAvB,KAAyC,IAAtE;AAEA,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAsCd,SAAS,CAClDe,MAAF,IAAc;AACb,WAAO;AACNF,MAAAA,cAAc,EAAEH,oBAAoB,GACjCK,MAAM,CAAEb,SAAF,CAAN,CAAoBc,gBAApB,CACA,UADA,EAEA,UAFA,EAGA;AACA;AACA;AAAEC,QAAAA,QAAQ,EAAE;AAAZ,OALA,CADiC,GAQjCZ,iBATG;AAUNS,MAAAA,eAAe,EAAEC,MAAM,CAAEX,WAAF,CAAN,CAAsBc,mBAAtB;AAVX,KAAP;AAYA,GAdmD,EAepD,CAAER,oBAAF,CAfoD,CAArD;AAkBA,SAAOX,OAAO,CACb,OAAQ,EACP,GAAGU,cADI;AAEPU,IAAAA,4BAA4B,EAAEN,cAFvB;AAGPO,IAAAA,kCAAkC,EAAEN;AAH7B,GAAR,CADa,EAMb,CAAEL,cAAF,EAAkBI,cAAlB,EAAkCC,eAAlC,CANa,CAAd;AAQA;;AAED,eAAeR,4BAAf","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":["useMemo","useSelect","store","coreStore","useBlockEditorSettings","editorStore","EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","hasTemplate","editorSettings","supportReusableBlock","capabilities","reusableBlock","reusableBlocks","isTitleSelected","select","getEntityRecords","per_page","isPostTitleSelected","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop"],"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":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,gCAAgC;AACnE,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAElD,MAAMC,iBAAiB,GAAG,EAAE;AAE5B,SAASC,4BAA4BA,CAAEC,QAAQ,EAAEC,WAAW,EAAG;EAC9D,MAAMC,cAAc,GAAGN,sBAAsB,CAAEI,QAAQ,EAAEC,WAAY,CAAC;EACtE,MAAME,oBAAoB,GAAGH,QAAQ,CAACI,YAAY,EAAEC,aAAa,KAAK,IAAI;EAE1E,MAAM;IAAEC,cAAc;IAAEC;EAAgB,CAAC,GAAGd,SAAS,CAClDe,MAAM,IAAM;IACb,OAAO;MACNF,cAAc,EAAEH,oBAAoB,GACjCK,MAAM,CAAEb,SAAU,CAAC,CAACc,gBAAgB,CACpC,UAAU,EACV,UAAU;MACV;MACA;MACA;QAAEC,QAAQ,EAAE;MAAI,CAChB,CAAC,GACDZ,iBAAiB;MACpBS,eAAe,EAAEC,MAAM,CAAEX,WAAY,CAAC,CAACc,mBAAmB,CAAC;IAC5D,CAAC;EACF,CAAC,EACD,CAAER,oBAAoB,CACvB,CAAC;EAED,OAAOX,OAAO,CACb,OAAQ;IACP,GAAGU,cAAc;IACjBU,4BAA4B,EAAEN,cAAc;IAC5CO,kCAAkC,EAAEN;EACrC,CAAC,CAAE,EACH,CAAEL,cAAc,EAAEI,cAAc,EAAEC,eAAe,CAClD,CAAC;AACF;AAEA,eAAeR,4BAA4B"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -7,10 +6,10 @@ import { useState, useEffect } from '@wordpress/element';
7
6
  import { withRegistry, createRegistry, RegistryProvider } from '@wordpress/data';
8
7
  import { createHigherOrderComponent } from '@wordpress/compose';
9
8
  import { storeConfig as blockEditorStoreConfig } from '@wordpress/block-editor';
9
+
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
13
-
14
13
  import { storeConfig } from '../../store';
15
14
  const withRegistryProvider = createHigherOrderComponent(WrappedComponent => withRegistry(props => {
16
15
  const {
@@ -18,12 +17,11 @@ const withRegistryProvider = createHigherOrderComponent(WrappedComponent => with
18
17
  registry,
19
18
  ...additionalProps
20
19
  } = props;
21
-
22
20
  if (!useSubRegistry) {
23
- return createElement(WrappedComponent, { ...additionalProps
21
+ return createElement(WrappedComponent, {
22
+ ...additionalProps
24
23
  });
25
24
  }
26
-
27
25
  const [subRegistry, setSubRegistry] = useState(null);
28
26
  useEffect(() => {
29
27
  const newRegistry = createRegistry({
@@ -32,14 +30,13 @@ const withRegistryProvider = createHigherOrderComponent(WrappedComponent => with
32
30
  newRegistry.registerStore('core/editor', storeConfig);
33
31
  setSubRegistry(newRegistry);
34
32
  }, [registry]);
35
-
36
33
  if (!subRegistry) {
37
34
  return null;
38
35
  }
39
-
40
36
  return createElement(RegistryProvider, {
41
37
  value: subRegistry
42
- }, createElement(WrappedComponent, { ...additionalProps
38
+ }, createElement(WrappedComponent, {
39
+ ...additionalProps
43
40
  }));
44
41
  }), 'withRegistryProvider');
45
42
  export default withRegistryProvider;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/with-registry-provider.js"],"names":["useState","useEffect","withRegistry","createRegistry","RegistryProvider","createHigherOrderComponent","storeConfig","blockEditorStoreConfig","withRegistryProvider","WrappedComponent","props","useSubRegistry","registry","additionalProps","subRegistry","setSubRegistry","newRegistry","registerStore"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SACCC,YADD,EAECC,cAFD,EAGCC,gBAHD,QAIO,iBAJP;AAKA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AAEA;AACA;AACA;;AACA,SAASD,WAAT,QAA4B,aAA5B;AAEA,MAAME,oBAAoB,GAAGH,0BAA0B,CACpDI,gBAAF,IACCP,YAAY,CAAIQ,KAAF,IAAa;AAC1B,QAAM;AACLC,IAAAA,cAAc,GAAG,IADZ;AAELC,IAAAA,QAFK;AAGL,OAAGC;AAHE,MAIFH,KAJJ;;AAKA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,cAAC,gBAAD,OAAuBE;AAAvB,MAAP;AACA;;AAED,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkCf,QAAQ,CAAE,IAAF,CAAhD;AACAC,EAAAA,SAAS,CAAE,MAAM;AAChB,UAAMe,WAAW,GAAGb,cAAc,CACjC;AACC,2BAAqBI;AADtB,KADiC,EAIjCK,QAJiC,CAAlC;AAMAI,IAAAA,WAAW,CAACC,aAAZ,CAA2B,aAA3B,EAA0CX,WAA1C;AACAS,IAAAA,cAAc,CAAEC,WAAF,CAAd;AACA,GATQ,EASN,CAAEJ,QAAF,CATM,CAAT;;AAWA,MAAK,CAAEE,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,gBAAD;AAAkB,IAAA,KAAK,EAAGA;AAA1B,KACC,cAAC,gBAAD,OAAuBD;AAAvB,IADD,CADD;AAKA,CA/BW,CAFyC,EAkCtD,sBAlCsD,CAAvD;AAqCA,eAAeL,oBAAf","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":["useState","useEffect","withRegistry","createRegistry","RegistryProvider","createHigherOrderComponent","storeConfig","blockEditorStoreConfig","withRegistryProvider","WrappedComponent","props","useSubRegistry","registry","additionalProps","createElement","subRegistry","setSubRegistry","newRegistry","registerStore","value"],"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":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SACCC,YAAY,EACZC,cAAc,EACdC,gBAAgB,QACV,iBAAiB;AACxB,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASD,WAAW,QAAQ,aAAa;AAEzC,MAAME,oBAAoB,GAAGH,0BAA0B,CACpDI,gBAAgB,IACjBP,YAAY,CAAIQ,KAAK,IAAM;EAC1B,MAAM;IACLC,cAAc,GAAG,IAAI;IACrBC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGH,KAAK;EACT,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAOG,aAAA,CAACL,gBAAgB;MAAA,GAAMI;IAAe,CAAI,CAAC;EACnD;EAEA,MAAM,CAAEE,WAAW,EAAEC,cAAc,CAAE,GAAGhB,QAAQ,CAAE,IAAK,CAAC;EACxDC,SAAS,CAAE,MAAM;IAChB,MAAMgB,WAAW,GAAGd,cAAc,CACjC;MACC,mBAAmB,EAAEI;IACtB,CAAC,EACDK,QACD,CAAC;IACDK,WAAW,CAACC,aAAa,CAAE,aAAa,EAAEZ,WAAY,CAAC;IACvDU,cAAc,CAAEC,WAAY,CAAC;EAC9B,CAAC,EAAE,CAAEL,QAAQ,CAAG,CAAC;EAEjB,IAAK,CAAEG,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OACCD,aAAA,CAACV,gBAAgB;IAACe,KAAK,EAAGJ;EAAa,GACtCD,aAAA,CAACL,gBAAgB;IAAA,GAAMI;EAAe,CAAI,CACzB,CAAC;AAErB,CAAE,CAAC,EACJ,sBACD,CAAC;AAED,eAAeL,oBAAoB"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -9,12 +8,11 @@ import { useSelect } from '@wordpress/data';
9
8
  import { info } from '@wordpress/icons';
10
9
  import { forwardRef } from '@wordpress/element';
11
10
  import { store as blockEditorStore } from '@wordpress/block-editor';
11
+
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
-
16
15
  import TableOfContentsPanel from './panel';
17
-
18
16
  function TableOfContents({
19
17
  hasOutlineItemsDisabled,
20
18
  repositionDropdown,
@@ -30,14 +28,14 @@ function TableOfContents({
30
28
  renderToggle: ({
31
29
  isOpen,
32
30
  onToggle
33
- }) => createElement(Button, { ...props,
31
+ }) => createElement(Button, {
32
+ ...props,
34
33
  ref: ref,
35
34
  onClick: hasBlocks ? onToggle : undefined,
36
35
  icon: info,
37
36
  "aria-expanded": isOpen,
38
37
  "aria-haspopup": "true"
39
- /* translators: button label text should, if possible, be under 16 characters. */
40
- ,
38
+ /* translators: button label text should, if possible, be under 16 characters. */,
41
39
  label: __('Details'),
42
40
  tooltipPosition: "bottom",
43
41
  "aria-disabled": !hasBlocks
@@ -50,6 +48,5 @@ function TableOfContents({
50
48
  })
51
49
  });
52
50
  }
53
-
54
51
  export default forwardRef(TableOfContents);
55
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","placement","isOpen","onToggle","undefined","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,uBAAjC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,IAAT,QAAqB,kBAArB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,SAAjC;;AAEA,SAASC,eAAT,CACC;AAAEC,EAAAA,uBAAF;AAA2BC,EAAAA,kBAA3B;AAA+C,KAAGC;AAAlD,CADD,EAECC,GAFD,EAGE;AACD,QAAMC,SAAS,GAAGX,SAAS,CACxBY,MAAF,IAAc,CAAC,CAAEA,MAAM,CAAER,gBAAF,CAAN,CAA2BS,aAA3B,EADS,EAE1B,EAF0B,CAA3B;AAIA,SACC,cAAC,QAAD;AACC,IAAA,YAAY,EAAG;AACdC,MAAAA,SAAS,EAAEN,kBAAkB,GAAG,OAAH,GAAa;AAD5B,KADhB;AAIC,IAAA,SAAS,EAAC,mBAJX;AAKC,IAAA,gBAAgB,EAAC,4BALlB;AAMC,IAAA,YAAY,EAAG,CAAE;AAAEO,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,cAAC,MAAD,OACMP,KADN;AAEC,MAAA,GAAG,EAAGC,GAFP;AAGC,MAAA,OAAO,EAAGC,SAAS,GAAGK,QAAH,GAAcC,SAHlC;AAIC,MAAA,IAAI,EAAGhB,IAJR;AAKC,uBAAgBc,MALjB;AAMC,uBAAc;AACd;AAPD;AAQC,MAAA,KAAK,EAAGlB,EAAE,CAAE,SAAF,CARX;AASC,MAAA,eAAe,EAAC,QATjB;AAUC,uBAAgB,CAAEc;AAVnB,MAPF;AAoBC,IAAA,aAAa,EAAG,CAAE;AAAEO,MAAAA;AAAF,KAAF,KACf,cAAC,oBAAD;AACC,MAAA,cAAc,EAAGA,OADlB;AAEC,MAAA,uBAAuB,EAAGX;AAF3B;AArBF,IADD;AA6BA;;AAED,eAAeL,UAAU,CAAEI,eAAF,CAAzB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\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":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","createElement","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","onClick","undefined","icon","label","tooltipPosition","renderContent","onClose","onRequestClose"],"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":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,SAAS;AAE1C,SAASC,eAAeA,CACvB;EAAEC,uBAAuB;EAAEC,kBAAkB;EAAE,GAAGC;AAAM,CAAC,EACzDC,GAAG,EACF;EACD,MAAMC,SAAS,GAAGX,SAAS,CACxBY,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAER,gBAAiB,CAAC,CAACS,aAAa,CAAC,CAAC,EAC3D,EACD,CAAC;EACD,OACCC,aAAA,CAAChB,QAAQ;IACRiB,YAAY,EAAG;MACdC,SAAS,EAAER,kBAAkB,GAAG,OAAO,GAAG;IAC3C,CAAG;IACHS,SAAS,EAAC,mBAAmB;IAC7BC,gBAAgB,EAAC,4BAA4B;IAC7CC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpCP,aAAA,CAACf,MAAM;MAAA,GACDU,KAAK;MACVC,GAAG,EAAGA,GAAK;MACXY,OAAO,EAAGX,SAAS,GAAGU,QAAQ,GAAGE,SAAW;MAC5CC,IAAI,EAAGvB,IAAM;MACb,iBAAgBmB,MAAQ;MACxB,iBAAc;MACd;MACAK,KAAK,EAAG5B,EAAE,CAAE,SAAU,CAAG;MACzB6B,eAAe,EAAC,QAAQ;MACxB,iBAAgB,CAAEf;IAAW,CAC7B,CACC;IACHgB,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KAC5Bd,aAAA,CAACT,oBAAoB;MACpBwB,cAAc,EAAGD,OAAS;MAC1BrB,uBAAuB,EAAGA;IAAyB,CACnD;EACC,CACH,CAAC;AAEJ;AAEA,eAAeL,UAAU,CAAEI,eAAgB,CAAC"}
@@ -1,20 +1,18 @@
1
1
  import { createElement, Fragment } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
6
5
  import { __ } from '@wordpress/i18n';
7
6
  import { useSelect } from '@wordpress/data';
8
7
  import { store as blockEditorStore } from '@wordpress/block-editor';
8
+
9
9
  /**
10
10
  * Internal dependencies
11
11
  */
12
-
13
12
  import WordCount from '../word-count';
14
13
  import TimeToRead from '../time-to-read';
15
14
  import DocumentOutline from '../document-outline';
16
15
  import CharacterCount from '../character-count';
17
-
18
16
  function TableOfContentsPanel({
19
17
  hasOutlineItemsDisabled,
20
18
  onRequestClose
@@ -38,7 +36,6 @@ function TableOfContentsPanel({
38
36
  * Disable reason: The `list` ARIA role is redundant but
39
37
  * Safari+VoiceOver won't announce the list otherwise.
40
38
  */
41
-
42
39
  /* eslint-disable jsx-a11y/no-redundant-roles */
43
40
  createElement(Fragment, null, createElement("div", {
44
41
  className: "table-of-contents__wrapper",
@@ -75,7 +72,6 @@ function TableOfContentsPanel({
75
72
  hasOutlineItemsDisabled: hasOutlineItemsDisabled
76
73
  })))
77
74
  /* eslint-enable jsx-a11y/no-redundant-roles */
78
-
79
75
  );
80
76
  }
81
77
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/table-of-contents/panel.js"],"names":["__","useSelect","store","blockEditorStore","WordCount","TimeToRead","DocumentOutline","CharacterCount","TableOfContentsPanel","hasOutlineItemsDisabled","onRequestClose","headingCount","paragraphCount","numberOfBlocks","select","getGlobalBlockCount"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,eAAtB;AACA,OAAOC,UAAP,MAAuB,iBAAvB;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,cAAP,MAA2B,oBAA3B;;AAEA,SAASC,oBAAT,CAA+B;AAAEC,EAAAA,uBAAF;AAA2BC,EAAAA;AAA3B,CAA/B,EAA6E;AAC5E,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,cAAhB;AAAgCC,IAAAA;AAAhC,MAAmDZ,SAAS,CAC/Da,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAA0BD,MAAM,CAAEX,gBAAF,CAAtC;AACA,WAAO;AACNQ,MAAAA,YAAY,EAAEI,mBAAmB,CAAE,cAAF,CAD3B;AAENH,MAAAA,cAAc,EAAEG,mBAAmB,CAAE,gBAAF,CAF7B;AAGNF,MAAAA,cAAc,EAAEE,mBAAmB;AAH7B,KAAP;AAKA,GARgE,EASjE,EATiE,CAAlE;AAWA;AACC;AACF;AACA;AACA;;AACE;AACA,kCACC;AACC,MAAA,SAAS,EAAC,4BADX;AAEC,MAAA,IAAI,EAAC,MAFN;AAGC,oBAAaf,EAAE,CAAE,qBAAF,CAHhB;AAIC,MAAA,QAAQ,EAAC;AAJV,OAMC;AAAI,MAAA,IAAI,EAAC,MAAT;AAAgB,MAAA,SAAS,EAAC;AAA1B,OACC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGA,EAAE,CAAE,OAAF,CADL,EAEC,cAAC,SAAD,OAFD,CADD,EAKC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGA,EAAE,CAAE,YAAF,CADL,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACC,cAAC,cAAD,OADD,CAFD,CALD,EAWC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGA,EAAE,CAAE,cAAF,CADL,EAEC,cAAC,UAAD,OAFD,CAXD,EAeC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGA,EAAE,CAAE,UAAF,CADL,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGW,YADH,CAFD,CAfD,EAqBC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGX,EAAE,CAAE,YAAF,CADL,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGY,cADH,CAFD,CArBD,EA2BC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGZ,EAAE,CAAE,QAAF,CADL,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACGa,cADH,CAFD,CA3BD,CAND,CADD,EA0CGF,YAAY,GAAG,CAAf,IACD,8BACC,yBADD,EAEC;AAAI,MAAA,SAAS,EAAC;AAAd,OACGX,EAAE,CAAE,kBAAF,CADL,CAFD,EAKC,cAAC,eAAD;AACC,MAAA,QAAQ,EAAGU,cADZ;AAEC,MAAA,uBAAuB,EAAGD;AAF3B,MALD,CA3CF;AAuDA;;AA7DD;AA+DA;;AAED,eAAeD,oBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport WordCount from '../word-count';\nimport 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":["__","useSelect","store","blockEditorStore","WordCount","TimeToRead","DocumentOutline","CharacterCount","TableOfContentsPanel","hasOutlineItemsDisabled","onRequestClose","headingCount","paragraphCount","numberOfBlocks","select","getGlobalBlockCount","createElement","Fragment","className","role","tabIndex","onSelect"],"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":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,UAAU,MAAM,iBAAiB;AACxC,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,cAAc,MAAM,oBAAoB;AAE/C,SAASC,oBAAoBA,CAAE;EAAEC,uBAAuB;EAAEC;AAAe,CAAC,EAAG;EAC5E,MAAM;IAAEC,YAAY;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGZ,SAAS,CAC/Da,MAAM,IAAM;IACb,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEX,gBAAiB,CAAC;IAC1D,OAAO;MACNQ,YAAY,EAAEI,mBAAmB,CAAE,cAAe,CAAC;MACnDH,cAAc,EAAEG,mBAAmB,CAAE,gBAAiB,CAAC;MACvDF,cAAc,EAAEE,mBAAmB,CAAC;IACrC,CAAC;EACF,CAAC,EACD,EACD,CAAC;EACD;IACC;AACF;AACA;AACA;IACE;IACAC,aAAA,CAAAC,QAAA,QACCD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,CAEF;IACF;EAAA;AAEF;;AAEA,eAAeD,oBAAoB"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -8,7 +7,6 @@ import { __ } from '@wordpress/i18n';
8
7
  import { withSelect, withDispatch } from '@wordpress/data';
9
8
  import { compose } from '@wordpress/compose';
10
9
  import { store as blockEditorStore } from '@wordpress/block-editor';
11
-
12
10
  function TemplateValidationNotice({
13
11
  isValid,
14
12
  ...props
@@ -16,14 +14,13 @@ function TemplateValidationNotice({
16
14
  if (isValid) {
17
15
  return null;
18
16
  }
19
-
20
17
  const confirmSynchronization = () => {
21
- if ( // eslint-disable-next-line no-alert
18
+ if (
19
+ // eslint-disable-next-line no-alert
22
20
  window.confirm(__('Resetting the template may result in loss of content, do you want to continue?'))) {
23
21
  props.synchronizeTemplate();
24
22
  }
25
23
  };
26
-
27
24
  return createElement(Notice, {
28
25
  className: "editor-template-validation-notice",
29
26
  isDismissible: false,
@@ -37,7 +34,6 @@ function TemplateValidationNotice({
37
34
  }]
38
35
  }, __('The content of your post doesn’t match the template assigned to your post type.'));
39
36
  }
40
-
41
37
  export default compose([withSelect(select => ({
42
38
  isValid: select(blockEditorStore).isValidTemplate()
43
39
  })), withDispatch(dispatch => {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/template-validation-notice/index.js"],"names":["Notice","__","withSelect","withDispatch","compose","store","blockEditorStore","TemplateValidationNotice","isValid","props","confirmSynchronization","window","confirm","synchronizeTemplate","label","onClick","resetTemplateValidity","select","isValidTemplate","dispatch","setTemplateValidity"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;;AAEA,SAASC,wBAAT,CAAmC;AAAEC,EAAAA,OAAF;AAAW,KAAGC;AAAd,CAAnC,EAA2D;AAC1D,MAAKD,OAAL,EAAe;AACd,WAAO,IAAP;AACA;;AAED,QAAME,sBAAsB,GAAG,MAAM;AACpC,SACC;AACAC,IAAAA,MAAM,CAACC,OAAP,CACCX,EAAE,CACD,gFADC,CADH,CAFD,EAOE;AACDQ,MAAAA,KAAK,CAACI,mBAAN;AACA;AACD,GAXD;;AAaA,SACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,aAAa,EAAG,KAFjB;AAGC,IAAA,MAAM,EAAC,SAHR;AAIC,IAAA,OAAO,EAAG,CACT;AACCC,MAAAA,KAAK,EAAEb,EAAE,CAAE,eAAF,CADV;AAECc,MAAAA,OAAO,EAAEN,KAAK,CAACO;AAFhB,KADS,EAKT;AACCF,MAAAA,KAAK,EAAEb,EAAE,CAAE,oBAAF,CADV;AAECc,MAAAA,OAAO,EAAEL;AAFV,KALS;AAJX,KAeGT,EAAE,CACH,iFADG,CAfL,CADD;AAqBA;;AAED,eAAeG,OAAO,CAAE,CACvBF,UAAU,CAAIe,MAAF,KAAgB;AAC3BT,EAAAA,OAAO,EAAES,MAAM,CAAEX,gBAAF,CAAN,CAA2BY,eAA3B;AADkB,CAAhB,CAAF,CADa,EAIvBf,YAAY,CAAIgB,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,mBAAF;AAAuBP,IAAAA;AAAvB,MACLM,QAAQ,CAAEb,gBAAF,CADT;AAEA,SAAO;AACNU,IAAAA,qBAAqB,EAAE,MAAMI,mBAAmB,CAAE,IAAF,CAD1C;AAENP,IAAAA;AAFM,GAAP;AAIA,CAPW,CAJW,CAAF,CAAP,CAYVN,wBAZU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction TemplateValidationNotice( { isValid, ...props } ) {\n\tif ( isValid ) {\n\t\treturn null;\n\t}\n\n\tconst confirmSynchronization = () => {\n\t\tif (\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\twindow.confirm(\n\t\t\t\t__(\n\t\t\t\t\t'Resetting the template may result in loss of content, do you want to continue?'\n\t\t\t\t)\n\t\t\t)\n\t\t) {\n\t\t\tprops.synchronizeTemplate();\n\t\t}\n\t};\n\n\treturn (\n\t\t<Notice\n\t\t\tclassName=\"editor-template-validation-notice\"\n\t\t\tisDismissible={ false }\n\t\t\tstatus=\"warning\"\n\t\t\tactions={ [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Keep it as is' ),\n\t\t\t\t\tonClick: props.resetTemplateValidity,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Reset the template' ),\n\t\t\t\t\tonClick: confirmSynchronization,\n\t\t\t\t},\n\t\t\t] }\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'The content of your post doesn’t match the template assigned to your post type.'\n\t\t\t) }\n\t\t</Notice>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tisValid: select( blockEditorStore ).isValidTemplate(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { setTemplateValidity, synchronizeTemplate } =\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":["Notice","__","withSelect","withDispatch","compose","store","blockEditorStore","TemplateValidationNotice","isValid","props","confirmSynchronization","window","confirm","synchronizeTemplate","createElement","className","isDismissible","status","actions","label","onClick","resetTemplateValidity","select","isValidTemplate","dispatch","setTemplateValidity"],"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":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,EAAEC,YA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