@wordpress/editor 13.15.0 → 13.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (557) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/autocompleters/index.js +0 -2
  3. package/build/components/autocompleters/index.js.map +1 -1
  4. package/build/components/autocompleters/user.js +2 -9
  5. package/build/components/autocompleters/user.js.map +1 -1
  6. package/build/components/autosave-monitor/index.js +0 -24
  7. package/build/components/autosave-monitor/index.js.map +1 -1
  8. package/build/components/character-count/index.js +1 -4
  9. package/build/components/character-count/index.js.map +1 -1
  10. package/build/components/deprecated.js +1 -11
  11. package/build/components/deprecated.js.map +1 -1
  12. package/build/components/deprecated.native.js +0 -1
  13. package/build/components/deprecated.native.js.map +1 -1
  14. package/build/components/document-outline/check.js +1 -7
  15. package/build/components/document-outline/check.js.map +1 -1
  16. package/build/components/document-outline/index.js +7 -24
  17. package/build/components/document-outline/index.js.map +1 -1
  18. package/build/components/document-outline/item.js +1 -5
  19. package/build/components/document-outline/item.js.map +1 -1
  20. package/build/components/editor-help/add-blocks.native.js +1 -8
  21. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  22. package/build/components/editor-help/customize-blocks.native.js +1 -8
  23. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  24. package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -13
  25. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  26. package/build/components/editor-help/help-get-support-button.native.js +1 -7
  27. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  28. package/build/components/editor-help/help-section-title.native.js +1 -7
  29. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  30. package/build/components/editor-help/help-topic-row.native.js +1 -8
  31. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  32. package/build/components/editor-help/icon-move-blocks.native.js +0 -4
  33. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/index.native.js +8 -29
  35. package/build/components/editor-help/index.native.js.map +1 -1
  36. package/build/components/editor-help/intro-to-blocks.native.js +1 -9
  37. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  38. package/build/components/editor-help/move-blocks.native.js +1 -8
  39. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  40. package/build/components/editor-help/remove-blocks.native.js +1 -8
  41. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/view-sections.native.js +1 -12
  43. package/build/components/editor-help/view-sections.native.js.map +1 -1
  44. package/build/components/editor-history/redo.js +6 -14
  45. package/build/components/editor-history/redo.js.map +1 -1
  46. package/build/components/editor-history/undo.js +6 -14
  47. package/build/components/editor-history/undo.js.map +1 -1
  48. package/build/components/editor-notices/index.js +1 -10
  49. package/build/components/editor-notices/index.js.map +1 -1
  50. package/build/components/editor-snackbars/index.js +1 -5
  51. package/build/components/editor-snackbars/index.js.map +1 -1
  52. package/build/components/entities-saved-states/entity-record-item.js +3 -10
  53. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  54. package/build/components/entities-saved-states/entity-type-list.js +3 -15
  55. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  56. package/build/components/entities-saved-states/hooks/use-is-dirty.js +5 -14
  57. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  58. package/build/components/entities-saved-states/index.js +8 -27
  59. package/build/components/entities-saved-states/index.js.map +1 -1
  60. package/build/components/error-boundary/index.js +1 -18
  61. package/build/components/error-boundary/index.js.map +1 -1
  62. package/build/components/global-keyboard-shortcuts/index.js +5 -9
  63. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  64. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -8
  65. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  66. package/build/components/index.js +4 -76
  67. package/build/components/index.js.map +1 -1
  68. package/build/components/index.native.js +0 -9
  69. package/build/components/index.native.js.map +1 -1
  70. package/build/components/local-autosave-monitor/index.js +6 -31
  71. package/build/components/local-autosave-monitor/index.js.map +1 -1
  72. package/build/components/media-categories/index.js +30 -45
  73. package/build/components/media-categories/index.js.map +1 -1
  74. package/build/components/page-attributes/check.js +3 -7
  75. package/build/components/page-attributes/check.js.map +1 -1
  76. package/build/components/page-attributes/order.js +17 -42
  77. package/build/components/page-attributes/order.js.map +1 -1
  78. package/build/components/page-attributes/parent.js +8 -34
  79. package/build/components/page-attributes/parent.js.map +1 -1
  80. package/build/components/post-author/check.js +1 -11
  81. package/build/components/post-author/check.js.map +1 -1
  82. package/build/components/post-author/combobox.js +7 -23
  83. package/build/components/post-author/combobox.js.map +1 -1
  84. package/build/components/post-author/constants.js +0 -1
  85. package/build/components/post-author/constants.js.map +1 -1
  86. package/build/components/post-author/index.js +1 -12
  87. package/build/components/post-author/index.js.map +1 -1
  88. package/build/components/post-author/select.js +1 -12
  89. package/build/components/post-author/select.js.map +1 -1
  90. package/build/components/post-comments/index.js +11 -23
  91. package/build/components/post-comments/index.js.map +1 -1
  92. package/build/components/post-excerpt/check.js +6 -8
  93. package/build/components/post-excerpt/check.js.map +1 -1
  94. package/build/components/post-excerpt/index.js +10 -27
  95. package/build/components/post-excerpt/index.js.map +1 -1
  96. package/build/components/post-featured-image/check.js +6 -9
  97. package/build/components/post-featured-image/check.js.map +1 -1
  98. package/build/components/post-featured-image/index.js +13 -42
  99. package/build/components/post-featured-image/index.js.map +1 -1
  100. package/build/components/post-format/check.js +9 -18
  101. package/build/components/post-format/check.js.map +1 -1
  102. package/build/components/post-format/index.js +2 -20
  103. package/build/components/post-format/index.js.map +1 -1
  104. package/build/components/post-last-revision/check.js +15 -22
  105. package/build/components/post-last-revision/check.js.map +1 -1
  106. package/build/components/post-last-revision/index.js +17 -28
  107. package/build/components/post-last-revision/index.js.map +1 -1
  108. package/build/components/post-locked-modal/index.js +8 -28
  109. package/build/components/post-locked-modal/index.js.map +1 -1
  110. package/build/components/post-pending-status/check.js +16 -24
  111. package/build/components/post-pending-status/check.js.map +1 -1
  112. package/build/components/post-pending-status/index.js +10 -28
  113. package/build/components/post-pending-status/index.js.map +1 -1
  114. package/build/components/post-pingbacks/index.js +11 -23
  115. package/build/components/post-pingbacks/index.js.map +1 -1
  116. package/build/components/post-preview-button/index.js +11 -22
  117. package/build/components/post-preview-button/index.js.map +1 -1
  118. package/build/components/post-publish-button/index.js +6 -32
  119. package/build/components/post-publish-button/index.js.map +1 -1
  120. package/build/components/post-publish-button/label.js +1 -10
  121. package/build/components/post-publish-button/label.js.map +1 -1
  122. package/build/components/post-publish-panel/index.js +1 -22
  123. package/build/components/post-publish-panel/index.js.map +1 -1
  124. package/build/components/post-publish-panel/maybe-category-panel.js +4 -14
  125. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  126. package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -18
  127. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  128. package/build/components/post-publish-panel/maybe-tags-panel.js +2 -17
  129. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  130. package/build/components/post-publish-panel/maybe-upload-media.js +1 -18
  131. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  132. package/build/components/post-publish-panel/postpublish.js +3 -27
  133. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  134. package/build/components/post-publish-panel/prepublish.js +1 -26
  135. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  136. package/build/components/post-saved-state/index.js +12 -29
  137. package/build/components/post-saved-state/index.js.map +1 -1
  138. package/build/components/post-schedule/check.js +1 -8
  139. package/build/components/post-schedule/check.js.map +1 -1
  140. package/build/components/post-schedule/index.js +7 -13
  141. package/build/components/post-schedule/index.js.map +1 -1
  142. package/build/components/post-schedule/label.js +18 -29
  143. package/build/components/post-schedule/label.js.map +1 -1
  144. package/build/components/post-slug/check.js +1 -4
  145. package/build/components/post-slug/check.js.map +1 -1
  146. package/build/components/post-slug/index.js +1 -19
  147. package/build/components/post-slug/index.js.map +1 -1
  148. package/build/components/post-sticky/check.js +1 -8
  149. package/build/components/post-sticky/check.js.map +1 -1
  150. package/build/components/post-sticky/index.js +1 -12
  151. package/build/components/post-sticky/index.js.map +1 -1
  152. package/build/components/post-switch-to-draft-button/index.js +1 -14
  153. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  154. package/build/components/post-sync-status/index.js +5 -18
  155. package/build/components/post-sync-status/index.js.map +1 -1
  156. package/build/components/post-taxonomies/check.js +1 -9
  157. package/build/components/post-taxonomies/check.js.map +1 -1
  158. package/build/components/post-taxonomies/flat-term-selector.js +15 -50
  159. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  160. package/build/components/post-taxonomies/hierarchical-term-selector.js +27 -79
  161. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  162. package/build/components/post-taxonomies/index.js +3 -13
  163. package/build/components/post-taxonomies/index.js.map +1 -1
  164. package/build/components/post-taxonomies/most-used-terms.js +1 -9
  165. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  166. package/build/components/post-template/index.js +1 -11
  167. package/build/components/post-template/index.js.map +1 -1
  168. package/build/components/post-text-editor/index.js +3 -17
  169. package/build/components/post-text-editor/index.js.map +1 -1
  170. package/build/components/post-title/index.js +14 -46
  171. package/build/components/post-title/index.js.map +1 -1
  172. package/build/components/post-title/index.native.js +7 -44
  173. package/build/components/post-title/index.native.js.map +1 -1
  174. package/build/components/post-trash/check.js +1 -7
  175. package/build/components/post-trash/check.js.map +1 -1
  176. package/build/components/post-trash/index.js +1 -8
  177. package/build/components/post-trash/index.js.map +1 -1
  178. package/build/components/post-type-support-check/index.js +10 -23
  179. package/build/components/post-type-support-check/index.js.map +1 -1
  180. package/build/components/post-url/check.js +1 -12
  181. package/build/components/post-url/check.js.map +1 -1
  182. package/build/components/post-url/index.js +3 -15
  183. package/build/components/post-url/index.js.map +1 -1
  184. package/build/components/post-url/label.js +1 -5
  185. package/build/components/post-url/label.js.map +1 -1
  186. package/build/components/post-visibility/check.js +1 -7
  187. package/build/components/post-visibility/check.js.map +1 -1
  188. package/build/components/post-visibility/index.js +1 -17
  189. package/build/components/post-visibility/index.js.map +1 -1
  190. package/build/components/post-visibility/label.js +1 -5
  191. package/build/components/post-visibility/label.js.map +1 -1
  192. package/build/components/post-visibility/utils.js +1 -2
  193. package/build/components/post-visibility/utils.js.map +1 -1
  194. package/build/components/provider/index.js +13 -27
  195. package/build/components/provider/index.js.map +1 -1
  196. package/build/components/provider/index.native.js +18 -70
  197. package/build/components/provider/index.native.js.map +1 -1
  198. package/build/components/provider/use-block-editor-settings.js +9 -20
  199. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  200. package/build/components/provider/use-block-editor-settings.native.js +5 -11
  201. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  202. package/build/components/provider/with-registry-provider.js +5 -12
  203. package/build/components/provider/with-registry-provider.js.map +1 -1
  204. package/build/components/table-of-contents/index.js +4 -14
  205. package/build/components/table-of-contents/index.js.map +1 -1
  206. package/build/components/table-of-contents/panel.js +1 -13
  207. package/build/components/table-of-contents/panel.js.map +1 -1
  208. package/build/components/template-validation-notice/index.js +3 -12
  209. package/build/components/template-validation-notice/index.js.map +1 -1
  210. package/build/components/theme-support-check/index.js +3 -12
  211. package/build/components/theme-support-check/index.js.map +1 -1
  212. package/build/components/time-to-read/index.js +2 -10
  213. package/build/components/time-to-read/index.js.map +1 -1
  214. package/build/components/unsaved-changes-warning/index.js +21 -35
  215. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  216. package/build/components/word-count/index.js +2 -7
  217. package/build/components/word-count/index.js.map +1 -1
  218. package/build/hooks/custom-sources-backwards-compatibility.js +8 -42
  219. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  220. package/build/hooks/default-autocompleters.js +3 -4
  221. package/build/hooks/default-autocompleters.js.map +1 -1
  222. package/build/hooks/index.js +0 -1
  223. package/build/hooks/index.js.map +1 -1
  224. package/build/hooks/index.native.js.map +1 -1
  225. package/build/index.js +0 -9
  226. package/build/index.js.map +1 -1
  227. package/build/index.native.js +0 -11
  228. package/build/index.native.js.map +1 -1
  229. package/build/lock-unlock.js +1 -2
  230. package/build/lock-unlock.js.map +1 -1
  231. package/build/private-apis.js +1 -4
  232. package/build/private-apis.js.map +1 -1
  233. package/build/store/actions.js +61 -130
  234. package/build/store/actions.js.map +1 -1
  235. package/build/store/actions.native.js +1 -8
  236. package/build/store/actions.native.js.map +1 -1
  237. package/build/store/constants.js +1 -2
  238. package/build/store/constants.js.map +1 -1
  239. package/build/store/defaults.js +2 -3
  240. package/build/store/defaults.js.map +1 -1
  241. package/build/store/index.js +3 -11
  242. package/build/store/index.js.map +1 -1
  243. package/build/store/local-autosave.js +0 -4
  244. package/build/store/local-autosave.js.map +1 -1
  245. package/build/store/reducer.js +19 -49
  246. package/build/store/reducer.js.map +1 -1
  247. package/build/store/reducer.native.js +3 -17
  248. package/build/store/reducer.native.js.map +1 -1
  249. package/build/store/selectors.js +170 -296
  250. package/build/store/selectors.js.map +1 -1
  251. package/build/store/selectors.native.js +4 -11
  252. package/build/store/selectors.native.js.map +1 -1
  253. package/build/store/utils/notice-builder.js +13 -24
  254. package/build/store/utils/notice-builder.js.map +1 -1
  255. package/build/utils/get-template-part-icon.js +0 -3
  256. package/build/utils/get-template-part-icon.js.map +1 -1
  257. package/build/utils/index.js +0 -4
  258. package/build/utils/index.js.map +1 -1
  259. package/build/utils/index.native.js +0 -2
  260. package/build/utils/index.native.js.map +1 -1
  261. package/build/utils/media-upload/index.js +2 -6
  262. package/build/utils/media-upload/index.js.map +1 -1
  263. package/build/utils/media-upload/index.native.js +0 -1
  264. package/build/utils/media-upload/index.native.js.map +1 -1
  265. package/build/utils/terms.js +8 -18
  266. package/build/utils/terms.js.map +1 -1
  267. package/build/utils/url.js +0 -4
  268. package/build/utils/url.js.map +1 -1
  269. package/build-module/components/autocompleters/index.js.map +1 -1
  270. package/build-module/components/autocompleters/user.js +2 -5
  271. package/build-module/components/autocompleters/user.js.map +1 -1
  272. package/build-module/components/autosave-monitor/index.js +2 -17
  273. package/build-module/components/autosave-monitor/index.js.map +1 -1
  274. package/build-module/components/character-count/index.js +1 -1
  275. package/build-module/components/character-count/index.js.map +1 -1
  276. package/build-module/components/deprecated.js +0 -4
  277. package/build-module/components/deprecated.js.map +1 -1
  278. package/build-module/components/deprecated.native.js +0 -1
  279. package/build-module/components/deprecated.native.js.map +1 -1
  280. package/build-module/components/document-outline/check.js +0 -4
  281. package/build-module/components/document-outline/check.js.map +1 -1
  282. package/build-module/components/document-outline/index.js +9 -13
  283. package/build-module/components/document-outline/index.js.map +1 -1
  284. package/build-module/components/document-outline/item.js +0 -3
  285. package/build-module/components/document-outline/item.js.map +1 -1
  286. package/build-module/components/editor-help/add-blocks.native.js +2 -5
  287. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  288. package/build-module/components/editor-help/customize-blocks.native.js +2 -5
  289. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  290. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +6 -8
  291. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  292. package/build-module/components/editor-help/help-get-support-button.native.js +2 -5
  293. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  294. package/build-module/components/editor-help/help-section-title.native.js +2 -5
  295. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  296. package/build-module/components/editor-help/help-topic-row.native.js +1 -6
  297. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  298. package/build-module/components/editor-help/icon-move-blocks.native.js +0 -1
  299. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  300. package/build-module/components/editor-help/index.native.js +9 -9
  301. package/build-module/components/editor-help/index.native.js.map +1 -1
  302. package/build-module/components/editor-help/intro-to-blocks.native.js +2 -5
  303. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  304. package/build-module/components/editor-help/move-blocks.native.js +2 -5
  305. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  306. package/build-module/components/editor-help/remove-blocks.native.js +2 -5
  307. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  308. package/build-module/components/editor-help/view-sections.native.js +2 -4
  309. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  310. package/build-module/components/editor-history/redo.js +6 -8
  311. package/build-module/components/editor-history/redo.js.map +1 -1
  312. package/build-module/components/editor-history/undo.js +6 -8
  313. package/build-module/components/editor-history/undo.js.map +1 -1
  314. package/build-module/components/editor-notices/index.js +1 -2
  315. package/build-module/components/editor-notices/index.js.map +1 -1
  316. package/build-module/components/editor-snackbars/index.js +0 -1
  317. package/build-module/components/editor-snackbars/index.js.map +1 -1
  318. package/build-module/components/entities-saved-states/entity-record-item.js +3 -4
  319. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  320. package/build-module/components/entities-saved-states/entity-type-list.js +3 -10
  321. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  322. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +4 -7
  323. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  324. package/build-module/components/entities-saved-states/index.js +8 -16
  325. package/build-module/components/entities-saved-states/index.js.map +1 -1
  326. package/build-module/components/error-boundary/index.js +1 -12
  327. package/build-module/components/error-boundary/index.js.map +1 -1
  328. package/build-module/components/global-keyboard-shortcuts/index.js +5 -6
  329. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  330. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +0 -3
  331. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  332. package/build-module/components/index.js +6 -3
  333. package/build-module/components/index.js.map +1 -1
  334. package/build-module/components/index.native.js +4 -2
  335. package/build-module/components/index.native.js.map +1 -1
  336. package/build-module/components/local-autosave-monitor/index.js +6 -21
  337. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  338. package/build-module/components/media-categories/index.js +31 -41
  339. package/build-module/components/media-categories/index.js.map +1 -1
  340. package/build-module/components/page-attributes/check.js +3 -3
  341. package/build-module/components/page-attributes/check.js.map +1 -1
  342. package/build-module/components/page-attributes/order.js +17 -31
  343. package/build-module/components/page-attributes/order.js.map +1 -1
  344. package/build-module/components/page-attributes/parent.js +9 -23
  345. package/build-module/components/page-attributes/parent.js.map +1 -1
  346. package/build-module/components/post-author/check.js +1 -5
  347. package/build-module/components/post-author/check.js.map +1 -1
  348. package/build-module/components/post-author/combobox.js +7 -16
  349. package/build-module/components/post-author/combobox.js.map +1 -1
  350. package/build-module/components/post-author/constants.js +0 -1
  351. package/build-module/components/post-author/constants.js.map +1 -1
  352. package/build-module/components/post-author/index.js +1 -6
  353. package/build-module/components/post-author/index.js.map +1 -1
  354. package/build-module/components/post-author/select.js +1 -6
  355. package/build-module/components/post-author/select.js.map +1 -1
  356. package/build-module/components/post-comments/index.js +12 -19
  357. package/build-module/components/post-comments/index.js.map +1 -1
  358. package/build-module/components/post-excerpt/check.js +5 -6
  359. package/build-module/components/post-excerpt/check.js.map +1 -1
  360. package/build-module/components/post-excerpt/index.js +11 -23
  361. package/build-module/components/post-excerpt/index.js.map +1 -1
  362. package/build-module/components/post-featured-image/check.js +5 -6
  363. package/build-module/components/post-featured-image/check.js.map +1 -1
  364. package/build-module/components/post-featured-image/index.js +13 -31
  365. package/build-module/components/post-featured-image/index.js.map +1 -1
  366. package/build-module/components/post-format/check.js +10 -15
  367. package/build-module/components/post-format/check.js.map +1 -1
  368. package/build-module/components/post-format/index.js +4 -12
  369. package/build-module/components/post-format/index.js.map +1 -1
  370. package/build-module/components/post-last-revision/check.js +17 -17
  371. package/build-module/components/post-last-revision/check.js.map +1 -1
  372. package/build-module/components/post-last-revision/index.js +18 -21
  373. package/build-module/components/post-last-revision/index.js.map +1 -1
  374. package/build-module/components/post-locked-modal/index.js +8 -22
  375. package/build-module/components/post-locked-modal/index.js.map +1 -1
  376. package/build-module/components/post-pending-status/check.js +17 -20
  377. package/build-module/components/post-pending-status/check.js.map +1 -1
  378. package/build-module/components/post-pending-status/index.js +11 -20
  379. package/build-module/components/post-pending-status/index.js.map +1 -1
  380. package/build-module/components/post-pingbacks/index.js +12 -19
  381. package/build-module/components/post-pingbacks/index.js.map +1 -1
  382. package/build-module/components/post-preview-button/index.js +11 -17
  383. package/build-module/components/post-preview-button/index.js.map +1 -1
  384. package/build-module/components/post-publish-button/index.js +7 -23
  385. package/build-module/components/post-publish-button/index.js.map +1 -1
  386. package/build-module/components/post-publish-button/label.js +1 -4
  387. package/build-module/components/post-publish-button/label.js.map +1 -1
  388. package/build-module/components/post-publish-panel/index.js +1 -8
  389. package/build-module/components/post-publish-panel/index.js.map +1 -1
  390. package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -8
  391. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  392. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -12
  393. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  394. package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -9
  395. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  396. package/build-module/components/post-publish-panel/maybe-upload-media.js +1 -12
  397. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  398. package/build-module/components/post-publish-panel/postpublish.js +3 -16
  399. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  400. package/build-module/components/post-publish-panel/prepublish.js +1 -10
  401. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  402. package/build-module/components/post-saved-state/index.js +15 -23
  403. package/build-module/components/post-saved-state/index.js.map +1 -1
  404. package/build-module/components/post-schedule/check.js +1 -3
  405. package/build-module/components/post-schedule/check.js.map +1 -1
  406. package/build-module/components/post-schedule/index.js +8 -8
  407. package/build-module/components/post-schedule/index.js.map +1 -1
  408. package/build-module/components/post-schedule/label.js +18 -22
  409. package/build-module/components/post-schedule/label.js.map +1 -1
  410. package/build-module/components/post-slug/check.js +0 -1
  411. package/build-module/components/post-slug/check.js.map +1 -1
  412. package/build-module/components/post-slug/index.js +1 -8
  413. package/build-module/components/post-slug/index.js.map +1 -1
  414. package/build-module/components/post-sticky/check.js +1 -3
  415. package/build-module/components/post-sticky/check.js.map +1 -1
  416. package/build-module/components/post-sticky/index.js +1 -3
  417. package/build-module/components/post-sticky/index.js.map +1 -1
  418. package/build-module/components/post-switch-to-draft-button/index.js +1 -9
  419. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  420. package/build-module/components/post-sync-status/index.js +5 -11
  421. package/build-module/components/post-sync-status/index.js.map +1 -1
  422. package/build-module/components/post-taxonomies/check.js +1 -3
  423. package/build-module/components/post-taxonomies/check.js.map +1 -1
  424. package/build-module/components/post-taxonomies/flat-term-selector.js +17 -39
  425. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  426. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +29 -66
  427. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  428. package/build-module/components/post-taxonomies/index.js +3 -5
  429. package/build-module/components/post-taxonomies/index.js.map +1 -1
  430. package/build-module/components/post-taxonomies/most-used-terms.js +1 -4
  431. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  432. package/build-module/components/post-template/index.js +1 -5
  433. package/build-module/components/post-template/index.js.map +1 -1
  434. package/build-module/components/post-text-editor/index.js +4 -9
  435. package/build-module/components/post-text-editor/index.js.map +1 -1
  436. package/build-module/components/post-title/index.js +17 -35
  437. package/build-module/components/post-title/index.js.map +1 -1
  438. package/build-module/components/post-title/index.native.js +8 -33
  439. package/build-module/components/post-title/index.native.js.map +1 -1
  440. package/build-module/components/post-trash/check.js +1 -4
  441. package/build-module/components/post-trash/check.js.map +1 -1
  442. package/build-module/components/post-trash/index.js +1 -4
  443. package/build-module/components/post-trash/index.js.map +1 -1
  444. package/build-module/components/post-type-support-check/index.js +14 -20
  445. package/build-module/components/post-type-support-check/index.js.map +1 -1
  446. package/build-module/components/post-url/check.js +1 -9
  447. package/build-module/components/post-url/check.js.map +1 -1
  448. package/build-module/components/post-url/index.js +3 -8
  449. package/build-module/components/post-url/index.js.map +1 -1
  450. package/build-module/components/post-url/label.js +1 -1
  451. package/build-module/components/post-url/label.js.map +1 -1
  452. package/build-module/components/post-visibility/check.js +1 -2
  453. package/build-module/components/post-visibility/check.js.map +1 -1
  454. package/build-module/components/post-visibility/index.js +1 -10
  455. package/build-module/components/post-visibility/index.js.map +1 -1
  456. package/build-module/components/post-visibility/label.js +1 -1
  457. package/build-module/components/post-visibility/label.js.map +1 -1
  458. package/build-module/components/post-visibility/utils.js.map +1 -1
  459. package/build-module/components/provider/index.js +13 -14
  460. package/build-module/components/provider/index.js.map +1 -1
  461. package/build-module/components/provider/index.native.js +21 -52
  462. package/build-module/components/provider/index.native.js.map +1 -1
  463. package/build-module/components/provider/use-block-editor-settings.js +9 -12
  464. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  465. package/build-module/components/provider/use-block-editor-settings.native.js +5 -5
  466. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  467. package/build-module/components/provider/with-registry-provider.js +5 -8
  468. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  469. package/build-module/components/table-of-contents/index.js +4 -7
  470. package/build-module/components/table-of-contents/index.js.map +1 -1
  471. package/build-module/components/table-of-contents/panel.js +1 -5
  472. package/build-module/components/table-of-contents/panel.js.map +1 -1
  473. package/build-module/components/template-validation-notice/index.js +2 -6
  474. package/build-module/components/template-validation-notice/index.js.map +1 -1
  475. package/build-module/components/theme-support-check/index.js +3 -7
  476. package/build-module/components/theme-support-check/index.js.map +1 -1
  477. package/build-module/components/time-to-read/index.js +4 -7
  478. package/build-module/components/time-to-read/index.js.map +1 -1
  479. package/build-module/components/unsaved-changes-warning/index.js +22 -31
  480. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  481. package/build-module/components/word-count/index.js +2 -4
  482. package/build-module/components/word-count/index.js.map +1 -1
  483. package/build-module/hooks/custom-sources-backwards-compatibility.js +11 -39
  484. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  485. package/build-module/hooks/default-autocompleters.js +3 -4
  486. package/build-module/hooks/default-autocompleters.js.map +1 -1
  487. package/build-module/hooks/index.js.map +1 -1
  488. package/build-module/hooks/index.native.js.map +1 -1
  489. package/build-module/index.js +1 -1
  490. package/build-module/index.js.map +1 -1
  491. package/build-module/index.native.js +1 -1
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/lock-unlock.js.map +1 -1
  494. package/build-module/private-apis.js.map +1 -1
  495. package/build-module/store/actions.js +63 -85
  496. package/build-module/store/actions.js.map +1 -1
  497. package/build-module/store/actions.native.js +2 -2
  498. package/build-module/store/actions.native.js.map +1 -1
  499. package/build-module/store/constants.js +1 -1
  500. package/build-module/store/constants.js.map +1 -1
  501. package/build-module/store/defaults.js +3 -2
  502. package/build-module/store/defaults.js.map +1 -1
  503. package/build-module/store/index.js +5 -4
  504. package/build-module/store/index.js.map +1 -1
  505. package/build-module/store/local-autosave.js +0 -1
  506. package/build-module/store/local-autosave.js.map +1 -1
  507. package/build-module/store/reducer.js +21 -33
  508. package/build-module/store/reducer.js.map +1 -1
  509. package/build-module/store/reducer.native.js +4 -10
  510. package/build-module/store/reducer.native.js.map +1 -1
  511. package/build-module/store/selectors.js +173 -223
  512. package/build-module/store/selectors.js.map +1 -1
  513. package/build-module/store/selectors.native.js +6 -8
  514. package/build-module/store/selectors.native.js.map +1 -1
  515. package/build-module/store/utils/notice-builder.js +15 -21
  516. package/build-module/store/utils/notice-builder.js.map +1 -1
  517. package/build-module/utils/get-template-part-icon.js +0 -2
  518. package/build-module/utils/get-template-part-icon.js.map +1 -1
  519. package/build-module/utils/index.js.map +1 -1
  520. package/build-module/utils/index.native.js.map +1 -1
  521. package/build-module/utils/media-upload/index.js +2 -4
  522. package/build-module/utils/media-upload/index.js.map +1 -1
  523. package/build-module/utils/media-upload/index.native.js.map +1 -1
  524. package/build-module/utils/terms.js +9 -11
  525. package/build-module/utils/terms.js.map +1 -1
  526. package/build-module/utils/url.js +1 -1
  527. package/build-module/utils/url.js.map +1 -1
  528. package/build-style/style-rtl.css +10 -17
  529. package/build-style/style.css +10 -17
  530. package/package.json +32 -31
  531. package/src/components/editor-help/index.native.js +1 -1
  532. package/src/components/editor-help/style.scss +5 -0
  533. package/src/components/page-attributes/order.js +15 -23
  534. package/src/components/page-attributes/test/order.js +46 -15
  535. package/src/components/post-author/test/check.js +18 -12
  536. package/src/components/post-comments/index.js +11 -17
  537. package/src/components/post-excerpt/check.js +6 -2
  538. package/src/components/post-excerpt/index.js +10 -16
  539. package/src/components/post-featured-image/check.js +4 -2
  540. package/src/components/post-format/check.js +16 -11
  541. package/src/components/post-last-revision/check.js +12 -14
  542. package/src/components/post-last-revision/index.js +12 -10
  543. package/src/components/post-last-revision/test/check.js +28 -16
  544. package/src/components/post-pending-status/check.js +13 -19
  545. package/src/components/post-pending-status/index.js +9 -14
  546. package/src/components/post-pending-status/test/check.js +32 -10
  547. package/src/components/post-pingbacks/index.js +11 -15
  548. package/src/components/post-publish-panel/style.scss +12 -25
  549. package/src/components/post-sync-status/style.scss +4 -1
  550. package/src/components/post-type-support-check/index.js +8 -10
  551. package/src/components/post-type-support-check/test/index.js +36 -20
  552. package/src/components/provider/index.js +3 -2
  553. package/src/components/unsaved-changes-warning/index.js +22 -27
  554. package/src/hooks/custom-sources-backwards-compatibility.js +1 -25
  555. package/src/store/actions.js +1 -1
  556. package/src/store/selectors.js +2 -2
  557. package/src/store/test/selectors.js +13 -13
@@ -1,50 +1,29 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = exports.ExperimentalEditorProvider = void 0;
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _memize = _interopRequireDefault(require("memize"));
13
-
14
10
  var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
15
-
16
11
  var _reactNativeBridge = _interopRequireWildcard(require("@wordpress/react-native-bridge"));
17
-
18
12
  var _wordcount = require("@wordpress/wordcount");
19
-
20
13
  var _blocks = require("@wordpress/blocks");
21
-
22
14
  var _data = require("@wordpress/data");
23
-
24
15
  var _compose = require("@wordpress/compose");
25
-
26
16
  var _hooks = require("@wordpress/hooks");
27
-
28
17
  var _blockEditor = require("@wordpress/block-editor");
29
-
30
18
  var _components = require("@wordpress/components");
31
-
32
19
  var _blockLibrary = require("@wordpress/block-library");
33
-
34
20
  var _editor = require("@wordpress/editor");
35
-
36
21
  var _notices = require("@wordpress/notices");
37
-
38
22
  var _coreData = require("@wordpress/core-data");
39
-
40
23
  var _editPost = require("@wordpress/edit-post");
41
-
42
24
  var _index = _interopRequireDefault(require("./index.js"));
43
-
44
25
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
45
-
46
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
47
-
48
27
  /**
49
28
  * External dependencies
50
29
  */
@@ -52,6 +31,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
52
31
  /**
53
32
  * WordPress dependencies
54
33
  */
34
+
55
35
  const postTypeEntities = [{
56
36
  name: 'post',
57
37
  baseURL: '/wp/v2/posts'
@@ -76,15 +56,16 @@ const postTypeEntities = [{
76
56
  },
77
57
  rawAttributes: ['title', 'excerpt', 'content']
78
58
  }));
79
-
80
59
  class NativeEditorProvider extends _element.Component {
81
60
  constructor() {
82
- super(...arguments); // Keep a local reference to `post` to detect changes.
61
+ super(...arguments);
83
62
 
63
+ // Keep a local reference to `post` to detect changes.
84
64
  this.post = this.props.post;
85
65
  this.props.addEntities(postTypeEntities);
86
66
  this.props.receiveEntityRecords('postType', this.post.type, this.post);
87
- this.getEditorSettings = (0, _memize.default)((settings, capabilities) => ({ ...settings,
67
+ this.getEditorSettings = (0, _memize.default)((settings, capabilities) => ({
68
+ ...settings,
88
69
  capabilities
89
70
  }), {
90
71
  maxSize: 1
@@ -93,7 +74,6 @@ class NativeEditorProvider extends _element.Component {
93
74
  isHelpVisible: false
94
75
  };
95
76
  }
96
-
97
77
  componentDidMount() {
98
78
  const {
99
79
  capabilities,
@@ -140,7 +120,6 @@ class NativeEditorProvider extends _element.Component {
140
120
  if (typeof galleryWithImageBlocks === 'boolean') {
141
121
  window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;
142
122
  }
143
-
144
123
  updateEditorSettings(this.getThemeColors(editorSettings));
145
124
  });
146
125
  this.subscriptionParentUpdateCapabilities = (0, _reactNativeBridge.subscribeUpdateCapabilities)(payload => {
@@ -153,69 +132,61 @@ class NativeEditorProvider extends _element.Component {
153
132
  this.setState({
154
133
  isHelpVisible: true
155
134
  });
156
- }); // Request current block impressions from native app.
135
+ });
157
136
 
137
+ // Request current block impressions from native app.
158
138
  (0, _reactNativeBridge.requestBlockTypeImpressions)(storedImpressions => {
159
- const impressions = { ..._blockLibrary.NEW_BLOCK_TYPES,
139
+ const impressions = {
140
+ ..._blockLibrary.NEW_BLOCK_TYPES,
160
141
  ...storedImpressions
161
- }; // Persist impressions to JavaScript store.
142
+ };
162
143
 
144
+ // Persist impressions to JavaScript store.
163
145
  updateBlockEditorSettings({
164
146
  impressions
165
- }); // Persist impressions to native store if they do not include latest
166
- // `NEW_BLOCK_TYPES` configuration.
147
+ });
167
148
 
149
+ // Persist impressions to native store if they do not include latest
150
+ // `NEW_BLOCK_TYPES` configuration.
168
151
  const storedImpressionKeys = Object.keys(storedImpressions);
169
152
  const storedImpressionsCurrent = Object.keys(_blockLibrary.NEW_BLOCK_TYPES).every(newKey => storedImpressionKeys.includes(newKey));
170
-
171
153
  if (!storedImpressionsCurrent) {
172
154
  (0, _reactNativeBridge.setBlockTypeImpressions)(impressions);
173
155
  }
174
156
  });
175
157
  }
176
-
177
158
  componentWillUnmount() {
178
159
  if (this.subscriptionParentGetHtml) {
179
160
  this.subscriptionParentGetHtml.remove();
180
161
  }
181
-
182
162
  if (this.subscriptionParentToggleHTMLMode) {
183
163
  this.subscriptionParentToggleHTMLMode.remove();
184
164
  }
185
-
186
165
  if (this.subscriptionParentSetTitle) {
187
166
  this.subscriptionParentSetTitle.remove();
188
167
  }
189
-
190
168
  if (this.subscriptionParentUpdateHtml) {
191
169
  this.subscriptionParentUpdateHtml.remove();
192
170
  }
193
-
194
171
  if (this.subscriptionParentReplaceBlock) {
195
172
  this.subscriptionParentReplaceBlock.remove();
196
173
  }
197
-
198
174
  if (this.subscriptionParentMediaAppend) {
199
175
  this.subscriptionParentMediaAppend.remove();
200
176
  }
201
-
202
177
  if (this.subscriptionParentUpdateEditorSettings) {
203
178
  this.subscriptionParentUpdateEditorSettings.remove();
204
179
  }
205
-
206
180
  if (this.subscriptionParentUpdateCapabilities) {
207
181
  this.subscriptionParentUpdateCapabilities.remove();
208
182
  }
209
-
210
183
  if (this.subscriptionParentShowNotice) {
211
184
  this.subscriptionParentShowNotice.remove();
212
185
  }
213
-
214
186
  if (this.subscriptionParentShowEditorHelp) {
215
187
  this.subscriptionParentShowEditorHelp.remove();
216
188
  }
217
189
  }
218
-
219
190
  getThemeColors({
220
191
  rawStyles,
221
192
  rawFeatures
@@ -224,32 +195,24 @@ class NativeEditorProvider extends _element.Component {
224
195
  defaultEditorColors,
225
196
  defaultEditorGradients
226
197
  } = this.props;
227
-
228
198
  if (rawStyles && rawFeatures) {
229
199
  return (0, _components.getGlobalStyles)(rawStyles, rawFeatures);
230
200
  }
231
-
232
201
  return (0, _components.getColorsAndGradients)(defaultEditorColors, defaultEditorGradients, rawFeatures);
233
202
  }
234
-
235
203
  componentDidUpdate(prevProps) {
236
204
  if (!prevProps.isReady && this.props.isReady) {
237
205
  const blocks = this.props.blocks;
238
-
239
206
  const isUnsupportedBlock = ({
240
207
  name
241
208
  }) => name === (0, _blocks.getUnregisteredTypeHandlerName)();
242
-
243
209
  const unsupportedBlockNames = blocks.filter(isUnsupportedBlock).map(block => block.attributes.originalName);
244
-
245
210
  _reactNativeBridge.default.editorDidMount(unsupportedBlockNames);
246
211
  }
247
212
  }
248
-
249
213
  serializeToNativeAction() {
250
214
  const title = this.props.title;
251
215
  let html;
252
-
253
216
  if (this.props.mode === 'text') {
254
217
  // The HTMLTextInput component does not update the store when user is doing changes
255
218
  // Let's request the HTML from the component's state directly.
@@ -257,49 +220,42 @@ class NativeEditorProvider extends _element.Component {
257
220
  } else {
258
221
  html = (0, _blocks.serialize)(this.props.blocks);
259
222
  }
223
+ const hasChanges = title !== this.post.title.raw || html !== this.post.content.raw;
260
224
 
261
- const hasChanges = title !== this.post.title.raw || html !== this.post.content.raw; // Variable to store the content structure metrics.
262
-
225
+ // Variable to store the content structure metrics.
263
226
  const contentInfo = {};
264
227
  contentInfo.characterCount = (0, _wordcount.count)(html, 'characters_including_spaces');
265
228
  contentInfo.wordCount = (0, _wordcount.count)(html, 'words');
266
229
  contentInfo.paragraphCount = this.props.paragraphCount;
267
230
  contentInfo.blockCount = this.props.blockCount;
268
-
269
231
  _reactNativeBridge.default.provideToNative_Html(html, title, hasChanges, contentInfo);
270
-
271
232
  if (hasChanges) {
272
233
  this.post.title.raw = title;
273
234
  this.post.content.raw = html;
274
235
  }
275
236
  }
276
-
277
237
  updateHtmlAction(html) {
278
238
  const parsed = (0, _blocks.parse)(html);
279
239
  this.props.resetEditorBlocksWithoutUndoLevel(parsed);
280
240
  }
281
-
282
241
  replaceBlockAction(html, blockClientId) {
283
242
  const parsed = (0, _blocks.parse)(html);
284
243
  this.props.replaceBlock(blockClientId, parsed);
285
244
  }
286
-
287
245
  toggleMode() {
288
246
  const {
289
247
  mode,
290
248
  switchMode
291
- } = this.props; // Refresh html content first.
292
-
249
+ } = this.props;
250
+ // Refresh html content first.
293
251
  this.serializeToNativeAction();
294
252
  switchMode(mode === 'visual' ? 'text' : 'visual');
295
253
  }
296
-
297
254
  updateCapabilitiesAction(capabilities) {
298
255
  this.props.updateEditorSettings({
299
256
  capabilities
300
257
  });
301
258
  }
302
-
303
259
  render() {
304
260
  const {
305
261
  children,
@@ -324,12 +280,9 @@ class NativeEditorProvider extends _element.Component {
324
280
  showSupport: capabilities?.supportSection === true
325
281
  }));
326
282
  }
327
-
328
283
  }
329
-
330
284
  const ComposedNativeProvider = (0, _compose.compose)([(0, _data.withSelect)(select => {
331
285
  var _settings$colors, _settings$gradients;
332
-
333
286
  const {
334
287
  __unstableIsEditorReady: isEditorReady,
335
288
  getEditorBlocks,
@@ -388,25 +341,20 @@ const ComposedNativeProvider = (0, _compose.compose)([(0, _data.withSelect)(sele
388
341
  addEntities,
389
342
  insertBlock,
390
343
  createSuccessNotice,
391
-
392
344
  editTitle(title) {
393
345
  editPost({
394
346
  title
395
347
  });
396
348
  },
397
-
398
349
  receiveEntityRecords,
399
-
400
350
  resetEditorBlocksWithoutUndoLevel(blocks) {
401
351
  resetEditorBlocks(blocks, {
402
352
  __unstableShouldCreateUndoLevel: false
403
353
  });
404
354
  },
405
-
406
355
  switchMode(mode) {
407
356
  switchEditorMode(mode);
408
357
  },
409
-
410
358
  replaceBlock
411
359
  };
412
360
  })])(NativeEditorProvider);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/index.native.js"],"names":["postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","NativeEditorProvider","Component","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","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","NEW_BLOCK_TYPES","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","RNReactNativeGutenbergBridge","editorDidMount","mode","hasChanges","raw","content","contentInfo","characterCount","wordCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","supportSection","ComposedNativeProvider","select","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","editorStore","getEditorMode","editPostStore","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","blockEditorStore","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","updateSettings","switchEditorMode","coreStore","noticesStore","__unstableShouldCreateUndoLevel"],"mappings":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AE;AAAE9F,QAAAA;AAAF,OAAF,CAAR;AACA,KARK;;AASNrB,IAAAA,oBATM;;AAUN0F,IAAAA,iCAAiC,CAAEtG,MAAF,EAAW;AAC3CgI,MAAAA,iBAAiB,CAAEhI,MAAF,EAAU;AAC1BqI,QAAAA,+BAA+B,EAAE;AADP,OAAV,CAAjB;AAGA,KAdK;;AAeN5B,IAAAA,UAAU,CAAEb,IAAF,EAAS;AAClBsC,MAAAA,gBAAgB,CAAEtC,IAAF,CAAhB;AACA,KAjBK;;AAkBNY,IAAAA;AAlBM,GAAP;AAoBA,CA7BD,CAhCuC,CAAT,EA8D1BnG,oBA9D0B,CAA/B;;eAgEewG,sB","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":["_element","require","_memize","_interopRequireDefault","_reactNativeSafeAreaContext","_reactNativeBridge","_interopRequireWildcard","_wordcount","_blocks","_data","_compose","_hooks","_blockEditor","_components","_blockLibrary","_editor","_notices","_coreData","_editPost","_index","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","NativeEditorProvider","Component","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","getEditorSettings","memize","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","subscribeParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","subscribeParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","subscribeSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","subscribeUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","subscribeReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","subscribeMediaAppend","blockName","mediaType","newBlock","createBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","subscribeUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","subscribeUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","subscribeShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","subscribeShowEditorHelp","setState","requestBlockTypeImpressions","storedImpressions","impressions","NEW_BLOCK_TYPES","storedImpressionKeys","keys","storedImpressionsCurrent","every","newKey","includes","setBlockTypeImpressions","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","getGlobalStyles","getColorsAndGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","getUnregisteredTypeHandlerName","unsupportedBlockNames","filter","block","attributes","originalName","RNReactNativeGutenbergBridge","editorDidMount","mode","applyFilters","serialize","hasChanges","raw","content","contentInfo","characterCount","wordCount","paragraphCount","provideToNative_Html","parsed","parse","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","createElement","Fragment","SafeAreaProvider","EditorHelpTopics","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","compose","withSelect","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","editorStore","getEditorMode","editPostStore","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","blockEditorStore","colors","gradients","selectedBlockClientId","withDispatch","dispatch","editPost","resetEditorBlocks","updateSettings","switchEditorMode","coreStore","noticesStore","__unstableShouldCreateUndoLevel","exports","ExperimentalEditorProvider","_default"],"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":";;;;;;;AAuBA,IAAAA,QAAA,GAAAC,OAAA;AApBA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAKA,IAAAI,kBAAA,GAAAC,uBAAA,CAAAL,OAAA;AAeA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAMA,IAAAQ,KAAA,GAAAR,OAAA;A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AACF,CAAE,CAAC,EACH,IAAAK,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC,QAAQ;IAAEC,iBAAiB;IAAExI;EAAqB,CAAC,GAC1DsI,QAAQ,CAAEX,aAAY,CAAC;EACxB,MAAM;IAAEc,cAAc;IAAEtG,WAAW;IAAEgE;EAAa,CAAC,GAClDmC,QAAQ,CAAEL,kBAAiB,CAAC;EAC7B,MAAM;IAAES;EAAiB,CAAC,GAAGJ,QAAQ,CAAET,eAAc,CAAC;EACtD,MAAM;IAAE1I,WAAW;IAAEC;EAAqB,CAAC,GAAGkJ,QAAQ,CAAEK,eAAU,CAAC;EACnE,MAAM;IAAE3F;EAAoB,CAAC,GAAGsF,QAAQ,CAAEM,cAAa,CAAC;EAExD,OAAO;IACN3I,yBAAyB,EAAEwI,cAAc;IACzCzI,oBAAoB;IACpBb,WAAW;IACXgD,WAAW;IACXa,mBAAmB;IACnBpC,SAASA,CAAEC,KAAK,EAAG;MAClB0H,QAAQ,CAAE;QAAE1H;MAAM,CAAE,CAAC;IACtB,CAAC;IACDzB,oBAAoB;IACpB6G,iCAAiCA,CAAEzH,MAAM,EAAG;MAC3CgK,iBAAiB,CAAEhK,MAAM,EAAE;QAC1BqK,+BAA+B,EAAE;MAClC,CAAE,CAAC;IACJ,CAAC;IACDzC,UAAUA,CAAEhB,IAAI,EAAG;MAClBsD,gBAAgB,CAAEtD,IAAK,CAAC;IACzB,CAAC;IACDe;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEtH,oBAAqB,CAAC;AAACiK,OAAA,CAAAC,0BAAA,GAAA/B,sBAAA;AAAA,IAAAgC,QAAA,GAEbhC,sBAAsB;AAAA8B,OAAA,CAAA5L,OAAA,GAAA8L,QAAA"}
@@ -1,26 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _data = require("@wordpress/data");
13
-
14
10
  var _coreData = require("@wordpress/core-data");
15
-
16
11
  var _i18n = require("@wordpress/i18n");
17
-
18
12
  var _mediaCategories = _interopRequireDefault(require("../media-categories"));
19
-
20
13
  var _utils = require("../../utils");
21
-
22
14
  var _store = require("../../store");
23
-
24
15
  /**
25
16
  * WordPress dependencies
26
17
  */
@@ -28,8 +19,10 @@ var _store = require("../../store");
28
19
  /**
29
20
  * Internal dependencies
30
21
  */
22
+
31
23
  const EMPTY_BLOCKS_LIST = [];
32
24
  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'];
25
+
33
26
  /**
34
27
  * React hook used to compute the block editor settings to use for the post editor.
35
28
  *
@@ -38,10 +31,8 @@ const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDi
38
31
  *
39
32
  * @return {Object} Block Editor Settings.
40
33
  */
41
-
42
34
  function useBlockEditorSettings(settings, hasTemplate) {
43
35
  var _settings$__experimen, _settings$__experimen2;
44
-
45
36
  const {
46
37
  reusableBlocks,
47
38
  hasUploadPermissions,
@@ -51,7 +42,6 @@ function useBlockEditorSettings(settings, hasTemplate) {
51
42
  postType
52
43
  } = (0, _data.useSelect)(select => {
53
44
  var _canUser;
54
-
55
45
  const {
56
46
  canUserUseUnfilteredHTML,
57
47
  getCurrentPostType
@@ -74,10 +64,11 @@ function useBlockEditorSettings(settings, hasTemplate) {
74
64
  postType: getCurrentPostType()
75
65
  };
76
66
  }, []);
77
- const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : // WP 6.0
67
+ const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen :
68
+ // WP 6.0
78
69
  settings.__experimentalBlockPatterns; // WP 5.9
79
-
80
- const settingsBlockPatternCategories = (_settings$__experimen2 = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen2 !== void 0 ? _settings$__experimen2 : // WP 6.0
70
+ const settingsBlockPatternCategories = (_settings$__experimen2 = settings.__experimentalAdditionalBlockPatternCategories) !== null && _settings$__experimen2 !== void 0 ? _settings$__experimen2 :
71
+ // WP 6.0
81
72
  settings.__experimentalBlockPatternCategories; // WP 5.9
82
73
 
83
74
  const {
@@ -99,6 +90,7 @@ function useBlockEditorSettings(settings, hasTemplate) {
99
90
  const {
100
91
  saveEntityRecord
101
92
  } = (0, _data.useDispatch)(_coreData.store);
93
+
102
94
  /**
103
95
  * Creates a Post entity.
104
96
  * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.
@@ -106,18 +98,16 @@ function useBlockEditorSettings(settings, hasTemplate) {
106
98
  * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.
107
99
  * @return {Object} the post type object that was created.
108
100
  */
109
-
110
101
  const createPageEntity = options => {
111
102
  if (!userCanCreatePages) {
112
103
  return Promise.reject({
113
104
  message: (0, _i18n.__)('You do not have permission to create Pages.')
114
105
  });
115
106
  }
116
-
117
107
  return saveEntityRecord('postType', 'page', options);
118
108
  };
119
-
120
- return (0, _element.useMemo)(() => ({ ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
109
+ return (0, _element.useMemo)(() => ({
110
+ ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
121
111
  mediaUpload: hasUploadPermissions ? _utils.mediaUpload : undefined,
122
112
  __experimentalReusableBlocks: reusableBlocks,
123
113
  __experimentalBlockPatterns: blockPatterns,
@@ -134,7 +124,6 @@ function useBlockEditorSettings(settings, hasTemplate) {
134
124
  __experimentalPreferPatternsOnRoot: hasTemplate
135
125
  }), [settings, hasUploadPermissions, reusableBlocks, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, hasTemplate, userCanCreatePages, pageOnFront]);
136
126
  }
137
-
138
127
  var _default = useBlockEditorSettings;
139
128
  exports.default = _default;
140
129
  //# sourceMappingURL=use-block-editor-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"names":["EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","hasTemplate","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","postType","select","canUserUseUnfilteredHTML","getCurrentPostType","editorStore","isWeb","Platform","OS","canUser","getEntityRecord","coreStore","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","mediaUpload","__experimentalReusableBlocks","__experimentalFetchLinkSuggestions","search","searchOptions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;AAKA,MAAMA,iBAAiB,GAAG,EAA1B;AAEA,MAAMC,qBAAqB,GAAG,CAC7B,8BAD6B,EAE7B,kCAF6B,EAG7B,wBAH6B,EAI7B,sCAJ6B,EAK7B,wCAL6B,EAM7B,mCAN6B,EAO7B,kCAP6B,EAQ7B,WAR6B,EAS7B,mBAT6B,EAU7B,oBAV6B,EAW7B,kBAX6B,EAY7B,iBAZ6B,EAa7B,eAb6B,EAc7B,cAd6B,EAe7B,qBAf6B,EAgB7B,oBAhB6B,EAiB7B,QAjB6B,EAkB7B,qBAlB6B,EAmB7B,wBAnB6B,EAoB7B,2BApB6B,EAqB7B,wBArB6B,EAsB7B,qBAtB6B,EAuB7B,wBAvB6B,EAwB7B,qBAxB6B,EAyB7B,mBAzB6B,EA0B7B,8BA1B6B,EA2B7B,WA3B6B,EA4B7B,iBA5B6B,EA6B7B,WA7B6B,EA8B7B,WA9B6B,EA+B7B,iBA/B6B,EAgC7B,iBAhC6B,EAiC7B,kBAjC6B,EAkC7B,mBAlC6B,EAmC7B,kBAnC6B,EAoC7B,iBApC6B,EAqC7B,cArC6B,EAsC7B,YAtC6B,EAuC7B,OAvC6B,EAwC7B,sBAxC6B,E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,MAAF,EAAUC,aAAV,KACnC,kDAAsBD,MAAtB,EAA8BC,aAA9B,EAA6C7D,QAA7C,CAXM;AAYP8D,IAAAA,uBAAuB,EAAvBA,wBAZO;AAaPC,IAAAA,8BAA8B,EAAEC,oCAbzB;AAcPC,IAAAA,sCAAsC,EAAE7D,oBAdjC;AAeP8D,IAAAA,kBAAkB,EAAEpB,IAfb;AAgBPqB,IAAAA,WAAW,EAAElE,WAhBN;AAiBPmE,IAAAA,8BAA8B,EAAEpB,gBAjBzB;AAkBPqB,IAAAA,gCAAgC,EAAEhE,kBAlB3B;AAmBPC,IAAAA,WAnBO;AAoBPgE,IAAAA,kCAAkC,EAAErE;AApB7B,GAAR,CADM,EAuBN,CACCD,QADD,EAECG,oBAFD,EAGCD,cAHD,EAIC+B,aAJD,EAKCY,sBALD,EAMCzC,oBAND,EAOC0C,IAPD,EAQC7C,WARD,EASCI,kBATD,EAUCC,WAVD,CAvBM,CAAP;AAoCA;;eAEcP,sB","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":["_element","require","_data","_coreData","_i18n","_mediaCategories","_interopRequireDefault","_utils","_store","EMPTY_BLOCKS_LIST","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","hasTemplate","_settings$__experimen","_settings$__experimen2","reusableBlocks","hasUploadPermissions","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","postType","useSelect","select","_canUser","canUserUseUnfilteredHTML","getCurrentPostType","editorStore","isWeb","Platform","OS","canUser","getEntityRecord","coreStore","siteSettings","undefined","getEntityRecords","per_page","page_on_front","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","restBlockPatterns","restBlockPatternCategories","getBlockPatterns","getBlockPatternCategories","blockPatterns","useMemo","filter","x","index","arr","findIndex","y","name","postTypes","Array","isArray","includes","blockPatternCategories","undo","useDispatch","saveEntityRecord","createPageEntity","options","Promise","reject","message","__","Object","fromEntries","entries","key","mediaUpload","__experimentalReusableBlocks","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","inserterMediaCategories","__experimentalFetchRichUrlData","fetchUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;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