@wordpress/editor 13.32.0 → 13.33.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 (589) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +225 -2
  3. package/build/bindings/index.js.map +1 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +12 -30
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/index.js.map +1 -1
  8. package/build/components/autocompleters/user.js.map +1 -1
  9. package/build/components/autosave-monitor/index.js +10 -0
  10. package/build/components/autosave-monitor/index.js.map +1 -1
  11. package/build/components/block-manager/category.js.map +1 -1
  12. package/build/components/block-manager/checklist.js.map +1 -1
  13. package/build/components/block-manager/index.js.map +1 -1
  14. package/build/components/block-removal-warnings/index.js.map +1 -1
  15. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  16. package/build/components/character-count/index.js.map +1 -1
  17. package/build/components/commands/index.js +19 -0
  18. package/build/components/commands/index.js.map +1 -1
  19. package/build/components/commands/index.native.js.map +1 -1
  20. package/build/components/deprecated.js.map +1 -1
  21. package/build/components/deprecated.native.js.map +1 -1
  22. package/build/components/document-bar/index.js.map +1 -1
  23. package/build/components/document-outline/check.js.map +1 -1
  24. package/build/components/document-outline/index.js.map +1 -1
  25. package/build/components/document-outline/item.js.map +1 -1
  26. package/build/components/document-tools/index.js +1 -1
  27. package/build/components/document-tools/index.js.map +1 -1
  28. package/build/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  29. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  30. package/build/components/editor-canvas/index.js +2 -2
  31. package/build/components/editor-canvas/index.js.map +1 -1
  32. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  33. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  34. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  35. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  36. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  37. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  38. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  39. package/build/components/editor-help/index.native.js.map +1 -1
  40. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  41. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  43. package/build/components/editor-help/view-sections.native.js.map +1 -1
  44. package/build/components/editor-history/redo.js.map +1 -1
  45. package/build/components/editor-history/undo.js.map +1 -1
  46. package/build/components/editor-notices/index.js.map +1 -1
  47. package/build/components/editor-snackbars/index.js.map +1 -1
  48. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  49. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  50. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  51. package/build/components/entities-saved-states/index.js.map +1 -1
  52. package/build/components/error-boundary/index.js.map +1 -1
  53. package/build/components/error-boundary/index.native.js.map +1 -1
  54. package/build/components/global-keyboard-shortcuts/index.js +24 -0
  55. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  56. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  57. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  58. package/build/components/index.js +33 -1
  59. package/build/components/index.js.map +1 -1
  60. package/build/components/index.native.js.map +1 -1
  61. package/build/components/inserter-sidebar/index.js.map +1 -1
  62. package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
  63. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  64. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
  65. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  66. package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
  67. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  68. package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
  69. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  70. package/build/components/list-view-sidebar/index.js.map +1 -1
  71. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  72. package/build/components/local-autosave-monitor/index.js.map +1 -1
  73. package/build/components/media-categories/index.js.map +1 -1
  74. package/build/components/mode-switcher/index.js.map +1 -1
  75. package/build/components/offline-status/index.native.js.map +1 -1
  76. package/build/components/page-attributes/check.js.map +1 -1
  77. package/build/components/page-attributes/order.js.map +1 -1
  78. package/build/components/page-attributes/panel.js.map +1 -1
  79. package/build/components/page-attributes/parent.js.map +1 -1
  80. package/build/components/pattern-overrides-panel/index.js.map +1 -1
  81. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  82. package/build/components/plugin-more-menu-item/index.js +78 -0
  83. package/build/components/plugin-more-menu-item/index.js.map +1 -0
  84. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  85. package/build/components/plugin-post-status-info/index.js +73 -0
  86. package/build/components/plugin-post-status-info/index.js.map +1 -0
  87. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  88. package/build/components/plugin-sidebar/index.js +108 -0
  89. package/build/components/plugin-sidebar/index.js.map +1 -0
  90. package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
  91. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  92. package/build/components/post-actions/actions.js +218 -17
  93. package/build/components/post-actions/actions.js.map +1 -1
  94. package/build/components/post-actions/index.js +137 -0
  95. package/build/components/post-actions/index.js.map +1 -0
  96. package/build/components/post-author/check.js.map +1 -1
  97. package/build/components/post-author/combobox.js.map +1 -1
  98. package/build/components/post-author/constants.js.map +1 -1
  99. package/build/components/post-author/hook.js.map +1 -1
  100. package/build/components/post-author/index.js.map +1 -1
  101. package/build/components/post-author/panel.js.map +1 -1
  102. package/build/components/post-author/select.js.map +1 -1
  103. package/build/components/post-card-panel/index.js +40 -6
  104. package/build/components/post-card-panel/index.js.map +1 -1
  105. package/build/components/post-comments/index.js.map +1 -1
  106. package/build/components/post-discussion/panel.js.map +1 -1
  107. package/build/components/post-excerpt/check.js +8 -0
  108. package/build/components/post-excerpt/check.js.map +1 -1
  109. package/build/components/post-excerpt/index.js.map +1 -1
  110. package/build/components/post-excerpt/panel.js.map +1 -1
  111. package/build/components/post-excerpt/plugin.js.map +1 -1
  112. package/build/components/post-featured-image/check.js.map +1 -1
  113. package/build/components/post-featured-image/index.js.map +1 -1
  114. package/build/components/post-featured-image/panel.js.map +1 -1
  115. package/build/components/post-format/check.js.map +1 -1
  116. package/build/components/post-format/index.js.map +1 -1
  117. package/build/components/post-last-revision/check.js.map +1 -1
  118. package/build/components/post-last-revision/index.js.map +1 -1
  119. package/build/components/post-last-revision/panel.js.map +1 -1
  120. package/build/components/post-locked-modal/index.js.map +1 -1
  121. package/build/components/post-panel-row/index.js.map +1 -1
  122. package/build/components/post-pending-status/check.js.map +1 -1
  123. package/build/components/post-pending-status/index.js.map +1 -1
  124. package/build/components/post-pingbacks/index.js.map +1 -1
  125. package/build/components/post-preview-button/index.js.map +1 -1
  126. package/build/components/post-publish-button/index.js +31 -31
  127. package/build/components/post-publish-button/index.js.map +1 -1
  128. package/build/components/post-publish-button/label.js +51 -43
  129. package/build/components/post-publish-button/label.js.map +1 -1
  130. package/build/components/post-publish-panel/index.js.map +1 -1
  131. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  132. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  133. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  134. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  135. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  136. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  137. package/build/components/post-saved-state/index.js +10 -6
  138. package/build/components/post-saved-state/index.js.map +1 -1
  139. package/build/components/post-schedule/check.js.map +1 -1
  140. package/build/components/post-schedule/index.js.map +1 -1
  141. package/build/components/post-schedule/label.js.map +1 -1
  142. package/build/components/post-schedule/panel.js +8 -0
  143. package/build/components/post-schedule/panel.js.map +1 -1
  144. package/build/components/post-slug/check.js.map +1 -1
  145. package/build/components/post-slug/index.js +43 -68
  146. package/build/components/post-slug/index.js.map +1 -1
  147. package/build/components/post-status/index.js +239 -0
  148. package/build/components/post-status/index.js.map +1 -0
  149. package/build/components/post-sticky/check.js.map +1 -1
  150. package/build/components/post-sticky/index.js.map +1 -1
  151. package/build/components/post-switch-to-draft-button/index.js +6 -1
  152. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  153. package/build/components/post-sync-status/index.js.map +1 -1
  154. package/build/components/post-taxonomies/check.js.map +1 -1
  155. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  156. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  157. package/build/components/post-taxonomies/index.js.map +1 -1
  158. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  159. package/build/components/post-taxonomies/panel.js.map +1 -1
  160. package/build/components/post-template/block-theme.js +6 -2
  161. package/build/components/post-template/block-theme.js.map +1 -1
  162. package/build/components/post-template/classic-theme.js.map +1 -1
  163. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  164. package/build/components/post-template/create-new-template.js.map +1 -1
  165. package/build/components/post-template/hooks.js.map +1 -1
  166. package/build/components/post-template/panel.js.map +1 -1
  167. package/build/components/post-template/reset-default-template.js.map +1 -1
  168. package/build/components/post-template/swap-template-button.js.map +1 -1
  169. package/build/components/post-text-editor/index.js.map +1 -1
  170. package/build/components/post-title/constants.js.map +1 -1
  171. package/build/components/post-title/index.js.map +1 -1
  172. package/build/components/post-title/index.native.js.map +1 -1
  173. package/build/components/post-title/post-title-raw.js.map +1 -1
  174. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  175. package/build/components/post-title/use-post-title.js.map +1 -1
  176. package/build/components/post-trash/check.js +23 -25
  177. package/build/components/post-trash/check.js.map +1 -1
  178. package/build/components/post-trash/index.js +2 -1
  179. package/build/components/post-trash/index.js.map +1 -1
  180. package/build/components/post-type-support-check/index.js.map +1 -1
  181. package/build/components/post-url/check.js.map +1 -1
  182. package/build/components/post-url/index.js +44 -19
  183. package/build/components/post-url/index.js.map +1 -1
  184. package/build/components/post-url/label.js.map +1 -1
  185. package/build/components/post-url/panel.js +14 -7
  186. package/build/components/post-url/panel.js.map +1 -1
  187. package/build/components/post-view-link/index.js.map +1 -1
  188. package/build/components/post-visibility/check.js.map +1 -1
  189. package/build/components/post-visibility/index.js +2 -1
  190. package/build/components/post-visibility/index.js.map +1 -1
  191. package/build/components/post-visibility/label.js.map +1 -1
  192. package/build/components/post-visibility/utils.js.map +1 -1
  193. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  194. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  195. package/build/components/preferences-modal/index.js +19 -17
  196. package/build/components/preferences-modal/index.js.map +1 -1
  197. package/build/components/preview-dropdown/index.js.map +1 -1
  198. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  199. package/build/components/provider/index.js +4 -2
  200. package/build/components/provider/index.js.map +1 -1
  201. package/build/components/provider/index.native.js +6 -1
  202. package/build/components/provider/index.native.js.map +1 -1
  203. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  204. package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
  205. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  206. package/build/components/provider/use-block-editor-settings.js +64 -43
  207. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  208. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  209. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  210. package/build/components/provider/with-registry-provider.js +1 -0
  211. package/build/components/provider/with-registry-provider.js.map +1 -1
  212. package/build/components/start-page-options/index.js +139 -0
  213. package/build/components/start-page-options/index.js.map +1 -0
  214. package/build/components/table-of-contents/index.js.map +1 -1
  215. package/build/components/table-of-contents/panel.js.map +1 -1
  216. package/build/components/template-areas/index.js.map +1 -1
  217. package/build/components/template-validation-notice/index.js +23 -29
  218. package/build/components/template-validation-notice/index.js.map +1 -1
  219. package/build/components/theme-support-check/index.js +10 -16
  220. package/build/components/theme-support-check/index.js.map +1 -1
  221. package/build/components/time-to-read/index.js.map +1 -1
  222. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  223. package/build/components/word-count/index.js.map +1 -1
  224. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  225. package/build/hooks/default-autocompleters.js.map +1 -1
  226. package/build/hooks/index.js.map +1 -1
  227. package/build/hooks/index.native.js.map +1 -1
  228. package/build/hooks/pattern-overrides.js +22 -10
  229. package/build/hooks/pattern-overrides.js.map +1 -1
  230. package/build/hooks/use-select-nearest-editable-block.js.map +1 -1
  231. package/build/index.js.map +1 -1
  232. package/build/index.native.js.map +1 -1
  233. package/build/lock-unlock.js.map +1 -1
  234. package/build/private-apis.js +20 -1
  235. package/build/private-apis.js.map +1 -1
  236. package/build/store/actions.js.map +1 -1
  237. package/build/store/actions.native.js.map +1 -1
  238. package/build/store/constants.js +8 -1
  239. package/build/store/constants.js.map +1 -1
  240. package/build/store/defaults.js.map +1 -1
  241. package/build/store/index.js +1 -1
  242. package/build/store/index.js.map +1 -1
  243. package/build/store/local-autosave.js.map +1 -1
  244. package/build/store/private-actions.js +177 -4
  245. package/build/store/private-actions.js.map +1 -1
  246. package/build/store/private-selectors.js +1 -7
  247. package/build/store/private-selectors.js.map +1 -1
  248. package/build/store/reducer.js.map +1 -1
  249. package/build/store/reducer.native.js.map +1 -1
  250. package/build/store/selectors.js +5 -10
  251. package/build/store/selectors.js.map +1 -1
  252. package/build/store/selectors.native.js.map +1 -1
  253. package/build/store/utils/get-filtered-template-parts.js.map +1 -1
  254. package/build/store/utils/is-template-revertable.js +28 -0
  255. package/build/store/utils/is-template-revertable.js.map +1 -0
  256. package/build/store/utils/notice-builder.js.map +1 -1
  257. package/build/utils/get-template-part-icon.js.map +1 -1
  258. package/build/utils/index.js.map +1 -1
  259. package/build/utils/index.native.js.map +1 -1
  260. package/build/utils/media-upload/index.js.map +1 -1
  261. package/build/utils/media-upload/index.native.js.map +1 -1
  262. package/build/utils/terms.js.map +1 -1
  263. package/build/utils/url.js.map +1 -1
  264. package/build-module/bindings/index.js.map +1 -1
  265. package/build-module/bindings/pattern-overrides.js.map +1 -1
  266. package/build-module/bindings/post-meta.js +14 -31
  267. package/build-module/bindings/post-meta.js.map +1 -1
  268. package/build-module/components/autocompleters/index.js.map +1 -1
  269. package/build-module/components/autocompleters/user.js.map +1 -1
  270. package/build-module/components/autosave-monitor/index.js +10 -0
  271. package/build-module/components/autosave-monitor/index.js.map +1 -1
  272. package/build-module/components/block-manager/category.js.map +1 -1
  273. package/build-module/components/block-manager/checklist.js.map +1 -1
  274. package/build-module/components/block-manager/index.js.map +1 -1
  275. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  276. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  277. package/build-module/components/character-count/index.js.map +1 -1
  278. package/build-module/components/commands/index.js +20 -1
  279. package/build-module/components/commands/index.js.map +1 -1
  280. package/build-module/components/commands/index.native.js.map +1 -1
  281. package/build-module/components/deprecated.js.map +1 -1
  282. package/build-module/components/deprecated.native.js.map +1 -1
  283. package/build-module/components/document-bar/index.js.map +1 -1
  284. package/build-module/components/document-outline/check.js.map +1 -1
  285. package/build-module/components/document-outline/index.js.map +1 -1
  286. package/build-module/components/document-outline/item.js.map +1 -1
  287. package/build-module/components/document-tools/index.js +1 -1
  288. package/build-module/components/document-tools/index.js.map +1 -1
  289. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +13 -2
  290. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  291. package/build-module/components/editor-canvas/index.js +2 -2
  292. package/build-module/components/editor-canvas/index.js.map +1 -1
  293. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  294. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  295. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  296. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  297. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  298. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -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.map +1 -1
  301. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  302. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  303. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  304. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  305. package/build-module/components/editor-history/redo.js.map +1 -1
  306. package/build-module/components/editor-history/undo.js.map +1 -1
  307. package/build-module/components/editor-notices/index.js.map +1 -1
  308. package/build-module/components/editor-snackbars/index.js.map +1 -1
  309. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  310. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  311. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  312. package/build-module/components/entities-saved-states/index.js.map +1 -1
  313. package/build-module/components/error-boundary/index.js.map +1 -1
  314. package/build-module/components/error-boundary/index.native.js.map +1 -1
  315. package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
  316. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  317. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  318. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  319. package/build-module/components/index.js +4 -0
  320. package/build-module/components/index.js.map +1 -1
  321. package/build-module/components/index.native.js.map +1 -1
  322. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  323. package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
  324. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  325. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  326. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  327. package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
  328. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  329. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
  330. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  331. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  332. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  333. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  334. package/build-module/components/media-categories/index.js.map +1 -1
  335. package/build-module/components/mode-switcher/index.js.map +1 -1
  336. package/build-module/components/offline-status/index.native.js.map +1 -1
  337. package/build-module/components/page-attributes/check.js.map +1 -1
  338. package/build-module/components/page-attributes/order.js.map +1 -1
  339. package/build-module/components/page-attributes/panel.js.map +1 -1
  340. package/build-module/components/page-attributes/parent.js.map +1 -1
  341. package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
  342. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  343. package/build-module/components/plugin-more-menu-item/index.js +73 -0
  344. package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
  345. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  346. package/build-module/components/plugin-post-status-info/index.js +66 -0
  347. package/build-module/components/plugin-post-status-info/index.js.map +1 -0
  348. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  349. package/build-module/components/plugin-sidebar/index.js +102 -0
  350. package/build-module/components/plugin-sidebar/index.js.map +1 -0
  351. package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
  352. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  353. package/build-module/components/post-actions/actions.js +219 -15
  354. package/build-module/components/post-actions/actions.js.map +1 -1
  355. package/build-module/components/post-actions/index.js +130 -0
  356. package/build-module/components/post-actions/index.js.map +1 -0
  357. package/build-module/components/post-author/check.js.map +1 -1
  358. package/build-module/components/post-author/combobox.js.map +1 -1
  359. package/build-module/components/post-author/constants.js.map +1 -1
  360. package/build-module/components/post-author/hook.js.map +1 -1
  361. package/build-module/components/post-author/index.js.map +1 -1
  362. package/build-module/components/post-author/panel.js.map +1 -1
  363. package/build-module/components/post-author/select.js.map +1 -1
  364. package/build-module/components/post-card-panel/index.js +42 -8
  365. package/build-module/components/post-card-panel/index.js.map +1 -1
  366. package/build-module/components/post-comments/index.js.map +1 -1
  367. package/build-module/components/post-discussion/panel.js.map +1 -1
  368. package/build-module/components/post-excerpt/check.js +9 -0
  369. package/build-module/components/post-excerpt/check.js.map +1 -1
  370. package/build-module/components/post-excerpt/index.js.map +1 -1
  371. package/build-module/components/post-excerpt/panel.js.map +1 -1
  372. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  373. package/build-module/components/post-featured-image/check.js.map +1 -1
  374. package/build-module/components/post-featured-image/index.js.map +1 -1
  375. package/build-module/components/post-featured-image/panel.js.map +1 -1
  376. package/build-module/components/post-format/check.js.map +1 -1
  377. package/build-module/components/post-format/index.js.map +1 -1
  378. package/build-module/components/post-last-revision/check.js.map +1 -1
  379. package/build-module/components/post-last-revision/index.js.map +1 -1
  380. package/build-module/components/post-last-revision/panel.js.map +1 -1
  381. package/build-module/components/post-locked-modal/index.js.map +1 -1
  382. package/build-module/components/post-panel-row/index.js.map +1 -1
  383. package/build-module/components/post-pending-status/check.js.map +1 -1
  384. package/build-module/components/post-pending-status/index.js.map +1 -1
  385. package/build-module/components/post-pingbacks/index.js.map +1 -1
  386. package/build-module/components/post-preview-button/index.js.map +1 -1
  387. package/build-module/components/post-publish-button/index.js +31 -31
  388. package/build-module/components/post-publish-button/index.js.map +1 -1
  389. package/build-module/components/post-publish-button/label.js +51 -42
  390. package/build-module/components/post-publish-button/label.js.map +1 -1
  391. package/build-module/components/post-publish-panel/index.js.map +1 -1
  392. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  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.map +1 -1
  395. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  396. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  397. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  398. package/build-module/components/post-saved-state/index.js +10 -6
  399. package/build-module/components/post-saved-state/index.js.map +1 -1
  400. package/build-module/components/post-schedule/check.js.map +1 -1
  401. package/build-module/components/post-schedule/index.js.map +1 -1
  402. package/build-module/components/post-schedule/label.js.map +1 -1
  403. package/build-module/components/post-schedule/panel.js +8 -0
  404. package/build-module/components/post-schedule/panel.js.map +1 -1
  405. package/build-module/components/post-slug/check.js.map +1 -1
  406. package/build-module/components/post-slug/index.js +44 -68
  407. package/build-module/components/post-slug/index.js.map +1 -1
  408. package/build-module/components/post-status/index.js +231 -0
  409. package/build-module/components/post-status/index.js.map +1 -0
  410. package/build-module/components/post-sticky/check.js.map +1 -1
  411. package/build-module/components/post-sticky/index.js.map +1 -1
  412. package/build-module/components/post-switch-to-draft-button/index.js +7 -1
  413. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  414. package/build-module/components/post-sync-status/index.js.map +1 -1
  415. package/build-module/components/post-taxonomies/check.js.map +1 -1
  416. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  417. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  418. package/build-module/components/post-taxonomies/index.js.map +1 -1
  419. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  420. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  421. package/build-module/components/post-template/block-theme.js +7 -3
  422. package/build-module/components/post-template/block-theme.js.map +1 -1
  423. package/build-module/components/post-template/classic-theme.js.map +1 -1
  424. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  425. package/build-module/components/post-template/create-new-template.js.map +1 -1
  426. package/build-module/components/post-template/hooks.js.map +1 -1
  427. package/build-module/components/post-template/panel.js.map +1 -1
  428. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  429. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  430. package/build-module/components/post-text-editor/index.js.map +1 -1
  431. package/build-module/components/post-title/constants.js.map +1 -1
  432. package/build-module/components/post-title/index.js.map +1 -1
  433. package/build-module/components/post-title/index.native.js.map +1 -1
  434. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  435. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  436. package/build-module/components/post-title/use-post-title.js.map +1 -1
  437. package/build-module/components/post-trash/check.js +24 -26
  438. package/build-module/components/post-trash/check.js.map +1 -1
  439. package/build-module/components/post-trash/index.js +2 -1
  440. package/build-module/components/post-trash/index.js.map +1 -1
  441. package/build-module/components/post-type-support-check/index.js.map +1 -1
  442. package/build-module/components/post-url/check.js.map +1 -1
  443. package/build-module/components/post-url/index.js +46 -21
  444. package/build-module/components/post-url/index.js.map +1 -1
  445. package/build-module/components/post-url/label.js.map +1 -1
  446. package/build-module/components/post-url/panel.js +14 -7
  447. package/build-module/components/post-url/panel.js.map +1 -1
  448. package/build-module/components/post-view-link/index.js.map +1 -1
  449. package/build-module/components/post-visibility/check.js.map +1 -1
  450. package/build-module/components/post-visibility/index.js +2 -1
  451. package/build-module/components/post-visibility/index.js.map +1 -1
  452. package/build-module/components/post-visibility/label.js.map +1 -1
  453. package/build-module/components/post-visibility/utils.js.map +1 -1
  454. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  455. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  456. package/build-module/components/preferences-modal/index.js +19 -17
  457. package/build-module/components/preferences-modal/index.js.map +1 -1
  458. package/build-module/components/preview-dropdown/index.js.map +1 -1
  459. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  460. package/build-module/components/provider/index.js +5 -3
  461. package/build-module/components/provider/index.js.map +1 -1
  462. package/build-module/components/provider/index.native.js.map +1 -1
  463. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  464. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
  465. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  466. package/build-module/components/provider/use-block-editor-settings.js +66 -45
  467. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  468. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  469. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  470. package/build-module/components/provider/with-registry-provider.js +1 -0
  471. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  472. package/build-module/components/start-page-options/index.js +132 -0
  473. package/build-module/components/start-page-options/index.js.map +1 -0
  474. package/build-module/components/table-of-contents/index.js.map +1 -1
  475. package/build-module/components/table-of-contents/panel.js.map +1 -1
  476. package/build-module/components/template-areas/index.js.map +1 -1
  477. package/build-module/components/template-validation-notice/index.js +25 -31
  478. package/build-module/components/template-validation-notice/index.js.map +1 -1
  479. package/build-module/components/theme-support-check/index.js +11 -16
  480. package/build-module/components/theme-support-check/index.js.map +1 -1
  481. package/build-module/components/time-to-read/index.js.map +1 -1
  482. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  483. package/build-module/components/word-count/index.js.map +1 -1
  484. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  485. package/build-module/hooks/default-autocompleters.js.map +1 -1
  486. package/build-module/hooks/index.js.map +1 -1
  487. package/build-module/hooks/index.native.js.map +1 -1
  488. package/build-module/hooks/pattern-overrides.js +22 -10
  489. package/build-module/hooks/pattern-overrides.js.map +1 -1
  490. package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -1
  491. package/build-module/index.js.map +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 +18 -1
  495. package/build-module/private-apis.js.map +1 -1
  496. package/build-module/store/actions.js.map +1 -1
  497. package/build-module/store/actions.native.js.map +1 -1
  498. package/build-module/store/constants.js +7 -0
  499. package/build-module/store/constants.js.map +1 -1
  500. package/build-module/store/defaults.js.map +1 -1
  501. package/build-module/store/index.js.map +1 -1
  502. package/build-module/store/local-autosave.js.map +1 -1
  503. package/build-module/store/private-actions.js +174 -4
  504. package/build-module/store/private-actions.js.map +1 -1
  505. package/build-module/store/private-selectors.js +1 -6
  506. package/build-module/store/private-selectors.js.map +1 -1
  507. package/build-module/store/reducer.js.map +1 -1
  508. package/build-module/store/reducer.native.js.map +1 -1
  509. package/build-module/store/selectors.js +1 -6
  510. package/build-module/store/selectors.js.map +1 -1
  511. package/build-module/store/selectors.native.js.map +1 -1
  512. package/build-module/store/utils/get-filtered-template-parts.js.map +1 -1
  513. package/build-module/store/utils/is-template-revertable.js +22 -0
  514. package/build-module/store/utils/is-template-revertable.js.map +1 -0
  515. package/build-module/store/utils/notice-builder.js.map +1 -1
  516. package/build-module/utils/get-template-part-icon.js.map +1 -1
  517. package/build-module/utils/index.js.map +1 -1
  518. package/build-module/utils/index.native.js.map +1 -1
  519. package/build-module/utils/media-upload/index.js.map +1 -1
  520. package/build-module/utils/media-upload/index.native.js.map +1 -1
  521. package/build-module/utils/terms.js.map +1 -1
  522. package/build-module/utils/url.js.map +1 -1
  523. package/build-style/style-rtl.css +498 -25
  524. package/build-style/style.css +498 -25
  525. package/package.json +35 -35
  526. package/src/bindings/post-meta.js +11 -27
  527. package/src/components/autosave-monitor/index.js +9 -0
  528. package/src/components/commands/index.js +20 -1
  529. package/src/components/document-tools/index.js +16 -14
  530. package/src/components/editor-canvas/edit-template-blocks-notification.js +16 -2
  531. package/src/components/editor-canvas/index.js +4 -4
  532. package/src/components/error-boundary/style.native.scss +1 -1
  533. package/src/components/global-keyboard-shortcuts/index.js +25 -0
  534. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
  535. package/src/components/index.js +4 -0
  536. package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
  537. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
  538. package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
  539. package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
  540. package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
  541. package/src/components/plugin-more-menu-item/index.js +73 -0
  542. package/src/components/plugin-post-status-info/index.js +63 -0
  543. package/src/components/plugin-sidebar/index.js +98 -0
  544. package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
  545. package/src/components/post-actions/actions.js +294 -14
  546. package/src/components/post-actions/index.js +156 -0
  547. package/src/components/post-actions/style.scss +3 -0
  548. package/src/components/post-card-panel/index.js +69 -9
  549. package/src/components/post-excerpt/check.js +8 -0
  550. package/src/components/post-publish-button/index.js +23 -36
  551. package/src/components/post-publish-button/label.js +54 -39
  552. package/src/components/post-publish-button/test/index.js +15 -26
  553. package/src/components/post-publish-button/test/label.js +44 -21
  554. package/src/components/post-saved-state/index.js +13 -6
  555. package/src/components/post-saved-state/test/index.js +4 -0
  556. package/src/components/post-schedule/panel.js +22 -0
  557. package/src/components/post-slug/index.js +50 -68
  558. package/src/components/post-slug/test/index.js +29 -6
  559. package/src/components/post-status/index.js +310 -0
  560. package/src/components/post-status/style.scss +75 -0
  561. package/src/components/post-switch-to-draft-button/index.js +5 -0
  562. package/src/components/post-template/block-theme.js +31 -22
  563. package/src/components/post-trash/check.js +19 -19
  564. package/src/components/post-trash/index.js +1 -0
  565. package/src/components/post-url/index.js +131 -101
  566. package/src/components/post-url/panel.js +20 -7
  567. package/src/components/post-url/style.scss +8 -6
  568. package/src/components/post-visibility/index.js +1 -0
  569. package/src/components/preferences-modal/index.js +26 -22
  570. package/src/components/provider/index.js +17 -8
  571. package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
  572. package/src/components/provider/use-block-editor-settings.js +59 -33
  573. package/src/components/provider/with-registry-provider.js +1 -0
  574. package/src/components/start-page-options/index.js +135 -0
  575. package/src/components/start-page-options/style.scss +26 -0
  576. package/src/components/template-validation-notice/index.js +48 -50
  577. package/src/components/theme-support-check/index.js +9 -16
  578. package/src/components/theme-support-check/test/index.js +44 -43
  579. package/src/hooks/pattern-overrides.js +25 -14
  580. package/src/private-apis.js +15 -0
  581. package/src/store/constants.js +7 -0
  582. package/src/store/private-actions.js +269 -4
  583. package/src/store/private-selectors.js +1 -6
  584. package/src/store/selectors.js +1 -6
  585. package/src/store/utils/is-template-revertable.js +23 -0
  586. package/src/style.scss +6 -2
  587. package/src/components/post-publish-button/style.scss +0 -8
  588. package/src/components/provider/test/disable-non-page-content-blocks.js +0 -111
  589. package/src/components/template-validation-notice/style.scss +0 -9
@@ -1 +1 @@
1
- {"version":3,"names":["BackHandler","memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","getBlockType","createBlock","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","__","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","EditorProvider","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","onHardwareBackPress","bind","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","createErrorNotice","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","blockType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","hardwareBackPressListener","addEventListener","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","clearSelectedBlock","mode","hasChanges","raw","content","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","createElement","Fragment","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","updateSettings","__unstableShouldCreateUndoLevel","ExperimentalEditorProvider"],"sources":["@wordpress/editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { BackHandler } from 'react-native';\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\tgetBlockType,\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';\nimport { __ } from '@wordpress/i18n';\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\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.onHardwareBackPress = this.onHardwareBackPress.bind( this );\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\tcreateErrorNotice,\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 blockType = getBlockType( blockName );\n\n\t\t\t\tif ( blockType && blockType?.name ) {\n\t\t\t\t\tconst newBlock = createBlock( blockType.name, {\n\t\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst indexAfterSelected =\n\t\t\t\t\t\tthis.props.selectedBlockIndex + 1;\n\t\t\t\t\tconst insertionIndex =\n\t\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t\t} else {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__( 'File type not supported as a media file.' )\n\t\t\t\t\t);\n\t\t\t\t}\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\tthis.hardwareBackPressListener = BackHandler.addEventListener(\n\t\t\t'hardwareBackPress',\n\t\t\tthis.onHardwareBackPress\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\n\t\tif ( this.hardwareBackPressListener ) {\n\t\t\tthis.hardwareBackPressListener.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\tonHardwareBackPress() {\n\t\tconst { clearSelectedBlock, selectedBlockIndex } = this.props;\n\n\t\tif ( selectedBlockIndex !== -1 ) {\n\t\t\tclearSelectedBlock();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\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\tgetEditorMode,\n\t\t} = select( editorStore );\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 {\n\t\t\teditPost,\n\t\t\tresetEditorBlocks,\n\t\t\tupdateEditorSettings,\n\t\t\tswitchEditorMode,\n\t\t} = dispatch( editorStore );\n\t\tconst {\n\t\t\tclearSelectedBlock,\n\t\t\tupdateSettings,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tdispatch( 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\tcreateErrorNotice,\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,cAAc;AAC1C,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,gBAAgB,QAAQ,gCAAgC;;AAEjE;AACA;AACA;AACA,OAAOC,4BAA4B,IAClCC,2BAA2B,EAC3BC,uBAAuB,EACvBC,sBAAsB,EACtBC,6BAA6B,EAC7BC,mBAAmB,EACnBC,iBAAiB,EACjBC,oBAAoB,EACpBC,qBAAqB,EACrBC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mBAAmB,EACnBC,uBAAuB,QACjB,gCAAgC;AACvC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,KAAK,EACLC,SAAS,EACTC,8BAA8B,EAC9BC,YAAY,EACZC,WAAW,QACL,mBAAmB;AAC1B,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,eAAe,EAAEC,qBAAqB,QAAQ,uBAAuB;AAC9E,SAASC,eAAe,QAAQ,0BAA0B;AAC1D,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,MAAMC,gBAAgB,GAAG,CACxB;EAAEC,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAe,CAAC,EACzC;EAAED,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAe,CAAC,EACzC;EAAED,IAAI,EAAE,YAAY;EAA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AASA,sBAAsB,IAAIsB,0BAA0B"}
1
+ {"version":3,"names":["BackHandler","memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","getBlockType","createBlock","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","__","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","EditorProvider","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","onHardwareBackPress","bind","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","createErrorNotice","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","blockType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","galleryWithImageBlocks","editorSettings","window","wp","galleryBlockV2Enabled","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","hardwareBackPressListener","addEventListener","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","clearSelectedBlock","mode","hasChanges","raw","content","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","createElement","Fragment","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","updateSettings","__unstableShouldCreateUndoLevel","ExperimentalEditorProvider"],"sources":["@wordpress/editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { BackHandler } from 'react-native';\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\tgetBlockType,\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';\nimport { __ } from '@wordpress/i18n';\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\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.onHardwareBackPress = this.onHardwareBackPress.bind( this );\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\tcreateErrorNotice,\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 blockType = getBlockType( blockName );\n\n\t\t\t\tif ( blockType && blockType?.name ) {\n\t\t\t\t\tconst newBlock = createBlock( blockType.name, {\n\t\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst indexAfterSelected =\n\t\t\t\t\t\tthis.props.selectedBlockIndex + 1;\n\t\t\t\t\tconst insertionIndex =\n\t\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t\t} else {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__( 'File type not supported as a media file.' )\n\t\t\t\t\t);\n\t\t\t\t}\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\tthis.hardwareBackPressListener = BackHandler.addEventListener(\n\t\t\t'hardwareBackPress',\n\t\t\tthis.onHardwareBackPress\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\n\t\tif ( this.hardwareBackPressListener ) {\n\t\t\tthis.hardwareBackPressListener.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\tonHardwareBackPress() {\n\t\tconst { clearSelectedBlock, selectedBlockIndex } = this.props;\n\n\t\tif ( selectedBlockIndex !== -1 ) {\n\t\t\tclearSelectedBlock();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\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\tgetEditorMode,\n\t\t} = select( editorStore );\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 {\n\t\t\teditPost,\n\t\t\tresetEditorBlocks,\n\t\t\tupdateEditorSettings,\n\t\t\tswitchEditorMode,\n\t\t} = dispatch( editorStore );\n\t\tconst {\n\t\t\tclearSelectedBlock,\n\t\t\tupdateSettings,\n\t\t\tinsertBlock,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tdispatch( 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\tcreateErrorNotice,\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,cAAc;AAC1C,OAAOC,MAAM,MAAM,QAAQ;AAC3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AAiB;IACjB/G,oBAAoB;IACpBgH;EACD,CAAC,GAAGH,QAAQ,CAAErI,WAAY,CAAC;EAC3B,MAAM;IACL8F,kBAAkB;IAClB2C,cAAc;IACdpF,WAAW;IACXqD;EACD,CAAC,GAAG2B,QAAQ,CAAEvJ,gBAAiB,CAAC;EAChC,MAAM;IAAE2B,WAAW;IAAEC;EAAqB,CAAC,GAAG2H,QAAQ,CAAEnI,SAAU,CAAC;EACnE,MAAM;IAAE6D,mBAAmB;IAAE1C;EAAkB,CAAC,GAC/CgH,QAAQ,CAAEpI,YAAa,CAAC;EAEzB,OAAO;IACNwB,yBAAyB,EAAEgH,cAAc;IACzCjH,oBAAoB;IACpBf,WAAW;IACX4C,WAAW;IACXU,mBAAmB;IACnB1C,iBAAiB;IACjByE,kBAAkB;IAClB7D,SAASA,CAAEC,KAAK,EAAG;MAClBoG,QAAQ,CAAE;QAAEpG;MAAM,CAAE,CAAC;IACtB,CAAC;IACDxB,oBAAoB;IACpB8F,iCAAiCA,CAAE9G,MAAM,EAAG;MAC3C6I,iBAAiB,CAAE7I,MAAM,EAAE;QAC1BgJ,+BAA+B,EAAE;MAClC,CAAE,CAAC;IACJ,CAAC;IACD/B,UAAUA,CAAEZ,IAAI,EAAG;MAClByC,gBAAgB,CAAEzC,IAAK,CAAC;IACzB,CAAC;IACDW;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEtG,oBAAqB,CAAC;AAE3B,eAAeiH,sBAAsB;AACrC,SAASA,sBAAsB,IAAIsB,0BAA0B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useDispatch","useSelect","store","blockEditorStore","NavigationBlockEditingMode","blockClientId","select","getBlockOrder","setBlockEditingMode","unsetBlockEditingMode"],"sources":["@wordpress/editor/src/components/provider/navigation-block-editing-mode.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * For the Navigation block editor, we need to force the block editor to contentOnly for that block.\n *\n * Set block editing mode to contentOnly when entering Navigation focus mode.\n * this ensures that non-content controls on the block will be hidden and thus\n * the user can focus on editing the Navigation Menu content only.\n */\n\nexport default function NavigationBlockEditingMode() {\n\t// In the navigation block editor,\n\t// the navigation block is the only root block.\n\tconst blockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockOrder()?.[ 0 ],\n\t\t[]\n\t);\n\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! blockClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetBlockEditingMode( blockClientId, 'contentOnly' );\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( blockClientId );\n\t\t};\n\t}, [ blockClientId, unsetBlockEditingMode, setBlockEditingMode ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,SAASC,0BAA0BA,CAAA,EAAG;EACpD;EACA;EACA,MAAMC,aAAa,GAAGJ,SAAS,CAC5BK,MAAM,IAAMA,MAAM,CAAEH,gBAAiB,CAAC,CAACI,aAAa,CAAC,CAAC,GAAI,CAAC,CAAE,EAC/D,EACD,CAAC;EACD,MAAM;IAAEC,mBAAmB;IAAEC;EAAsB,CAAC,GACnDT,WAAW,CAAEG,gBAAiB,CAAC;EAEhCJ,SAAS,CAAE,MAAM;IAChB,IAAK,CAAEM,aAAa,EAAG;MACtB;IACD;IAEAG,mBAAmB,CAAEH,aAAa,EAAE,aAAc,CAAC;IAEnD,OAAO,MAAM;MACZI,qBAAqB,CAAEJ,aAAc,CAAC;IACvC,CAAC;EACF,CAAC,EAAE,CAAEA,aAAa,EAAEI,qBAAqB,EAAED,mBAAmB,CAAG,CAAC;AACnE"}
1
+ {"version":3,"names":["useEffect","useDispatch","useSelect","store","blockEditorStore","NavigationBlockEditingMode","blockClientId","select","getBlockOrder","setBlockEditingMode","unsetBlockEditingMode"],"sources":["@wordpress/editor/src/components/provider/navigation-block-editing-mode.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * For the Navigation block editor, we need to force the block editor to contentOnly for that block.\n *\n * Set block editing mode to contentOnly when entering Navigation focus mode.\n * this ensures that non-content controls on the block will be hidden and thus\n * the user can focus on editing the Navigation Menu content only.\n */\n\nexport default function NavigationBlockEditingMode() {\n\t// In the navigation block editor,\n\t// the navigation block is the only root block.\n\tconst blockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockOrder()?.[ 0 ],\n\t\t[]\n\t);\n\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( ! blockClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetBlockEditingMode( blockClientId, 'contentOnly' );\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( blockClientId );\n\t\t};\n\t}, [ blockClientId, unsetBlockEditingMode, setBlockEditingMode ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe,SAASC,0BAA0BA,CAAA,EAAG;EACpD;EACA;EACA,MAAMC,aAAa,GAAGJ,SAAS,CAC5BK,MAAM,IAAMA,MAAM,CAAEH,gBAAiB,CAAC,CAACI,aAAa,CAAC,CAAC,GAAI,CAAC,CAAE,EAC/D,EACD,CAAC;EACD,MAAM;IAAEC,mBAAmB;IAAEC;EAAsB,CAAC,GACnDT,WAAW,CAAEG,gBAAiB,CAAC;EAEhCJ,SAAS,CAAE,MAAM;IAChB,IAAK,CAAEM,aAAa,EAAG;MACtB;IACD;IAEAG,mBAAmB,CAAEH,aAAa,EAAE,aAAc,CAAC;IAEnD,OAAO,MAAM;MACZI,qBAAqB,CAAEJ,aAAc,CAAC;IACvC,CAAC;EACF,CAAC,EAAE,CAAEA,aAAa,EAAEI,qBAAqB,EAAED,mBAAmB,CAAG,CAAC;AACnE","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect, useDispatch } from '@wordpress/data';
5
+ import { useEffect } from '@wordpress/element';
6
+ import { store as blockEditorStore } from '@wordpress/block-editor';
7
+ import { store as preferencesStore } from '@wordpress/preferences';
8
+ import { store as interfaceStore } from '@wordpress/interface';
9
+
10
+ /**
11
+ * This listener hook monitors for block selection and triggers the appropriate
12
+ * sidebar state.
13
+ */
14
+ function useAutoSwitchEditorSidebars() {
15
+ const {
16
+ hasBlockSelection
17
+ } = useSelect(select => {
18
+ return {
19
+ hasBlockSelection: !!select(blockEditorStore).getBlockSelectionStart()
20
+ };
21
+ }, []);
22
+ const {
23
+ getActiveComplementaryArea
24
+ } = useSelect(interfaceStore);
25
+ const {
26
+ enableComplementaryArea
27
+ } = useDispatch(interfaceStore);
28
+ const {
29
+ get: getPreference
30
+ } = useSelect(preferencesStore);
31
+ useEffect(() => {
32
+ const activeGeneralSidebar = getActiveComplementaryArea('core');
33
+ const isEditorSidebarOpened = ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar);
34
+ const isDistractionFree = getPreference('core', 'distractionFree');
35
+ if (!isEditorSidebarOpened || isDistractionFree) {
36
+ return;
37
+ }
38
+ if (hasBlockSelection) {
39
+ enableComplementaryArea('core', 'edit-post/block');
40
+ } else {
41
+ enableComplementaryArea('core', 'edit-post/document');
42
+ }
43
+ }, [hasBlockSelection, getActiveComplementaryArea, enableComplementaryArea, getPreference]);
44
+ }
45
+ export default useAutoSwitchEditorSidebars;
46
+ //# sourceMappingURL=use-auto-switch-editor-sidebars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSelect","useDispatch","useEffect","store","blockEditorStore","preferencesStore","interfaceStore","useAutoSwitchEditorSidebars","hasBlockSelection","select","getBlockSelectionStart","getActiveComplementaryArea","enableComplementaryArea","get","getPreference","activeGeneralSidebar","isEditorSidebarOpened","includes","isDistractionFree"],"sources":["@wordpress/editor/src/components/provider/use-auto-switch-editor-sidebars.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * This listener hook monitors for block selection and triggers the appropriate\n * sidebar state.\n */\nfunction useAutoSwitchEditorSidebars() {\n\tconst { hasBlockSelection } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\n\tconst { getActiveComplementaryArea } = useSelect( interfaceStore );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\n\tuseEffect( () => {\n\t\tconst activeGeneralSidebar = getActiveComplementaryArea( 'core' );\n\t\tconst isEditorSidebarOpened = [\n\t\t\t'edit-post/document',\n\t\t\t'edit-post/block',\n\t\t].includes( activeGeneralSidebar );\n\t\tconst isDistractionFree = getPreference( 'core', 'distractionFree' );\n\t\tif ( ! isEditorSidebarOpened || isDistractionFree ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasBlockSelection ) {\n\t\t\tenableComplementaryArea( 'core', 'edit-post/block' );\n\t\t} else {\n\t\t\tenableComplementaryArea( 'core', 'edit-post/document' );\n\t\t}\n\t}, [\n\t\thasBlockSelection,\n\t\tgetActiveComplementaryArea,\n\t\tenableComplementaryArea,\n\t\tgetPreference,\n\t] );\n}\n\nexport default useAutoSwitchEditorSidebars;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SAASF,KAAK,IAAIG,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA;AACA,SAASC,2BAA2BA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAkB,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IACtD,OAAO;MACND,iBAAiB,EAChB,CAAC,CAAEC,MAAM,CAAEL,gBAAiB,CAAC,CAACM,sBAAsB,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEC;EAA2B,CAAC,GAAGX,SAAS,CAAEM,cAAe,CAAC;EAClE,MAAM;IAAEM;EAAwB,CAAC,GAAGX,WAAW,CAAEK,cAAe,CAAC;EACjE,MAAM;IAAEO,GAAG,EAAEC;EAAc,CAAC,GAAGd,SAAS,CAAEK,gBAAiB,CAAC;EAE5DH,SAAS,CAAE,MAAM;IAChB,MAAMa,oBAAoB,GAAGJ,0BAA0B,CAAE,MAAO,CAAC;IACjE,MAAMK,qBAAqB,GAAG,CAC7B,oBAAoB,EACpB,iBAAiB,CACjB,CAACC,QAAQ,CAAEF,oBAAqB,CAAC;IAClC,MAAMG,iBAAiB,GAAGJ,aAAa,CAAE,MAAM,EAAE,iBAAkB,CAAC;IACpE,IAAK,CAAEE,qBAAqB,IAAIE,iBAAiB,EAAG;MACnD;IACD;IACA,IAAKV,iBAAiB,EAAG;MACxBI,uBAAuB,CAAE,MAAM,EAAE,iBAAkB,CAAC;IACrD,CAAC,MAAM;MACNA,uBAAuB,CAAE,MAAM,EAAE,oBAAqB,CAAC;IACxD;EACD,CAAC,EAAE,CACFJ,iBAAiB,EACjBG,0BAA0B,EAC1BC,uBAAuB,EACvBE,aAAa,CACZ,CAAC;AACJ;AAEA,eAAeP,2BAA2B","ignoreList":[]}
@@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
8
8
  import { store as preferencesStore } from '@wordpress/preferences';
9
9
  import { useViewportMatch } from '@wordpress/compose';
10
10
  import { store as blocksStore } from '@wordpress/blocks';
11
- import { privateApis } from '@wordpress/block-editor';
11
+ import { privateApis, store as blockEditorStore } from '@wordpress/block-editor';
12
12
 
13
13
  /**
14
14
  * Internal dependencies
@@ -16,7 +16,7 @@ import { privateApis } from '@wordpress/block-editor';
16
16
  import inserterMediaCategories from '../media-categories';
17
17
  import { mediaUpload } from '../../utils';
18
18
  import { store as editorStore } from '../../store';
19
- import { unlock } from '../../lock-unlock';
19
+ import { lock, unlock } from '../../lock-unlock';
20
20
  const EMPTY_BLOCKS_LIST = [];
21
21
  function __experimentalReusableBlocksSelect(select) {
22
22
  var _select$getEntityReco;
@@ -24,18 +24,19 @@ function __experimentalReusableBlocksSelect(select) {
24
24
  per_page: -1
25
25
  })) !== null && _select$getEntityReco !== void 0 ? _select$getEntityReco : EMPTY_BLOCKS_LIST;
26
26
  }
27
- const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__unstableGalleryWithImageBlocks', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel'];
27
+ const BLOCK_EDITOR_SETTINGS = ['__experimentalBlockDirectory', '__experimentalDiscussionSettings', '__experimentalFeatures', '__experimentalGlobalStylesBaseStyles', '__unstableGalleryWithImageBlocks', 'alignWide', 'blockInspectorTabs', 'allowedMimeTypes', 'bodyPlaceholder', 'canLockBlocks', 'capabilities', 'clearBlockSelection', 'codeEditingEnabled', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'disableCustomSpacingSizes', 'disableCustomGradients', 'disableLayoutStyles', 'enableCustomLineHeight', 'enableCustomSpacing', 'enableCustomUnits', 'enableOpenverseMediaCategory', 'fontSizes', 'gradients', 'generateAnchors', 'onNavigateToEntityRecord', 'imageDefaultSize', 'imageDimensions', 'imageEditing', 'imageSizes', 'isRTL', 'locale', 'maxWidth', 'postContentAttributes', 'postsPerPage', 'readOnly', 'sectionRootClientId', 'styles', 'titlePlaceholder', 'supportsLayout', 'widgetTypesToHideFromLegacyWidgetBlock', '__unstableHasCustomAppender', '__unstableIsPreviewMode', '__unstableResolvedAssets', '__unstableIsBlockBasedTheme', '__experimentalArchiveTitleTypeLabel', '__experimentalArchiveTitleNameLabel'];
28
28
 
29
29
  /**
30
30
  * React hook used to compute the block editor settings to use for the post editor.
31
31
  *
32
- * @param {Object} settings EditorProvider settings prop.
33
- * @param {string} postType Editor root level post type.
34
- * @param {string} postId Editor root level post ID.
32
+ * @param {Object} settings EditorProvider settings prop.
33
+ * @param {string} postType Editor root level post type.
34
+ * @param {string} postId Editor root level post ID.
35
+ * @param {string} renderingMode Editor rendering mode.
35
36
  *
36
37
  * @return {Object} Block Editor Settings.
37
38
  */
38
- function useBlockEditorSettings(settings, postType, postId) {
39
+ function useBlockEditorSettings(settings, postType, postId, renderingMode) {
39
40
  var _settings$__experimen, _settings$__experimen2;
40
41
  const isLargeViewport = useViewportMatch('medium');
41
42
  const {
@@ -52,7 +53,8 @@ function useBlockEditorSettings(settings, postType, postId) {
52
53
  pageOnFront,
53
54
  pageForPosts,
54
55
  userPatternCategories,
55
- restBlockPatternCategories
56
+ restBlockPatternCategories,
57
+ sectionRootClientId
56
58
  } = useSelect(select => {
57
59
  var _canUser;
58
60
  const {
@@ -68,7 +70,19 @@ function useBlockEditorSettings(settings, postType, postId) {
68
70
  const {
69
71
  getBlockTypes
70
72
  } = select(blocksStore);
73
+ const {
74
+ getBlocksByName,
75
+ getBlockAttributes
76
+ } = select(blockEditorStore);
71
77
  const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined;
78
+ function getSectionRootBlock() {
79
+ var _getBlocksByName$find;
80
+ if (renderingMode === 'template-locked') {
81
+ var _getBlocksByName$;
82
+ return (_getBlocksByName$ = getBlocksByName('core/post-content')?.[0]) !== null && _getBlocksByName$ !== void 0 ? _getBlocksByName$ : '';
83
+ }
84
+ return (_getBlocksByName$find = getBlocksByName('core/group').find(clientId => getBlockAttributes(clientId)?.tagName === 'main')) !== null && _getBlocksByName$find !== void 0 ? _getBlocksByName$find : '';
85
+ }
72
86
  return {
73
87
  allowRightClickOverrides: get('core', 'allowRightClickOverrides'),
74
88
  blockTypes: getBlockTypes(),
@@ -83,9 +97,10 @@ function useBlockEditorSettings(settings, postType, postId) {
83
97
  pageOnFront: siteSettings?.page_on_front,
84
98
  pageForPosts: siteSettings?.page_for_posts,
85
99
  userPatternCategories: getUserPatternCategories(),
86
- restBlockPatternCategories: getBlockPatternCategories()
100
+ restBlockPatternCategories: getBlockPatternCategories(),
101
+ sectionRootClientId: getSectionRootBlock()
87
102
  };
88
- }, [postType, postId, isLargeViewport]);
103
+ }, [postType, postId, isLargeViewport, renderingMode]);
89
104
  const settingsBlockPatterns = (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen :
90
105
  // WP 6.0
91
106
  settings.__experimentalBlockPatterns; // WP 5.9
@@ -136,41 +151,47 @@ function useBlockEditorSettings(settings, postType, postId) {
136
151
  return settings.allowedBlockTypes;
137
152
  }, [settings.allowedBlockTypes, hiddenBlockTypes, blockTypes]);
138
153
  const forceDisableFocusMode = settings.focusMode === false;
139
- return useMemo(() => ({
140
- ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
141
- allowedBlockTypes,
142
- allowRightClickOverrides,
143
- focusMode: focusMode && !forceDisableFocusMode,
144
- hasFixedToolbar,
145
- isDistractionFree,
146
- keepCaretInsideBlock,
147
- mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
148
- __experimentalBlockPatterns: blockPatterns,
149
- [unlock(privateApis).selectBlockPatternsKey]: select => unlock(select(coreStore)).getBlockPatternsForPostType(postType),
150
- [unlock(privateApis).reusableBlocksSelectKey]: __experimentalReusableBlocksSelect,
151
- __experimentalBlockPatternCategories: blockPatternCategories,
152
- __experimentalUserPatternCategories: userPatternCategories,
153
- __experimentalFetchLinkSuggestions: (search, searchOptions) => fetchLinkSuggestions(search, searchOptions, settings),
154
- inserterMediaCategories,
155
- __experimentalFetchRichUrlData: fetchUrlData,
156
- // Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.
157
- // This might be better as a generic "canUser" selector.
158
- __experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,
159
- //Todo: this is only needed for native and should probably be removed.
160
- __experimentalUndo: undo,
161
- // Check whether we want all site editor frames to have outlines
162
- // including the navigation / pattern / parts editors.
163
- outlineMode: postType === 'wp_template',
164
- // Check these two properties: they were not present in the site editor.
165
- __experimentalCreatePageEntity: createPageEntity,
166
- __experimentalUserCanCreatePages: userCanCreatePages,
167
- pageOnFront,
168
- pageForPosts,
169
- __experimentalPreferPatternsOnRoot: postType === 'wp_template',
170
- templateLock: postType === 'wp_navigation' ? 'insert' : settings.templateLock,
171
- template: postType === 'wp_navigation' ? [['core/navigation', {}, []]] : settings.template,
172
- __experimentalSetIsInserterOpened: setIsInserterOpened
173
- }), [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened]);
154
+ return useMemo(() => {
155
+ const blockEditorSettings = {
156
+ ...Object.fromEntries(Object.entries(settings).filter(([key]) => BLOCK_EDITOR_SETTINGS.includes(key))),
157
+ allowedBlockTypes,
158
+ allowRightClickOverrides,
159
+ focusMode: focusMode && !forceDisableFocusMode,
160
+ hasFixedToolbar,
161
+ isDistractionFree,
162
+ keepCaretInsideBlock,
163
+ mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
164
+ __experimentalBlockPatterns: blockPatterns,
165
+ [unlock(privateApis).selectBlockPatternsKey]: select => unlock(select(coreStore)).getBlockPatternsForPostType(postType),
166
+ [unlock(privateApis).reusableBlocksSelectKey]: __experimentalReusableBlocksSelect,
167
+ __experimentalBlockPatternCategories: blockPatternCategories,
168
+ __experimentalUserPatternCategories: userPatternCategories,
169
+ __experimentalFetchLinkSuggestions: (search, searchOptions) => fetchLinkSuggestions(search, searchOptions, settings),
170
+ inserterMediaCategories,
171
+ __experimentalFetchRichUrlData: fetchUrlData,
172
+ // Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.
173
+ // This might be better as a generic "canUser" selector.
174
+ __experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,
175
+ //Todo: this is only needed for native and should probably be removed.
176
+ __experimentalUndo: undo,
177
+ // Check whether we want all site editor frames to have outlines
178
+ // including the navigation / pattern / parts editors.
179
+ outlineMode: postType === 'wp_template',
180
+ // Check these two properties: they were not present in the site editor.
181
+ __experimentalCreatePageEntity: createPageEntity,
182
+ __experimentalUserCanCreatePages: userCanCreatePages,
183
+ pageOnFront,
184
+ pageForPosts,
185
+ __experimentalPreferPatternsOnRoot: postType === 'wp_template',
186
+ templateLock: postType === 'wp_navigation' ? 'insert' : settings.templateLock,
187
+ template: postType === 'wp_navigation' ? [['core/navigation', {}, []]] : settings.template,
188
+ __experimentalSetIsInserterOpened: setIsInserterOpened
189
+ };
190
+ lock(blockEditorSettings, {
191
+ sectionRootClientId
192
+ });
193
+ return blockEditorSettings;
194
+ }, [allowedBlockTypes, allowRightClickOverrides, focusMode, forceDisableFocusMode, hasFixedToolbar, isDistractionFree, keepCaretInsideBlock, settings, hasUploadPermissions, userPatternCategories, blockPatterns, blockPatternCategories, canUseUnfilteredHTML, undo, createPageEntity, userCanCreatePages, pageOnFront, pageForPosts, postType, setIsInserterOpened, sectionRootClientId]);
174
195
  }
175
196
  export default useBlockEditorSettings;
176
197
  //# sourceMappingURL=use-block-editor-settings.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","__","preferencesStore","useViewportMatch","blocksStore","privateApis","inserterMediaCategories","mediaUpload","editorStore","unlock","EMPTY_BLOCKS_LIST","__experimentalReusableBlocksSelect","select","_select$getEntityReco","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","_settings$__experimen","_settings$__experimen2","isLargeViewport","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","getBlockTypes","siteSettings","undefined","_links","hasOwnProperty","page_on_front","page_for_posts","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","name","undo","setIsInserterOpened","saveEntityRecord","createPageEntity","options","Promise","reject","message","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","Object","fromEntries","entries","key","selectBlockPatternsKey","getBlockPatternsForPostType","reusableBlocksSelectKey","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } 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';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\treturn (\n\t\tselect( coreStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\tper_page: -1,\n\t\t} ) ?? EMPTY_BLOCKS_LIST\n\t);\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\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'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\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 {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport ]\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 blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { 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\t),\n\t\t[ settingsBlockPatterns, 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, setIsInserterOpened } = 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 = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\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\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ unlock( privateApis ).selectBlockPatternsKey ]: ( select ) =>\n\t\t\t\tunlock( select( coreStore ) ).getBlockPatternsForPostType(\n\t\t\t\t\tpostType\n\t\t\t\t),\n\t\t\t[ unlock( privateApis ).reusableBlocksSelectKey ]:\n\t\t\t\t__experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\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// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t} ),\n\t\t[\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode,\n\t\t\tforceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tsettings,\n\t\t\thasUploadPermissions,\n\t\t\tuserPatternCategories,\n\t\t\tblockPatterns,\n\t\t\tblockPatternCategories,\n\t\t\tcanUseUnfilteredHTML,\n\t\t\tundo,\n\t\t\tcreatePageEntity,\n\t\t\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,CAAC;AACF;AAEA,eAAevD,sBAAsB"}
1
+ {"version":3,"names":["useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","__","preferencesStore","useViewportMatch","blocksStore","privateApis","blockEditorStore","inserterMediaCategories","mediaUpload","editorStore","lock","unlock","EMPTY_BLOCKS_LIST","__experimentalReusableBlocksSelect","select","_select$getEntityReco","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","useBlockEditorSettings","settings","postType","postId","renderingMode","_settings$__experimen","_settings$__experimen2","isLargeViewport","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","getBlockTypes","getBlocksByName","getBlockAttributes","siteSettings","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","name","undo","setIsInserterOpened","saveEntityRecord","createPageEntity","options","Promise","reject","message","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","selectBlockPatternsKey","getBlockPatternsForPostType","reusableBlocksSelectKey","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } 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';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { store as editorStore } from '../../store';\nimport { lock, unlock } from '../../lock-unlock';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\treturn (\n\t\tselect( coreStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\tper_page: -1,\n\t\t} ) ?? EMPTY_BLOCKS_LIST\n\t);\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'__unstableGalleryWithImageBlocks',\n\t'alignWide',\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'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'sectionRootClientId',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableIsPreviewMode',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n\t'__experimentalArchiveTitleTypeLabel',\n\t'__experimentalArchiveTitleNameLabel',\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 {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions: canUser( 'create', 'media' ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', 'pages' ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\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 blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { 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\t),\n\t\t[ settingsBlockPatterns, 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, setIsInserterOpened } = 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 = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\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\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ unlock( privateApis ).selectBlockPatternsKey ]: ( select ) =>\n\t\t\t\tunlock( select( coreStore ) ).getBlockPatternsForPostType(\n\t\t\t\t\tpostType\n\t\t\t\t),\n\t\t\t[ unlock( privateApis ).reusableBlocksSelectKey ]:\n\t\t\t\t__experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\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// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t};\n\t\tlock( blockEditorSettings, {\n\t\t\tsectionRootClientId,\n\t\t} );\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType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ACpDC,WAAW;MACXC,YAAY;MACZ4E,kCAAkC,EAAE7F,QAAQ,KAAK,aAAa;MAC9D8F,YAAY,EACX9F,QAAQ,KAAK,eAAe,GAAG,QAAQ,GAAGD,QAAQ,CAAC+F,YAAY;MAChEC,QAAQ,EACP/F,QAAQ,KAAK,eAAe,GACzB,CAAE,CAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAAE,GACjCD,QAAQ,CAACgG,QAAQ;MACrBC,iCAAiC,EAAEjC;IACpC,CAAC;IACD1E,IAAI,CAAEuF,mBAAmB,EAAE;MAC1BxD;IACD,CAAE,CAAC;IACH,OAAOwD,mBAAmB;EAC3B,CAAC,EAAE,CACFN,iBAAiB,EACjBhE,wBAAwB,EACxBE,SAAS,EACTmE,qBAAqB,EACrBlE,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBZ,QAAQ,EACRa,oBAAoB,EACpBM,qBAAqB,EACrB+B,aAAa,EACbM,sBAAsB,EACtBzC,oBAAoB,EACpBgD,IAAI,EACJG,gBAAgB,EAChBlD,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZjB,QAAQ,EACR+D,mBAAmB,EACnB3C,mBAAmB,CAClB,CAAC;AACJ;AAEA,eAAetB,sBAAsB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useSelect","store","coreStore","useBlockEditorSettings","editorStore","EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","postType","postId","editorSettings","supportReusableBlock","capabilities","reusableBlock","reusableBlocks","isTitleSelected","select","getEntityRecords","per_page","isPostTitleSelected","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useBlockEditorSettings from './use-block-editor-settings.js';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction useNativeBlockEditorSettings( settings, postType, postId ) {\n\tconst editorSettings = useBlockEditorSettings( settings, postType, postId );\n\tconst supportReusableBlock = settings.capabilities?.reusableBlock === true;\n\n\tconst { reusableBlocks, isTitleSelected } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\treusableBlocks: supportReusableBlock\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t\t// Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.\n\t\t\t\t\t\t\t// Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661\n\t\t\t\t\t\t\t{ per_page: 100 }\n\t\t\t\t\t )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST,\n\t\t\t\tisTitleSelected: select( editorStore ).isPostTitleSelected(),\n\t\t\t};\n\t\t},\n\t\t[ supportReusableBlock ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalShouldInsertAtTheTop: isTitleSelected,\n\t\t} ),\n\t\t[ editorSettings, reusableBlocks, isTitleSelected ]\n\t);\n}\n\nexport default useNativeBlockEditorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,gCAAgC;AACnE,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAElD,MAAMC,iBAAiB,GAAG,EAAE;AAE5B,SAASC,4BAA4BA,CAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACnE,MAAMC,cAAc,GAAGP,sBAAsB,CAAEI,QAAQ,EAAEC,QAAQ,EAAEC,MAAO,CAAC;EAC3E,MAAME,oBAAoB,GAAGJ,QAAQ,CAACK,YAAY,EAAEC,aAAa,KAAK,IAAI;EAE1E,MAAM;IAAEC,cAAc;IAAEC;EAAgB,CAAC,GAAGf,SAAS,CAClDgB,MAAM,IAAM;IACb,OAAO;MACNF,cAAc,EAAEH,oBAAoB,GACjCK,MAAM,CAAEd,SAAU,CAAC,CAACe,gBAAgB,CACpC,UAAU,EACV,UAAU;MACV;MACA;MACA;QAAEC,QAAQ,EAAE;MAAI,CAChB,CAAC,GACDb,iBAAiB;MACpBU,eAAe,EAAEC,MAAM,CAAEZ,WAAY,CAAC,CAACe,mBAAmB,CAAC;IAC5D,CAAC;EACF,CAAC,EACD,CAAER,oBAAoB,CACvB,CAAC;EAED,OAAOZ,OAAO,CACb,OAAQ;IACP,GAAGW,cAAc;IACjBU,4BAA4B,EAAEN,cAAc;IAC5CO,kCAAkC,EAAEN;EACrC,CAAC,CAAE,EACH,CAAEL,cAAc,EAAEI,cAAc,EAAEC,eAAe,CAClD,CAAC;AACF;AAEA,eAAeT,4BAA4B"}
1
+ {"version":3,"names":["useMemo","useSelect","store","coreStore","useBlockEditorSettings","editorStore","EMPTY_BLOCKS_LIST","useNativeBlockEditorSettings","settings","postType","postId","editorSettings","supportReusableBlock","capabilities","reusableBlock","reusableBlocks","isTitleSelected","select","getEntityRecords","per_page","isPostTitleSelected","__experimentalReusableBlocks","__experimentalShouldInsertAtTheTop"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport useBlockEditorSettings from './use-block-editor-settings.js';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_BLOCKS_LIST = [];\n\nfunction useNativeBlockEditorSettings( settings, postType, postId ) {\n\tconst editorSettings = useBlockEditorSettings( settings, postType, postId );\n\tconst supportReusableBlock = settings.capabilities?.reusableBlock === true;\n\n\tconst { reusableBlocks, isTitleSelected } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\treusableBlocks: supportReusableBlock\n\t\t\t\t\t? select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_block',\n\t\t\t\t\t\t\t// Unbounded queries are not supported on native so as a workaround, we set per_page with the maximum value that native version can handle.\n\t\t\t\t\t\t\t// Related issue: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2661\n\t\t\t\t\t\t\t{ per_page: 100 }\n\t\t\t\t\t )\n\t\t\t\t\t: EMPTY_BLOCKS_LIST,\n\t\t\t\tisTitleSelected: select( editorStore ).isPostTitleSelected(),\n\t\t\t};\n\t\t},\n\t\t[ supportReusableBlock ]\n\t);\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\t__experimentalShouldInsertAtTheTop: isTitleSelected,\n\t\t} ),\n\t\t[ editorSettings, reusableBlocks, isTitleSelected ]\n\t);\n}\n\nexport default useNativeBlockEditorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,gCAAgC;AACnE,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAElD,MAAMC,iBAAiB,GAAG,EAAE;AAE5B,SAASC,4BAA4BA,CAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACnE,MAAMC,cAAc,GAAGP,sBAAsB,CAAEI,QAAQ,EAAEC,QAAQ,EAAEC,MAAO,CAAC;EAC3E,MAAME,oBAAoB,GAAGJ,QAAQ,CAACK,YAAY,EAAEC,aAAa,KAAK,IAAI;EAE1E,MAAM;IAAEC,cAAc;IAAEC;EAAgB,CAAC,GAAGf,SAAS,CAClDgB,MAAM,IAAM;IACb,OAAO;MACNF,cAAc,EAAEH,oBAAoB,GACjCK,MAAM,CAAEd,SAAU,CAAC,CAACe,gBAAgB,CACpC,UAAU,EACV,UAAU;MACV;MACA;MACA;QAAEC,QAAQ,EAAE;MAAI,CAChB,CAAC,GACDb,iBAAiB;MACpBU,eAAe,EAAEC,MAAM,CAAEZ,WAAY,CAAC,CAACe,mBAAmB,CAAC;IAC5D,CAAC;EACF,CAAC,EACD,CAAER,oBAAoB,CACvB,CAAC;EAED,OAAOZ,OAAO,CACb,OAAQ;IACP,GAAGW,cAAc;IACjBU,4BAA4B,EAAEN,cAAc;IAC5CO,kCAAkC,EAAEN;EACrC,CAAC,CAAE,EACH,CAAEL,cAAc,EAAEI,cAAc,EAAEC,eAAe,CAClD,CAAC;AACF;AAEA,eAAeT,4BAA4B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","addFilter","removeFilter","POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART","useHideBlocksFromInserter","postType","mode","canInsert","blockType","includes","name","rootClientId","getBlockParentsByBlockName","length"],"sources":["@wordpress/editor/src/components/provider/use-hide-blocks-from-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { addFilter, removeFilter } from '@wordpress/hooks';\n\n// These post types are \"structural\" block lists.\n// We should be allowed to use\n// the post content and template parts blocks within them.\nconst POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_template_part',\n];\n\n/**\n * In some specific contexts,\n * the template part and post content blocks need to be hidden.\n *\n * @param {string} postType Post Type\n * @param {string} mode Rendering mode\n */\nexport function useHideBlocksFromInserter( postType, mode ) {\n\tuseEffect( () => {\n\t\t/*\n\t\t * Prevent adding template part in the editor.\n\t\t */\n\t\taddFilter(\n\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t'removeTemplatePartsFromInserter',\n\t\t\t( canInsert, blockType ) => {\n\t\t\t\tif (\n\t\t\t\t\t! POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) &&\n\t\t\t\t\tblockType.name === 'core/template-part' &&\n\t\t\t\t\tmode === 'post-only'\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn canInsert;\n\t\t\t}\n\t\t);\n\n\t\t/*\n\t\t * Prevent adding post content block (except in query block) in the editor.\n\t\t */\n\t\taddFilter(\n\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t'removePostContentFromInserter',\n\t\t\t(\n\t\t\t\tcanInsert,\n\t\t\t\tblockType,\n\t\t\t\trootClientId,\n\t\t\t\t{ getBlockParentsByBlockName }\n\t\t\t) => {\n\t\t\t\tif (\n\t\t\t\t\t! POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) &&\n\t\t\t\t\tblockType.name === 'core/post-content'\n\t\t\t\t) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tgetBlockParentsByBlockName( rootClientId, 'core/query' )\n\t\t\t\t\t\t\t.length > 0\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn canInsert;\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tremoveFilter(\n\t\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t\t'removeTemplatePartsFromInserter'\n\t\t\t);\n\t\t\tremoveFilter(\n\t\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t\t'removePostContentFromInserter'\n\t\t\t);\n\t\t};\n\t}, [ postType, mode ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,YAAY,QAAQ,kBAAkB;;AAE1D;AACA;AACA;AACA,MAAMC,8CAA8C,GAAG,CACtD,UAAU,EACV,aAAa,EACb,kBAAkB,CAClB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CAAEC,QAAQ,EAAEC,IAAI,EAAG;EAC3DN,SAAS,CAAE,MAAM;IAChB;AACF;AACA;IACEC,SAAS,CACR,0CAA0C,EAC1C,iCAAiC,EACjC,CAAEM,SAAS,EAAEC,SAAS,KAAM;MAC3B,IACC,CAAEL,8CAA8C,CAACM,QAAQ,CACxDJ,QACD,CAAC,IACDG,SAAS,CAACE,IAAI,KAAK,oBAAoB,IACvCJ,IAAI,KAAK,WAAW,EACnB;QACD,OAAO,KAAK;MACb;MACA,OAAOC,SAAS;IACjB,CACD,CAAC;;IAED;AACF;AACA;IACEN,SAAS,CACR,0CAA0C,EAC1C,+BAA+B,EAC/B,CACCM,SAAS,EACTC,SAAS,EACTG,YAAY,EACZ;MAAEC;IAA2B,CAAC,KAC1B;MACJ,IACC,CAAET,8CAA8C,CAACM,QAAQ,CACxDJ,QACD,CAAC,IACDG,SAAS,CAACE,IAAI,KAAK,mBAAmB,EACrC;QACD,OACCE,0BAA0B,CAAED,YAAY,EAAE,YAAa,CAAC,CACtDE,MAAM,GAAG,CAAC;MAEd;MACA,OAAON,SAAS;IACjB,CACD,CAAC;IAED,OAAO,MAAM;MACZL,YAAY,CACX,0CAA0C,EAC1C,iCACD,CAAC;MACDA,YAAY,CACX,0CAA0C,EAC1C,+BACD,CAAC;IACF,CAAC;EACF,CAAC,EAAE,CAAEG,QAAQ,EAAEC,IAAI,CAAG,CAAC;AACxB"}
1
+ {"version":3,"names":["useEffect","addFilter","removeFilter","POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART","useHideBlocksFromInserter","postType","mode","canInsert","blockType","includes","name","rootClientId","getBlockParentsByBlockName","length"],"sources":["@wordpress/editor/src/components/provider/use-hide-blocks-from-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { addFilter, removeFilter } from '@wordpress/hooks';\n\n// These post types are \"structural\" block lists.\n// We should be allowed to use\n// the post content and template parts blocks within them.\nconst POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_template_part',\n];\n\n/**\n * In some specific contexts,\n * the template part and post content blocks need to be hidden.\n *\n * @param {string} postType Post Type\n * @param {string} mode Rendering mode\n */\nexport function useHideBlocksFromInserter( postType, mode ) {\n\tuseEffect( () => {\n\t\t/*\n\t\t * Prevent adding template part in the editor.\n\t\t */\n\t\taddFilter(\n\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t'removeTemplatePartsFromInserter',\n\t\t\t( canInsert, blockType ) => {\n\t\t\t\tif (\n\t\t\t\t\t! POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) &&\n\t\t\t\t\tblockType.name === 'core/template-part' &&\n\t\t\t\t\tmode === 'post-only'\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn canInsert;\n\t\t\t}\n\t\t);\n\n\t\t/*\n\t\t * Prevent adding post content block (except in query block) in the editor.\n\t\t */\n\t\taddFilter(\n\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t'removePostContentFromInserter',\n\t\t\t(\n\t\t\t\tcanInsert,\n\t\t\t\tblockType,\n\t\t\t\trootClientId,\n\t\t\t\t{ getBlockParentsByBlockName }\n\t\t\t) => {\n\t\t\t\tif (\n\t\t\t\t\t! POST_TYPES_ALLOWING_POST_CONTENT_TEMPLATE_PART.includes(\n\t\t\t\t\t\tpostType\n\t\t\t\t\t) &&\n\t\t\t\t\tblockType.name === 'core/post-content'\n\t\t\t\t) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tgetBlockParentsByBlockName( rootClientId, 'core/query' )\n\t\t\t\t\t\t\t.length > 0\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn canInsert;\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tremoveFilter(\n\t\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t\t'removeTemplatePartsFromInserter'\n\t\t\t);\n\t\t\tremoveFilter(\n\t\t\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t\t\t'removePostContentFromInserter'\n\t\t\t);\n\t\t};\n\t}, [ postType, mode ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,EAAEC,YAAY,QAAQ,kBAAkB;;AAE1D;AACA;AACA;AACA,MAAMC,8CAA8C,GAAG,CACtD,UAAU,EACV,aAAa,EACb,kBAAkB,CAClB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CAAEC,QAAQ,EAAEC,IAAI,EAAG;EAC3DN,SAAS,CAAE,MAAM;IAChB;AACF;AACA;IACEC,SAAS,CACR,0CAA0C,EAC1C,iCAAiC,EACjC,CAAEM,SAAS,EAAEC,SAAS,KAAM;MAC3B,IACC,CAAEL,8CAA8C,CAACM,QAAQ,CACxDJ,QACD,CAAC,IACDG,SAAS,CAACE,IAAI,KAAK,oBAAoB,IACvCJ,IAAI,KAAK,WAAW,EACnB;QACD,OAAO,KAAK;MACb;MACA,OAAOC,SAAS;IACjB,CACD,CAAC;;IAED;AACF;AACA;IACEN,SAAS,CACR,0CAA0C,EAC1C,+BAA+B,EAC/B,CACCM,SAAS,EACTC,SAAS,EACTG,YAAY,EACZ;MAAEC;IAA2B,CAAC,KAC1B;MACJ,IACC,CAAET,8CAA8C,CAACM,QAAQ,CACxDJ,QACD,CAAC,IACDG,SAAS,CAACE,IAAI,KAAK,mBAAmB,EACrC;QACD,OACCE,0BAA0B,CAAED,YAAY,EAAE,YAAa,CAAC,CACtDE,MAAM,GAAG,CAAC;MAEd;MACA,OAAON,SAAS;IACjB,CACD,CAAC;IAED,OAAO,MAAM;MACZL,YAAY,CACX,0CAA0C,EAC1C,iCACD,CAAC;MACDA,YAAY,CACX,0CAA0C,EAC1C,+BACD,CAAC;IACF,CAAC;EACF,CAAC,EAAE,CAAEG,QAAQ,EAAEC,IAAI,CAAG,CAAC;AACxB","ignoreList":[]}
@@ -27,6 +27,7 @@ const withRegistryProvider = createHigherOrderComponent(WrappedComponent => with
27
27
  const newRegistry = createRegistry({
28
28
  'core/block-editor': blockEditorStoreConfig
29
29
  }, registry);
30
+ // Todo: The interface store should also be created per instance.
30
31
  newRegistry.registerStore('core/editor', storeConfig);
31
32
  setSubRegistry(newRegistry);
32
33
  }, [registry]);
@@ -1 +1 @@
1
- {"version":3,"names":["useState","useEffect","withRegistry","createRegistry","RegistryProvider","createHigherOrderComponent","storeConfig","blockEditorStoreConfig","withRegistryProvider","WrappedComponent","props","useSubRegistry","registry","additionalProps","createElement","subRegistry","setSubRegistry","newRegistry","registerStore","value"],"sources":["@wordpress/editor/src/components/provider/with-registry-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\twithRegistry,\n\tcreateRegistry,\n\tRegistryProvider,\n} from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { storeConfig as blockEditorStoreConfig } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { storeConfig } from '../../store';\n\nconst withRegistryProvider = createHigherOrderComponent(\n\t( WrappedComponent ) =>\n\t\twithRegistry( ( props ) => {\n\t\t\tconst {\n\t\t\t\tuseSubRegistry = true,\n\t\t\t\tregistry,\n\t\t\t\t...additionalProps\n\t\t\t} = props;\n\t\t\tif ( ! useSubRegistry ) {\n\t\t\t\treturn <WrappedComponent { ...additionalProps } />;\n\t\t\t}\n\n\t\t\tconst [ subRegistry, setSubRegistry ] = useState( null );\n\t\t\tuseEffect( () => {\n\t\t\t\tconst newRegistry = createRegistry(\n\t\t\t\t\t{\n\t\t\t\t\t\t'core/block-editor': blockEditorStoreConfig,\n\t\t\t\t\t},\n\t\t\t\t\tregistry\n\t\t\t\t);\n\t\t\t\tnewRegistry.registerStore( 'core/editor', storeConfig );\n\t\t\t\tsetSubRegistry( newRegistry );\n\t\t\t}, [ registry ] );\n\n\t\t\tif ( ! subRegistry ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<RegistryProvider value={ subRegistry }>\n\t\t\t\t\t<WrappedComponent { ...additionalProps } />\n\t\t\t\t</RegistryProvider>\n\t\t\t);\n\t\t} ),\n\t'withRegistryProvider'\n);\n\nexport default withRegistryProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SACCC,YAAY,EACZC,cAAc,EACdC,gBAAgB,QACV,iBAAiB;AACxB,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASD,WAAW,QAAQ,aAAa;AAEzC,MAAME,oBAAoB,GAAGH,0BAA0B,CACpDI,gBAAgB,IACjBP,YAAY,CAAIQ,KAAK,IAAM;EAC1B,MAAM;IACLC,cAAc,GAAG,IAAI;IACrBC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGH,KAAK;EACT,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAOG,aAAA,CAACL,gBAAgB;MAAA,GAAMI;IAAe,CAAI,CAAC;EACnD;EAEA,MAAM,CAAEE,WAAW,EAAEC,cAAc,CAAE,GAAGhB,QAAQ,CAAE,IAAK,CAAC;EACxDC,SAAS,CAAE,MAAM;IAChB,MAAMgB,WAAW,GAAGd,cAAc,CACjC;MACC,mBAAmB,EAAEI;IACtB,CAAC,EACDK,QACD,CAAC;IACDK,WAAW,CAACC,aAAa,CAAE,aAAa,EAAEZ,WAAY,CAAC;IACvDU,cAAc,CAAEC,WAAY,CAAC;EAC9B,CAAC,EAAE,CAAEL,QAAQ,CAAG,CAAC;EAEjB,IAAK,CAAEG,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OACCD,aAAA,CAACV,gBAAgB;IAACe,KAAK,EAAGJ;EAAa,GACtCD,aAAA,CAACL,gBAAgB;IAAA,GAAMI;EAAe,CAAI,CACzB,CAAC;AAErB,CAAE,CAAC,EACJ,sBACD,CAAC;AAED,eAAeL,oBAAoB"}
1
+ {"version":3,"names":["useState","useEffect","withRegistry","createRegistry","RegistryProvider","createHigherOrderComponent","storeConfig","blockEditorStoreConfig","withRegistryProvider","WrappedComponent","props","useSubRegistry","registry","additionalProps","createElement","subRegistry","setSubRegistry","newRegistry","registerStore","value"],"sources":["@wordpress/editor/src/components/provider/with-registry-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\nimport {\n\twithRegistry,\n\tcreateRegistry,\n\tRegistryProvider,\n} from '@wordpress/data';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { storeConfig as blockEditorStoreConfig } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { storeConfig } from '../../store';\n\nconst withRegistryProvider = createHigherOrderComponent(\n\t( WrappedComponent ) =>\n\t\twithRegistry( ( props ) => {\n\t\t\tconst {\n\t\t\t\tuseSubRegistry = true,\n\t\t\t\tregistry,\n\t\t\t\t...additionalProps\n\t\t\t} = props;\n\t\t\tif ( ! useSubRegistry ) {\n\t\t\t\treturn <WrappedComponent { ...additionalProps } />;\n\t\t\t}\n\n\t\t\tconst [ subRegistry, setSubRegistry ] = useState( null );\n\t\t\tuseEffect( () => {\n\t\t\t\tconst newRegistry = createRegistry(\n\t\t\t\t\t{\n\t\t\t\t\t\t'core/block-editor': blockEditorStoreConfig,\n\t\t\t\t\t},\n\t\t\t\t\tregistry\n\t\t\t\t);\n\t\t\t\t// Todo: The interface store should also be created per instance.\n\t\t\t\tnewRegistry.registerStore( 'core/editor', storeConfig );\n\t\t\t\tsetSubRegistry( newRegistry );\n\t\t\t}, [ registry ] );\n\n\t\t\tif ( ! subRegistry ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<RegistryProvider value={ subRegistry }>\n\t\t\t\t\t<WrappedComponent { ...additionalProps } />\n\t\t\t\t</RegistryProvider>\n\t\t\t);\n\t\t} ),\n\t'withRegistryProvider'\n);\n\nexport default withRegistryProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SACCC,YAAY,EACZC,cAAc,EACdC,gBAAgB,QACV,iBAAiB;AACxB,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASD,WAAW,QAAQ,aAAa;AAEzC,MAAME,oBAAoB,GAAGH,0BAA0B,CACpDI,gBAAgB,IACjBP,YAAY,CAAIQ,KAAK,IAAM;EAC1B,MAAM;IACLC,cAAc,GAAG,IAAI;IACrBC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGH,KAAK;EACT,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAOG,aAAA,CAACL,gBAAgB;MAAA,GAAMI;IAAe,CAAI,CAAC;EACnD;EAEA,MAAM,CAAEE,WAAW,EAAEC,cAAc,CAAE,GAAGhB,QAAQ,CAAE,IAAK,CAAC;EACxDC,SAAS,CAAE,MAAM;IAChB,MAAMgB,WAAW,GAAGd,cAAc,CACjC;MACC,mBAAmB,EAAEI;IACtB,CAAC,EACDK,QACD,CAAC;IACD;IACAK,WAAW,CAACC,aAAa,CAAE,aAAa,EAAEZ,WAAY,CAAC;IACvDU,cAAc,CAAEC,WAAY,CAAC;EAC9B,CAAC,EAAE,CAAEL,QAAQ,CAAG,CAAC;EAEjB,IAAK,CAAEG,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OACCD,aAAA,CAACV,gBAAgB;IAACe,KAAK,EAAGJ;EAAa,GACtCD,aAAA,CAACL,gBAAgB;IAAA,GAAMI;EAAe,CAAI,CACzB,CAAC;AAErB,CAAE,CAAC,EACJ,sBACD,CAAC;AAED,eAAeL,oBAAoB","ignoreList":[]}