@wordpress/editor 13.31.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 (647) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1080 -0
  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 +107 -0
  16. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
  17. package/build/components/character-count/index.js.map +1 -1
  18. package/build/components/commands/index.js +20 -1
  19. package/build/components/commands/index.js.map +1 -1
  20. package/build/components/commands/index.native.js.map +1 -1
  21. package/build/components/deprecated.js +158 -0
  22. package/build/components/deprecated.js.map +1 -1
  23. package/build/components/deprecated.native.js.map +1 -1
  24. package/build/components/document-bar/index.js +5 -8
  25. package/build/components/document-bar/index.js.map +1 -1
  26. package/build/components/document-outline/check.js.map +1 -1
  27. package/build/components/document-outline/index.js.map +1 -1
  28. package/build/components/document-outline/item.js.map +1 -1
  29. package/build/components/document-tools/index.js +1 -1
  30. package/build/components/document-tools/index.js.map +1 -1
  31. package/build/components/editor-canvas/edit-template-blocks-notification.js +12 -38
  32. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  33. package/build/components/editor-canvas/index.js +5 -2
  34. package/build/components/editor-canvas/index.js.map +1 -1
  35. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  36. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  37. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  38. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  39. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  40. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  41. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/index.native.js.map +1 -1
  43. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  44. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  45. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  46. package/build/components/editor-help/view-sections.native.js.map +1 -1
  47. package/build/components/editor-history/redo.js.map +1 -1
  48. package/build/components/editor-history/undo.js.map +1 -1
  49. package/build/components/editor-notices/index.js.map +1 -1
  50. package/build/components/editor-snackbars/index.js.map +1 -1
  51. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  52. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  53. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  54. package/build/components/entities-saved-states/index.js +11 -85
  55. package/build/components/entities-saved-states/index.js.map +1 -1
  56. package/build/components/error-boundary/index.js.map +1 -1
  57. package/build/components/error-boundary/index.native.js.map +1 -1
  58. package/build/components/global-keyboard-shortcuts/index.js +24 -0
  59. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  60. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  61. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  62. package/build/components/index.js +57 -1
  63. package/build/components/index.js.map +1 -1
  64. package/build/components/index.native.js.map +1 -1
  65. package/build/components/inserter-sidebar/index.js +5 -1
  66. package/build/components/inserter-sidebar/index.js.map +1 -1
  67. package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
  68. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  69. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
  70. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  71. package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
  72. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  73. package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
  74. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  75. package/build/components/list-view-sidebar/index.js +2 -1
  76. package/build/components/list-view-sidebar/index.js.map +1 -1
  77. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  78. package/build/components/local-autosave-monitor/index.js.map +1 -1
  79. package/build/components/media-categories/index.js.map +1 -1
  80. package/build/components/mode-switcher/index.js.map +1 -1
  81. package/build/components/offline-status/index.native.js.map +1 -1
  82. package/build/components/page-attributes/check.js.map +1 -1
  83. package/build/components/page-attributes/order.js.map +1 -1
  84. package/build/components/page-attributes/panel.js.map +1 -1
  85. package/build/components/page-attributes/parent.js.map +1 -1
  86. package/build/components/pattern-overrides-panel/index.js +30 -0
  87. package/build/components/pattern-overrides-panel/index.js.map +1 -0
  88. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  89. package/build/components/plugin-more-menu-item/index.js +78 -0
  90. package/build/components/plugin-more-menu-item/index.js.map +1 -0
  91. package/build/components/plugin-post-publish-panel/index.js +68 -0
  92. package/build/components/plugin-post-publish-panel/index.js.map +1 -0
  93. package/build/components/plugin-post-status-info/index.js +73 -0
  94. package/build/components/plugin-post-status-info/index.js.map +1 -0
  95. package/build/components/plugin-pre-publish-panel/index.js +71 -0
  96. package/build/components/plugin-pre-publish-panel/index.js.map +1 -0
  97. package/build/components/plugin-sidebar/index.js +108 -0
  98. package/build/components/plugin-sidebar/index.js.map +1 -0
  99. package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
  100. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  101. package/build/components/post-actions/actions.js +656 -0
  102. package/build/components/post-actions/actions.js.map +1 -0
  103. package/build/components/post-actions/index.js +137 -0
  104. package/build/components/post-actions/index.js.map +1 -0
  105. package/build/components/post-author/check.js.map +1 -1
  106. package/build/components/post-author/combobox.js.map +1 -1
  107. package/build/components/post-author/constants.js.map +1 -1
  108. package/build/components/post-author/hook.js.map +1 -1
  109. package/build/components/post-author/index.js.map +1 -1
  110. package/build/components/post-author/panel.js.map +1 -1
  111. package/build/components/post-author/select.js.map +1 -1
  112. package/build/components/post-card-panel/index.js +127 -0
  113. package/build/components/post-card-panel/index.js.map +1 -0
  114. package/build/components/post-comments/index.js.map +1 -1
  115. package/build/components/post-discussion/panel.js.map +1 -1
  116. package/build/components/post-excerpt/check.js +8 -0
  117. package/build/components/post-excerpt/check.js.map +1 -1
  118. package/build/components/post-excerpt/index.js.map +1 -1
  119. package/build/components/post-excerpt/panel.js.map +1 -1
  120. package/build/components/post-excerpt/plugin.js.map +1 -1
  121. package/build/components/post-featured-image/check.js.map +1 -1
  122. package/build/components/post-featured-image/index.js.map +1 -1
  123. package/build/components/post-featured-image/panel.js.map +1 -1
  124. package/build/components/post-format/check.js.map +1 -1
  125. package/build/components/post-format/index.js.map +1 -1
  126. package/build/components/post-last-revision/check.js.map +1 -1
  127. package/build/components/post-last-revision/index.js.map +1 -1
  128. package/build/components/post-last-revision/panel.js.map +1 -1
  129. package/build/components/post-locked-modal/index.js.map +1 -1
  130. package/build/components/post-panel-row/index.js.map +1 -1
  131. package/build/components/post-pending-status/check.js.map +1 -1
  132. package/build/components/post-pending-status/index.js.map +1 -1
  133. package/build/components/post-pingbacks/index.js.map +1 -1
  134. package/build/components/post-preview-button/index.js.map +1 -1
  135. package/build/components/post-publish-button/index.js +31 -31
  136. package/build/components/post-publish-button/index.js.map +1 -1
  137. package/build/components/post-publish-button/label.js +51 -43
  138. package/build/components/post-publish-button/label.js.map +1 -1
  139. package/build/components/post-publish-panel/index.js.map +1 -1
  140. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  141. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  142. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  143. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  144. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  145. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  146. package/build/components/post-saved-state/index.js +10 -6
  147. package/build/components/post-saved-state/index.js.map +1 -1
  148. package/build/components/post-schedule/check.js.map +1 -1
  149. package/build/components/post-schedule/index.js.map +1 -1
  150. package/build/components/post-schedule/label.js.map +1 -1
  151. package/build/components/post-schedule/panel.js +8 -0
  152. package/build/components/post-schedule/panel.js.map +1 -1
  153. package/build/components/post-slug/check.js.map +1 -1
  154. package/build/components/post-slug/index.js +43 -68
  155. package/build/components/post-slug/index.js.map +1 -1
  156. package/build/components/post-status/index.js +239 -0
  157. package/build/components/post-status/index.js.map +1 -0
  158. package/build/components/post-sticky/check.js.map +1 -1
  159. package/build/components/post-sticky/index.js.map +1 -1
  160. package/build/components/post-switch-to-draft-button/index.js +6 -1
  161. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  162. package/build/components/post-sync-status/index.js.map +1 -1
  163. package/build/components/post-taxonomies/check.js.map +1 -1
  164. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  165. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  166. package/build/components/post-taxonomies/index.js.map +1 -1
  167. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  168. package/build/components/post-taxonomies/panel.js.map +1 -1
  169. package/build/components/post-template/block-theme.js +6 -2
  170. package/build/components/post-template/block-theme.js.map +1 -1
  171. package/build/components/post-template/classic-theme.js.map +1 -1
  172. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  173. package/build/components/post-template/create-new-template.js.map +1 -1
  174. package/build/components/post-template/hooks.js.map +1 -1
  175. package/build/components/post-template/panel.js.map +1 -1
  176. package/build/components/post-template/reset-default-template.js.map +1 -1
  177. package/build/components/post-template/swap-template-button.js.map +1 -1
  178. package/build/components/post-text-editor/index.js.map +1 -1
  179. package/build/components/post-title/constants.js.map +1 -1
  180. package/build/components/post-title/index.js.map +1 -1
  181. package/build/components/post-title/index.native.js +1 -1
  182. package/build/components/post-title/index.native.js.map +1 -1
  183. package/build/components/post-title/post-title-raw.js.map +1 -1
  184. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  185. package/build/components/post-title/use-post-title.js.map +1 -1
  186. package/build/components/post-trash/check.js +23 -25
  187. package/build/components/post-trash/check.js.map +1 -1
  188. package/build/components/post-trash/index.js +2 -1
  189. package/build/components/post-trash/index.js.map +1 -1
  190. package/build/components/post-type-support-check/index.js.map +1 -1
  191. package/build/components/post-url/check.js.map +1 -1
  192. package/build/components/post-url/index.js +44 -19
  193. package/build/components/post-url/index.js.map +1 -1
  194. package/build/components/post-url/label.js.map +1 -1
  195. package/build/components/post-url/panel.js +14 -7
  196. package/build/components/post-url/panel.js.map +1 -1
  197. package/build/components/post-view-link/index.js.map +1 -1
  198. package/build/components/post-visibility/check.js.map +1 -1
  199. package/build/components/post-visibility/index.js +2 -1
  200. package/build/components/post-visibility/index.js.map +1 -1
  201. package/build/components/post-visibility/label.js.map +1 -1
  202. package/build/components/post-visibility/utils.js.map +1 -1
  203. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  204. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  205. package/build/components/preferences-modal/index.js +19 -17
  206. package/build/components/preferences-modal/index.js.map +1 -1
  207. package/build/components/preview-dropdown/index.js.map +1 -1
  208. package/build/components/provider/disable-non-page-content-blocks.js +36 -20
  209. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  210. package/build/components/provider/index.js +4 -2
  211. package/build/components/provider/index.js.map +1 -1
  212. package/build/components/provider/index.native.js +6 -1
  213. package/build/components/provider/index.native.js.map +1 -1
  214. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  215. package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
  216. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  217. package/build/components/provider/use-block-editor-settings.js +70 -50
  218. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  219. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  220. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  221. package/build/components/provider/with-registry-provider.js +1 -0
  222. package/build/components/provider/with-registry-provider.js.map +1 -1
  223. package/build/components/start-page-options/index.js +139 -0
  224. package/build/components/start-page-options/index.js.map +1 -0
  225. package/build/components/table-of-contents/index.js.map +1 -1
  226. package/build/components/table-of-contents/panel.js.map +1 -1
  227. package/build/components/template-areas/index.js +70 -0
  228. package/build/components/template-areas/index.js.map +1 -0
  229. package/build/components/template-validation-notice/index.js +23 -29
  230. package/build/components/template-validation-notice/index.js.map +1 -1
  231. package/build/components/theme-support-check/index.js +10 -16
  232. package/build/components/theme-support-check/index.js.map +1 -1
  233. package/build/components/time-to-read/index.js.map +1 -1
  234. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  235. package/build/components/word-count/index.js.map +1 -1
  236. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  237. package/build/hooks/default-autocompleters.js.map +1 -1
  238. package/build/hooks/index.js.map +1 -1
  239. package/build/hooks/index.native.js.map +1 -1
  240. package/build/hooks/pattern-overrides.js +22 -10
  241. package/build/hooks/pattern-overrides.js.map +1 -1
  242. package/build/hooks/use-select-nearest-editable-block.js +87 -0
  243. package/build/hooks/use-select-nearest-editable-block.js.map +1 -0
  244. package/build/index.js.map +1 -1
  245. package/build/index.native.js.map +1 -1
  246. package/build/lock-unlock.js.map +1 -1
  247. package/build/private-apis.js +26 -1
  248. package/build/private-apis.js.map +1 -1
  249. package/build/store/actions.js +46 -6
  250. package/build/store/actions.js.map +1 -1
  251. package/build/store/actions.native.js.map +1 -1
  252. package/build/store/constants.js +10 -1
  253. package/build/store/constants.js.map +1 -1
  254. package/build/store/defaults.js.map +1 -1
  255. package/build/store/index.js +1 -1
  256. package/build/store/index.js.map +1 -1
  257. package/build/store/local-autosave.js.map +1 -1
  258. package/build/store/private-actions.js +253 -1
  259. package/build/store/private-actions.js.map +1 -1
  260. package/build/store/private-selectors.js +50 -3
  261. package/build/store/private-selectors.js.map +1 -1
  262. package/build/store/reducer.js +14 -1
  263. package/build/store/reducer.js.map +1 -1
  264. package/build/store/reducer.native.js.map +1 -1
  265. package/build/store/selectors.js +25 -20
  266. package/build/store/selectors.js.map +1 -1
  267. package/build/store/selectors.native.js.map +1 -1
  268. package/build/store/utils/get-filtered-template-parts.js +71 -0
  269. package/build/store/utils/get-filtered-template-parts.js.map +1 -0
  270. package/build/store/utils/is-template-revertable.js +28 -0
  271. package/build/store/utils/is-template-revertable.js.map +1 -0
  272. package/build/store/utils/notice-builder.js.map +1 -1
  273. package/build/utils/get-template-part-icon.js.map +1 -1
  274. package/build/utils/index.js.map +1 -1
  275. package/build/utils/index.native.js.map +1 -1
  276. package/build/utils/media-upload/index.js.map +1 -1
  277. package/build/utils/media-upload/index.native.js.map +1 -1
  278. package/build/utils/terms.js.map +1 -1
  279. package/build/utils/url.js.map +1 -1
  280. package/build-module/bindings/index.js.map +1 -1
  281. package/build-module/bindings/pattern-overrides.js.map +1 -1
  282. package/build-module/bindings/post-meta.js +14 -31
  283. package/build-module/bindings/post-meta.js.map +1 -1
  284. package/build-module/components/autocompleters/index.js.map +1 -1
  285. package/build-module/components/autocompleters/user.js.map +1 -1
  286. package/build-module/components/autosave-monitor/index.js +10 -0
  287. package/build-module/components/autosave-monitor/index.js.map +1 -1
  288. package/build-module/components/block-manager/category.js.map +1 -1
  289. package/build-module/components/block-manager/checklist.js.map +1 -1
  290. package/build-module/components/block-manager/index.js.map +1 -1
  291. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  292. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +100 -0
  293. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
  294. package/build-module/components/character-count/index.js.map +1 -1
  295. package/build-module/components/commands/index.js +21 -2
  296. package/build-module/components/commands/index.js.map +1 -1
  297. package/build-module/components/commands/index.native.js.map +1 -1
  298. package/build-module/components/deprecated.js +159 -0
  299. package/build-module/components/deprecated.js.map +1 -1
  300. package/build-module/components/deprecated.native.js.map +1 -1
  301. package/build-module/components/document-bar/index.js +6 -9
  302. package/build-module/components/document-bar/index.js.map +1 -1
  303. package/build-module/components/document-outline/check.js.map +1 -1
  304. package/build-module/components/document-outline/index.js.map +1 -1
  305. package/build-module/components/document-outline/item.js.map +1 -1
  306. package/build-module/components/document-tools/index.js +1 -1
  307. package/build-module/components/document-tools/index.js.map +1 -1
  308. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +14 -40
  309. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  310. package/build-module/components/editor-canvas/index.js +5 -2
  311. package/build-module/components/editor-canvas/index.js.map +1 -1
  312. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  313. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  314. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  315. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  316. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  317. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  318. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  319. package/build-module/components/editor-help/index.native.js.map +1 -1
  320. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  321. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  322. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  323. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  324. package/build-module/components/editor-history/redo.js.map +1 -1
  325. package/build-module/components/editor-history/undo.js.map +1 -1
  326. package/build-module/components/editor-notices/index.js.map +1 -1
  327. package/build-module/components/editor-snackbars/index.js.map +1 -1
  328. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  329. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  330. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  331. package/build-module/components/entities-saved-states/index.js +11 -85
  332. package/build-module/components/entities-saved-states/index.js.map +1 -1
  333. package/build-module/components/error-boundary/index.js.map +1 -1
  334. package/build-module/components/error-boundary/index.native.js.map +1 -1
  335. package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
  336. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  337. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  338. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  339. package/build-module/components/index.js +7 -0
  340. package/build-module/components/index.js.map +1 -1
  341. package/build-module/components/index.native.js.map +1 -1
  342. package/build-module/components/inserter-sidebar/index.js +5 -1
  343. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  344. package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
  345. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  346. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  347. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  348. package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
  349. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  350. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
  351. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  352. package/build-module/components/list-view-sidebar/index.js +2 -1
  353. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  354. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  355. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  356. package/build-module/components/media-categories/index.js.map +1 -1
  357. package/build-module/components/mode-switcher/index.js.map +1 -1
  358. package/build-module/components/offline-status/index.native.js.map +1 -1
  359. package/build-module/components/page-attributes/check.js.map +1 -1
  360. package/build-module/components/page-attributes/order.js.map +1 -1
  361. package/build-module/components/page-attributes/panel.js.map +1 -1
  362. package/build-module/components/page-attributes/parent.js.map +1 -1
  363. package/build-module/components/pattern-overrides-panel/index.js +23 -0
  364. package/build-module/components/pattern-overrides-panel/index.js.map +1 -0
  365. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  366. package/build-module/components/plugin-more-menu-item/index.js +73 -0
  367. package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
  368. package/build-module/components/plugin-post-publish-panel/index.js +61 -0
  369. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -0
  370. package/build-module/components/plugin-post-status-info/index.js +66 -0
  371. package/build-module/components/plugin-post-status-info/index.js.map +1 -0
  372. package/build-module/components/plugin-pre-publish-panel/index.js +64 -0
  373. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -0
  374. package/build-module/components/plugin-sidebar/index.js +102 -0
  375. package/build-module/components/plugin-sidebar/index.js.map +1 -0
  376. package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
  377. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  378. package/build-module/components/post-actions/actions.js +648 -0
  379. package/build-module/components/post-actions/actions.js.map +1 -0
  380. package/build-module/components/post-actions/index.js +130 -0
  381. package/build-module/components/post-actions/index.js.map +1 -0
  382. package/build-module/components/post-author/check.js.map +1 -1
  383. package/build-module/components/post-author/combobox.js.map +1 -1
  384. package/build-module/components/post-author/constants.js.map +1 -1
  385. package/build-module/components/post-author/hook.js.map +1 -1
  386. package/build-module/components/post-author/index.js.map +1 -1
  387. package/build-module/components/post-author/panel.js.map +1 -1
  388. package/build-module/components/post-author/select.js.map +1 -1
  389. package/build-module/components/post-card-panel/index.js +119 -0
  390. package/build-module/components/post-card-panel/index.js.map +1 -0
  391. package/build-module/components/post-comments/index.js.map +1 -1
  392. package/build-module/components/post-discussion/panel.js.map +1 -1
  393. package/build-module/components/post-excerpt/check.js +9 -0
  394. package/build-module/components/post-excerpt/check.js.map +1 -1
  395. package/build-module/components/post-excerpt/index.js.map +1 -1
  396. package/build-module/components/post-excerpt/panel.js.map +1 -1
  397. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  398. package/build-module/components/post-featured-image/check.js.map +1 -1
  399. package/build-module/components/post-featured-image/index.js.map +1 -1
  400. package/build-module/components/post-featured-image/panel.js.map +1 -1
  401. package/build-module/components/post-format/check.js.map +1 -1
  402. package/build-module/components/post-format/index.js.map +1 -1
  403. package/build-module/components/post-last-revision/check.js.map +1 -1
  404. package/build-module/components/post-last-revision/index.js.map +1 -1
  405. package/build-module/components/post-last-revision/panel.js.map +1 -1
  406. package/build-module/components/post-locked-modal/index.js.map +1 -1
  407. package/build-module/components/post-panel-row/index.js.map +1 -1
  408. package/build-module/components/post-pending-status/check.js.map +1 -1
  409. package/build-module/components/post-pending-status/index.js.map +1 -1
  410. package/build-module/components/post-pingbacks/index.js.map +1 -1
  411. package/build-module/components/post-preview-button/index.js.map +1 -1
  412. package/build-module/components/post-publish-button/index.js +31 -31
  413. package/build-module/components/post-publish-button/index.js.map +1 -1
  414. package/build-module/components/post-publish-button/label.js +51 -42
  415. package/build-module/components/post-publish-button/label.js.map +1 -1
  416. package/build-module/components/post-publish-panel/index.js.map +1 -1
  417. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  418. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  419. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  420. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  421. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  422. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  423. package/build-module/components/post-saved-state/index.js +10 -6
  424. package/build-module/components/post-saved-state/index.js.map +1 -1
  425. package/build-module/components/post-schedule/check.js.map +1 -1
  426. package/build-module/components/post-schedule/index.js.map +1 -1
  427. package/build-module/components/post-schedule/label.js.map +1 -1
  428. package/build-module/components/post-schedule/panel.js +8 -0
  429. package/build-module/components/post-schedule/panel.js.map +1 -1
  430. package/build-module/components/post-slug/check.js.map +1 -1
  431. package/build-module/components/post-slug/index.js +44 -68
  432. package/build-module/components/post-slug/index.js.map +1 -1
  433. package/build-module/components/post-status/index.js +231 -0
  434. package/build-module/components/post-status/index.js.map +1 -0
  435. package/build-module/components/post-sticky/check.js.map +1 -1
  436. package/build-module/components/post-sticky/index.js.map +1 -1
  437. package/build-module/components/post-switch-to-draft-button/index.js +7 -1
  438. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  439. package/build-module/components/post-sync-status/index.js.map +1 -1
  440. package/build-module/components/post-taxonomies/check.js.map +1 -1
  441. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  442. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  443. package/build-module/components/post-taxonomies/index.js.map +1 -1
  444. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  445. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  446. package/build-module/components/post-template/block-theme.js +7 -3
  447. package/build-module/components/post-template/block-theme.js.map +1 -1
  448. package/build-module/components/post-template/classic-theme.js.map +1 -1
  449. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  450. package/build-module/components/post-template/create-new-template.js.map +1 -1
  451. package/build-module/components/post-template/hooks.js.map +1 -1
  452. package/build-module/components/post-template/panel.js.map +1 -1
  453. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  454. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  455. package/build-module/components/post-text-editor/index.js.map +1 -1
  456. package/build-module/components/post-title/constants.js.map +1 -1
  457. package/build-module/components/post-title/index.js.map +1 -1
  458. package/build-module/components/post-title/index.native.js +1 -1
  459. package/build-module/components/post-title/index.native.js.map +1 -1
  460. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  461. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  462. package/build-module/components/post-title/use-post-title.js.map +1 -1
  463. package/build-module/components/post-trash/check.js +24 -26
  464. package/build-module/components/post-trash/check.js.map +1 -1
  465. package/build-module/components/post-trash/index.js +2 -1
  466. package/build-module/components/post-trash/index.js.map +1 -1
  467. package/build-module/components/post-type-support-check/index.js.map +1 -1
  468. package/build-module/components/post-url/check.js.map +1 -1
  469. package/build-module/components/post-url/index.js +46 -21
  470. package/build-module/components/post-url/index.js.map +1 -1
  471. package/build-module/components/post-url/label.js.map +1 -1
  472. package/build-module/components/post-url/panel.js +14 -7
  473. package/build-module/components/post-url/panel.js.map +1 -1
  474. package/build-module/components/post-view-link/index.js.map +1 -1
  475. package/build-module/components/post-visibility/check.js.map +1 -1
  476. package/build-module/components/post-visibility/index.js +2 -1
  477. package/build-module/components/post-visibility/index.js.map +1 -1
  478. package/build-module/components/post-visibility/label.js.map +1 -1
  479. package/build-module/components/post-visibility/utils.js.map +1 -1
  480. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  481. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  482. package/build-module/components/preferences-modal/index.js +19 -17
  483. package/build-module/components/preferences-modal/index.js.map +1 -1
  484. package/build-module/components/preview-dropdown/index.js.map +1 -1
  485. package/build-module/components/provider/disable-non-page-content-blocks.js +36 -20
  486. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  487. package/build-module/components/provider/index.js +5 -3
  488. package/build-module/components/provider/index.js.map +1 -1
  489. package/build-module/components/provider/index.native.js.map +1 -1
  490. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  491. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
  492. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  493. package/build-module/components/provider/use-block-editor-settings.js +73 -53
  494. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  495. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  496. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  497. package/build-module/components/provider/with-registry-provider.js +1 -0
  498. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  499. package/build-module/components/start-page-options/index.js +132 -0
  500. package/build-module/components/start-page-options/index.js.map +1 -0
  501. package/build-module/components/table-of-contents/index.js.map +1 -1
  502. package/build-module/components/table-of-contents/panel.js.map +1 -1
  503. package/build-module/components/template-areas/index.js +63 -0
  504. package/build-module/components/template-areas/index.js.map +1 -0
  505. package/build-module/components/template-validation-notice/index.js +25 -31
  506. package/build-module/components/template-validation-notice/index.js.map +1 -1
  507. package/build-module/components/theme-support-check/index.js +11 -16
  508. package/build-module/components/theme-support-check/index.js.map +1 -1
  509. package/build-module/components/time-to-read/index.js.map +1 -1
  510. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  511. package/build-module/components/word-count/index.js.map +1 -1
  512. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  513. package/build-module/hooks/default-autocompleters.js.map +1 -1
  514. package/build-module/hooks/index.js.map +1 -1
  515. package/build-module/hooks/index.native.js.map +1 -1
  516. package/build-module/hooks/pattern-overrides.js +22 -10
  517. package/build-module/hooks/pattern-overrides.js.map +1 -1
  518. package/build-module/hooks/use-select-nearest-editable-block.js +80 -0
  519. package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -0
  520. package/build-module/index.js.map +1 -1
  521. package/build-module/index.native.js.map +1 -1
  522. package/build-module/lock-unlock.js.map +1 -1
  523. package/build-module/private-apis.js +24 -1
  524. package/build-module/private-apis.js.map +1 -1
  525. package/build-module/store/actions.js +37 -3
  526. package/build-module/store/actions.js.map +1 -1
  527. package/build-module/store/actions.native.js.map +1 -1
  528. package/build-module/store/constants.js +9 -0
  529. package/build-module/store/constants.js.map +1 -1
  530. package/build-module/store/defaults.js.map +1 -1
  531. package/build-module/store/index.js.map +1 -1
  532. package/build-module/store/local-autosave.js.map +1 -1
  533. package/build-module/store/private-actions.js +249 -1
  534. package/build-module/store/private-actions.js.map +1 -1
  535. package/build-module/store/private-selectors.js +50 -4
  536. package/build-module/store/private-selectors.js.map +1 -1
  537. package/build-module/store/reducer.js +13 -1
  538. package/build-module/store/reducer.js.map +1 -1
  539. package/build-module/store/reducer.native.js.map +1 -1
  540. package/build-module/store/selectors.js +20 -16
  541. package/build-module/store/selectors.js.map +1 -1
  542. package/build-module/store/selectors.native.js.map +1 -1
  543. package/build-module/store/utils/get-filtered-template-parts.js +64 -0
  544. package/build-module/store/utils/get-filtered-template-parts.js.map +1 -0
  545. package/build-module/store/utils/is-template-revertable.js +22 -0
  546. package/build-module/store/utils/is-template-revertable.js.map +1 -0
  547. package/build-module/store/utils/notice-builder.js.map +1 -1
  548. package/build-module/utils/get-template-part-icon.js.map +1 -1
  549. package/build-module/utils/index.js.map +1 -1
  550. package/build-module/utils/index.native.js.map +1 -1
  551. package/build-module/utils/media-upload/index.js.map +1 -1
  552. package/build-module/utils/media-upload/index.native.js.map +1 -1
  553. package/build-module/utils/terms.js.map +1 -1
  554. package/build-module/utils/url.js.map +1 -1
  555. package/build-style/style-rtl.css +565 -49
  556. package/build-style/style.css +565 -49
  557. package/package.json +36 -36
  558. package/src/bindings/post-meta.js +11 -27
  559. package/src/components/autosave-monitor/index.js +9 -0
  560. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +108 -0
  561. package/src/components/commands/index.js +21 -2
  562. package/src/components/deprecated.js +157 -0
  563. package/src/components/document-bar/index.js +9 -15
  564. package/src/components/document-bar/style.scss +9 -12
  565. package/src/components/document-tools/index.js +16 -14
  566. package/src/components/document-tools/style.scss +4 -11
  567. package/src/components/editor-canvas/edit-template-blocks-notification.js +17 -53
  568. package/src/components/editor-canvas/index.js +8 -4
  569. package/src/components/entities-saved-states/index.js +12 -113
  570. package/src/components/error-boundary/style.native.scss +1 -1
  571. package/src/components/global-keyboard-shortcuts/index.js +25 -0
  572. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
  573. package/src/components/index.js +7 -0
  574. package/src/components/inserter-sidebar/index.js +7 -1
  575. package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
  576. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
  577. package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
  578. package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
  579. package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
  580. package/src/components/list-view-sidebar/index.js +1 -0
  581. package/src/components/list-view-sidebar/style.scss +1 -1
  582. package/src/components/pattern-overrides-panel/index.js +26 -0
  583. package/src/components/plugin-more-menu-item/index.js +73 -0
  584. package/src/components/plugin-post-publish-panel/index.js +64 -0
  585. package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +39 -0
  586. package/src/components/plugin-post-publish-panel/test/index.js +33 -0
  587. package/src/components/plugin-post-status-info/index.js +63 -0
  588. package/src/components/plugin-pre-publish-panel/index.js +67 -0
  589. package/src/components/plugin-pre-publish-panel/test/index.js +33 -0
  590. package/src/components/plugin-sidebar/index.js +98 -0
  591. package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
  592. package/src/components/post-actions/actions.js +862 -0
  593. package/src/components/post-actions/index.js +156 -0
  594. package/src/components/post-actions/style.scss +3 -0
  595. package/src/components/post-card-panel/index.js +168 -0
  596. package/src/components/post-card-panel/style.scss +32 -0
  597. package/src/components/post-excerpt/check.js +8 -0
  598. package/src/components/post-featured-image/style.scss +3 -2
  599. package/src/components/post-publish-button/index.js +23 -36
  600. package/src/components/post-publish-button/label.js +54 -39
  601. package/src/components/post-publish-button/test/index.js +15 -26
  602. package/src/components/post-publish-button/test/label.js +44 -21
  603. package/src/components/post-saved-state/index.js +13 -6
  604. package/src/components/post-saved-state/test/index.js +4 -0
  605. package/src/components/post-schedule/panel.js +22 -0
  606. package/src/components/post-slug/index.js +50 -68
  607. package/src/components/post-slug/test/index.js +29 -6
  608. package/src/components/post-status/index.js +310 -0
  609. package/src/components/post-status/style.scss +75 -0
  610. package/src/components/post-switch-to-draft-button/index.js +5 -0
  611. package/src/components/post-template/block-theme.js +31 -22
  612. package/src/components/post-title/index.native.js +1 -1
  613. package/src/components/post-trash/check.js +19 -19
  614. package/src/components/post-trash/index.js +1 -0
  615. package/src/components/post-url/index.js +131 -101
  616. package/src/components/post-url/panel.js +20 -7
  617. package/src/components/post-url/style.scss +8 -6
  618. package/src/components/post-visibility/index.js +1 -0
  619. package/src/components/preferences-modal/index.js +26 -22
  620. package/src/components/provider/disable-non-page-content-blocks.js +40 -20
  621. package/src/components/provider/index.js +17 -8
  622. package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
  623. package/src/components/provider/use-block-editor-settings.js +70 -44
  624. package/src/components/provider/with-registry-provider.js +1 -0
  625. package/src/components/start-page-options/index.js +135 -0
  626. package/src/components/start-page-options/style.scss +26 -0
  627. package/src/components/template-areas/index.js +85 -0
  628. package/src/components/template-areas/style.scss +23 -0
  629. package/src/components/template-validation-notice/index.js +48 -50
  630. package/src/components/theme-support-check/index.js +9 -16
  631. package/src/components/theme-support-check/test/index.js +44 -43
  632. package/src/hooks/pattern-overrides.js +25 -14
  633. package/src/hooks/use-select-nearest-editable-block.js +95 -0
  634. package/src/private-apis.js +21 -0
  635. package/src/store/actions.js +37 -3
  636. package/src/store/constants.js +9 -0
  637. package/src/store/private-actions.js +377 -1
  638. package/src/store/private-selectors.js +101 -18
  639. package/src/store/reducer.js +13 -0
  640. package/src/store/selectors.js +51 -46
  641. package/src/store/utils/get-filtered-template-parts.js +69 -0
  642. package/src/store/utils/is-template-revertable.js +23 -0
  643. package/src/store/utils/test/get-filtered-template-parts.js +189 -0
  644. package/src/style.scss +8 -2
  645. package/src/components/post-publish-button/style.scss +0 -8
  646. package/src/components/provider/test/disable-non-page-content-blocks.js +0 -90
  647. package/src/components/template-validation-notice/style.scss +0 -9
@@ -1 +1 @@
1
- {"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","store","preferencesStore","privateApis","preferencesPrivateApis","EnablePanelOption","EnablePluginDocumentSettingPanelOption","BlockManager","PostTaxonomies","PostFeaturedImageCheck","PostExcerptCheck","PageAttributesCheck","PostTypeSupportCheck","editorStore","unlock","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","PreferenceToggleControl","EditorPreferencesModal","extraSections","isActive","onClose","isLargeViewport","showBlockBreadcrumbsOption","select","getEditorSettings","get","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","turnOffDistractionFree","sections","name","tabLabel","content","createElement","Fragment","title","scope","featureName","help","label","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","general","onToggle","appearance","closeModal"],"sources":["@wordpress/editor/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport BlockManager from '../block-manager';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( {\n\textraSections = {},\n\tisActive,\n\tonClose,\n} ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { showBlockBreadcrumbsOption } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn {\n\t\t\t\tshowBlockBreadcrumbsOption:\n\t\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled,\n\t\t\t};\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\t// Todo: Check sidebar when closing/opening distraction free.\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'appearance',\n\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'accessibility',\n\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption, extraSections ]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ onClose }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,wBAAwB;;AAE/B;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,gBAAgB;AAC9C,OAAOC,sCAAsC,MAAM,wCAAwC;AAC3F,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,sBAAsB,MAAM,8BAA8B;AACjE,OAAOC,gBAAgB,MAAM,uBAAuB;AACpD,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASX,KAAK,IAAIY,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EACLC,gBAAgB;EAChBC,oBAAoB;EACpBC,uBAAuB;EACvBC;AACD,CAAC,GAAGJ,MAAM,CAAEV,sBAAuB,CAAC;AAEpC,eAAe,SAASe,sBAAsBA,CAAE;EAC/CC,aAAa,GAAG,CAAC,CAAC;EAClBC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAMC,eAAe,GAAG1B,gBAAgB,CAAE,QAAS,CAAC;EACpD,MAAM;IAAE2B;EAA2B,CAAC,GAA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G,GAEH6C,aAAA,CAAClC,YAAY,MAAE,CACS,CACxB;EAEJ,CAAC,CACD,EACD,CAAEgB,eAAe,EAAEC,0BAA0B,EAAEJ,aAAa,CAC7D,CAAC;EAED,IAAK,CAAEC,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OACCoB,aAAA,CAAC1B,gBAAgB;IAAC6C,UAAU,EAAGtC;EAAS,GACvCmB,aAAA,CAACzB,oBAAoB;IAACqB,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
1
+ {"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","store","preferencesStore","privateApis","preferencesPrivateApis","interfaceStore","EnablePanelOption","EnablePluginDocumentSettingPanelOption","BlockManager","PostTaxonomies","PostFeaturedImageCheck","PostExcerptCheck","PageAttributesCheck","PostTypeSupportCheck","editorStore","unlock","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","PreferenceToggleControl","EditorPreferencesModal","extraSections","isLargeViewport","isActive","showBlockBreadcrumbsOption","select","getEditorSettings","get","isModalActive","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeModal","setIsListViewOpened","setIsInserterOpened","set","setPreference","sections","name","tabLabel","content","createElement","Fragment","title","scope","featureName","help","label","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","general","onToggle","appearance"],"sources":["@wordpress/editor/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport BlockManager from '../block-manager';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { isActive, showBlockBreadcrumbsOption } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isModalActive } = select( interfaceStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn {\n\t\t\t\tshowBlockBreadcrumbsOption:\n\t\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled,\n\t\t\t\tisActive: isModalActive( 'editor/preferences' ),\n\t\t\t};\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'appearance',\n\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'accessibility',\n\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,KAA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1
- {"version":3,"names":["useViewportMatch","DropdownMenu","MenuGroup","MenuItem","VisuallyHidden","Icon","__","check","desktop","mobile","tablet","external","useSelect","useDispatch","store","coreStore","preferencesStore","editorStore","PostPreviewButton","PreviewDropdown","forceIsAutosaveable","disabled","deviceType","homeUrl","isTemplate","isViewable","showIconLabels","select","_getPostType$viewable","getDeviceType","getCurrentPostType","getUnstableBase","getPostType","get","_currentPostType","home","viewable","setDeviceType","isMobile","popoverProps","placement","toggleProps","className","size","showTooltip","__experimentalIsFocusable","menuProps","deviceIcons","createElement","icon","toLowerCase","label","disableOpenOnArrowDown","onClose","Fragment","onClick","href","target","as","role","textContent","onPreview"],"sources":["@wordpress/editor/src/components/preview-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check, desktop, mobile, tablet, external } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostPreviewButton from '../post-preview-button';\n\nexport default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {\n\tconst { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getDeviceType, getCurrentPostType } = select( editorStore );\n\t\t\tconst { getUnstableBase, getPostType } = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst _currentPostType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tisTemplate: _currentPostType === 'wp_template',\n\t\t\t\tisViewable: getPostType( _currentPostType )?.viewable ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tif ( isMobile ) return null;\n\n\tconst popoverProps = {\n\t\tplacement: 'bottom-end',\n\t};\n\tconst toggleProps = {\n\t\tclassName: 'editor-preview-dropdown__toggle',\n\t\tsize: 'compact',\n\t\tshowTooltip: ! showIconLabels,\n\t\tdisabled,\n\t\t__experimentalIsFocusable: disabled,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\n\tconst deviceIcons = {\n\t\tmobile,\n\t\ttablet,\n\t\tdesktop,\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"editor-preview-dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ deviceIcons[ deviceType.toLowerCase() ] }\n\t\t\tlabel={ __( 'View' ) }\n\t\t\tdisableOpenOnArrowDown={ disabled }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ isTemplate && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\t\tclassName=\"editor-preview-dropdown__button-external\"\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\tforceIsAutosaveable={ forceIsAutosaveable }\n\t\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Preview in new tab' ) }\n\t\t\t\t\t\t\t\t\t\t<Icon icon={ external } />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPreview={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";AAAA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RoD,OAAO,EAAGA,CAAA,KAAMlB,aAAa,CAAE,QAAS,CAAG;IAC3CY,IAAI,EAAG3B,UAAU,KAAK,QAAQ,IAAIf;EAAO,GAEvCD,EAAE,CAAE,QAAS,CACN,CAAC,EACX0C,aAAA,CAAC7C,QAAQ;IACRoD,OAAO,EAAGA,CAAA,KAAMlB,aAAa,CAAE,QAAS,CAAG;IAC3CY,IAAI,EAAG3B,UAAU,KAAK,QAAQ,IAAIf;EAAO,GAEvCD,EAAE,CAAE,QAAS,CACN,CACA,CAAC,EACVkB,UAAU,IACXwB,aAAA,CAAC9C,SAAS,QACT8C,aAAA,CAAC7C,QAAQ;IACRqD,IAAI,EAAGjC,OAAS;IAChBkC,MAAM,EAAC,QAAQ;IACfR,IAAI,EAAGtC,QAAU;IACjB4C,OAAO,EAAGF;EAAS,GAEjB/C,EAAE,CAAE,WAAY,CAAC,EACnB0C,aAAA,CAAC5C,cAAc;IAACsD,EAAE,EAAC;EAAM,GAEvB;EACApD,EAAE,CAAE,sBAAuB,CAEb,CACP,CACA,CACX,EACCmB,UAAU,IACXuB,aAAA,CAAC9C,SAAS,QACT8C,aAAA,CAAC9B,iBAAiB;IACjBwB,SAAS,EAAC,0CAA0C;IACpDiB,IAAI,EAAC,UAAU;IACfvC,mBAAmB,EAAGA,mBAAqB;IAC3CwC,WAAW,EACVZ,aAAA,CAAAM,QAAA,QACGhD,EAAE,CAAE,oBAAqB,CAAC,EAC5B0C,aAAA,CAAC3C,IAAI;MAAC4C,IAAI,EAAGtC;IAAU,CAAE,CACxB,CACF;IACDkD,SAAS,EAAGR;EAAS,CACrB,CACS,CAEX,CAEU,CAAC;AAEjB"}
1
+ {"version":3,"names":["useViewportMatch","DropdownMenu","MenuGroup","MenuItem","VisuallyHidden","Icon","__","check","desktop","mobile","tablet","external","useSelect","useDispatch","store","coreStore","preferencesStore","editorStore","PostPreviewButton","PreviewDropdown","forceIsAutosaveable","disabled","deviceType","homeUrl","isTemplate","isViewable","showIconLabels","select","_getPostType$viewable","getDeviceType","getCurrentPostType","getUnstableBase","getPostType","get","_currentPostType","home","viewable","setDeviceType","isMobile","popoverProps","placement","toggleProps","className","size","showTooltip","__experimentalIsFocusable","menuProps","deviceIcons","createElement","icon","toLowerCase","label","disableOpenOnArrowDown","onClose","Fragment","onClick","href","target","as","role","textContent","onPreview"],"sources":["@wordpress/editor/src/components/preview-dropdown/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check, desktop, mobile, tablet, external } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostPreviewButton from '../post-preview-button';\n\nexport default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {\n\tconst { deviceType, homeUrl, isTemplate, isViewable, showIconLabels } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getDeviceType, getCurrentPostType } = select( editorStore );\n\t\t\tconst { getUnstableBase, getPostType } = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst _currentPostType = getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tisTemplate: _currentPostType === 'wp_template',\n\t\t\t\tisViewable: getPostType( _currentPostType )?.viewable ?? false,\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t}, [] );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\tif ( isMobile ) return null;\n\n\tconst popoverProps = {\n\t\tplacement: 'bottom-end',\n\t};\n\tconst toggleProps = {\n\t\tclassName: 'editor-preview-dropdown__toggle',\n\t\tsize: 'compact',\n\t\tshowTooltip: ! showIconLabels,\n\t\tdisabled,\n\t\t__experimentalIsFocusable: disabled,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\n\tconst deviceIcons = {\n\t\tmobile,\n\t\ttablet,\n\t\tdesktop,\n\t};\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"editor-preview-dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ deviceIcons[ deviceType.toLowerCase() ] }\n\t\t\tlabel={ __( 'View' ) }\n\t\t\tdisableOpenOnArrowDown={ disabled }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ isTemplate && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'View site' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isViewable && (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\t\tclassName=\"editor-preview-dropdown__button-external\"\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\tforceIsAutosaveable={ forceIsAutosaveable }\n\t\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Preview in new tab' ) }\n\t\t\t\t\t\t\t\t\t\t<Icon icon={ external } />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonPreview={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SACCC,YAAY,EACZC,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,IAAI,QACE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,OAAO,EAAEC,M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AA,KAAMlB,aAAa,CAAE,QAAS,CAAG;IAC3CY,IAAI,EAAG3B,UAAU,KAAK,QAAQ,IAAIf;EAAO,GAEvCD,EAAE,CAAE,QAAS,CACN,CACA,CAAC,EACVkB,UAAU,IACXwB,aAAA,CAAC9C,SAAS,QACT8C,aAAA,CAAC7C,QAAQ;IACRqD,IAAI,EAAGjC,OAAS;IAChBkC,MAAM,EAAC,QAAQ;IACfR,IAAI,EAAGtC,QAAU;IACjB4C,OAAO,EAAGF;EAAS,GAEjB/C,EAAE,CAAE,WAAY,CAAC,EACnB0C,aAAA,CAAC5C,cAAc;IAACsD,EAAE,EAAC;EAAM,GAEvB;EACApD,EAAE,CAAE,sBAAuB,CAEb,CACP,CACA,CACX,EACCmB,UAAU,IACXuB,aAAA,CAAC9C,SAAS,QACT8C,aAAA,CAAC9B,iBAAiB;IACjBwB,SAAS,EAAC,0CAA0C;IACpDiB,IAAI,EAAC,UAAU;IACfvC,mBAAmB,EAAGA,mBAAqB;IAC3CwC,WAAW,EACVZ,aAAA,CAAAM,QAAA,QACGhD,EAAE,CAAE,oBAAqB,CAAC,EAC5B0C,aAAA,CAAC3C,IAAI;MAAC4C,IAAI,EAAGtC;IAAU,CAAE,CACxB,CACF;IACDkD,SAAS,EAAGR;EAAS,CACrB,CACS,CAEX,CAEU,CAAC;AAEjB","ignoreList":[]}
@@ -4,43 +4,59 @@
4
4
  import { useSelect, useDispatch } from '@wordpress/data';
5
5
  import { store as blockEditorStore } from '@wordpress/block-editor';
6
6
  import { useEffect } from '@wordpress/element';
7
- const PAGE_CONTENT_BLOCKS = ['core/post-title', 'core/post-featured-image', 'core/post-content'];
8
- function useDisableNonPageContentBlocks() {
9
- const contentIds = useSelect(select => {
7
+ import { applyFilters } from '@wordpress/hooks';
8
+ const CONTENT_ONLY_BLOCKS = applyFilters('editor.postContentBlockTypes', ['core/post-title', 'core/post-featured-image', 'core/post-content', 'core/template-part']);
9
+
10
+ /**
11
+ * Component that when rendered, makes it so that the site editor allows only
12
+ * page content to be edited.
13
+ */
14
+ export default function DisableNonPageContentBlocks() {
15
+ const contentOnlyIds = useSelect(select => {
10
16
  const {
11
17
  getBlocksByName,
12
18
  getBlockParents,
13
19
  getBlockName
14
20
  } = select(blockEditorStore);
15
- return getBlocksByName(PAGE_CONTENT_BLOCKS).filter(clientId => getBlockParents(clientId).every(parentClientId => {
21
+ return getBlocksByName(CONTENT_ONLY_BLOCKS).filter(clientId => getBlockParents(clientId).every(parentClientId => {
16
22
  const parentBlockName = getBlockName(parentClientId);
17
- return parentBlockName !== 'core/query' && !PAGE_CONTENT_BLOCKS.includes(parentBlockName);
23
+ return (
24
+ // Ignore descendents of the query block.
25
+ parentBlockName !== 'core/query' &&
26
+ // Enable only the top-most block.
27
+ !CONTENT_ONLY_BLOCKS.includes(parentBlockName)
28
+ );
18
29
  }));
19
30
  }, []);
31
+ const disabledIds = useSelect(select => {
32
+ const {
33
+ getBlocksByName,
34
+ getBlockOrder
35
+ } = select(blockEditorStore);
36
+ return getBlocksByName(['core/template-part']).flatMap(clientId => getBlockOrder(clientId));
37
+ }, []);
20
38
  const {
21
39
  setBlockEditingMode,
22
40
  unsetBlockEditingMode
23
41
  } = useDispatch(blockEditorStore);
24
42
  useEffect(() => {
25
- setBlockEditingMode('', 'disabled'); // Disable editing at the root level.
26
-
27
- for (const contentId of contentIds) {
28
- setBlockEditingMode(contentId, 'contentOnly'); // Re-enable each content block.
43
+ setBlockEditingMode('', 'disabled');
44
+ for (const clientId of contentOnlyIds) {
45
+ setBlockEditingMode(clientId, 'contentOnly');
46
+ }
47
+ for (const clientId of disabledIds) {
48
+ setBlockEditingMode(clientId, 'disabled');
29
49
  }
30
50
  return () => {
31
51
  unsetBlockEditingMode('');
32
- for (const contentId of contentIds) {
33
- unsetBlockEditingMode(contentId);
52
+ for (const clientId of contentOnlyIds) {
53
+ unsetBlockEditingMode(clientId);
54
+ }
55
+ for (const clientId of disabledIds) {
56
+ unsetBlockEditingMode(clientId);
34
57
  }
35
58
  };
36
- }, [contentIds, setBlockEditingMode, unsetBlockEditingMode]);
37
- }
38
-
39
- /**
40
- * Component that when rendered, makes it so that the site editor allows only
41
- * page content to be edited.
42
- */
43
- export default function DisableNonPageContentBlocks() {
44
- useDisableNonPageContentBlocks();
59
+ }, [contentOnlyIds, disabledIds, setBlockEditingMode, unsetBlockEditingMode]);
60
+ return null;
45
61
  }
46
62
  //# sourceMappingURL=disable-non-page-content-blocks.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","store","blockEditorStore","useEffect","PAGE_CONTENT_BLOCKS","useDisableNonPageContentBlocks","contentIds","select","getBlocksByName","getBlockParents","getBlockName","filter","clientId","every","parentClientId","parentBlockName","includes","setBlockEditingMode","unsetBlockEditingMode","contentId","DisableNonPageContentBlocks"],"sources":["@wordpress/editor/src/components/provider/disable-non-page-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\n\nconst PAGE_CONTENT_BLOCKS = [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n];\n\nfunction useDisableNonPageContentBlocks() {\n\tconst contentIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockParents, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\treturn getBlocksByName( PAGE_CONTENT_BLOCKS ).filter( ( clientId ) =>\n\t\t\tgetBlockParents( clientId ).every( ( parentClientId ) => {\n\t\t\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\t\t\treturn (\n\t\t\t\t\tparentBlockName !== 'core/query' &&\n\t\t\t\t\t! PAGE_CONTENT_BLOCKS.includes( parentBlockName )\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}, [] );\n\n\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tsetBlockEditingMode( '', 'disabled' ); // Disable editing at the root level.\n\n\t\tfor ( const contentId of contentIds ) {\n\t\t\tsetBlockEditingMode( contentId, 'contentOnly' ); // Re-enable each content block.\n\t\t}\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( '' );\n\t\t\tfor ( const contentId of contentIds ) {\n\t\t\t\tunsetBlockEditingMode( contentId );\n\t\t\t}\n\t\t};\n\t}, [ contentIds, setBlockEditingMode, unsetBlockEditingMode ] );\n}\n\n/**\n * Component that when rendered, makes it so that the site editor allows only\n * page content to be edited.\n */\nexport default function DisableNonPageContentBlocks() {\n\tuseDisableNonPageContentBlocks();\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,SAAS,QAAQ,oBAAoB;AAE9C,MAAMC,mBAAmB,GAAG,CAC3B,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,CACnB;AAED,SAASC,8BAA8BA,CAAA,EAAG;EACzC,MAAMC,UAAU,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IAC3C,MAAM;MAAEC,eAAe;MAAEC,eAAe;MAAEC;IAAa,CAAC,GACvDH,MAAM,CAAEL,gBAAiB,CAAC;IAC3B,OAAOM,eAAe,CAAEJ,mBAAoB,CAAC,CAACO,MAAM,CAAIC,QAAQ,IAC/DH,eAAe,CAAEG,QAAS,CAAC,CAACC,KAAK,CAAIC,cAAc,IAAM;MACxD,MAAMC,eAAe,GAAGL,YAAY,CAAEI,cAAe,CAAC;MACtD,OACCC,eAAe,KAAK,YAAY,IAChC,CAAEX,mBAAmB,CAACY,QAAQ,CAAED,eAAgB,CAAC;IAEnD,CAAE,CACH,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEE,mBAAmB;IAAEC;EAAsB,CAAC,GACnDlB,WAAW,CAAEE,gBAAiB,CAAC;EAEhCC,SAAS,CAAE,MAAM;IAChBc,mBAAmB,CAAE,EAAE,EAAE,UAAW,CAAC,CAAC,CAAC;;IAEvC,KAAM,MAAME,SAAS,IAAIb,UAAU,EAAG;MACrCW,mBAAmB,CAAEE,SAAS,EAAE,aAAc,CAAC,CAAC,CAAC;IAClD;IACA,OAAO,MAAM;MACZD,qBAAqB,CAAE,EAAG,CAAC;MAC3B,KAAM,MAAMC,SAAS,IAAIb,UAAU,EAAG;QACrCY,qBAAqB,CAAEC,SAAU,CAAC;MACnC;IACD,CAAC;EACF,CAAC,EAAE,CAAEb,UAAU,EAAEW,mBAAmB,EAAEC,qBAAqB,CAAG,CAAC;AAChE;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAASE,2BAA2BA,CAAA,EAAG;EACrDf,8BAA8B,CAAC,CAAC;AACjC"}
1
+ {"version":3,"names":["useSelect","useDispatch","store","blockEditorStore","useEffect","applyFilters","CONTENT_ONLY_BLOCKS","DisableNonPageContentBlocks","contentOnlyIds","select","getBlocksByName","getBlockParents","getBlockName","filter","clientId","every","parentClientId","parentBlockName","includes","disabledIds","getBlockOrder","flatMap","setBlockEditingMode","unsetBlockEditingMode"],"sources":["@wordpress/editor/src/components/provider/disable-non-page-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\n\nconst CONTENT_ONLY_BLOCKS = applyFilters( 'editor.postContentBlockTypes', [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n\t'core/template-part',\n] );\n\n/**\n * Component that when rendered, makes it so that the site editor allows only\n * page content to be edited.\n */\nexport default function DisableNonPageContentBlocks() {\n\tconst contentOnlyIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockParents, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\treturn getBlocksByName( CONTENT_ONLY_BLOCKS ).filter( ( clientId ) =>\n\t\t\tgetBlockParents( clientId ).every( ( parentClientId ) => {\n\t\t\t\tconst parentBlockName = getBlockName( parentClientId );\n\t\t\t\treturn (\n\t\t\t\t\t// Ignore descendents of the query block.\n\t\t\t\t\tparentBlockName !== 'core/query' &&\n\t\t\t\t\t// Enable only the top-most block.\n\t\t\t\t\t! CONTENT_ONLY_BLOCKS.includes( parentBlockName )\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}, [] );\n\n\tconst disabledIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, getBlockOrder } = select( blockEditorStore );\n\t\treturn getBlocksByName( [ 'core/template-part' ] ).flatMap(\n\t\t\t( clientId ) => getBlockOrder( clientId )\n\t\t);\n\t}, [] );\n\n\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tsetBlockEditingMode( '', 'disabled' );\n\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t}\n\t\tfor ( const clientId of disabledIds ) {\n\t\t\tsetBlockEditingMode( clientId, 'disabled' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( '' );\n\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t}\n\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t}\n\t\t};\n\t}, [\n\t\tcontentOnlyIds,\n\t\tdisabledIds,\n\t\tsetBlockEditingMode,\n\t\tunsetBlockEditingMode,\n\t] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,YAAY,QAAQ,kBAAkB;AAE/C,MAAMC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G;MACrCG,mBAAmB,CAAER,QAAQ,EAAE,UAAW,CAAC;IAC5C;IAEA,OAAO,MAAM;MACZS,qBAAqB,CAAE,EAAG,CAAC;MAC3B,KAAM,MAAMT,QAAQ,IAAIN,cAAc,EAAG;QACxCe,qBAAqB,CAAET,QAAS,CAAC;MAClC;MACA,KAAM,MAAMA,QAAQ,IAAIK,WAAW,EAAG;QACrCI,qBAAqB,CAAET,QAAS,CAAC;MAClC;IACD,CAAC;EACF,CAAC,EAAE,CACFN,cAAc,EACdW,WAAW,EACXG,mBAAmB,EACnBC,qBAAqB,CACpB,CAAC;EAEH,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { createElement } from "react";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -23,6 +23,8 @@ import NavigationBlockEditingMode from './navigation-block-editing-mode';
23
23
  import { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';
24
24
  import useCommands from '../commands';
25
25
  import BlockRemovalWarnings from '../block-removal-warnings';
26
+ import StartPageOptions from '../start-page-options';
27
+ import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
26
28
  const {
27
29
  ExperimentalBlockEditorProvider
28
30
  } = unlock(blockEditorPrivateApis);
@@ -131,7 +133,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
131
133
  id,
132
134
  type
133
135
  } = rootLevelPost;
134
- const blockEditorSettings = useBlockEditorSettings(editorSettings, type, id);
136
+ const blockEditorSettings = useBlockEditorSettings(editorSettings, type, id, mode);
135
137
  const [blocks, onInput, onChange] = useBlockEditorProps(post, template, mode);
136
138
  const {
137
139
  updatePostLock,
@@ -207,7 +209,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
207
209
  selection: selection,
208
210
  settings: blockEditorSettings,
209
211
  useSubRegistry: false
210
- }, children, createElement(PatternsMenuItems, null), mode === 'template-locked' && createElement(DisableNonPageContentBlocks, null), type === 'wp_navigation' && createElement(NavigationBlockEditingMode, null), createElement(BlockRemovalWarnings, null)))));
212
+ }, children, !settings.__unstableIsPreviewMode && createElement(Fragment, null, createElement(PatternsMenuItems, null), mode === 'template-locked' && createElement(DisableNonPageContentBlocks, null), type === 'wp_navigation' && createElement(NavigationBlockEditingMode, null), createElement(KeyboardShortcutHelpModal, null), createElement(BlockRemovalWarnings, null), createElement(StartPageOptions, null))))));
211
213
  });
212
214
  export function EditorProvider(props) {
213
215
  return createElement(ExperimentalEditorProvider, {
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","store","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","select","getRenderingMode","shouldRenderTemplate","defaultBlockContext","postContext","includes","postId","postType","templateSlug","slug","undefined","editorSettings","selection","isReady","getEditorSettings","getEditorSelection","__unstableIsEditorReady","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","_settings$defaultRend","defaultRenderingMode","createElement","kind","value","useSubRegistry","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst mode = useSelect(\n\t\t\t( select ) => select( editorStore ).getRenderingMode(),\n\t\t\t[]\n\t\t);\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext =\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t\t\t? { postId: post.id, postType: post.type }\n\t\t\t\t\t: {};\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t] );\n\t\tconst { editorSettings, selection, isReady } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,sBAAsB;AAC3E,SACCC,mBAAmB,EACnBC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BuD,aAAA,CAACnE,2BAA2B,MAAE,CAC9B,EACCiB,IAAI,KAAK,eAAe,IACzBkD,aAAA,CAAClE,0BAA0B,MAAE,CAC7B,EACDkE,aAAA,CAAC/D,oBAAoB,MAAE,CACM,CACT,CACP,CACD,CAAC;AAEnB,CACD,CAAC;AAED,OAAO,SAASmE,cAAcA,CAAEC,KAAK,EAAG;EACvC,OACCL,aAAA,CAACxC,0BAA0B;IAAA,GACrB6C,KAAK;IACVxC,4BAA4B,EAAG5C;EAAqB,GAElDoF,KAAK,CAACzC,QACmB,CAAC;AAE/B;AAEA,eAAewC,cAAc"}
1
+ {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","store","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","select","getRenderingMode","shouldRenderTemplate","defaultBlockContext","postContext","includes","postId","postType","templateSlug","slug","undefined","editorSettings","selection","isReady","getEditorSettings","getEditorSelection","__unstableIsEditorReady","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","_settings$defaultRend","defaultRenderingMode","createElement","kind","value","useSubRegistry","__unstableIsPreviewMode","Fragment","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst mode = useSelect(\n\t\t\t( select ) => select( editorStore ).getRenderingMode(),\n\t\t\t[]\n\t\t);\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext =\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t\t\t? { postId: post.id, postType: post.type }\n\t\t\t\t\t: {};\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t] );\n\t\tconst { editorSettings, selection, isReady } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.__unstableIsPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,sBAAsB;AAC3E,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASH,WAAW,IAAII,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;AAClD,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,2BAA2B,MAAM,mCAAmC;AAC3E,OAAOC,0BAA0B,MAAM,iCAAiC;AACxE,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,OAAOC,WAAW,MAAM,aAAa;AACrC,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,OAAOC,gBAAgB,MAAM,uBAAuB;AACpD,OAAOC,yBAAyB,MAAM,iCAAiC;AAEvE,MAAM;EAAEC;AAAgC,CAAC,GAAGR,MAAM,CAAER,sBAAuB,CAAC;AAC5E,MAAM;EAAEiB;AAAkB,CAAC,GAAGT,MAAM,CAAEL,uBAAwB,CAAC;AAE/D,MAAMe,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA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IAACnD,IAAI,EAAC;EAAM,GACtCkD,aAAA,CAACnF,cAAc;IACdoF,IAAI,EAAC,UAAU;IACfnD,IAAI,EAAGP,IAAI,CAACO,IAAM;IAClBC,EAAE,EAAGR,IAAI,CAACQ;EAAI,GAEdiD,aAAA,CAAChF,oBAAoB;IAACkF,KAAK,EAAGhC;EAAqB,GAClD8B,aAAA,CAACnC,4BAA4B;IAC5BqC,KAAK,EAAG5C,MAAQ;IAChBT,QAAQ,EAAGA,QAAU;IACrBD,OAAO,EAAGA,OAAS;IACnB+B,SAAS,EAAGA,SAAW;IACvBlB,QAAQ,EAAGuB,mBAAqB;IAChCmB,cAAc,EAAG;EAAO,GAEtBvC,QAAQ,EACR,CAAEH,QAAQ,CAAC2C,uBAAuB,IACnCJ,aAAA,CAAAK,QAAA,QACCL,aAAA,CAAC7D,iBAAiB,MAAE,CAAC,EACnBM,IAAI,KAAK,iBAAiB,IAC3BuD,aAAA,CAACrE,2BAA2B,MAAE,CAC9B,EACCmB,IAAI,KAAK,eAAe,IACzBkD,aAAA,CAACpE,0BAA0B,MAAE,CAC7B,EACDoE,aAAA,CAAC/D,yBAAyB,MAAE,CAAC,EAC7B+D,aAAA,CAACjE,oBAAoB,MAAE,CAAC,EACxBiE,aAAA,CAAChE,gBAAgB,MAAE,CAClB,CAE0B,CACT,CACP,CACD,CAAC;AAEnB,CACD,CAAC;AAED,OAAO,SAASsE,cAAcA,CAAEC,KAAK,EAAG;EACvC,OACCP,aAAA,CAACxC,0BAA0B;IAAA,GACrB+C,KAAK;IACV1C,4BAA4B,EAAG9C;EAAqB,GAElDwF,KAAK,CAAC3C,QACmB,CAAC;AAE/B;AAEA,eAAe0C,cAAc","ignoreList":[]}
@@ -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,qBA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C,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"}
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,OA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,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;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