@wordpress/edit-post 7.31.0 → 7.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 (294) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +9 -323
  3. package/build/components/browser-url/index.js.map +1 -1
  4. package/build/components/editor-initialization/index.js +0 -1
  5. package/build/components/editor-initialization/index.js.map +1 -1
  6. package/build/components/editor-initialization/listener-hooks.js +1 -38
  7. package/build/components/editor-initialization/listener-hooks.js.map +1 -1
  8. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  9. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  10. package/build/components/header/index.js +5 -5
  11. package/build/components/header/index.js.map +1 -1
  12. package/build/components/header/index.native.js +1 -1
  13. package/build/components/header/index.native.js.map +1 -1
  14. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  15. package/build/components/header/more-menu/index.js +7 -6
  16. package/build/components/header/more-menu/index.js.map +1 -1
  17. package/build/components/header/post-publish-button-or-toggle.js +11 -13
  18. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  19. package/build/components/header/preferences-menu-item/index.js +12 -4
  20. package/build/components/header/preferences-menu-item/index.js.map +1 -1
  21. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  22. package/build/components/header/writing-menu/index.js.map +1 -1
  23. package/build/components/init-pattern-modal/index.js.map +1 -1
  24. package/build/components/keyboard-shortcuts/index.js +1 -36
  25. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  26. package/build/components/layout/actions-panel.js +4 -7
  27. package/build/components/layout/actions-panel.js.map +1 -1
  28. package/build/components/layout/index.js +16 -21
  29. package/build/components/layout/index.js.map +1 -1
  30. package/build/components/layout/index.native.js.map +1 -1
  31. package/build/components/meta-boxes/index.js.map +1 -1
  32. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  33. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  34. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  35. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  36. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  37. package/build/components/preferences-modal/index.js +1 -21
  38. package/build/components/preferences-modal/index.js.map +1 -1
  39. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  40. package/build/components/sidebar/plugin-post-publish-panel/index.js +16 -64
  41. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  42. package/build/components/sidebar/plugin-pre-publish-panel/index.js +16 -63
  43. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  44. package/build/components/sidebar/post-format/index.js.map +1 -1
  45. package/build/components/sidebar/post-pending-status/index.js.map +1 -1
  46. package/build/components/sidebar/post-slug/index.js.map +1 -1
  47. package/build/components/sidebar/post-status/index.js +9 -9
  48. package/build/components/sidebar/post-status/index.js.map +1 -1
  49. package/build/components/sidebar/post-sticky/index.js.map +1 -1
  50. package/build/components/sidebar/post-trash/index.js.map +1 -1
  51. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  52. package/build/components/sidebar/settings-header/index.js.map +1 -1
  53. package/build/components/sidebar/settings-sidebar/index.js +42 -40
  54. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  55. package/build/components/text-editor/index.js.map +1 -1
  56. package/build/components/visual-editor/block-inspector-button.js +1 -1
  57. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  58. package/build/components/visual-editor/header.native.js.map +1 -1
  59. package/build/components/visual-editor/index.js +4 -1
  60. package/build/components/visual-editor/index.js.map +1 -1
  61. package/build/components/visual-editor/index.native.js.map +1 -1
  62. package/build/components/visual-editor/use-padding-appender.js +62 -0
  63. package/build/components/visual-editor/use-padding-appender.js.map +1 -0
  64. package/build/components/welcome-guide/default.js.map +1 -1
  65. package/build/components/welcome-guide/image.js.map +1 -1
  66. package/build/components/welcome-guide/index.js.map +1 -1
  67. package/build/components/welcome-guide/template.js.map +1 -1
  68. package/build/editor.js +9 -4
  69. package/build/editor.js.map +1 -1
  70. package/build/editor.native.js.map +1 -1
  71. package/build/hooks/commands/use-common-commands.js +7 -24
  72. package/build/hooks/commands/use-common-commands.js.map +1 -1
  73. package/build/hooks/components/index.js.map +1 -1
  74. package/build/hooks/index.js.map +1 -1
  75. package/build/hooks/use-navigate-to-entity-record.js +36 -19
  76. package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
  77. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  78. package/build/index.js +7 -12
  79. package/build/index.js.map +1 -1
  80. package/build/index.native.js +2 -4
  81. package/build/index.native.js.map +1 -1
  82. package/build/lock-unlock.js.map +1 -1
  83. package/build/plugins/copy-content-menu-item/index.js.map +1 -1
  84. package/build/plugins/index.js.map +1 -1
  85. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
  86. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  87. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  88. package/build/store/actions.js +46 -31
  89. package/build/store/actions.js.map +1 -1
  90. package/build/store/constants.js.map +1 -1
  91. package/build/store/index.js +1 -1
  92. package/build/store/index.js.map +1 -1
  93. package/build/store/reducer.js +1 -15
  94. package/build/store/reducer.js.map +1 -1
  95. package/build/store/selectors.js +44 -24
  96. package/build/store/selectors.js.map +1 -1
  97. package/build/utils/meta-boxes.js.map +1 -1
  98. package/build-module/components/browser-url/index.js.map +1 -1
  99. package/build-module/components/editor-initialization/index.js +1 -2
  100. package/build-module/components/editor-initialization/index.js.map +1 -1
  101. package/build-module/components/editor-initialization/listener-hooks.js +2 -38
  102. package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
  103. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  104. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  105. package/build-module/components/header/index.js +4 -4
  106. package/build-module/components/header/index.js.map +1 -1
  107. package/build-module/components/header/index.native.js +1 -1
  108. package/build-module/components/header/index.native.js.map +1 -1
  109. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  110. package/build-module/components/header/more-menu/index.js +5 -4
  111. package/build-module/components/header/more-menu/index.js.map +1 -1
  112. package/build-module/components/header/post-publish-button-or-toggle.js +11 -13
  113. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  114. package/build-module/components/header/preferences-menu-item/index.js +11 -3
  115. package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
  116. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  117. package/build-module/components/header/writing-menu/index.js.map +1 -1
  118. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  119. package/build-module/components/keyboard-shortcuts/index.js +1 -36
  120. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  121. package/build-module/components/layout/actions-panel.js +4 -5
  122. package/build-module/components/layout/actions-panel.js.map +1 -1
  123. package/build-module/components/layout/index.js +15 -20
  124. package/build-module/components/layout/index.js.map +1 -1
  125. package/build-module/components/layout/index.native.js.map +1 -1
  126. package/build-module/components/meta-boxes/index.js.map +1 -1
  127. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  128. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  129. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  130. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  131. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  132. package/build-module/components/preferences-modal/index.js +1 -20
  133. package/build-module/components/preferences-modal/index.js.map +1 -1
  134. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  135. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +14 -62
  136. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  137. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +14 -61
  138. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  139. package/build-module/components/sidebar/post-format/index.js.map +1 -1
  140. package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
  141. package/build-module/components/sidebar/post-slug/index.js.map +1 -1
  142. package/build-module/components/sidebar/post-status/index.js +9 -10
  143. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  144. package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
  145. package/build-module/components/sidebar/post-trash/index.js.map +1 -1
  146. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  147. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  148. package/build-module/components/sidebar/settings-sidebar/index.js +43 -41
  149. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  150. package/build-module/components/text-editor/index.js.map +1 -1
  151. package/build-module/components/visual-editor/block-inspector-button.js +1 -1
  152. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  153. package/build-module/components/visual-editor/header.native.js.map +1 -1
  154. package/build-module/components/visual-editor/index.js +4 -1
  155. package/build-module/components/visual-editor/index.js.map +1 -1
  156. package/build-module/components/visual-editor/index.native.js.map +1 -1
  157. package/build-module/components/visual-editor/use-padding-appender.js +55 -0
  158. package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
  159. package/build-module/components/welcome-guide/default.js.map +1 -1
  160. package/build-module/components/welcome-guide/image.js.map +1 -1
  161. package/build-module/components/welcome-guide/index.js.map +1 -1
  162. package/build-module/components/welcome-guide/template.js.map +1 -1
  163. package/build-module/editor.js +9 -4
  164. package/build-module/editor.js.map +1 -1
  165. package/build-module/editor.native.js.map +1 -1
  166. package/build-module/hooks/commands/use-common-commands.js +9 -26
  167. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  168. package/build-module/hooks/components/index.js.map +1 -1
  169. package/build-module/hooks/index.js.map +1 -1
  170. package/build-module/hooks/use-navigate-to-entity-record.js +37 -20
  171. package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
  172. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  173. package/build-module/index.js +8 -8
  174. package/build-module/index.js.map +1 -1
  175. package/build-module/index.native.js +2 -4
  176. package/build-module/index.native.js.map +1 -1
  177. package/build-module/lock-unlock.js.map +1 -1
  178. package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
  179. package/build-module/plugins/index.js.map +1 -1
  180. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
  181. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  182. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  183. package/build-module/store/actions.js +38 -22
  184. package/build-module/store/actions.js.map +1 -1
  185. package/build-module/store/constants.js.map +1 -1
  186. package/build-module/store/index.js.map +1 -1
  187. package/build-module/store/reducer.js +1 -13
  188. package/build-module/store/reducer.js.map +1 -1
  189. package/build-module/store/selectors.js +42 -21
  190. package/build-module/store/selectors.js.map +1 -1
  191. package/build-module/utils/meta-boxes.js.map +1 -1
  192. package/build-style/classic-rtl.css +2 -2
  193. package/build-style/classic.css +2 -2
  194. package/build-style/style-rtl.css +12 -454
  195. package/build-style/style.css +12 -454
  196. package/package.json +32 -34
  197. package/src/classic.scss +2 -1
  198. package/src/components/editor-initialization/index.js +1 -5
  199. package/src/components/editor-initialization/listener-hooks.js +1 -40
  200. package/src/components/editor-initialization/test/listener-hooks.js +1 -96
  201. package/src/components/header/index.js +3 -4
  202. package/src/components/header/index.native.js +1 -1
  203. package/src/components/header/more-menu/index.js +3 -4
  204. package/src/components/header/post-publish-button-or-toggle.js +10 -11
  205. package/src/components/header/preferences-menu-item/index.js +9 -3
  206. package/src/components/header/style.scss +5 -3
  207. package/src/components/header/test/index.js +13 -1
  208. package/src/components/keyboard-shortcuts/index.js +3 -44
  209. package/src/components/layout/actions-panel.js +5 -4
  210. package/src/components/layout/index.js +20 -42
  211. package/src/components/meta-boxes/meta-boxes-area/style.scss +1 -1
  212. package/src/components/preferences-modal/index.js +1 -24
  213. package/src/components/sidebar/plugin-post-publish-panel/index.js +12 -67
  214. package/src/components/sidebar/plugin-pre-publish-panel/index.js +12 -66
  215. package/src/components/sidebar/post-status/index.js +6 -9
  216. package/src/components/sidebar/settings-sidebar/index.js +64 -56
  217. package/src/components/visual-editor/block-inspector-button.js +1 -1
  218. package/src/components/visual-editor/index.js +4 -0
  219. package/src/components/visual-editor/use-padding-appender.js +66 -0
  220. package/src/editor.js +14 -4
  221. package/src/hooks/commands/use-common-commands.js +13 -28
  222. package/src/hooks/use-navigate-to-entity-record.js +37 -24
  223. package/src/index.js +11 -6
  224. package/src/index.native.js +1 -4
  225. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
  226. package/src/store/actions.js +37 -24
  227. package/src/store/reducer.js +0 -13
  228. package/src/store/selectors.js +52 -36
  229. package/src/store/test/actions.js +11 -10
  230. package/src/style.scss +1 -20
  231. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -107
  232. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
  233. package/build/components/header/plugin-more-menu-item/index.js +0 -78
  234. package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
  235. package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
  236. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  237. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  238. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  239. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
  240. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  241. package/build/components/keyboard-shortcut-help-modal/index.js +0 -129
  242. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  243. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
  244. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  245. package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
  246. package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  247. package/build/components/sidebar/plugin-sidebar/index.js +0 -104
  248. package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
  249. package/build/components/sidebar/template-summary/index.js +0 -36
  250. package/build/components/sidebar/template-summary/index.js.map +0 -1
  251. package/build/components/start-page-options/index.js +0 -107
  252. package/build/components/start-page-options/index.js.map +0 -1
  253. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -100
  254. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
  255. package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
  256. package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
  257. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
  258. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  259. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  260. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  261. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  262. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  263. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -119
  264. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  265. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
  266. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  267. package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
  268. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  269. package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
  270. package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
  271. package/build-module/components/sidebar/template-summary/index.js +0 -29
  272. package/build-module/components/sidebar/template-summary/index.js.map +0 -1
  273. package/build-module/components/start-page-options/index.js +0 -100
  274. package/build-module/components/start-page-options/index.js.map +0 -1
  275. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -108
  276. package/src/components/header/plugin-more-menu-item/index.js +0 -73
  277. package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
  278. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  279. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
  280. package/src/components/keyboard-shortcut-help-modal/index.js +0 -159
  281. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
  282. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  283. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
  284. package/src/components/sidebar/plugin-post-publish-panel/test/__snapshots__/index.js.snap +0 -39
  285. package/src/components/sidebar/plugin-post-publish-panel/test/index.js +0 -33
  286. package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
  287. package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
  288. package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
  289. package/src/components/sidebar/plugin-pre-publish-panel/test/index.js +0 -33
  290. package/src/components/sidebar/plugin-sidebar/index.js +0 -94
  291. package/src/components/sidebar/template-summary/index.js +0 -37
  292. package/src/components/sidebar/template-summary/style.scss +0 -5
  293. package/src/components/start-page-options/index.js +0 -108
  294. package/src/components/start-page-options/style.scss +0 -26
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_i18n","_icons","_commands","_preferences","_interface","_editor","_notices","_keyboardShortcutHelpModal","_preferencesModal","_store","useCommonCommands","openGeneralSidebar","closeGeneralSidebar","useDispatch","editPostStore","openModal","interfaceStore","activeSidebar","isFullscreen","isPublishSidebarEnabled","useSelect","select","get","preferencesStore","getActiveComplementaryArea","name","editorStore","toggle","createInfoNotice","noticesStore","useCommand","label","__","icon","isRTL","drawerLeft","drawerRight","callback","close","blockDefault","fullscreen","id","type","actions","onClick","PREFERENCES_MODAL_NAME","keyboard","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","formatListBullets"],"sources":["@wordpress/edit-post/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tkeyboard,\n\tfullscreen,\n\tformatListBullets,\n} from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { store as editPostStore } from '../../store';\n\nexport default function useCommonCommands() {\n\tconst { openGeneralSidebar, closeGeneralSidebar } =\n\t\tuseDispatch( editPostStore );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { activeSidebar, isFullscreen, isPublishSidebarEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\treturn {\n\t\t\t\tactiveSidebar: select(\n\t\t\t\t\tinterfaceStore\n\t\t\t\t).getActiveComplementaryArea( editPostStore.name ),\n\t\t\t\tisPublishSidebarEnabled:\n\t\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\t\tisFullscreen: get( 'core/edit-post', 'fullscreenMode' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tuseCommand( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/document' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: isFullscreen\n\t\t\t? __( 'Exit fullscreen' )\n\t\t\t: __( 'Enter fullscreen' ),\n\t\ticon: fullscreen,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFullscreen ? __( 'Fullscreen off.' ) : __( 'Fullscreen on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-fullscreen-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\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\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Editor preferences' ),\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-publish-sidebar',\n\t\tlabel: isPublishSidebarEnabled\n\t\t\t? __( 'Disable pre-publish checks' )\n\t\t\t: __( 'Enable pre-publish checks' ),\n\t\ticon: formatListBullets,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\ttoggle( 'core/edit-post', 'isPublishSidebarEnabled' );\n\t\t\tcreateInfoNotice(\n\t\t\t\tisPublishSidebarEnabled\n\t\t\t\t\t? __( 'Pre-publish checks disabled.' )\n\t\t\t\t\t: __( 'Pre-publish checks enabled.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/publish-sidebar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAQA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,0BAAA,GAAAR,OAAA;AACA,IAAAS,iBAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAxBA;AACA;AACA;;AAiBA;AACA;AACA;;AAKe,SAASW,iBAAiBA,CAAA,EAAG;EAC3C,MAAM;IAAEC,kBAAkB;IAAEC;EAAoB,CAAC,GAChD,IAAAC,iBAAW,EAAEC,YAAc,CAAC;EAC7B,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAF,iBAAW,EAAEG,gBAAe,CAAC;EACnD,MAAM;IAAEC,aAAa;IAAEC,YAAY;IAAEC;EAAwB,CAAC,GAAG,IAAAC,eAAS,EACvEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAI,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IAE1C,OAAO;MACNN,aAAa,EAAEI,MAAM,CACpBL,gBACD,CAAC,CAACQ,0BAA0B,CAAEV,YA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,KAAM;MAC1BA,KAAK,CAAC,CAAC;MACPX,MAAM,CAAE,gBAAgB,EAAE,yBAA0B,CAAC;MACrDC,gBAAgB,CACfT,uBAAuB,GACpB,IAAAa,QAAE,EAAE,8BAA+B,CAAC,GACpC,IAAAA,QAAE,EAAE,6BAA8B,CAAC,EACtC;QACCS,EAAE,EAAE,uCAAuC;QAC3CC,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAE,CAAC;AACJ"}
1
+ {"version":3,"names":["_data","require","_i18n","_icons","_commands","_preferences","_editor","_notices","_store","_lockUnlock","interfaceStore","unlock","editorPrivateApis","useCommonCommands","openGeneralSidebar","closeGeneralSidebar","useDispatch","editPostStore","activeSidebar","isFullscreen","isPublishSidebarEnabled","useSelect","select","get","preferencesStore","getActiveComplementaryArea","editorStore","toggle","createInfoNotice","noticesStore","useCommand","name","label","__","icon","isRTL","drawerLeft","drawerRight","callback","close","blockDefault","fullscreen","id","type","actions","onClick","formatListBullets"],"sources":["@wordpress/edit-post/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tfullscreen,\n\tformatListBullets,\n} from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function useCommonCommands() {\n\tconst { openGeneralSidebar, closeGeneralSidebar } =\n\t\tuseDispatch( editPostStore );\n\tconst { activeSidebar, isFullscreen, isPublishSidebarEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\treturn {\n\t\t\t\tactiveSidebar:\n\t\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\t\t'core'\n\t\t\t\t\t),\n\t\t\t\tisPublishSidebarEnabled:\n\t\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\t\tisFullscreen: get( 'core/edit-post', 'fullscreenMode' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tuseCommand( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/document' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: isFullscreen\n\t\t\t? __( 'Exit fullscreen' )\n\t\t\t: __( 'Enter fullscreen' ),\n\t\ticon: fullscreen,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFullscreen ? __( 'Fullscreen off.' ) : __( 'Fullscreen on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-fullscreen-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\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\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-publish-sidebar',\n\t\tlabel: isPublishSidebarEnabled\n\t\t\t? __( 'Disable pre-publish checks' )\n\t\t\t: __( 'Enable pre-publish checks' ),\n\t\ticon: formatListBullets,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\ttoggle( 'core', 'isPublishSidebarEnabled' );\n\t\t\tcreateInfoNotice(\n\t\t\t\tisPublishSidebarEnabled\n\t\t\t\t\t? __( 'Pre-publish checks disabled.' )\n\t\t\t\t\t: __( 'Pre-publish checks enabled.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/publish-sidebar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAOA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAIA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAxBA;AACA;AACA;;AAkBA;AACA;AACA;;AAIA,MAAM;EAAES;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEvC,SAASC,iBAAiBA,CAAA,EAAG;EAC3C,MAAM;IAAEC,kB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E,EAAE,8BAA+B,CAAC,GACpC,IAAAA,QAAE,EAAE,6BAA8B,CAAC,EACtC;QACCS,EAAE,EAAE,oCAAoC;QACxCC,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_hooks","require","_mediaUtils","replaceMediaUpload","MediaUpload","addFilter"],"sources":["@wordpress/edit-post/src/hooks/components/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { MediaUpload } from '@wordpress/media-utils';\n\nconst replaceMediaUpload = () => MediaUpload;\n\naddFilter(\n\t'editor.MediaUpload',\n\t'core/edit-post/replace-media-upload',\n\treplaceMediaUpload\n);\n"],"mappings":";;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,kBAAkB,GAAGA,CAAA,KAAMC,uBAAW;AAE5C,IAAAC,gBAAS,EACR,oBAAoB,EACpB,qCAAqC,EACrCF,kBACD,CAAC"}
1
+ {"version":3,"names":["_hooks","require","_mediaUtils","replaceMediaUpload","MediaUpload","addFilter"],"sources":["@wordpress/edit-post/src/hooks/components/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { MediaUpload } from '@wordpress/media-utils';\n\nconst replaceMediaUpload = () => MediaUpload;\n\naddFilter(\n\t'editor.MediaUpload',\n\t'core/edit-post/replace-media-upload',\n\treplaceMediaUpload\n);\n"],"mappings":";;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,kBAAkB,GAAGA,CAAA,KAAMC,uBAAW;AAE5C,IAAAC,gBAAS,EACR,oBAAoB,EACpB,qCAAqC,EACrCF,kBACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["require"],"sources":["@wordpress/edit-post/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './components';\nimport './validate-multiple-use';\n"],"mappings":";;AAGAA,OAAA;AACAA,OAAA"}
1
+ {"version":3,"names":["require"],"sources":["@wordpress/edit-post/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './components';\nimport './validate-multiple-use';\n"],"mappings":";;AAGAA,OAAA;AACAA,OAAA","ignoreList":[]}
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = useNavigateToEntityRecord;
7
7
  var _element = require("@wordpress/element");
8
+ var _data = require("@wordpress/data");
9
+ var _editor = require("@wordpress/editor");
8
10
  /**
9
11
  * WordPress dependencies
10
12
  */
@@ -17,19 +19,24 @@ var _element = require("@wordpress/element");
17
19
  *
18
20
  * Used to control displaying UI elements like the back button.
19
21
  *
20
- * @param {number} initialPostId The post id of the post when the editor loaded.
21
- * @param {string} initialPostType The post type of the post when the editor loaded.
22
+ * @param {number} initialPostId The post id of the post when the editor loaded.
23
+ * @param {string} initialPostType The post type of the post when the editor loaded.
24
+ * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.
22
25
  *
23
26
  * @return {Object} An object containing the `currentPost` variable and
24
27
  * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.
25
28
  */
26
- function useNavigateToEntityRecord(initialPostId, initialPostType) {
29
+ function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRenderingMode) {
27
30
  const [postHistory, dispatch] = (0, _element.useReducer)((historyState, {
28
31
  type,
29
- post
32
+ post,
33
+ previousRenderingMode
30
34
  }) => {
31
35
  if (type === 'push') {
32
- return [...historyState, post];
36
+ return [...historyState, {
37
+ post,
38
+ previousRenderingMode
39
+ }];
33
40
  }
34
41
  if (type === 'pop') {
35
42
  // Try to leave one item in the history.
@@ -39,33 +46,43 @@ function useNavigateToEntityRecord(initialPostId, initialPostType) {
39
46
  }
40
47
  return historyState;
41
48
  }, [{
42
- postId: initialPostId,
43
- postType: initialPostType
49
+ post: {
50
+ postId: initialPostId,
51
+ postType: initialPostType
52
+ }
44
53
  }]);
45
- const initialPost = (0, _element.useMemo)(() => {
46
- return {
47
- type: initialPostType,
48
- id: initialPostId
49
- };
50
- }, [initialPostType, initialPostId]);
54
+ const {
55
+ post,
56
+ previousRenderingMode
57
+ } = postHistory[postHistory.length - 1];
58
+ const {
59
+ getRenderingMode
60
+ } = (0, _data.useSelect)(_editor.store);
61
+ const {
62
+ setRenderingMode
63
+ } = (0, _data.useDispatch)(_editor.store);
51
64
  const onNavigateToEntityRecord = (0, _element.useCallback)(params => {
52
65
  dispatch({
53
66
  type: 'push',
54
67
  post: {
55
68
  postId: params.postId,
56
69
  postType: params.postType
57
- }
70
+ },
71
+ // Save the current rendering mode so we can restore it when navigating back.
72
+ previousRenderingMode: getRenderingMode()
58
73
  });
59
- }, []);
74
+ setRenderingMode(defaultRenderingMode);
75
+ }, [getRenderingMode, setRenderingMode, defaultRenderingMode]);
60
76
  const onNavigateToPreviousEntityRecord = (0, _element.useCallback)(() => {
61
77
  dispatch({
62
78
  type: 'pop'
63
79
  });
64
- }, []);
65
- const currentPost = postHistory[postHistory.length - 1];
80
+ if (previousRenderingMode) {
81
+ setRenderingMode(previousRenderingMode);
82
+ }
83
+ }, [setRenderingMode, previousRenderingMode]);
66
84
  return {
67
- currentPost,
68
- initialPost,
85
+ currentPost: post,
69
86
  onNavigateToEntityRecord,
70
87
  onNavigateToPreviousEntityRecord: postHistory.length > 1 ? onNavigateToPreviousEntityRecord : undefined
71
88
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","useNavigateToEntityRecord","initialPostId","initialPostType","postHistory","dispatch","useReducer","historyState","type","post","length","slice","postId","postType","initialPost","useMemo","id","onNavigateToEntityRecord","useCallback","params","onNavigateToPreviousEntityRecord","currentPost","undefined"],"sources":["@wordpress/edit-post/src/hooks/use-navigate-to-entity-record.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer, useMemo } from '@wordpress/element';\n\n/**\n * A hook that records the 'entity' history in the post editor as a user\n * navigates between editing a post and editing the post template or patterns.\n *\n * Implemented as a stack, so a little similar to the browser history API.\n *\n * Used to control displaying UI elements like the back button.\n *\n * @param {number} initialPostId The post id of the post when the editor loaded.\n * @param {string} initialPostType The post type of the post when the editor loaded.\n *\n * @return {Object} An object containing the `currentPost` variable and\n * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.\n */\nexport default function useNavigateToEntityRecord(\n\tinitialPostId,\n\tinitialPostType\n) {\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t( historyState, { type, post } ) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\treturn [ ...historyState, post ];\n\t\t\t}\n\t\t\tif ( type === 'pop' ) {\n\t\t\t\t// Try to leave one item in the history.\n\t\t\t\tif ( historyState.length > 1 ) {\n\t\t\t\t\treturn historyState.slice( 0, -1 );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn historyState;\n\t\t},\n\t\t[ { postId: initialPostId, postType: initialPostType } ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst onNavigateToEntityRecord = useCallback( ( params ) => {\n\t\tdispatch( {\n\t\t\ttype: 'push',\n\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t} );\n\t}, [] );\n\n\tconst onNavigateToPreviousEntityRecord = useCallback( () => {\n\t\tdispatch( { type: 'pop' } );\n\t}, [] );\n\n\tconst currentPost = postHistory[ postHistory.length - 1 ];\n\n\treturn {\n\t\tcurrentPost,\n\t\tinitialPost,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord:\n\t\t\tpostHistory.length > 1\n\t\t\t\t? onNavigateToPreviousEntityRecord\n\t\t\t\t: undefined,\n\t};\n}\n"],"mappings":";;;;;;AAGA,I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AAG,CAAC;EAEP,MAAMa,WAAW,GAAGjB,WAAW,CAAEA,WAAW,CAACM,MAAM,GAAG,CAAC,CAAE;EAEzD,OAAO;IACNW,WAAW;IACXP,WAAW;IACXG,wBAAwB;IACxBG,gCAAgC,EAC/BhB,WAAW,CAACM,MAAM,GAAG,CAAC,GACnBU,gCAAgC,GAChCE;EACL,CAAC;AACF"}
1
+ {"version":3,"names":["_element","require","_data","_editor","useNavigateToEntityRecord","initialPostId","initialPostType","defaultRenderingMode","postHistory","dispatch","useReducer","historyState","type","post","previousRenderingMode","length","slice","postId","postType","getRenderingMode","useSelect","editorStore","setRenderingMode","useDispatch","onNavigateToEntityRecord","useCallback","params","onNavigateToPreviousEntityRecord","currentPost","undefined"],"sources":["@wordpress/edit-post/src/hooks/use-navigate-to-entity-record.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * A hook that records the 'entity' history in the post editor as a user\n * navigates between editing a post and editing the post template or patterns.\n *\n * Implemented as a stack, so a little similar to the browser history API.\n *\n * Used to control displaying UI elements like the back button.\n *\n * @param {number} initialPostId The post id of the post when the editor loaded.\n * @param {string} initialPostType The post type of the post when the editor loaded.\n * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.\n *\n * @return {Object} An object containing the `currentPost` variable and\n * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.\n */\nexport default function useNavigateToEntityRecord(\n\tinitialPostId,\n\tinitialPostType,\n\tdefaultRenderingMode\n) {\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t( historyState, { type, post, previousRenderingMode } ) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\treturn [ ...historyState, { post, previousRenderingMode } ];\n\t\t\t}\n\t\t\tif ( type === 'pop' ) {\n\t\t\t\t// Try to leave one item in the history.\n\t\t\t\tif ( historyState.length > 1 ) {\n\t\t\t\t\treturn historyState.slice( 0, -1 );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn historyState;\n\t\t},\n\t\t[\n\t\t\t{\n\t\t\t\tpost: { postId: initialPostId, postType: initialPostType },\n\t\t\t},\n\t\t]\n\t);\n\n\tconst { post, previousRenderingMode } =\n\t\tpostHistory[ postHistory.length - 1 ];\n\n\tconst { getRenderingMode } = useSelect( editorStore );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params ) => {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'push',\n\t\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t\t\t// Save the current rendering mode so we can restore it when navigating back.\n\t\t\t\tpreviousRenderingMode: getRenderingMode(),\n\t\t\t} );\n\t\t\tsetRenderingMode( defaultRenderingMode );\n\t\t},\n\t\t[ getRenderingMode, setRenderingMode, defaultRenderingMode ]\n\t);\n\n\tconst onNavigateToPreviousEntityRecord = useCallback( () => {\n\t\tdispatch( { type: 'pop' } );\n\t\tif ( previousRenderingMode ) {\n\t\t\tsetRenderingMode( previousRenderingMode );\n\t\t}\n\t}, [ setRenderingMode, previousRenderingMode ] );\n\n\treturn {\n\t\tcurrentPost: post,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord:\n\t\t\tpostHistory.length > 1\n\t\t\t\t? onNavigateToPreviousEntityRecord\n\t\t\t\t: undefined,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,yBAAyBA,CAChDC,aAAa,EACbC,eAAe,EACfC,oBAAoB,EACnB;EACD,MAAM,CAAEC,WAAW,EAAEC,QAAQ,CAAE,GAAG,IAAAC,mBAAU,EA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EAAE;IAAM,CAAE,CAAC;IAC3B,IAAKE,qBAAqB,EAAG;MAC5BQ,gBAAgB,CAAER,qBAAsB,CAAC;IAC1C;EACD,CAAC,EAAE,CAAEQ,gBAAgB,EAAER,qBAAqB,CAAG,CAAC;EAEhD,OAAO;IACNc,WAAW,EAAEf,IAAI;IACjBW,wBAAwB;IACxBG,gCAAgC,EAC/BnB,WAAW,CAACO,MAAM,GAAG,CAAC,GACnBY,gCAAgC,GAChCE;EACL,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_components","_data","_blockEditor","_hooks","_i18n","_compose","findFirstOfSameType","blocks","name","Array","isArray","length","block","firstBlock","innerBlocks","enhance","compose","withSelect","select","multiple","hasBlockSupport","blockEditorStore","getBlocks","firstOfSameType","isInvalid","clientId","originalBlockClientId","withDispatch","dispatch","selectFirst","selectBlock","withMultipleValidation","createHigherOrderComponent","BlockEdit","props","_react","createElement","blockType","getBlockType","outboundType","getOutboundType","key","style","minHeight","Warning","actions","Button","variant","onClick","__","onReplace","createBlock","attributes","title","blockName","transform","findTransform","getBlockTransforms","type","addFilter"],"sources":["@wordpress/edit-post/src/hooks/validate-multiple-use/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateBlock,\n\tfindTransform,\n\tgetBlockTransforms,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { Button } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { Warning, store as blockEditorStore } from '@wordpress/block-editor';\nimport { addFilter } from '@wordpress/hooks';\nimport { __ } from '@wordpress/i18n';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Recursively find very first block of an specific block type.\n *\n * @param {Object[]} blocks List of blocks.\n * @param {string} name Block name to search.\n *\n * @return {Object|undefined} Return block object or undefined.\n */\nfunction findFirstOfSameType( blocks, name ) {\n\tif ( ! Array.isArray( blocks ) || ! blocks.length ) {\n\t\treturn;\n\t}\n\n\tfor ( const block of blocks ) {\n\t\tif ( block.name === name ) {\n\t\t\treturn block;\n\t\t}\n\n\t\t// Search inside innerBlocks.\n\t\tconst firstBlock = findFirstOfSameType( block.innerBlocks, name );\n\n\t\tif ( firstBlock ) {\n\t\t\treturn firstBlock;\n\t\t}\n\t}\n}\n\nconst enhance = compose(\n\t/**\n\t * For blocks whose block type doesn't support `multiple`, provides the\n\t * wrapped component with `originalBlockClientId` -- a reference to the\n\t * first block of the same type in the content -- if and only if that\n\t * \"original\" block is not the current one. Thus, an inexisting\n\t * `originalBlockClientId` prop signals that the block is valid.\n\t *\n\t * @param {Component} WrappedBlockEdit A filtered BlockEdit instance.\n\t *\n\t * @return {Component} Enhanced component with merged state data props.\n\t */\n\twithSelect( ( select, block ) => {\n\t\tconst multiple = hasBlockSupport( block.name, 'multiple', true );\n\n\t\t// For block types with `multiple` support, there is no \"original\n\t\t// block\" to be found in the content, as the block itself is valid.\n\t\tif ( multiple ) {\n\t\t\treturn {};\n\t\t}\n\n\t\t// Otherwise, only pass `originalBlockClientId` if it refers to a different\n\t\t// block from the current one.\n\t\tconst blocks = select( blockEditorStore ).getBlocks();\n\t\tconst firstOfSameType = findFirstOfSameType( blocks, block.name );\n\t\tconst isInvalid =\n\t\t\tfirstOfSameType && firstOfSameType.clientId !== block.clientId;\n\t\treturn {\n\t\t\toriginalBlockClientId: isInvalid && firstOfSameType.clientId,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { originalBlockClientId } ) => ( {\n\t\tselectFirst: () =>\n\t\t\tdispatch( blockEditorStore ).selectBlock( originalBlockClientId ),\n\t} ) )\n);\n\nconst withMultipleValidation = createHigherOrderComponent( ( BlockEdit ) => {\n\treturn enhance( ( { originalBlockClientId, selectFirst, ...props } ) => {\n\t\tif ( ! originalBlockClientId ) {\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t}\n\n\t\tconst blockType = getBlockType( props.name );\n\t\tconst outboundType = getOutboundType( props.name );\n\n\t\treturn [\n\t\t\t<div key=\"invalid-preview\" style={ { minHeight: '60px' } }>\n\t\t\t\t<BlockEdit key=\"block-edit\" { ...props } />\n\t\t\t</div>,\n\t\t\t<Warning\n\t\t\t\tkey=\"multiple-use-warning\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"find-original\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ selectFirst }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Find original' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"remove\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ () => props.onReplace( [] ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\toutboundType && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey=\"transform\"\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tprops.onReplace(\n\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\toutboundType.name,\n\t\t\t\t\t\t\t\t\t\tprops.attributes\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>\n\t\t\t\t\t\t\t{ __( 'Transform into:' ) } { outboundType.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t),\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t<strong>{ blockType?.title }: </strong>\n\t\t\t\t{ __( 'This block can only be used once.' ) }\n\t\t\t</Warning>,\n\t\t];\n\t} );\n}, 'withMultipleValidation' );\n\n/**\n * Given a base block name, returns the default block type to which to offer\n * transforms.\n *\n * @param {string} blockName Base block name.\n *\n * @return {?Object} The chosen default block type.\n */\nfunction getOutboundType( blockName ) {\n\t// Grab the first outbound transform.\n\tconst transform = findTransform(\n\t\tgetBlockTransforms( 'to', blockName ),\n\t\t( { type, blocks } ) => type === 'block' && blocks.length === 1 // What about when .length > 1?\n\t);\n\n\tif ( ! transform ) {\n\t\treturn null;\n\t}\n\n\treturn getBlockType( transform.blocks[ 0 ] );\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-post/validate-multiple-use/with-multiple-validation',\n\twithMultipleValidation\n);\n"],"mappings":";;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAfA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASO,mBAAmBA,CAAEC,MAAM,EAAEC,IAAI,EAAG;EAC5C,IAAK,CAAEC,KAAK,CAACC,OAAO,CAAEH,MAAO,CAAC,IAAI,CAAEA,MAAM,CAACI,MAAM,EAAG;IACnD;EACD;EAEA,KAAM,MAAMC,KAAK,IAAIL,MAAM,EAAG;IAC7B,IAAKK,KAAK,CAACJ,IAAI,KAAKA,IAAI,EAAG;MAC1B,OAAOI,KAAK;IACb;;IAEA;IACA,MAAMC,UAAU,GAAGP,mBAAmB,CAAEM,KAAK,CAACE,WAAW,EAAEN,IAAK,CAAC;IAEjE,IAAKK,UAAU,EAAG;MACjB,OAAOA,UAAU;IAClB;EACD;AACD;AAEA,MAAME,OAAO,GAAG,IAAAC,gBAAO;AACtB;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACC,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAEN,KAAK,KAAM;EAChC,MAAMO,QAAQ,GAAG,IAAAC,uBAAe,EAAER,KAAK,CAACJ,IAAI,EAAE,UAAU,EAAE,IAA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,CAAC,EACrC,CAAE;IAAEI,IAAI;IAAEnD;EAAO,CAAC,KAAMmD,IAAI,KAAK,OAAO,IAAInD,MAAM,CAACI,MAAM,KAAK,CAAC,CAAC;EACjE,CAAC;EAED,IAAK,CAAE4C,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAjB,oBAAY,EAAEiB,SAAS,CAAChD,MAAM,CAAE,CAAC,CAAG,CAAC;AAC7C;AAEA,IAAAoD,gBAAS,EACR,kBAAkB,EAClB,+DAA+D,EAC/D5B,sBACD,CAAC"}
1
+ {"version":3,"names":["_blocks","require","_components","_data","_blockEditor","_hooks","_i18n","_compose","findFirstOfSameType","blocks","name","Array","isArray","length","block","firstBlock","innerBlocks","enhance","compose","withSelect","select","multiple","hasBlockSupport","blockEditorStore","getBlocks","firstOfSameType","isInvalid","clientId","originalBlockClientId","withDispatch","dispatch","selectFirst","selectBlock","withMultipleValidation","createHigherOrderComponent","BlockEdit","props","_react","createElement","blockType","getBlockType","outboundType","getOutboundType","key","style","minHeight","Warning","actions","Button","variant","onClick","__","onReplace","createBlock","attributes","title","blockName","transform","findTransform","getBlockTransforms","type","addFilter"],"sources":["@wordpress/edit-post/src/hooks/validate-multiple-use/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateBlock,\n\tfindTransform,\n\tgetBlockTransforms,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { Button } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { Warning, store as blockEditorStore } from '@wordpress/block-editor';\nimport { addFilter } from '@wordpress/hooks';\nimport { __ } from '@wordpress/i18n';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Recursively find very first block of an specific block type.\n *\n * @param {Object[]} blocks List of blocks.\n * @param {string} name Block name to search.\n *\n * @return {Object|undefined} Return block object or undefined.\n */\nfunction findFirstOfSameType( blocks, name ) {\n\tif ( ! Array.isArray( blocks ) || ! blocks.length ) {\n\t\treturn;\n\t}\n\n\tfor ( const block of blocks ) {\n\t\tif ( block.name === name ) {\n\t\t\treturn block;\n\t\t}\n\n\t\t// Search inside innerBlocks.\n\t\tconst firstBlock = findFirstOfSameType( block.innerBlocks, name );\n\n\t\tif ( firstBlock ) {\n\t\t\treturn firstBlock;\n\t\t}\n\t}\n}\n\nconst enhance = compose(\n\t/**\n\t * For blocks whose block type doesn't support `multiple`, provides the\n\t * wrapped component with `originalBlockClientId` -- a reference to the\n\t * first block of the same type in the content -- if and only if that\n\t * \"original\" block is not the current one. Thus, an inexisting\n\t * `originalBlockClientId` prop signals that the block is valid.\n\t *\n\t * @param {Component} WrappedBlockEdit A filtered BlockEdit instance.\n\t *\n\t * @return {Component} Enhanced component with merged state data props.\n\t */\n\twithSelect( ( select, block ) => {\n\t\tconst multiple = hasBlockSupport( block.name, 'multiple', true );\n\n\t\t// For block types with `multiple` support, there is no \"original\n\t\t// block\" to be found in the content, as the block itself is valid.\n\t\tif ( multiple ) {\n\t\t\treturn {};\n\t\t}\n\n\t\t// Otherwise, only pass `originalBlockClientId` if it refers to a different\n\t\t// block from the current one.\n\t\tconst blocks = select( blockEditorStore ).getBlocks();\n\t\tconst firstOfSameType = findFirstOfSameType( blocks, block.name );\n\t\tconst isInvalid =\n\t\t\tfirstOfSameType && firstOfSameType.clientId !== block.clientId;\n\t\treturn {\n\t\t\toriginalBlockClientId: isInvalid && firstOfSameType.clientId,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { originalBlockClientId } ) => ( {\n\t\tselectFirst: () =>\n\t\t\tdispatch( blockEditorStore ).selectBlock( originalBlockClientId ),\n\t} ) )\n);\n\nconst withMultipleValidation = createHigherOrderComponent( ( BlockEdit ) => {\n\treturn enhance( ( { originalBlockClientId, selectFirst, ...props } ) => {\n\t\tif ( ! originalBlockClientId ) {\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t}\n\n\t\tconst blockType = getBlockType( props.name );\n\t\tconst outboundType = getOutboundType( props.name );\n\n\t\treturn [\n\t\t\t<div key=\"invalid-preview\" style={ { minHeight: '60px' } }>\n\t\t\t\t<BlockEdit key=\"block-edit\" { ...props } />\n\t\t\t</div>,\n\t\t\t<Warning\n\t\t\t\tkey=\"multiple-use-warning\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"find-original\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ selectFirst }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Find original' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"remove\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ () => props.onReplace( [] ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\toutboundType && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey=\"transform\"\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tprops.onReplace(\n\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\toutboundType.name,\n\t\t\t\t\t\t\t\t\t\tprops.attributes\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>\n\t\t\t\t\t\t\t{ __( 'Transform into:' ) } { outboundType.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t),\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t<strong>{ blockType?.title }: </strong>\n\t\t\t\t{ __( 'This block can only be used once.' ) }\n\t\t\t</Warning>,\n\t\t];\n\t} );\n}, 'withMultipleValidation' );\n\n/**\n * Given a base block name, returns the default block type to which to offer\n * transforms.\n *\n * @param {string} blockName Base block name.\n *\n * @return {?Object} The chosen default block type.\n */\nfunction getOutboundType( blockName ) {\n\t// Grab the first outbound transform.\n\tconst transform = findTransform(\n\t\tgetBlockTransforms( 'to', blockName ),\n\t\t( { type, blocks } ) => type === 'block' && blocks.length === 1 // What about when .length > 1?\n\t);\n\n\tif ( ! transform ) {\n\t\treturn null;\n\t}\n\n\treturn getBlockType( transform.blocks[ 0 ] );\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-post/validate-multiple-use/with-multiple-validation',\n\twithMultipleValidation\n);\n"],"mappings":";;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAfA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASO,mBAAmBA,CAAEC,MAAM,EAAEC,IAAI,EAAG;EAC5C,IAAK,CAAEC,KAAK,CAACC,OAAO,CAAEH,MAAO,CAAC,IAAI,CAAEA,MAAM,CAACI,MAAM,EAAG;IACnD;EACD;EAEA,KAAM,MAAMC,KAAK,IAAIL,MAAM,EAAG;IAC7B,IAAKK,KAAK,CAACJ,IAAI,KAAKA,IAAI,EAAG;MAC1B,OAAOI,KAAK;IACb;;IAEA;IACA,MAAMC,UAAU,GAAGP,mBAAmB,CAAEM,KAAK,CAACE,WAAW,EAAEN,IAAK,CAAC;IAEjE,IAAKK,UAAU,EAAG;MACjB,OAAOA,UAAU;IAClB;EACD;AACD;AAEA,MAAME,OAAO,GAAG,IAAAC,gBAAO;AACtB;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACC,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAEN,KAAK,KAAM;EAChC,MAAMO,QAAQ,GAAG,IAAAC,uBAAe,EAAER,KAAK,CAACJ,IAAI,EAA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IAAI,EAAEH,SAAU,CAAC,EACrC,CAAE;IAAEI,IAAI;IAAEnD;EAAO,CAAC,KAAMmD,IAAI,KAAK,OAAO,IAAInD,MAAM,CAACI,MAAM,KAAK,CAAC,CAAC;EACjE,CAAC;EAED,IAAK,CAAE4C,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAjB,oBAAY,EAAEiB,SAAS,CAAChD,MAAM,CAAE,CAAC,CAAG,CAAC;AAC7C;AAEA,IAAAoD,gBAAS,EACR,kBAAkB,EAClB,+DAA+D,EAC/D5B,sBACD,CAAC","ignoreList":[]}
package/build/index.js CHANGED
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  Object.defineProperty(exports, "PluginBlockSettingsMenuItem", {
8
8
  enumerable: true,
9
9
  get: function () {
10
- return _pluginBlockSettingsMenuItem.default;
10
+ return _editor.PluginBlockSettingsMenuItem;
11
11
  }
12
12
  });
13
13
  Object.defineProperty(exports, "PluginDocumentSettingPanel", {
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "PluginDocumentSettingPanel", {
19
19
  Object.defineProperty(exports, "PluginMoreMenuItem", {
20
20
  enumerable: true,
21
21
  get: function () {
22
- return _pluginMoreMenuItem.default;
22
+ return _editor.PluginMoreMenuItem;
23
23
  }
24
24
  });
25
25
  Object.defineProperty(exports, "PluginPostPublishPanel", {
@@ -31,7 +31,7 @@ Object.defineProperty(exports, "PluginPostPublishPanel", {
31
31
  Object.defineProperty(exports, "PluginPostStatusInfo", {
32
32
  enumerable: true,
33
33
  get: function () {
34
- return _pluginPostStatusInfo.default;
34
+ return _editor.PluginPostStatusInfo;
35
35
  }
36
36
  });
37
37
  Object.defineProperty(exports, "PluginPrePublishPanel", {
@@ -43,13 +43,13 @@ Object.defineProperty(exports, "PluginPrePublishPanel", {
43
43
  Object.defineProperty(exports, "PluginSidebar", {
44
44
  enumerable: true,
45
45
  get: function () {
46
- return _pluginSidebar.default;
46
+ return _editor.PluginSidebar;
47
47
  }
48
48
  });
49
49
  Object.defineProperty(exports, "PluginSidebarMoreMenuItem", {
50
50
  enumerable: true,
51
51
  get: function () {
52
- return _pluginSidebarMoreMenuItem.default;
52
+ return _editor.PluginSidebarMoreMenuItem;
53
53
  }
54
54
  });
55
55
  Object.defineProperty(exports, "__experimentalFullscreenModeClose", {
@@ -86,13 +86,8 @@ require("./hooks");
86
86
  require("./plugins");
87
87
  var _editor2 = _interopRequireDefault(require("./editor"));
88
88
  var _lockUnlock = require("./lock-unlock");
89
- var _pluginBlockSettingsMenuItem = _interopRequireDefault(require("./components/block-settings-menu/plugin-block-settings-menu-item"));
90
- var _pluginMoreMenuItem = _interopRequireDefault(require("./components/header/plugin-more-menu-item"));
91
89
  var _pluginPostPublishPanel = _interopRequireDefault(require("./components/sidebar/plugin-post-publish-panel"));
92
- var _pluginPostStatusInfo = _interopRequireDefault(require("./components/sidebar/plugin-post-status-info"));
93
90
  var _pluginPrePublishPanel = _interopRequireDefault(require("./components/sidebar/plugin-pre-publish-panel"));
94
- var _pluginSidebar = _interopRequireDefault(require("./components/sidebar/plugin-sidebar"));
95
- var _pluginSidebarMoreMenuItem = _interopRequireDefault(require("./components/header/plugin-sidebar-more-menu-item"));
96
91
  var _fullscreenModeClose = _interopRequireDefault(require("./components/header/fullscreen-mode-close"));
97
92
  var _mainDashboardButton = _interopRequireDefault(require("./components/header/main-dashboard-button"));
98
93
  var _store = require("./store");
@@ -126,7 +121,6 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
126
121
  const root = (0, _element.createRoot)(target);
127
122
  (0, _data.dispatch)(_preferences.store).setDefaults('core/edit-post', {
128
123
  fullscreenMode: true,
129
- isPublishSidebarEnabled: true,
130
124
  themeStyles: true,
131
125
  welcomeGuide: true,
132
126
  welcomeGuideTemplate: true
@@ -140,7 +134,8 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
140
134
  openPanels: ['post-status'],
141
135
  showBlockBreadcrumbs: true,
142
136
  showIconLabels: false,
143
- showListViewByDefault: false
137
+ showListViewByDefault: false,
138
+ isPublishSidebarEnabled: true
144
139
  });
145
140
  (0, _data.dispatch)(_blocks.store).reapplyBlockTypeFilters();
146
141
 
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_preferences","_widgets","_editor","_editor2","_lockUnlock","_pluginBlockSettingsMenuItem","_pluginMoreMenuItem","_pluginPostPublishPanel","_pluginPostStatusInfo","_pluginPrePublishPanel","_pluginSidebar","_pluginSidebarMoreMenuItem","_fullscreenModeClose","_mainDashboardButton","_store","PluginPostExcerpt","__experimentalPluginPostExcerpt","unlock","editorPrivateApis","exports","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","fullscreenMode","isPublishSidebarEnabled","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","blocksStore","reapplyBlockTypeFilters","select","get","editorStore","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tPluginDocumentSettingPanel,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { unlock } from './lock-unlock';\n\nconst { PluginPostExcerpt: __experimentalPluginPostExcerpt } =\n\tunlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tisPublishSidebarEnabled: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { PluginDocumentSettingPanel };\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { __experimentalPluginPostExcerpt };\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,MAAM,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEnD,IAAI,CAACoD,MAAM,CACV,IAAAC,MAAA,CAAAC,aAAA,EAACpF,QAAA,CAAAqF,OAAM;IACNhE,QAAQ,EAAGA,QAAU;IACrBD,MAAM,EAAGA,MAAQ;IACjBD,QAAQ,EAAGA,QAAU;IACrBG,YAAY,EAAGA;EAAc,CAC7B,CACF,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAASwD,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
1
+ {"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_preferences","_widgets","_editor","_editor2","_lockUnlock","_pluginPostPublishPanel","_pluginPrePublishPanel","_fullscreenModeClose","_mainDashboardButton","_store","PluginPostExcerpt","__experimentalPluginPostExcerpt","unlock","editorPrivateApis","exports","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","blocksStore","reapplyBlockTypeFilters","select","get","editorStore","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tPluginBlockSettingsMenuItem,\n\tPluginDocumentSettingPanel,\n\tPluginMoreMenuItem,\n\tPluginPostStatusInfo,\n\tPluginSidebar,\n\tPluginSidebarMoreMenuItem,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { unlock } from './lock-unlock';\n\nconst { PluginPostExcerpt: __experimentalPluginPostExcerpt } =\n\tunlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { PluginBlockSettingsMenuItem };\nexport { PluginDocumentSettingPanel };\nexport { PluginMoreMenuItem };\nexport { PluginPostStatusInfo };\nexport { PluginSidebar };\nexport { PluginSidebarMoreMenuItem };\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { __experimentalPluginPostExcerpt };\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAIA,IAAAQ,OAAA,GAAAR,OAAA;AAcAA,OAAA;AACAA,OAAA;AACA,IAAAS,QAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AA6IA,IAAAW,uBAAA,GAAAR,sBAAA,CAAAH,OAAA;AACA,IAAAY,sBAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa,oBAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,oBAAA,GAAAX,sBAAA,CAAAH,OAAA;AAEA,IAAAe,MAAA,GAAAf,OAAA;AAnLA;AACA;AACA;;AAyBA;AACA;AACA;;AAMA,MAAM;EAAEgB,iBAAiB,EAAEC;AAAgC,CAAC,GAC3D,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVAC,OAAA,CAAAH,+BAAA,GAAAA,+BAAA;AAWO,SAASI,gBAAgBA,CAC/BC,EAAE,EACFC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,YAAY,EACX;EACD,MAAMC,gBAAgB,GAAGC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,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEnD,IAAI,CAACoD,MAAM,CACV,IAAAC,MAAA,CAAAC,aAAA,EAAC/E,QAAA,CAAAgF,OAAM;IACNhE,QAAQ,EAAGA,QAAU;IACrBD,MAAM,EAAGA,MAAQ;IACjBD,QAAQ,EAAGA,QAAU;IACrBG,YAAY,EAAGA;EAAc,CAC7B,CACF,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAASwD,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -39,16 +39,14 @@ function initializeEditor(id, postType, postId) {
39
39
  editorMode: 'visual',
40
40
  fullscreenMode: true,
41
41
  inactivePanels: [],
42
- isPublishSidebarEnabled: true,
43
42
  openPanels: ['post-status'],
44
43
  welcomeGuide: true
45
44
  });
46
45
  (0, _data.dispatch)(_preferences.store).setDefaults('core', {
47
46
  hiddenBlockTypes: [],
48
47
  inactivePanels: [],
49
- openPanels: ['post-status']
50
- });
51
- (0, _data.dispatch)(_preferences.store).setDefaults('core', {
48
+ openPanels: ['post-status'],
49
+ isPublishSidebarEnabled: true,
52
50
  fixedToolbar: false
53
51
  });
54
52
  return (0, _react.createElement)(_editor.default, {
@@ -1 +1 @@
1
- {"version":3,"names":["require","_data","_preferences","_store","_editor","_interopRequireDefault","initializeEditor","id","postType","postId","dispatch","preferencesStore","setDefaults","editorMode","fullscreenMode","inactivePanels","isPublishSidebarEnabled","openPanels","welcomeGuide","hiddenBlockTypes","fixedToolbar","_react","createElement","default"],"sources":["@wordpress/edit-post/src/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/core-data';\nimport '@wordpress/format-library';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nexport { store } from './store';\nimport Editor from './editor';\n\n/**\n * Initializes the Editor and returns a componentProvider\n * that can be registered with `AppRegistry.registerComponent`\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit (unused right now)\n */\nexport function initializeEditor( id, postType, postId ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfullscreenMode: true,\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\twelcomeGuide: true,\n\t} );\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tfixedToolbar: false,\n\t} );\n\n\treturn <Editor postId={ postId } postType={ postType } />;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGAA,OAAA;AACAA,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACxD,IAAAC,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,gBAAgB,EAAE;IAC3DC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,IAAI;IACpBC,cAAc,EAAE,EAAE;IAClBC,uBAAuB,EAAE,IAAI;IAC7BC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EACH,IAAAR,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,MAAM,EAAE;IACjDO,gBAAgB,EAAE,EAAE;IACpBJ,cAAc,EAAE,EAAE;IAClBE,UAAU,EAAE,CAAE,aAAa;EAC5B,CAAE,CAAC;EAEH,IAAAP,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,MAAM,EAAE;IACjDQ,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAAClB,OAAA,CAAAmB,OAAM;IAACd,MAAM,EAAGA,MAAQ;IAACD,QAAQ,EAAGA;EAAU,CAAE,CAAC;AAC1D"}
1
+ {"version":3,"names":["require","_data","_preferences","_store","_editor","_interopRequireDefault","initializeEditor","id","postType","postId","dispatch","preferencesStore","setDefaults","editorMode","fullscreenMode","inactivePanels","openPanels","welcomeGuide","hiddenBlockTypes","isPublishSidebarEnabled","fixedToolbar","_react","createElement","default"],"sources":["@wordpress/edit-post/src/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/core-data';\nimport '@wordpress/format-library';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nexport { store } from './store';\nimport Editor from './editor';\n\n/**\n * Initializes the Editor and returns a componentProvider\n * that can be registered with `AppRegistry.registerComponent`\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit (unused right now)\n */\nexport function initializeEditor( id, postType, postId ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfullscreenMode: true,\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\twelcomeGuide: true,\n\t} );\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tisPublishSidebarEnabled: true,\n\t\tfixedToolbar: false,\n\t} );\n\n\treturn <Editor postId={ postId } postType={ postType } />;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGAA,OAAA;AACAA,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACxD,IAAAC,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,gBAAgB,EAAE;IAC3DC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,IAAI;IACpBC,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EACH,IAAAP,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,MAAM,EAAE;IACjDM,gBAAgB,EAAE,EAAE;IACpBH,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BG,uBAAuB,EAAE,IAAI;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAAClB,OAAA,CAAAmB,OAAM;IAACd,MAAM,EAAGA,MAAQ;IAACD,QAAQ,EAAGA;EAAU,CAAE,CAAC;AAC1D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/edit-post/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-post'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,iHAAiH,EACjH,sBACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA"}
1
+ {"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/edit-post/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-post'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,iHAAiH,EACjH,sBACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_data","_i18n","_compose","_notices","_editor","CopyContentMenuItem","createNotice","useDispatch","noticesStore","getEditedPostAttribute","useSelect","editorStore","getText","onSuccess","__","isDismissible","type","ref","useCopyToClipboard","_react","createElement","MenuItem"],"sources":["@wordpress/edit-post/src/plugins/copy-content-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function CopyContentMenuItem() {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { getEditedPostAttribute } = useSelect( editorStore );\n\n\tfunction getText() {\n\t\treturn getEditedPostAttribute( 'content' );\n\t}\n\n\tfunction onSuccess() {\n\t\tcreateNotice( 'info', __( 'All content copied.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tconst ref = useCopyToClipboard( getText, onSuccess );\n\n\treturn <MenuItem ref={ ref }>{ __( 'Copy all blocks' ) }</MenuItem>;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQe,SAASM,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEC,cAAa,CAAC;EACpD,MAAM;IAAEC;EAAuB,CAAC,GAAG,IAAAC,eAAS,EAAEC,aAAY,CAAC;EAE3D,SAASC,OAAOA,CAAA,EAAG;IAClB,OAAOH,sBAAsB,CAAE,SAAU,CAAC;EAC3C;EAEA,SAASI,SAASA,CAAA,EAAG;IACpBP,YAAY,CAAE,MAAM,EAAE,IAAAQ,QAAE,EAAE,qBAAsB,CAAC,EAAE;MAClDC,aAAa,EAAE,IAAI;MACnBC,IAAI,EAAE;IACP,CAAE,CAAC;EACJ;EAEA,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEN,OAAO,EAAEC,SAAU,CAAC;EAEpD,OAAO,IAAAM,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,QAAQ;IAACJ,GAAG,EAAGA;EAAK,GAAG,IAAAH,QAAE,EAAE,iBAAkB,CAAa,CAAC;AACpE"}
1
+ {"version":3,"names":["_components","require","_data","_i18n","_compose","_notices","_editor","CopyContentMenuItem","createNotice","useDispatch","noticesStore","getEditedPostAttribute","useSelect","editorStore","getText","onSuccess","__","isDismissible","type","ref","useCopyToClipboard","_react","createElement","MenuItem"],"sources":["@wordpress/edit-post/src/plugins/copy-content-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function CopyContentMenuItem() {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { getEditedPostAttribute } = useSelect( editorStore );\n\n\tfunction getText() {\n\t\treturn getEditedPostAttribute( 'content' );\n\t}\n\n\tfunction onSuccess() {\n\t\tcreateNotice( 'info', __( 'All content copied.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tconst ref = useCopyToClipboard( getText, onSuccess );\n\n\treturn <MenuItem ref={ ref }>{ __( 'Copy all blocks' ) }</MenuItem>;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQe,SAASM,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEC,cAAa,CAAC;EACpD,MAAM;IAAEC;EAAuB,CAAC,GAAG,IAAAC,eAAS,EAAEC,aAAY,CAAC;EAE3D,SAASC,OAAOA,CAAA,EAAG;IAClB,OAAOH,sBAAsB,CAAE,SAAU,CAAC;EAC3C;EAEA,SAASI,SAASA,CAAA,EAAG;IACpBP,YAAY,CAAE,MAAM,EAAE,IAAAQ,QAAE,EAAE,qBAAsB,CAAC,EAAE;MAClDC,aAAa,EAAE,IAAI;MACnBC,IAAI,EAAE;IACP,CAAE,CAAC;EACJ;EAEA,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEN,OAAO,EAAEC,SAAU,CAAC;EAEpD,OAAO,IAAAM,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,QAAQ;IAACJ,GAAG,EAAGA;EAAK,GAAG,IAAAH,QAAE,EAAE,iBAAkB,CAAa,CAAC;AACpE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_coreData","_editor","_data","_icons","_i18n","_plugins","_url","_copyContentMenuItem","_interopRequireDefault","_keyboardShortcutsHelpMenuItem","_toolsMoreMenuGroup","_welcomeGuideMenuItem","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","getEditorSettings","editorStore","isBlockTheme","__unstableIsBlockBasedTheme","defaultUrl","addQueryArgs","post_type","patternsUrl","path","_react","createElement","MenuItem","role","href","__","registerPlugin","render","Fragment","default","onClose","onSelect","icon","external","target","rel","VisuallyHidden","as"],"sources":["@wordpress/edit-post/src/plugins/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\n\t\tconst isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) && isBlockTheme\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\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</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"],"mappings":";;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAKA,IAAAQ,oBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,8BAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,mBAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,qBAAA,GAAAH,sBAAA,CAAAT,OAAA;AAlBA;AACA;AACA;;AAUA;AACA;AACA;;AAMA,SAASa,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IACvC,MAAM;MAAEC;IAAkB,CAAC,GAAGH,MAAM,CAAEI,aAAY,CAAC;IAEnD,MAAMC,YAAY,GAAGF,iBAAiB,CAAC,CAAC,CAACG,2BAA2B;IACpE,MAAMC,UAAU,GAAG,IAA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AAC,QAAQ;MACfC,GAAG,EAAC;IAAqB,GAEvB,IAAAV,QAAE,EAAE,MAAO,CAAC,EACd,IAAAL,MAAA,CAAAC,aAAA,EAAC9B,WAAA,CAAA6C,cAAc;MAACC,EAAE,EAAC;IAAM,GAEvB;IACA,IAAAZ,QAAE,EAAE,sBAAuB,CAEb,CACP,CACT,CAEgB,CACnB,CAAC;EAEL;AACD,CAAE,CAAC"}
1
+ {"version":3,"names":["_components","require","_coreData","_editor","_data","_icons","_i18n","_plugins","_url","_copyContentMenuItem","_interopRequireDefault","_keyboardShortcutsHelpMenuItem","_toolsMoreMenuGroup","_welcomeGuideMenuItem","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","getEditorSettings","editorStore","isBlockTheme","__unstableIsBlockBasedTheme","defaultUrl","addQueryArgs","post_type","patternsUrl","path","_react","createElement","MenuItem","role","href","__","registerPlugin","render","Fragment","default","onClose","onSelect","icon","external","target","rel","VisuallyHidden","as"],"sources":["@wordpress/edit-post/src/plugins/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\n\t\tconst isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) && isBlockTheme\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\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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oreList":[]}
@@ -10,8 +10,8 @@ var _components = require("@wordpress/components");
10
10
  var _data = require("@wordpress/data");
11
11
  var _i18n = require("@wordpress/i18n");
12
12
  var _keycodes = require("@wordpress/keycodes");
13
- var _interface = require("@wordpress/interface");
14
- var _keyboardShortcutHelpModal = require("../../components/keyboard-shortcut-help-modal");
13
+ var _editor = require("@wordpress/editor");
14
+ var _lockUnlock = require("../../lock-unlock");
15
15
  /**
16
16
  * WordPress dependencies
17
17
  */
@@ -20,12 +20,15 @@ var _keyboardShortcutHelpModal = require("../../components/keyboard-shortcut-hel
20
20
  * Internal dependencies
21
21
  */
22
22
 
23
+ const {
24
+ interfaceStore
25
+ } = (0, _lockUnlock.unlock)(_editor.privateApis);
23
26
  function KeyboardShortcutsHelpMenuItem({
24
27
  openModal
25
28
  }) {
26
29
  return (0, _react.createElement)(_components.MenuItem, {
27
30
  onClick: () => {
28
- openModal(_keyboardShortcutHelpModal.KEYBOARD_SHORTCUT_HELP_MODAL_NAME);
31
+ openModal('editor/keyboard-shortcut-help');
29
32
  },
30
33
  shortcut: _keycodes.displayShortcut.access('h')
31
34
  }, (0, _i18n.__)('Keyboard shortcuts'));
@@ -33,7 +36,7 @@ function KeyboardShortcutsHelpMenuItem({
33
36
  var _default = exports.default = (0, _data.withDispatch)(dispatch => {
34
37
  const {
35
38
  openModal
36
- } = dispatch(_interface.store);
39
+ } = dispatch(interfaceStore);
37
40
  return {
38
41
  openModal
39
42
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_data","_i18n","_keycodes","_interface","_keyboardShortcutHelpModal","KeyboardShortcutsHelpMenuItem","openModal","_react","createElement","MenuItem","onClick","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","shortcut","displayShortcut","access","__","_default","exports","default","withDispatch","dispatch","interfaceStore"],"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { withDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\n\nexport function KeyboardShortcutsHelpMenuItem( { openModal } ) {\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t\t} }\n\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t>\n\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default withDispatch( ( dispatch ) => {\n\tconst { openModal } = dispatch( interfaceStore );\n\n\treturn {\n\t\topenModal,\n\t};\n} )( KeyboardShortcutsHelpMenuItem );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAKA,IAAAK,0BAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGO,SAASM,6BAA6BA,CAAE;EAAEC;AAAU,CAAC,EAAG;EAC9D,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAW,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfJ,SAAS,CAAEK,4DAAkC,CAAC;IAC/C,CAAG;IACHC,QAAQ,EAAGC,yBAAe,CAACC,MAAM,CAAE,GAAI;EAAG,GAExC,IAAAC,QAAE,EAAE,oBAAqB,CAClB,CAAC;AAEb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC5C,MAAM;IAAEd;EAAU,CAAC,GAAGc,QAAQ,CAAEC,gBAAe,CAAC;EAEhD,OAAO;IACNf;EACD,CAAC;AACF,CAAE,CAAC,CAAED,6BAA8B,CAAC"}
1
+ {"version":3,"names":["_components","require","_data","_i18n","_keycodes","_editor","_lockUnlock","interfaceStore","unlock","editorPrivateApis","KeyboardShortcutsHelpMenuItem","openModal","_react","createElement","MenuItem","onClick","shortcut","displayShortcut","access","__","_default","exports","default","withDispatch","dispatch"],"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { withDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport function KeyboardShortcutsHelpMenuItem( { openModal } ) {\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( 'editor/keyboard-shortcut-help' );\n\t\t\t} }\n\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t>\n\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default withDispatch( ( dispatch ) => {\n\tconst { openModal } = dispatch( interfaceStore );\n\n\treturn {\n\t\topenModal,\n\t};\n} )( KeyboardShortcutsHelpMenuItem );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEM;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE/C,SAASC,6BAA6BA,CAAE;EAAEC;AAAU,CAAC,EAAG;EAC9D,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACb,WAAA,CAAAc,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfJ,SAAS,CAAE,+BAAgC,CAAC;IAC7C,CAAG;IACHK,QAAQ,EAAGC,yBAAe,CAACC,MAAM,CAAE,GAAI;EAAG,GAExC,IAAAC,QAAE,EAAE,oBAAqB,CAClB,CAAC;AAEb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC5C,MAAM;IAAEb;EAAU,CAAC,GAAGa,QAAQ,CAAEjB,cAAe,CAAC;EAEhD,OAAO;IACNI;EACD,CAAC;AACF,CAAE,CAAC,CAAED,6BAA8B,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_preferences","_i18n","_editor","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","_react","createElement","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/plugins/welcome-guide-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMe,SAASI,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGT,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEU,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ"}
1
+ {"version":3,"names":["_data","require","_preferences","_i18n","_editor","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","_react","createElement","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/plugins/welcome-guide-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMe,SAASI,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGT,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEU,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ","ignoreList":[]}