@wordpress/editor 13.16.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 (549) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/autocompleters/index.js +0 -2
  3. package/build/components/autocompleters/index.js.map +1 -1
  4. package/build/components/autocompleters/user.js +2 -9
  5. package/build/components/autocompleters/user.js.map +1 -1
  6. package/build/components/autosave-monitor/index.js +0 -24
  7. package/build/components/autosave-monitor/index.js.map +1 -1
  8. package/build/components/character-count/index.js +1 -4
  9. package/build/components/character-count/index.js.map +1 -1
  10. package/build/components/deprecated.js +1 -11
  11. package/build/components/deprecated.js.map +1 -1
  12. package/build/components/deprecated.native.js +0 -1
  13. package/build/components/deprecated.native.js.map +1 -1
  14. package/build/components/document-outline/check.js +1 -7
  15. package/build/components/document-outline/check.js.map +1 -1
  16. package/build/components/document-outline/index.js +7 -24
  17. package/build/components/document-outline/index.js.map +1 -1
  18. package/build/components/document-outline/item.js +1 -5
  19. package/build/components/document-outline/item.js.map +1 -1
  20. package/build/components/editor-help/add-blocks.native.js +1 -8
  21. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  22. package/build/components/editor-help/customize-blocks.native.js +1 -8
  23. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  24. package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -13
  25. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  26. package/build/components/editor-help/help-get-support-button.native.js +1 -7
  27. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  28. package/build/components/editor-help/help-section-title.native.js +1 -7
  29. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  30. package/build/components/editor-help/help-topic-row.native.js +1 -8
  31. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  32. package/build/components/editor-help/icon-move-blocks.native.js +0 -4
  33. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/index.native.js +8 -29
  35. package/build/components/editor-help/index.native.js.map +1 -1
  36. package/build/components/editor-help/intro-to-blocks.native.js +1 -9
  37. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  38. package/build/components/editor-help/move-blocks.native.js +1 -8
  39. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  40. package/build/components/editor-help/remove-blocks.native.js +1 -8
  41. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/view-sections.native.js +1 -12
  43. package/build/components/editor-help/view-sections.native.js.map +1 -1
  44. package/build/components/editor-history/redo.js +6 -14
  45. package/build/components/editor-history/redo.js.map +1 -1
  46. package/build/components/editor-history/undo.js +6 -14
  47. package/build/components/editor-history/undo.js.map +1 -1
  48. package/build/components/editor-notices/index.js +1 -10
  49. package/build/components/editor-notices/index.js.map +1 -1
  50. package/build/components/editor-snackbars/index.js +1 -5
  51. package/build/components/editor-snackbars/index.js.map +1 -1
  52. package/build/components/entities-saved-states/entity-record-item.js +3 -10
  53. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  54. package/build/components/entities-saved-states/entity-type-list.js +3 -15
  55. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  56. package/build/components/entities-saved-states/hooks/use-is-dirty.js +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 +1 -10
  91. package/build/components/post-comments/index.js.map +1 -1
  92. package/build/components/post-excerpt/check.js +6 -8
  93. package/build/components/post-excerpt/check.js.map +1 -1
  94. package/build/components/post-excerpt/index.js +1 -7
  95. package/build/components/post-excerpt/index.js.map +1 -1
  96. package/build/components/post-featured-image/check.js +6 -9
  97. package/build/components/post-featured-image/check.js.map +1 -1
  98. package/build/components/post-featured-image/index.js +13 -42
  99. package/build/components/post-featured-image/index.js.map +1 -1
  100. package/build/components/post-format/check.js +9 -18
  101. package/build/components/post-format/check.js.map +1 -1
  102. package/build/components/post-format/index.js +2 -20
  103. package/build/components/post-format/index.js.map +1 -1
  104. package/build/components/post-last-revision/check.js +15 -22
  105. package/build/components/post-last-revision/check.js.map +1 -1
  106. package/build/components/post-last-revision/index.js +17 -28
  107. package/build/components/post-last-revision/index.js.map +1 -1
  108. package/build/components/post-locked-modal/index.js +8 -28
  109. package/build/components/post-locked-modal/index.js.map +1 -1
  110. package/build/components/post-pending-status/check.js +16 -24
  111. package/build/components/post-pending-status/check.js.map +1 -1
  112. package/build/components/post-pending-status/index.js +10 -28
  113. package/build/components/post-pending-status/index.js.map +1 -1
  114. package/build/components/post-pingbacks/index.js +1 -10
  115. package/build/components/post-pingbacks/index.js.map +1 -1
  116. package/build/components/post-preview-button/index.js +11 -22
  117. package/build/components/post-preview-button/index.js.map +1 -1
  118. package/build/components/post-publish-button/index.js +6 -32
  119. package/build/components/post-publish-button/index.js.map +1 -1
  120. package/build/components/post-publish-button/label.js +1 -10
  121. package/build/components/post-publish-button/label.js.map +1 -1
  122. package/build/components/post-publish-panel/index.js +1 -22
  123. package/build/components/post-publish-panel/index.js.map +1 -1
  124. package/build/components/post-publish-panel/maybe-category-panel.js +4 -14
  125. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  126. package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -18
  127. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  128. package/build/components/post-publish-panel/maybe-tags-panel.js +2 -17
  129. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  130. package/build/components/post-publish-panel/maybe-upload-media.js +1 -18
  131. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  132. package/build/components/post-publish-panel/postpublish.js +3 -27
  133. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  134. package/build/components/post-publish-panel/prepublish.js +1 -26
  135. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  136. package/build/components/post-saved-state/index.js +12 -29
  137. package/build/components/post-saved-state/index.js.map +1 -1
  138. package/build/components/post-schedule/check.js +1 -8
  139. package/build/components/post-schedule/check.js.map +1 -1
  140. package/build/components/post-schedule/index.js +7 -13
  141. package/build/components/post-schedule/index.js.map +1 -1
  142. package/build/components/post-schedule/label.js +18 -29
  143. package/build/components/post-schedule/label.js.map +1 -1
  144. package/build/components/post-slug/check.js +1 -4
  145. package/build/components/post-slug/check.js.map +1 -1
  146. package/build/components/post-slug/index.js +1 -19
  147. package/build/components/post-slug/index.js.map +1 -1
  148. package/build/components/post-sticky/check.js +1 -8
  149. package/build/components/post-sticky/check.js.map +1 -1
  150. package/build/components/post-sticky/index.js +1 -12
  151. package/build/components/post-sticky/index.js.map +1 -1
  152. package/build/components/post-switch-to-draft-button/index.js +1 -14
  153. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  154. package/build/components/post-sync-status/index.js +5 -18
  155. package/build/components/post-sync-status/index.js.map +1 -1
  156. package/build/components/post-taxonomies/check.js +1 -9
  157. package/build/components/post-taxonomies/check.js.map +1 -1
  158. package/build/components/post-taxonomies/flat-term-selector.js +15 -50
  159. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  160. package/build/components/post-taxonomies/hierarchical-term-selector.js +27 -79
  161. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  162. package/build/components/post-taxonomies/index.js +3 -13
  163. package/build/components/post-taxonomies/index.js.map +1 -1
  164. package/build/components/post-taxonomies/most-used-terms.js +1 -9
  165. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  166. package/build/components/post-template/index.js +1 -11
  167. package/build/components/post-template/index.js.map +1 -1
  168. package/build/components/post-text-editor/index.js +3 -17
  169. package/build/components/post-text-editor/index.js.map +1 -1
  170. package/build/components/post-title/index.js +14 -46
  171. package/build/components/post-title/index.js.map +1 -1
  172. package/build/components/post-title/index.native.js +7 -44
  173. package/build/components/post-title/index.native.js.map +1 -1
  174. package/build/components/post-trash/check.js +1 -7
  175. package/build/components/post-trash/check.js.map +1 -1
  176. package/build/components/post-trash/index.js +1 -8
  177. package/build/components/post-trash/index.js.map +1 -1
  178. package/build/components/post-type-support-check/index.js +0 -9
  179. package/build/components/post-type-support-check/index.js.map +1 -1
  180. package/build/components/post-url/check.js +1 -12
  181. package/build/components/post-url/check.js.map +1 -1
  182. package/build/components/post-url/index.js +3 -15
  183. package/build/components/post-url/index.js.map +1 -1
  184. package/build/components/post-url/label.js +1 -5
  185. package/build/components/post-url/label.js.map +1 -1
  186. package/build/components/post-visibility/check.js +1 -7
  187. package/build/components/post-visibility/check.js.map +1 -1
  188. package/build/components/post-visibility/index.js +1 -17
  189. package/build/components/post-visibility/index.js.map +1 -1
  190. package/build/components/post-visibility/label.js +1 -5
  191. package/build/components/post-visibility/label.js.map +1 -1
  192. package/build/components/post-visibility/utils.js +1 -2
  193. package/build/components/post-visibility/utils.js.map +1 -1
  194. package/build/components/provider/index.js +13 -27
  195. package/build/components/provider/index.js.map +1 -1
  196. package/build/components/provider/index.native.js +18 -70
  197. package/build/components/provider/index.native.js.map +1 -1
  198. package/build/components/provider/use-block-editor-settings.js +9 -20
  199. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  200. package/build/components/provider/use-block-editor-settings.native.js +5 -11
  201. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  202. package/build/components/provider/with-registry-provider.js +5 -12
  203. package/build/components/provider/with-registry-provider.js.map +1 -1
  204. package/build/components/table-of-contents/index.js +4 -14
  205. package/build/components/table-of-contents/index.js.map +1 -1
  206. package/build/components/table-of-contents/panel.js +1 -13
  207. package/build/components/table-of-contents/panel.js.map +1 -1
  208. package/build/components/template-validation-notice/index.js +3 -12
  209. package/build/components/template-validation-notice/index.js.map +1 -1
  210. package/build/components/theme-support-check/index.js +3 -12
  211. package/build/components/theme-support-check/index.js.map +1 -1
  212. package/build/components/time-to-read/index.js +2 -10
  213. package/build/components/time-to-read/index.js.map +1 -1
  214. package/build/components/unsaved-changes-warning/index.js +21 -35
  215. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  216. package/build/components/word-count/index.js +2 -7
  217. package/build/components/word-count/index.js.map +1 -1
  218. package/build/hooks/custom-sources-backwards-compatibility.js +7 -18
  219. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  220. package/build/hooks/default-autocompleters.js +3 -4
  221. package/build/hooks/default-autocompleters.js.map +1 -1
  222. package/build/hooks/index.js +0 -1
  223. package/build/hooks/index.js.map +1 -1
  224. package/build/hooks/index.native.js.map +1 -1
  225. package/build/index.js +0 -9
  226. package/build/index.js.map +1 -1
  227. package/build/index.native.js +0 -11
  228. package/build/index.native.js.map +1 -1
  229. package/build/lock-unlock.js +1 -2
  230. package/build/lock-unlock.js.map +1 -1
  231. package/build/private-apis.js +1 -4
  232. package/build/private-apis.js.map +1 -1
  233. package/build/store/actions.js +60 -129
  234. package/build/store/actions.js.map +1 -1
  235. package/build/store/actions.native.js +1 -8
  236. package/build/store/actions.native.js.map +1 -1
  237. package/build/store/constants.js +1 -2
  238. package/build/store/constants.js.map +1 -1
  239. package/build/store/defaults.js +2 -3
  240. package/build/store/defaults.js.map +1 -1
  241. package/build/store/index.js +3 -11
  242. package/build/store/index.js.map +1 -1
  243. package/build/store/local-autosave.js +0 -4
  244. package/build/store/local-autosave.js.map +1 -1
  245. package/build/store/reducer.js +19 -49
  246. package/build/store/reducer.js.map +1 -1
  247. package/build/store/reducer.native.js +3 -17
  248. package/build/store/reducer.native.js.map +1 -1
  249. package/build/store/selectors.js +169 -295
  250. package/build/store/selectors.js.map +1 -1
  251. package/build/store/selectors.native.js +4 -11
  252. package/build/store/selectors.native.js.map +1 -1
  253. package/build/store/utils/notice-builder.js +13 -24
  254. package/build/store/utils/notice-builder.js.map +1 -1
  255. package/build/utils/get-template-part-icon.js +0 -3
  256. package/build/utils/get-template-part-icon.js.map +1 -1
  257. package/build/utils/index.js +0 -4
  258. package/build/utils/index.js.map +1 -1
  259. package/build/utils/index.native.js +0 -2
  260. package/build/utils/index.native.js.map +1 -1
  261. package/build/utils/media-upload/index.js +2 -6
  262. package/build/utils/media-upload/index.js.map +1 -1
  263. package/build/utils/media-upload/index.native.js +0 -1
  264. package/build/utils/media-upload/index.native.js.map +1 -1
  265. package/build/utils/terms.js +8 -18
  266. package/build/utils/terms.js.map +1 -1
  267. package/build/utils/url.js +0 -4
  268. package/build/utils/url.js.map +1 -1
  269. package/build-module/components/autocompleters/index.js.map +1 -1
  270. package/build-module/components/autocompleters/user.js +2 -5
  271. package/build-module/components/autocompleters/user.js.map +1 -1
  272. package/build-module/components/autosave-monitor/index.js +2 -17
  273. package/build-module/components/autosave-monitor/index.js.map +1 -1
  274. package/build-module/components/character-count/index.js +1 -1
  275. package/build-module/components/character-count/index.js.map +1 -1
  276. package/build-module/components/deprecated.js +0 -4
  277. package/build-module/components/deprecated.js.map +1 -1
  278. package/build-module/components/deprecated.native.js +0 -1
  279. package/build-module/components/deprecated.native.js.map +1 -1
  280. package/build-module/components/document-outline/check.js +0 -4
  281. package/build-module/components/document-outline/check.js.map +1 -1
  282. package/build-module/components/document-outline/index.js +9 -13
  283. package/build-module/components/document-outline/index.js.map +1 -1
  284. package/build-module/components/document-outline/item.js +0 -3
  285. package/build-module/components/document-outline/item.js.map +1 -1
  286. package/build-module/components/editor-help/add-blocks.native.js +2 -5
  287. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  288. package/build-module/components/editor-help/customize-blocks.native.js +2 -5
  289. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  290. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +6 -8
  291. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  292. package/build-module/components/editor-help/help-get-support-button.native.js +2 -5
  293. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  294. package/build-module/components/editor-help/help-section-title.native.js +2 -5
  295. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  296. package/build-module/components/editor-help/help-topic-row.native.js +1 -6
  297. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  298. package/build-module/components/editor-help/icon-move-blocks.native.js +0 -1
  299. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  300. package/build-module/components/editor-help/index.native.js +9 -9
  301. package/build-module/components/editor-help/index.native.js.map +1 -1
  302. package/build-module/components/editor-help/intro-to-blocks.native.js +2 -5
  303. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  304. package/build-module/components/editor-help/move-blocks.native.js +2 -5
  305. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  306. package/build-module/components/editor-help/remove-blocks.native.js +2 -5
  307. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  308. package/build-module/components/editor-help/view-sections.native.js +2 -4
  309. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  310. package/build-module/components/editor-history/redo.js +6 -8
  311. package/build-module/components/editor-history/redo.js.map +1 -1
  312. package/build-module/components/editor-history/undo.js +6 -8
  313. package/build-module/components/editor-history/undo.js.map +1 -1
  314. package/build-module/components/editor-notices/index.js +1 -2
  315. package/build-module/components/editor-notices/index.js.map +1 -1
  316. package/build-module/components/editor-snackbars/index.js +0 -1
  317. package/build-module/components/editor-snackbars/index.js.map +1 -1
  318. package/build-module/components/entities-saved-states/entity-record-item.js +3 -4
  319. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  320. package/build-module/components/entities-saved-states/entity-type-list.js +3 -10
  321. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  322. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +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 +1 -7
  357. package/build-module/components/post-comments/index.js.map +1 -1
  358. package/build-module/components/post-excerpt/check.js +5 -6
  359. package/build-module/components/post-excerpt/check.js.map +1 -1
  360. package/build-module/components/post-excerpt/index.js +1 -4
  361. package/build-module/components/post-excerpt/index.js.map +1 -1
  362. package/build-module/components/post-featured-image/check.js +5 -6
  363. package/build-module/components/post-featured-image/check.js.map +1 -1
  364. package/build-module/components/post-featured-image/index.js +13 -31
  365. package/build-module/components/post-featured-image/index.js.map +1 -1
  366. package/build-module/components/post-format/check.js +10 -15
  367. package/build-module/components/post-format/check.js.map +1 -1
  368. package/build-module/components/post-format/index.js +4 -12
  369. package/build-module/components/post-format/index.js.map +1 -1
  370. package/build-module/components/post-last-revision/check.js +17 -17
  371. package/build-module/components/post-last-revision/check.js.map +1 -1
  372. package/build-module/components/post-last-revision/index.js +18 -21
  373. package/build-module/components/post-last-revision/index.js.map +1 -1
  374. package/build-module/components/post-locked-modal/index.js +8 -22
  375. package/build-module/components/post-locked-modal/index.js.map +1 -1
  376. package/build-module/components/post-pending-status/check.js +17 -20
  377. package/build-module/components/post-pending-status/check.js.map +1 -1
  378. package/build-module/components/post-pending-status/index.js +11 -20
  379. package/build-module/components/post-pending-status/index.js.map +1 -1
  380. package/build-module/components/post-pingbacks/index.js +1 -7
  381. package/build-module/components/post-pingbacks/index.js.map +1 -1
  382. package/build-module/components/post-preview-button/index.js +11 -17
  383. package/build-module/components/post-preview-button/index.js.map +1 -1
  384. package/build-module/components/post-publish-button/index.js +7 -23
  385. package/build-module/components/post-publish-button/index.js.map +1 -1
  386. package/build-module/components/post-publish-button/label.js +1 -4
  387. package/build-module/components/post-publish-button/label.js.map +1 -1
  388. package/build-module/components/post-publish-panel/index.js +1 -8
  389. package/build-module/components/post-publish-panel/index.js.map +1 -1
  390. package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -8
  391. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  392. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -12
  393. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  394. package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -9
  395. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  396. package/build-module/components/post-publish-panel/maybe-upload-media.js +1 -12
  397. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  398. package/build-module/components/post-publish-panel/postpublish.js +3 -16
  399. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  400. package/build-module/components/post-publish-panel/prepublish.js +1 -10
  401. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  402. package/build-module/components/post-saved-state/index.js +15 -23
  403. package/build-module/components/post-saved-state/index.js.map +1 -1
  404. package/build-module/components/post-schedule/check.js +1 -3
  405. package/build-module/components/post-schedule/check.js.map +1 -1
  406. package/build-module/components/post-schedule/index.js +8 -8
  407. package/build-module/components/post-schedule/index.js.map +1 -1
  408. package/build-module/components/post-schedule/label.js +18 -22
  409. package/build-module/components/post-schedule/label.js.map +1 -1
  410. package/build-module/components/post-slug/check.js +0 -1
  411. package/build-module/components/post-slug/check.js.map +1 -1
  412. package/build-module/components/post-slug/index.js +1 -8
  413. package/build-module/components/post-slug/index.js.map +1 -1
  414. package/build-module/components/post-sticky/check.js +1 -3
  415. package/build-module/components/post-sticky/check.js.map +1 -1
  416. package/build-module/components/post-sticky/index.js +1 -3
  417. package/build-module/components/post-sticky/index.js.map +1 -1
  418. package/build-module/components/post-switch-to-draft-button/index.js +1 -9
  419. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  420. package/build-module/components/post-sync-status/index.js +5 -11
  421. package/build-module/components/post-sync-status/index.js.map +1 -1
  422. package/build-module/components/post-taxonomies/check.js +1 -3
  423. package/build-module/components/post-taxonomies/check.js.map +1 -1
  424. package/build-module/components/post-taxonomies/flat-term-selector.js +17 -39
  425. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  426. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +29 -66
  427. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  428. package/build-module/components/post-taxonomies/index.js +3 -5
  429. package/build-module/components/post-taxonomies/index.js.map +1 -1
  430. package/build-module/components/post-taxonomies/most-used-terms.js +1 -4
  431. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  432. package/build-module/components/post-template/index.js +1 -5
  433. package/build-module/components/post-template/index.js.map +1 -1
  434. package/build-module/components/post-text-editor/index.js +4 -9
  435. package/build-module/components/post-text-editor/index.js.map +1 -1
  436. package/build-module/components/post-title/index.js +17 -35
  437. package/build-module/components/post-title/index.js.map +1 -1
  438. package/build-module/components/post-title/index.native.js +8 -33
  439. package/build-module/components/post-title/index.native.js.map +1 -1
  440. package/build-module/components/post-trash/check.js +1 -4
  441. package/build-module/components/post-trash/check.js.map +1 -1
  442. package/build-module/components/post-trash/index.js +1 -4
  443. package/build-module/components/post-trash/index.js.map +1 -1
  444. package/build-module/components/post-type-support-check/index.js +3 -6
  445. package/build-module/components/post-type-support-check/index.js.map +1 -1
  446. package/build-module/components/post-url/check.js +1 -9
  447. package/build-module/components/post-url/check.js.map +1 -1
  448. package/build-module/components/post-url/index.js +3 -8
  449. package/build-module/components/post-url/index.js.map +1 -1
  450. package/build-module/components/post-url/label.js +1 -1
  451. package/build-module/components/post-url/label.js.map +1 -1
  452. package/build-module/components/post-visibility/check.js +1 -2
  453. package/build-module/components/post-visibility/check.js.map +1 -1
  454. package/build-module/components/post-visibility/index.js +1 -10
  455. package/build-module/components/post-visibility/index.js.map +1 -1
  456. package/build-module/components/post-visibility/label.js +1 -1
  457. package/build-module/components/post-visibility/label.js.map +1 -1
  458. package/build-module/components/post-visibility/utils.js.map +1 -1
  459. package/build-module/components/provider/index.js +13 -14
  460. package/build-module/components/provider/index.js.map +1 -1
  461. package/build-module/components/provider/index.native.js +21 -52
  462. package/build-module/components/provider/index.native.js.map +1 -1
  463. package/build-module/components/provider/use-block-editor-settings.js +9 -12
  464. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  465. package/build-module/components/provider/use-block-editor-settings.native.js +5 -5
  466. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  467. package/build-module/components/provider/with-registry-provider.js +5 -8
  468. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  469. package/build-module/components/table-of-contents/index.js +4 -7
  470. package/build-module/components/table-of-contents/index.js.map +1 -1
  471. package/build-module/components/table-of-contents/panel.js +1 -5
  472. package/build-module/components/table-of-contents/panel.js.map +1 -1
  473. package/build-module/components/template-validation-notice/index.js +2 -6
  474. package/build-module/components/template-validation-notice/index.js.map +1 -1
  475. package/build-module/components/theme-support-check/index.js +3 -7
  476. package/build-module/components/theme-support-check/index.js.map +1 -1
  477. package/build-module/components/time-to-read/index.js +4 -7
  478. package/build-module/components/time-to-read/index.js.map +1 -1
  479. package/build-module/components/unsaved-changes-warning/index.js +22 -31
  480. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  481. package/build-module/components/word-count/index.js +2 -4
  482. package/build-module/components/word-count/index.js.map +1 -1
  483. package/build-module/hooks/custom-sources-backwards-compatibility.js +9 -15
  484. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  485. package/build-module/hooks/default-autocompleters.js +3 -4
  486. package/build-module/hooks/default-autocompleters.js.map +1 -1
  487. package/build-module/hooks/index.js.map +1 -1
  488. package/build-module/hooks/index.native.js.map +1 -1
  489. package/build-module/index.js +1 -1
  490. package/build-module/index.js.map +1 -1
  491. package/build-module/index.native.js +1 -1
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/lock-unlock.js.map +1 -1
  494. package/build-module/private-apis.js.map +1 -1
  495. package/build-module/store/actions.js +62 -84
  496. package/build-module/store/actions.js.map +1 -1
  497. package/build-module/store/actions.native.js +2 -2
  498. package/build-module/store/actions.native.js.map +1 -1
  499. package/build-module/store/constants.js +1 -1
  500. package/build-module/store/constants.js.map +1 -1
  501. package/build-module/store/defaults.js +3 -2
  502. package/build-module/store/defaults.js.map +1 -1
  503. package/build-module/store/index.js +5 -4
  504. package/build-module/store/index.js.map +1 -1
  505. package/build-module/store/local-autosave.js +0 -1
  506. package/build-module/store/local-autosave.js.map +1 -1
  507. package/build-module/store/reducer.js +21 -33
  508. package/build-module/store/reducer.js.map +1 -1
  509. package/build-module/store/reducer.native.js +4 -10
  510. package/build-module/store/reducer.native.js.map +1 -1
  511. package/build-module/store/selectors.js +172 -222
  512. package/build-module/store/selectors.js.map +1 -1
  513. package/build-module/store/selectors.native.js +6 -8
  514. package/build-module/store/selectors.native.js.map +1 -1
  515. package/build-module/store/utils/notice-builder.js +15 -21
  516. package/build-module/store/utils/notice-builder.js.map +1 -1
  517. package/build-module/utils/get-template-part-icon.js +0 -2
  518. package/build-module/utils/get-template-part-icon.js.map +1 -1
  519. package/build-module/utils/index.js.map +1 -1
  520. package/build-module/utils/index.native.js.map +1 -1
  521. package/build-module/utils/media-upload/index.js +2 -4
  522. package/build-module/utils/media-upload/index.js.map +1 -1
  523. package/build-module/utils/media-upload/index.native.js.map +1 -1
  524. package/build-module/utils/terms.js +9 -11
  525. package/build-module/utils/terms.js.map +1 -1
  526. package/build-module/utils/url.js +1 -1
  527. package/build-module/utils/url.js.map +1 -1
  528. package/build-style/style-rtl.css +10 -17
  529. package/build-style/style.css +10 -17
  530. package/package.json +32 -31
  531. package/src/components/editor-help/index.native.js +1 -1
  532. package/src/components/editor-help/style.scss +5 -0
  533. package/src/components/page-attributes/order.js +15 -23
  534. package/src/components/page-attributes/test/order.js +46 -15
  535. package/src/components/post-excerpt/check.js +6 -2
  536. package/src/components/post-featured-image/check.js +4 -2
  537. package/src/components/post-format/check.js +16 -11
  538. package/src/components/post-last-revision/check.js +12 -14
  539. package/src/components/post-last-revision/index.js +12 -10
  540. package/src/components/post-last-revision/test/check.js +28 -16
  541. package/src/components/post-pending-status/check.js +13 -19
  542. package/src/components/post-pending-status/index.js +9 -14
  543. package/src/components/post-pending-status/test/check.js +32 -10
  544. package/src/components/post-publish-panel/style.scss +12 -25
  545. package/src/components/post-sync-status/style.scss +4 -1
  546. package/src/components/post-type-support-check/index.js +1 -1
  547. package/src/components/post-type-support-check/test/index.js +1 -1
  548. package/src/components/provider/index.js +3 -2
  549. package/src/components/unsaved-changes-warning/index.js +22 -27
@@ -3,10 +3,10 @@
3
3
  */
4
4
  import { compose } from '@wordpress/compose';
5
5
  import { withSelect } from '@wordpress/data';
6
+
6
7
  /**
7
8
  * Internal dependencies
8
9
  */
9
-
10
10
  import { store as editorStore } from '../../store';
11
11
  export function PostVisibilityCheck({
12
12
  hasPublishAction,
@@ -19,7 +19,6 @@ export function PostVisibilityCheck({
19
19
  }
20
20
  export default compose([withSelect(select => {
21
21
  var _getCurrentPost$_link;
22
-
23
22
  const {
24
23
  getCurrentPost,
25
24
  getCurrentPostType
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"names":["compose","withSelect","store","editorStore","PostVisibilityCheck","hasPublishAction","render","canEdit","select","getCurrentPost","getCurrentPostType","_links","postType"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,mBAAT,CAA8B;AAAEC,EAAAA,gBAAF;AAAoBC,EAAAA;AAApB,CAA9B,EAA6D;AACnE,QAAMC,OAAO,GAAGF,gBAAhB;AACA,SAAOC,MAAM,CAAE;AAAEC,IAAAA;AAAF,GAAF,CAAb;AACA;AAED,eAAeP,OAAO,CAAE,CACvBC,UAAU,CAAIO,MAAF,IAAc;AAAA;;AACzB,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAyCF,MAAM,CAAEL,WAAF,CAArD;AACA,SAAO;AACNE,IAAAA,gBAAgB,2BACfI,cAAc,GAAGE,MAAjB,GAA2B,mBAA3B,CADe,yEACqC,KAF/C;AAGNC,IAAAA,QAAQ,EAAEF,kBAAkB;AAHtB,GAAP;AAKA,CAPS,CADa,CAAF,CAAP,CASVN,mBATU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostVisibilityCheck( { hasPublishAction, render } ) {\n\tconst canEdit = hasPublishAction;\n\treturn render( { canEdit } );\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getCurrentPost, getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t} ),\n] )( PostVisibilityCheck );\n"]}
1
+ {"version":3,"names":["compose","withSelect","store","editorStore","PostVisibilityCheck","hasPublishAction","render","canEdit","select","_getCurrentPost$_link","getCurrentPost","getCurrentPostType","_links","postType"],"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostVisibilityCheck( { hasPublishAction, render } ) {\n\tconst canEdit = hasPublishAction;\n\treturn render( { canEdit } );\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getCurrentPost, getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t} ),\n] )( PostVisibilityCheck );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,iBAAiB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,OAAO,SAASC,mBAAmBA,CAAE;EAAEC,gBAAgB;EAAEC;AAAO,CAAC,EAAG;EACnE,MAAMC,OAAO,GAAGF,gBAAgB;EAChC,OAAOC,MAAM,CAAE;IAAEC;EAAQ,CAAE,CAAC;AAC7B;AAEA,eAAeP,OAAO,CAAE,CACvBC,UAAU,CAAIO,MAAM,IAAM;EAAA,IAAAC,qBAAA;EACzB,MAAM;IAAEC,cAAc;IAAEC;EAAmB,CAAC,GAAGH,MAAM,CAAEL,WAAY,CAAC;EACpE,OAAO;IACNE,gBAAgB,GAAAI,qBAAA,GACfC,cAAc,CAAC,CAAC,CAACE,MAAM,GAAI,mBAAmB,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;IAC1DI,QAAQ,EAAEF,kBAAkB,CAAC;EAC9B,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEP,mBAAoB,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -9,10 +8,10 @@ import { VisuallyHidden, __experimentalConfirmDialog as ConfirmDialog } from '@w
9
8
  import { useInstanceId } from '@wordpress/compose';
10
9
  import { useSelect, useDispatch } from '@wordpress/data';
11
10
  import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
11
+
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
-
16
15
  import { visibilityOptions } from './utils';
17
16
  import { store as editorStore } from '../../store';
18
17
  export default function PostVisibility({
@@ -34,7 +33,6 @@ export default function PostVisibility({
34
33
  } = useDispatch(editorStore);
35
34
  const [hasPassword, setHasPassword] = useState(!!password);
36
35
  const [showPrivateConfirmDialog, setShowPrivateConfirmDialog] = useState(false);
37
-
38
36
  const setPublic = () => {
39
37
  editPost({
40
38
  status: visibility === 'private' ? 'draft' : status,
@@ -42,11 +40,9 @@ export default function PostVisibility({
42
40
  });
43
41
  setHasPassword(false);
44
42
  };
45
-
46
43
  const setPrivate = () => {
47
44
  setShowPrivateConfirmDialog(true);
48
45
  };
49
-
50
46
  const confirmPrivate = () => {
51
47
  editPost({
52
48
  status: 'private',
@@ -56,11 +52,9 @@ export default function PostVisibility({
56
52
  setShowPrivateConfirmDialog(false);
57
53
  savePost();
58
54
  };
59
-
60
55
  const handleDialogCancel = () => {
61
56
  setShowPrivateConfirmDialog(false);
62
57
  };
63
-
64
58
  const setPasswordProtected = () => {
65
59
  editPost({
66
60
  status: visibility === 'private' ? 'draft' : status,
@@ -68,13 +62,11 @@ export default function PostVisibility({
68
62
  });
69
63
  setHasPassword(true);
70
64
  };
71
-
72
65
  const updatePassword = event => {
73
66
  editPost({
74
67
  password: event.target.value
75
68
  });
76
69
  };
77
-
78
70
  return createElement("div", {
79
71
  className: "editor-post-visibility"
80
72
  }, createElement(InspectorPopoverHeader, {
@@ -124,7 +116,6 @@ export default function PostVisibility({
124
116
  onCancel: handleDialogCancel
125
117
  }, __('Would you like to privately publish this post now?')));
126
118
  }
127
-
128
119
  function PostVisibilityChoice({
129
120
  instanceId,
130
121
  value,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"names":["__","useState","VisuallyHidden","__experimentalConfirmDialog","ConfirmDialog","useInstanceId","useSelect","useDispatch","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","visibilityOptions","store","editorStore","PostVisibility","onClose","instanceId","status","visibility","password","select","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","hasPassword","setHasPassword","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","public","label","info","private","PostVisibilityChoice","props"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SACCC,cADD,EAECC,2BAA2B,IAAIC,aAFhC,QAGO,uBAHP;AAIA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,oCAAoC,IAAIC,sBAAjD,QAA+E,yBAA/E;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,SAAlC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,eAAe,SAASC,cAAT,CAAyB;AAAEC,EAAAA;AAAF,CAAzB,EAAuC;AACrD,QAAMC,UAAU,GAAGV,aAAa,CAAEQ,cAAF,CAAhC;AAEA,QAAM;AAAEG,IAAAA,MAAF;AAAUC,IAAAA,UAAV;AAAsBC,IAAAA;AAAtB,MAAmCZ,SAAS,CAAIa,MAAF,KAAgB;AACnEH,IAAAA,MAAM,EAAEG,MAAM,CAAEP,WAAF,CAAN,CAAsBQ,sBAAtB,CAA8C,QAA9C,CAD2D;AAEnEH,IAAAA,UAAU,EAAEE,MAAM,CAAEP,WAAF,CAAN,CAAsBS,uBAAtB,EAFuD;AAGnEH,IAAAA,QAAQ,EAAEC,MAAM,CAAEP,WAAF,CAAN,CA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AEC,IAAA,SAAS,EAAC;AAFX,KAIGuB,KAJH,CAVD,EAgBC;AACC,IAAA,EAAE,EAAI,eAAeF,KAAO,IAAIrB,UAAY,cAD7C;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGwB,IAJH,CAhBD,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost, savePost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\tconst [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] =\n\t\tuseState( false );\n\n\tconst setPublic = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: '',\n\t\t} );\n\t\tsetHasPassword( false );\n\t};\n\n\tconst setPrivate = () => {\n\t\tsetShowPrivateConfirmDialog( true );\n\t};\n\n\tconst confirmPrivate = () => {\n\t\teditPost( { status: 'private', password: '' } );\n\t\tsetHasPassword( false );\n\t\tsetShowPrivateConfirmDialog( false );\n\t\tsavePost();\n\t};\n\n\tconst handleDialogCancel = () => {\n\t\tsetShowPrivateConfirmDialog( false );\n\t};\n\n\tconst setPasswordProtected = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: password || '',\n\t\t} );\n\t\tsetHasPassword( true );\n\t};\n\n\tconst updatePassword = ( event ) => {\n\t\teditPost( { password: event.target.value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<fieldset className=\"editor-post-visibility__fieldset\">\n\t\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t\t{ __( 'Visibility' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"public\"\n\t\t\t\t\tlabel={ visibilityOptions.public.label }\n\t\t\t\t\tinfo={ visibilityOptions.public.info }\n\t\t\t\t\tchecked={ visibility === 'public' && ! hasPassword }\n\t\t\t\t\tonChange={ setPublic }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"private\"\n\t\t\t\t\tlabel={ visibilityOptions.private.label }\n\t\t\t\t\tinfo={ visibilityOptions.private.info }\n\t\t\t\t\tchecked={ visibility === 'private' }\n\t\t\t\t\tonChange={ setPrivate }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"password\"\n\t\t\t\t\tlabel={ visibilityOptions.password.label }\n\t\t\t\t\tinfo={ visibilityOptions.password.info }\n\t\t\t\t\tchecked={ hasPassword }\n\t\t\t\t\tonChange={ setPasswordProtected }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<div className=\"editor-post-visibility__password\">\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\thtmlFor={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__password-input\"\n\t\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</fieldset>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showPrivateConfirmDialog }\n\t\t\t\tonConfirm={ confirmPrivate }\n\t\t\t\tonCancel={ handleDialogCancel }\n\t\t\t>\n\t\t\t\t{ __( 'Would you like to privately publish this post now?' ) }\n\t\t\t</ConfirmDialog>\n\t\t</div>\n\t);\n}\n\nfunction PostVisibilityChoice( { instanceId, value, label, info, ...props } ) {\n\treturn (\n\t\t<div className=\"editor-post-visibility__choice\">\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\tvalue={ value }\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__radio\"\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t\t<label\n\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\tclassName=\"editor-post-visibility__label\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t\t<p\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__info\"\n\t\t\t>\n\t\t\t\t{ info }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"names":["__","useState","VisuallyHidden","__experimentalConfirmDialog","ConfirmDialog","useInstanceId","useSelect","useDispatch","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","visibilityOptions","store","editorStore","PostVisibility","onClose","instanceId","status","visibility","password","select","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","hasPassword","setHasPassword","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","createElement","className","title","help","as","PostVisibilityChoice","label","public","info","checked","onChange","private","htmlFor","id","type","placeholder","isOpen","onConfirm","onCancel","props","name"],"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost, savePost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\tconst [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] =\n\t\tuseState( false );\n\n\tconst setPublic = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: '',\n\t\t} );\n\t\tsetHasPassword( false );\n\t};\n\n\tconst setPrivate = () => {\n\t\tsetShowPrivateConfirmDialog( true );\n\t};\n\n\tconst confirmPrivate = () => {\n\t\teditPost( { status: 'private', password: '' } );\n\t\tsetHasPassword( false );\n\t\tsetShowPrivateConfirmDialog( false );\n\t\tsavePost();\n\t};\n\n\tconst handleDialogCancel = () => {\n\t\tsetShowPrivateConfirmDialog( false );\n\t};\n\n\tconst setPasswordProtected = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: password || '',\n\t\t} );\n\t\tsetHasPassword( true );\n\t};\n\n\tconst updatePassword = ( event ) => {\n\t\teditPost( { password: event.target.value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<fieldset className=\"editor-post-visibility__fieldset\">\n\t\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t\t{ __( 'Visibility' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"public\"\n\t\t\t\t\tlabel={ visibilityOptions.public.label }\n\t\t\t\t\tinfo={ visibilityOptions.public.info }\n\t\t\t\t\tchecked={ visibility === 'public' && ! hasPassword }\n\t\t\t\t\tonChange={ setPublic }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"private\"\n\t\t\t\t\tlabel={ visibilityOptions.private.label }\n\t\t\t\t\tinfo={ visibilityOptions.private.info }\n\t\t\t\t\tchecked={ visibility === 'private' }\n\t\t\t\t\tonChange={ setPrivate }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"password\"\n\t\t\t\t\tlabel={ visibilityOptions.password.label }\n\t\t\t\t\tinfo={ visibilityOptions.password.info }\n\t\t\t\t\tchecked={ hasPassword }\n\t\t\t\t\tonChange={ setPasswordProtected }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<div className=\"editor-post-visibility__password\">\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\thtmlFor={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__password-input\"\n\t\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</fieldset>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showPrivateConfirmDialog }\n\t\t\t\tonConfirm={ confirmPrivate }\n\t\t\t\tonCancel={ handleDialogCancel }\n\t\t\t>\n\t\t\t\t{ __( 'Would you like to privately publish this post now?' ) }\n\t\t\t</ConfirmDialog>\n\t\t</div>\n\t);\n}\n\nfunction PostVisibilityChoice( { instanceId, value, label, info, ...props } ) {\n\treturn (\n\t\t<div className=\"editor-post-visibility__choice\">\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\tvalue={ value }\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__radio\"\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t\t<label\n\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\tclassName=\"editor-post-visibility__label\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t\t<p\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__info\"\n\t\t\t>\n\t\t\t\t{ info }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,cAAc,EACdC,2BAA2B,IAAIC,aAAa,QACtC,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAExG;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,cAAcA,CAAE;EAAEC;AAAQ,CAAC,EAAG;EACrD,MAAMC,UAAU,GAAGV,aAAa,CAAEQ,cAAe,CAAC;EAElD,MAAM;IAAEG,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAGZ,SAAS,CAAIa,MAAM,KAAQ;IACnEH,MAAM,EAAEG,MAAM,CAAEP,WAAY,CAAC,CAACQ,sBAAsB,CAAE,QAAS,CAAC;IAChEH,UAAU,EAAEE,MAAM,CAAEP,WAAY,CAAC,CAACS,uBAAuB,CAAC,CAAC;IAC3DH,QAAQ,EAAEC,MAAM,CAAEP,WAAY,CAAC,CAACQ,sBAAsB,CAAE,UAAW;EACpE,CAAC,CAAG,CAAC;EAEL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  */
4
4
  import { useSelect } from '@wordpress/data';
5
+
5
6
  /**
6
7
  * Internal dependencies
7
8
  */
8
-
9
9
  import { visibilityOptions } from './utils';
10
10
  import { store as editorStore } from '../../store';
11
11
  export default function PostVisibilityLabel() {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"names":["useSelect","visibilityOptions","store","editorStore","PostVisibilityLabel","usePostVisibilityLabel","visibility","select","getEditedPostVisibility","label"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,SAAlC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,aAArC;AAEA,eAAe,SAASC,mBAAT,GAA+B;AAC7C,SAAOC,sBAAsB,EAA7B;AACA;AAED,OAAO,SAASA,sBAAT,GAAkC;AACxC,QAAMC,UAAU,GAAGN,SAAS,CAAIO,MAAF,IAC7BA,MAAM,CAAEJ,WAAF,CAAN,CAAsBK,uBAAtB,EAD2B,CAA5B;AAGA,SAAOP,iBAAiB,CAAEK,UAAF,CAAjB,EAAiCG,KAAxC;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibilityLabel() {\n\treturn usePostVisibilityLabel();\n}\n\nexport function usePostVisibilityLabel() {\n\tconst visibility = useSelect( ( select ) =>\n\t\tselect( editorStore ).getEditedPostVisibility()\n\t);\n\treturn visibilityOptions[ visibility ]?.label;\n}\n"]}
1
+ {"version":3,"names":["useSelect","visibilityOptions","store","editorStore","PostVisibilityLabel","usePostVisibilityLabel","visibility","select","getEditedPostVisibility","label"],"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibilityLabel() {\n\treturn usePostVisibilityLabel();\n}\n\nexport function usePostVisibilityLabel() {\n\tconst visibility = useSelect( ( select ) =>\n\t\tselect( editorStore ).getEditedPostVisibility()\n\t);\n\treturn visibilityOptions[ visibility ]?.label;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,OAAOC,sBAAsB,CAAC,CAAC;AAChC;AAEA,OAAO,SAASA,sBAAsBA,CAAA,EAAG;EACxC,MAAMC,UAAU,GAAGN,SAAS,CAAIO,MAAM,IACrCA,MAAM,CAAEJ,WAAY,CAAC,CAACK,uBAAuB,CAAC,CAC/C,CAAC;EACD,OAAOP,iBAAiB,CAAEK,UAAU,CAAE,EAAEG,KAAK;AAC9C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/post-visibility/utils.js"],"names":["__","visibilityOptions","public","label","info","private","password"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA,OAAO,MAAMC,iBAAiB,GAAG;AAChCC,EAAAA,MAAM,EAAE;AACPC,IAAAA,KAAK,EAAEH,EAAE,CAAE,QAAF,CADF;AAEPI,IAAAA,IAAI,EAAEJ,EAAE,CAAE,sBAAF;AAFD,GADwB;AAKhCK,EAAAA,OAAO,EAAE;AACRF,IAAAA,KAAK,EAAEH,EAAE,CAAE,SAAF,CADD;AAERI,IAAAA,IAAI,EAAEJ,EAAE,CAAE,0CAAF;AAFA,GALuB;AAShCM,EAAAA,QAAQ,EAAE;AACTH,IAAAA,KAAK,EAAEH,EAAE,CAAE,oBAAF,CADA;AAETI,IAAAA,IAAI,EAAEJ,EAAE,CAAE,kDAAF;AAFC;AATsB,CAA1B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const visibilityOptions = {\n\tpublic: {\n\t\tlabel: __( 'Public' ),\n\t\tinfo: __( 'Visible to everyone.' ),\n\t},\n\tprivate: {\n\t\tlabel: __( 'Private' ),\n\t\tinfo: __( 'Only visible to site admins and editors.' ),\n\t},\n\tpassword: {\n\t\tlabel: __( 'Password protected' ),\n\t\tinfo: __( 'Only those with the password can view this post.' ),\n\t},\n};\n"]}
1
+ {"version":3,"names":["__","visibilityOptions","public","label","info","private","password"],"sources":["@wordpress/editor/src/components/post-visibility/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const visibilityOptions = {\n\tpublic: {\n\t\tlabel: __( 'Public' ),\n\t\tinfo: __( 'Visible to everyone.' ),\n\t},\n\tprivate: {\n\t\tlabel: __( 'Private' ),\n\t\tinfo: __( 'Only visible to site admins and editors.' ),\n\t},\n\tpassword: {\n\t\tlabel: __( 'Password protected' ),\n\t\tinfo: __( 'Only those with the password can view this post.' ),\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,iBAAiB,GAAG;EAChCC,MAAM,EAAE;IACPC,KAAK,EAAEH,EAAE,CAAE,QAAS,CAAC;IACrBI,IAAI,EAAEJ,EAAE,CAAE,sBAAuB;EAClC,CAAC;EACDK,OAAO,EAAE;IACRF,KAAK,EAAEH,EAAE,CAAE,SAAU,CAAC;IACtBI,IAAI,EAAEJ,EAAE,CAAE,0CAA2C;EACtD,CAAC;EACDM,QAAQ,EAAE;IACTH,KAAK,EAAEH,EAAE,CAAE,oBAAqB,CAAC;IACjCI,IAAI,EAAEJ,EAAE,CAAE,kDAAmD;EAC9D;AACD,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -8,12 +7,12 @@ import { useDispatch, useSelect } from '@wordpress/data';
8
7
  import { __ } from '@wordpress/i18n';
9
8
  import { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';
10
9
  import { BlockEditorProvider, BlockContextProvider, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
11
- import { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';
12
10
  import { store as noticesStore } from '@wordpress/notices';
11
+ import { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';
12
+
13
13
  /**
14
14
  * Internal dependencies
15
15
  */
16
-
17
16
  import withRegistryProvider from './with-registry-provider';
18
17
  import { store as editorStore } from '../../store';
19
18
  import useBlockEditorSettings from './use-block-editor-settings';
@@ -21,6 +20,9 @@ import { unlock } from '../../lock-unlock';
21
20
  const {
22
21
  ExperimentalBlockEditorProvider
23
22
  } = unlock(blockEditorPrivateApis);
23
+ const {
24
+ PatternsMenuItems
25
+ } = unlock(editPatternsPrivateApis);
24
26
  export const ExperimentalEditorProvider = withRegistryProvider(({
25
27
  __unstableTemplate,
26
28
  post,
@@ -34,7 +36,6 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
34
36
  if (post.type === 'wp_template') {
35
37
  return {};
36
38
  }
37
-
38
39
  return {
39
40
  postId: post.id,
40
41
  postType: post.type
@@ -72,18 +73,17 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
72
73
  } = useDispatch(editorStore);
73
74
  const {
74
75
  createWarningNotice
75
- } = useDispatch(noticesStore); // Initialize and tear down the editor.
76
- // Ideally this should be synced on each change and not just something you do once.
76
+ } = useDispatch(noticesStore);
77
77
 
78
+ // Initialize and tear down the editor.
79
+ // Ideally this should be synced on each change and not just something you do once.
78
80
  useLayoutEffect(() => {
79
81
  // Assume that we don't need to initialize in the case of an error recovery.
80
82
  if (recovery) {
81
83
  return;
82
84
  }
83
-
84
85
  updatePostLock(settings.postLock);
85
86
  setupEditor(post, initialEdits, settings.template);
86
-
87
87
  if (settings.autosave) {
88
88
  createWarningNotice(__('There is an autosave of this post that is more recent than the version below.'), {
89
89
  id: 'autosave-exists',
@@ -93,20 +93,18 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
93
93
  }]
94
94
  });
95
95
  }
96
-
97
96
  return () => {
98
97
  __experimentalTearDownEditor();
99
98
  };
100
- }, []); // Synchronize the editor settings as they change.
99
+ }, []);
101
100
 
101
+ // Synchronize the editor settings as they change.
102
102
  useEffect(() => {
103
103
  updateEditorSettings(settings);
104
104
  }, [settings]);
105
-
106
105
  if (!isReady) {
107
106
  return null;
108
107
  }
109
-
110
108
  return createElement(EntityProvider, {
111
109
  kind: "root",
112
110
  type: "site"
@@ -123,10 +121,11 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
123
121
  selection: selection,
124
122
  settings: blockEditorSettings,
125
123
  useSubRegistry: false
126
- }, children, createElement(ReusableBlocksMenuItems, null)))));
124
+ }, children, createElement(PatternsMenuItems, null)))));
127
125
  });
128
126
  export function EditorProvider(props) {
129
- return createElement(ExperimentalEditorProvider, { ...props,
127
+ return createElement(ExperimentalEditorProvider, {
128
+ ...props,
130
129
  BlockEditorProviderComponent: BlockEditorProvider
131
130
  }, props.children);
132
131
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/provider/index.js"],"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","ReusableBlocksMenuItems","store","noticesStore","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","ExperimentalBlockEditorProvider","ExperimentalEditorProvider","__unstableTemplate","post","settings","recovery","initialEdits","children","BlockEditorProviderComponent","defaultBlockContext","type","postId","id","postType","editorSettings","selection","isReady","select","getEditorSettings","getEditorSelection","__unstableIsEditorReady","blocks","onInput","onChange","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","__experimentalTearDownEditor","createWarningNotice","postLock","template","autosave","actions","label","url","editLink","EditorProvider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ffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\n\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\t__unstableTemplate,\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t} ) => {\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\treturn { postId: post.id, postType: post.type };\n\t\t}, [ post.id, post.type ] );\n\t\tconst { editorSettings, selection, isReady } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { id, type } = __unstableTemplate ?? post;\n\t\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t\t'postType',\n\t\t\ttype,\n\t\t\t{ id }\n\t\t);\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\t!! __unstableTemplate\n\t\t);\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\t__experimentalTearDownEditor,\n\t\t} = useDispatch( editorStore );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Initialize and tear down the editor.\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\t__experimentalTearDownEditor();\n\t\t\t};\n\t\t}, [] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings ] );\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t<ReusableBlocksMenuItems />\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"]}
1
+ {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","store","noticesStore","editPatternsPrivateApis","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","ExperimentalBlockEditorProvider","PatternsMenuItems","ExperimentalEditorProvider","__unstableTemplate","post","settings","recovery","initialEdits","children","BlockEditorProviderComponent","defaultBlockContext","type","postId","id","postType","editorSettings","selection","isReady","select","getEditorSettings","getEditorSelection","__unstableIsEditorReady","blocks","onInput","onChange","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","__experimentalTearDownEditor","createWarningNotice","postLock","template","autosave","actions","label","url","editLink","createElement","kind","value","useSubRegistry","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\t__unstableTemplate,\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t} ) => {\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\treturn { postId: post.id, postType: post.type };\n\t\t}, [ post.id, post.type ] );\n\t\tconst { editorSettings, selection, isReady } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { id, type } = __unstableTemplate ?? post;\n\t\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t\t'postType',\n\t\t\ttype,\n\t\t\t{ id }\n\t\t);\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\t!! __unstableTemplate\n\t\t);\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\t__experimentalTearDownEditor,\n\t\t} = useDispatch( editorStore );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Initialize and tear down the editor.\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\t__experimentalTearDownEditor();\n\t\t\t};\n\t\t}, [] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings ] );\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,sBAAsB;AAC3E,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASH,WAAW,IAAII,uBAAuB,QAAQ,qBAAqB;;AAE5E;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAASH,KAAK,IAAII,WAAW,QAAQ,aAAa;AAClD,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAgC,CAAC,GAAGD,MAAM,CAAEP,sBAAuB,CAAC;AAC5E,MAAM;EAAES;AAAkB,CAAC,GAAGF,MAAM,CA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AAO,EAAGA,OAAS;IACnBP,SAAS,EAAGA,SAAW;IACvBX,QAAQ,EAAGoB,mBAAqB;IAChCgB,cAAc,EAAG;EAAO,GAEtBjC,QAAQ,EACV8B,aAAA,CAACrC,iBAAiB,MAAE,CACS,CACT,CACP,CACD,CAAC;AAEnB,CACD,CAAC;AAED,OAAO,SAASyC,cAAcA,CAAEC,KAAK,EAAG;EACvC,OACCL,aAAA,CAACpC,0BAA0B;IAAA,GACrByC,KAAK;IACVlC,4BAA4B,EAAGpB;EAAqB,GAElDsD,KAAK,CAACnC,QACmB,CAAC;AAE/B;AAEA,eAAekC,cAAc"}
@@ -1,14 +1,13 @@
1
1
  import { createElement, Fragment } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * External dependencies
5
4
  */
6
5
  import memize from 'memize';
7
6
  import { SafeAreaProvider } from 'react-native-safe-area-context';
7
+
8
8
  /**
9
9
  * WordPress dependencies
10
10
  */
11
-
12
11
  import RNReactNativeGutenbergBridge, { requestBlockTypeImpressions, setBlockTypeImpressions, subscribeParentGetHtml, subscribeParentToggleHTMLMode, subscribeUpdateHtml, subscribeSetTitle, subscribeMediaAppend, subscribeReplaceBlock, subscribeUpdateEditorSettings, subscribeUpdateCapabilities, subscribeShowNotice, subscribeShowEditorHelp } from '@wordpress/react-native-bridge';
13
12
  import { Component } from '@wordpress/element';
14
13
  import { count as wordCount } from '@wordpress/wordcount';
@@ -45,23 +44,24 @@ const postTypeEntities = [{
45
44
  }));
46
45
  import { EditorHelpTopics, store as editorStore } from '@wordpress/editor';
47
46
  import { store as noticesStore } from '@wordpress/notices';
48
- import { store as coreStore } from '@wordpress/core-data'; // eslint-disable-next-line no-restricted-imports
49
-
47
+ import { store as coreStore } from '@wordpress/core-data';
48
+ // eslint-disable-next-line no-restricted-imports
50
49
  import { store as editPostStore } from '@wordpress/edit-post';
50
+
51
51
  /**
52
52
  * Internal dependencies
53
53
  */
54
-
55
54
  import EditorProvider from './index.js';
56
-
57
55
  class NativeEditorProvider extends Component {
58
56
  constructor() {
59
- super(...arguments); // Keep a local reference to `post` to detect changes.
57
+ super(...arguments);
60
58
 
59
+ // Keep a local reference to `post` to detect changes.
61
60
  this.post = this.props.post;
62
61
  this.props.addEntities(postTypeEntities);
63
62
  this.props.receiveEntityRecords('postType', this.post.type, this.post);
64
- this.getEditorSettings = memize((settings, capabilities) => ({ ...settings,
63
+ this.getEditorSettings = memize((settings, capabilities) => ({
64
+ ...settings,
65
65
  capabilities
66
66
  }), {
67
67
  maxSize: 1
@@ -70,7 +70,6 @@ class NativeEditorProvider extends Component {
70
70
  isHelpVisible: false
71
71
  };
72
72
  }
73
-
74
73
  componentDidMount() {
75
74
  const {
76
75
  capabilities,
@@ -117,7 +116,6 @@ class NativeEditorProvider extends Component {
117
116
  if (typeof galleryWithImageBlocks === 'boolean') {
118
117
  window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;
119
118
  }
120
-
121
119
  updateEditorSettings(this.getThemeColors(editorSettings));
122
120
  });
123
121
  this.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(payload => {
@@ -130,69 +128,61 @@ class NativeEditorProvider extends Component {
130
128
  this.setState({
131
129
  isHelpVisible: true
132
130
  });
133
- }); // Request current block impressions from native app.
131
+ });
134
132
 
133
+ // Request current block impressions from native app.
135
134
  requestBlockTypeImpressions(storedImpressions => {
136
- const impressions = { ...NEW_BLOCK_TYPES,
135
+ const impressions = {
136
+ ...NEW_BLOCK_TYPES,
137
137
  ...storedImpressions
138
- }; // Persist impressions to JavaScript store.
138
+ };
139
139
 
140
+ // Persist impressions to JavaScript store.
140
141
  updateBlockEditorSettings({
141
142
  impressions
142
- }); // Persist impressions to native store if they do not include latest
143
- // `NEW_BLOCK_TYPES` configuration.
143
+ });
144
144
 
145
+ // Persist impressions to native store if they do not include latest
146
+ // `NEW_BLOCK_TYPES` configuration.
145
147
  const storedImpressionKeys = Object.keys(storedImpressions);
146
148
  const storedImpressionsCurrent = Object.keys(NEW_BLOCK_TYPES).every(newKey => storedImpressionKeys.includes(newKey));
147
-
148
149
  if (!storedImpressionsCurrent) {
149
150
  setBlockTypeImpressions(impressions);
150
151
  }
151
152
  });
152
153
  }
153
-
154
154
  componentWillUnmount() {
155
155
  if (this.subscriptionParentGetHtml) {
156
156
  this.subscriptionParentGetHtml.remove();
157
157
  }
158
-
159
158
  if (this.subscriptionParentToggleHTMLMode) {
160
159
  this.subscriptionParentToggleHTMLMode.remove();
161
160
  }
162
-
163
161
  if (this.subscriptionParentSetTitle) {
164
162
  this.subscriptionParentSetTitle.remove();
165
163
  }
166
-
167
164
  if (this.subscriptionParentUpdateHtml) {
168
165
  this.subscriptionParentUpdateHtml.remove();
169
166
  }
170
-
171
167
  if (this.subscriptionParentReplaceBlock) {
172
168
  this.subscriptionParentReplaceBlock.remove();
173
169
  }
174
-
175
170
  if (this.subscriptionParentMediaAppend) {
176
171
  this.subscriptionParentMediaAppend.remove();
177
172
  }
178
-
179
173
  if (this.subscriptionParentUpdateEditorSettings) {
180
174
  this.subscriptionParentUpdateEditorSettings.remove();
181
175
  }
182
-
183
176
  if (this.subscriptionParentUpdateCapabilities) {
184
177
  this.subscriptionParentUpdateCapabilities.remove();
185
178
  }
186
-
187
179
  if (this.subscriptionParentShowNotice) {
188
180
  this.subscriptionParentShowNotice.remove();
189
181
  }
190
-
191
182
  if (this.subscriptionParentShowEditorHelp) {
192
183
  this.subscriptionParentShowEditorHelp.remove();
193
184
  }
194
185
  }
195
-
196
186
  getThemeColors({
197
187
  rawStyles,
198
188
  rawFeatures
@@ -201,31 +191,24 @@ class NativeEditorProvider extends Component {
201
191
  defaultEditorColors,
202
192
  defaultEditorGradients
203
193
  } = this.props;
204
-
205
194
  if (rawStyles && rawFeatures) {
206
195
  return getGlobalStyles(rawStyles, rawFeatures);
207
196
  }
208
-
209
197
  return getColorsAndGradients(defaultEditorColors, defaultEditorGradients, rawFeatures);
210
198
  }
211
-
212
199
  componentDidUpdate(prevProps) {
213
200
  if (!prevProps.isReady && this.props.isReady) {
214
201
  const blocks = this.props.blocks;
215
-
216
202
  const isUnsupportedBlock = ({
217
203
  name
218
204
  }) => name === getUnregisteredTypeHandlerName();
219
-
220
205
  const unsupportedBlockNames = blocks.filter(isUnsupportedBlock).map(block => block.attributes.originalName);
221
206
  RNReactNativeGutenbergBridge.editorDidMount(unsupportedBlockNames);
222
207
  }
223
208
  }
224
-
225
209
  serializeToNativeAction() {
226
210
  const title = this.props.title;
227
211
  let html;
228
-
229
212
  if (this.props.mode === 'text') {
230
213
  // The HTMLTextInput component does not update the store when user is doing changes
231
214
  // Let's request the HTML from the component's state directly.
@@ -233,48 +216,42 @@ class NativeEditorProvider extends Component {
233
216
  } else {
234
217
  html = serialize(this.props.blocks);
235
218
  }
219
+ const hasChanges = title !== this.post.title.raw || html !== this.post.content.raw;
236
220
 
237
- const hasChanges = title !== this.post.title.raw || html !== this.post.content.raw; // Variable to store the content structure metrics.
238
-
221
+ // Variable to store the content structure metrics.
239
222
  const contentInfo = {};
240
223
  contentInfo.characterCount = wordCount(html, 'characters_including_spaces');
241
224
  contentInfo.wordCount = wordCount(html, 'words');
242
225
  contentInfo.paragraphCount = this.props.paragraphCount;
243
226
  contentInfo.blockCount = this.props.blockCount;
244
227
  RNReactNativeGutenbergBridge.provideToNative_Html(html, title, hasChanges, contentInfo);
245
-
246
228
  if (hasChanges) {
247
229
  this.post.title.raw = title;
248
230
  this.post.content.raw = html;
249
231
  }
250
232
  }
251
-
252
233
  updateHtmlAction(html) {
253
234
  const parsed = parse(html);
254
235
  this.props.resetEditorBlocksWithoutUndoLevel(parsed);
255
236
  }
256
-
257
237
  replaceBlockAction(html, blockClientId) {
258
238
  const parsed = parse(html);
259
239
  this.props.replaceBlock(blockClientId, parsed);
260
240
  }
261
-
262
241
  toggleMode() {
263
242
  const {
264
243
  mode,
265
244
  switchMode
266
- } = this.props; // Refresh html content first.
267
-
245
+ } = this.props;
246
+ // Refresh html content first.
268
247
  this.serializeToNativeAction();
269
248
  switchMode(mode === 'visual' ? 'text' : 'visual');
270
249
  }
271
-
272
250
  updateCapabilitiesAction(capabilities) {
273
251
  this.props.updateEditorSettings({
274
252
  capabilities
275
253
  });
276
254
  }
277
-
278
255
  render() {
279
256
  const {
280
257
  children,
@@ -299,12 +276,9 @@ class NativeEditorProvider extends Component {
299
276
  showSupport: capabilities?.supportSection === true
300
277
  }));
301
278
  }
302
-
303
279
  }
304
-
305
280
  const ComposedNativeProvider = compose([withSelect(select => {
306
281
  var _settings$colors, _settings$gradients;
307
-
308
282
  const {
309
283
  __unstableIsEditorReady: isEditorReady,
310
284
  getEditorBlocks,
@@ -363,25 +337,20 @@ const ComposedNativeProvider = compose([withSelect(select => {
363
337
  addEntities,
364
338
  insertBlock,
365
339
  createSuccessNotice,
366
-
367
340
  editTitle(title) {
368
341
  editPost({
369
342
  title
370
343
  });
371
344
  },
372
-
373
345
  receiveEntityRecords,
374
-
375
346
  resetEditorBlocksWithoutUndoLevel(blocks) {
376
347
  resetEditorBlocks(blocks, {
377
348
  __unstableShouldCreateUndoLevel: false
378
349
  });
379
350
  },
380
-
381
351
  switchMode(mode) {
382
352
  switchEditorMode(mode);
383
353
  },
384
-
385
354
  replaceBlock
386
355
  };
387
356
  })])(NativeEditorProvider);