@wordpress/edit-post 7.32.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 (261) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +4 -196
  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 +4 -4
  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 +9 -6
  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.map +1 -1
  27. package/build/components/layout/index.js +12 -20
  28. package/build/components/layout/index.js.map +1 -1
  29. package/build/components/layout/index.native.js.map +1 -1
  30. package/build/components/meta-boxes/index.js.map +1 -1
  31. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  32. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  33. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  34. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  35. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  36. package/build/components/preferences-modal/index.js +1 -21
  37. package/build/components/preferences-modal/index.js.map +1 -1
  38. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  39. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  40. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  41. package/build/components/sidebar/post-format/index.js.map +1 -1
  42. package/build/components/sidebar/post-pending-status/index.js.map +1 -1
  43. package/build/components/sidebar/post-slug/index.js.map +1 -1
  44. package/build/components/sidebar/post-status/index.js +9 -9
  45. package/build/components/sidebar/post-status/index.js.map +1 -1
  46. package/build/components/sidebar/post-sticky/index.js.map +1 -1
  47. package/build/components/sidebar/post-trash/index.js.map +1 -1
  48. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  49. package/build/components/sidebar/settings-header/index.js.map +1 -1
  50. package/build/components/sidebar/settings-sidebar/index.js +37 -40
  51. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  52. package/build/components/text-editor/index.js.map +1 -1
  53. package/build/components/visual-editor/block-inspector-button.js +1 -1
  54. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  55. package/build/components/visual-editor/header.native.js.map +1 -1
  56. package/build/components/visual-editor/index.js +4 -1
  57. package/build/components/visual-editor/index.js.map +1 -1
  58. package/build/components/visual-editor/index.native.js.map +1 -1
  59. package/build/components/visual-editor/use-padding-appender.js +62 -0
  60. package/build/components/visual-editor/use-padding-appender.js.map +1 -0
  61. package/build/components/welcome-guide/default.js.map +1 -1
  62. package/build/components/welcome-guide/image.js.map +1 -1
  63. package/build/components/welcome-guide/index.js.map +1 -1
  64. package/build/components/welcome-guide/template.js.map +1 -1
  65. package/build/editor.js +2 -2
  66. package/build/editor.js.map +1 -1
  67. package/build/editor.native.js.map +1 -1
  68. package/build/hooks/commands/use-common-commands.js +5 -22
  69. package/build/hooks/commands/use-common-commands.js.map +1 -1
  70. package/build/hooks/components/index.js.map +1 -1
  71. package/build/hooks/index.js.map +1 -1
  72. package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
  73. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  74. package/build/index.js +4 -8
  75. package/build/index.js.map +1 -1
  76. package/build/index.native.js.map +1 -1
  77. package/build/lock-unlock.js.map +1 -1
  78. package/build/plugins/copy-content-menu-item/index.js.map +1 -1
  79. package/build/plugins/index.js.map +1 -1
  80. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
  81. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  82. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  83. package/build/store/actions.js +10 -8
  84. package/build/store/actions.js.map +1 -1
  85. package/build/store/constants.js.map +1 -1
  86. package/build/store/index.js +1 -1
  87. package/build/store/index.js.map +1 -1
  88. package/build/store/reducer.js.map +1 -1
  89. package/build/store/selectors.js +34 -19
  90. package/build/store/selectors.js.map +1 -1
  91. package/build/utils/meta-boxes.js.map +1 -1
  92. package/build-module/components/browser-url/index.js.map +1 -1
  93. package/build-module/components/editor-initialization/index.js +1 -2
  94. package/build-module/components/editor-initialization/index.js.map +1 -1
  95. package/build-module/components/editor-initialization/listener-hooks.js +2 -38
  96. package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
  97. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  98. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  99. package/build-module/components/header/index.js +3 -3
  100. package/build-module/components/header/index.js.map +1 -1
  101. package/build-module/components/header/index.native.js +1 -1
  102. package/build-module/components/header/index.native.js.map +1 -1
  103. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  104. package/build-module/components/header/more-menu/index.js +5 -4
  105. package/build-module/components/header/more-menu/index.js.map +1 -1
  106. package/build-module/components/header/post-publish-button-or-toggle.js +9 -6
  107. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  108. package/build-module/components/header/preferences-menu-item/index.js +11 -3
  109. package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
  110. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  111. package/build-module/components/header/writing-menu/index.js.map +1 -1
  112. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  113. package/build-module/components/keyboard-shortcuts/index.js +1 -36
  114. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  115. package/build-module/components/layout/actions-panel.js.map +1 -1
  116. package/build-module/components/layout/index.js +11 -19
  117. package/build-module/components/layout/index.js.map +1 -1
  118. package/build-module/components/layout/index.native.js.map +1 -1
  119. package/build-module/components/meta-boxes/index.js.map +1 -1
  120. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  121. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  122. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  123. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  124. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  125. package/build-module/components/preferences-modal/index.js +1 -20
  126. package/build-module/components/preferences-modal/index.js.map +1 -1
  127. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  128. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  129. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  130. package/build-module/components/sidebar/post-format/index.js.map +1 -1
  131. package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
  132. package/build-module/components/sidebar/post-slug/index.js.map +1 -1
  133. package/build-module/components/sidebar/post-status/index.js +9 -10
  134. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  135. package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
  136. package/build-module/components/sidebar/post-trash/index.js.map +1 -1
  137. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  138. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  139. package/build-module/components/sidebar/settings-sidebar/index.js +38 -41
  140. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  141. package/build-module/components/text-editor/index.js.map +1 -1
  142. package/build-module/components/visual-editor/block-inspector-button.js +1 -1
  143. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  144. package/build-module/components/visual-editor/header.native.js.map +1 -1
  145. package/build-module/components/visual-editor/index.js +4 -1
  146. package/build-module/components/visual-editor/index.js.map +1 -1
  147. package/build-module/components/visual-editor/index.native.js.map +1 -1
  148. package/build-module/components/visual-editor/use-padding-appender.js +55 -0
  149. package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
  150. package/build-module/components/welcome-guide/default.js.map +1 -1
  151. package/build-module/components/welcome-guide/image.js.map +1 -1
  152. package/build-module/components/welcome-guide/index.js.map +1 -1
  153. package/build-module/components/welcome-guide/template.js.map +1 -1
  154. package/build-module/editor.js +2 -2
  155. package/build-module/editor.js.map +1 -1
  156. package/build-module/editor.native.js.map +1 -1
  157. package/build-module/hooks/commands/use-common-commands.js +7 -24
  158. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  159. package/build-module/hooks/components/index.js.map +1 -1
  160. package/build-module/hooks/index.js.map +1 -1
  161. package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
  162. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  163. package/build-module/index.js +5 -5
  164. package/build-module/index.js.map +1 -1
  165. package/build-module/index.native.js.map +1 -1
  166. package/build-module/lock-unlock.js.map +1 -1
  167. package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
  168. package/build-module/plugins/index.js.map +1 -1
  169. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
  170. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  171. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  172. package/build-module/store/actions.js +8 -7
  173. package/build-module/store/actions.js.map +1 -1
  174. package/build-module/store/constants.js.map +1 -1
  175. package/build-module/store/index.js.map +1 -1
  176. package/build-module/store/reducer.js.map +1 -1
  177. package/build-module/store/selectors.js +33 -18
  178. package/build-module/store/selectors.js.map +1 -1
  179. package/build-module/utils/meta-boxes.js.map +1 -1
  180. package/build-style/classic-rtl.css +2 -2
  181. package/build-style/classic.css +2 -2
  182. package/build-style/style-rtl.css +12 -448
  183. package/build-style/style.css +12 -448
  184. package/package.json +32 -34
  185. package/src/classic.scss +1 -1
  186. package/src/components/editor-initialization/index.js +1 -5
  187. package/src/components/editor-initialization/listener-hooks.js +1 -40
  188. package/src/components/editor-initialization/test/listener-hooks.js +1 -96
  189. package/src/components/header/index.js +2 -3
  190. package/src/components/header/index.native.js +1 -1
  191. package/src/components/header/more-menu/index.js +3 -4
  192. package/src/components/header/post-publish-button-or-toggle.js +8 -3
  193. package/src/components/header/preferences-menu-item/index.js +9 -3
  194. package/src/components/header/style.scss +5 -3
  195. package/src/components/header/test/index.js +13 -1
  196. package/src/components/keyboard-shortcuts/index.js +3 -44
  197. package/src/components/layout/index.js +14 -41
  198. package/src/components/preferences-modal/index.js +1 -24
  199. package/src/components/sidebar/post-status/index.js +6 -9
  200. package/src/components/sidebar/settings-sidebar/index.js +62 -58
  201. package/src/components/visual-editor/block-inspector-button.js +1 -1
  202. package/src/components/visual-editor/index.js +4 -0
  203. package/src/components/visual-editor/use-padding-appender.js +66 -0
  204. package/src/editor.js +2 -2
  205. package/src/hooks/commands/use-common-commands.js +11 -26
  206. package/src/index.js +8 -4
  207. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
  208. package/src/store/actions.js +10 -12
  209. package/src/store/selectors.js +41 -33
  210. package/src/store/test/actions.js +11 -10
  211. package/src/style.scss +1 -19
  212. package/build/components/header/plugin-more-menu-item/index.js +0 -78
  213. package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
  214. package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
  215. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  216. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  217. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  218. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
  219. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  220. package/build/components/keyboard-shortcut-help-modal/index.js +0 -132
  221. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  222. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
  223. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  224. package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
  225. package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  226. package/build/components/sidebar/plugin-sidebar/index.js +0 -104
  227. package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
  228. package/build/components/start-page-options/index.js +0 -107
  229. package/build/components/start-page-options/index.js.map +0 -1
  230. package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
  231. package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
  232. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
  233. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  234. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  235. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  236. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  237. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  238. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -122
  239. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  240. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
  241. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  242. package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
  243. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  244. package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
  245. package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
  246. package/build-module/components/start-page-options/index.js +0 -100
  247. package/build-module/components/start-page-options/index.js.map +0 -1
  248. package/src/components/header/plugin-more-menu-item/index.js +0 -73
  249. package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
  250. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  251. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
  252. package/src/components/keyboard-shortcut-help-modal/index.js +0 -163
  253. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
  254. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  255. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
  256. package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
  257. package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
  258. package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
  259. package/src/components/sidebar/plugin-sidebar/index.js +0 -94
  260. package/src/components/start-page-options/index.js +0 -108
  261. package/src/components/start-page-options/style.scss +0 -26
@@ -8,7 +8,6 @@ exports.default = void 0;
8
8
  var _react = require("react");
9
9
  var _i18n = require("@wordpress/i18n");
10
10
  var _components = require("@wordpress/components");
11
- var _interface = require("@wordpress/interface");
12
11
  var _compose = require("@wordpress/compose");
13
12
  var _editor = require("@wordpress/editor");
14
13
  var _icons = require("@wordpress/icons");
@@ -25,7 +24,9 @@ var _lockUnlock = require("../../../lock-unlock");
25
24
  */
26
25
 
27
26
  const {
28
- ModeSwitcher
27
+ ModeSwitcher,
28
+ ActionItem,
29
+ PinnedItems
29
30
  } = (0, _lockUnlock.unlock)(_editor.privateApis);
30
31
  const MoreMenu = ({
31
32
  showIconLabels
@@ -48,11 +49,11 @@ const MoreMenu = ({
48
49
  }
49
50
  }, ({
50
51
  onClose
51
- }) => (0, _react.createElement)(_react.Fragment, null, showIconLabels && !isLargeViewport && (0, _react.createElement)(_interface.PinnedItems.Slot, {
52
+ }) => (0, _react.createElement)(_react.Fragment, null, showIconLabels && !isLargeViewport && (0, _react.createElement)(PinnedItems.Slot, {
52
53
  className: showIconLabels && 'show-icon-labels',
53
- scope: "core/edit-post"
54
- }), (0, _react.createElement)(_writingMenu.default, null), (0, _react.createElement)(ModeSwitcher, null), (0, _react.createElement)(_interface.ActionItem.Slot, {
55
- name: "core/edit-post/plugin-more-menu",
54
+ scope: "core"
55
+ }), (0, _react.createElement)(_writingMenu.default, null), (0, _react.createElement)(ModeSwitcher, null), (0, _react.createElement)(ActionItem.Slot, {
56
+ name: "core/plugin-more-menu",
56
57
  label: (0, _i18n.__)('Plugins'),
57
58
  as: _components.MenuGroup,
58
59
  fillProps: {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_interface","_compose","_editor","_icons","_preferencesMenuItem","_interopRequireDefault","_toolsMoreMenuGroup","_writingMenu","_lockUnlock","ModeSwitcher","unlock","editorPrivateApis","MoreMenu","showIconLabels","isLargeViewport","useViewportMatch","_react","createElement","DropdownMenu","icon","moreVertical","label","__","popoverProps","placement","className","toggleProps","variant","tooltipPosition","showTooltip","size","onClose","Fragment","PinnedItems","Slot","scope","default","ActionItem","name","as","MenuGroup","fillProps","onClick","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuGroup, DropdownMenu } from '@wordpress/components';\nimport { ActionItem, PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { moreVertical } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PreferencesMenuItem from '../preferences-menu-item';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport WritingMenu from '../writing-menu';\nimport { unlock } from '../../../lock-unlock';\n\nconst { ModeSwitcher } = unlock( editorPrivateApis );\n\nconst MoreMenu = ( { showIconLabels } ) => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: 'bottom-end',\n\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t} }\n\t\t\ttoggleProps={ {\n\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\tsize: 'compact',\n\t\t\t} }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t\t<PinnedItems.Slot\n\t\t\t\t\t\t\tclassName={ showIconLabels && 'show-icon-labels' }\n\t\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<WritingMenu />\n\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\tname=\"core/edit-post/plugin-more-menu\"\n\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<PreferencesMenuItem />\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM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AqC,UAAU,CAACH,IAAI;IACfI,IAAI,EAAC,iCAAiC;IACtCjB,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IACzBiB,EAAE,EAAGC,qBAAW;IAChBC,SAAS,EAAG;MAAEC,OAAO,EAAEX;IAAQ;EAAG,CAClC,CAAC,EACF,IAAAf,MAAA,CAAAC,aAAA,EAACX,mBAAA,CAAA8B,OAAkB,CAACF,IAAI;IAACO,SAAS,EAAG;MAAEV;IAAQ;EAAG,CAAE,CAAC,EACrD,IAAAf,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAyC,SAAS,QACT,IAAAxB,MAAA,CAAAC,aAAA,EAACb,oBAAA,CAAAgC,OAAmB,MAAE,CACZ,CACV,CAEU,CAAC;AAEjB,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAR,OAAA,GAEaxB,QAAQ"}
1
+ {"version":3,"names":["_i18n","require","_components","_compose","_editor","_icons","_preferencesMenuItem","_interopRequireDefault","_toolsMoreMenuGroup","_writingMenu","_lockUnlock","ModeSwitcher","ActionItem","PinnedItems","unlock","editorPrivateApis","MoreMenu","showIconLabels","isLargeViewport","useViewportMatch","_react","createElement","DropdownMenu","icon","moreVertical","label","__","popoverProps","placement","className","toggleProps","variant","tooltipPosition","showTooltip","size","onClose","Fragment","Slot","scope","default","name","as","MenuGroup","fillProps","onClick","_default","exports"],"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuGroup, DropdownMenu } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { moreVertical } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport PreferencesMenuItem from '../preferences-menu-item';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport WritingMenu from '../writing-menu';\nimport { unlock } from '../../../lock-unlock';\n\nconst { ModeSwitcher, ActionItem, PinnedItems } = unlock( editorPrivateApis );\n\nconst MoreMenu = ( { showIconLabels } ) => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: 'bottom-end',\n\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t} }\n\t\t\ttoggleProps={ {\n\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\tsize: 'compact',\n\t\t\t} }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t\t<PinnedItems.Slot\n\t\t\t\t\t\t\tclassName={ showIconLabels && 'show-icon-labels' }\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<WritingMenu />\n\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<PreferencesMenuItem />\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAA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AE,CAAC,EAChB,IAAAS,MAAA,CAAAC,aAAA,EAACT,UAAU,CAACyB,IAAI;IACfG,IAAI,EAAC,uBAAuB;IAC5Bf,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IACzBe,EAAE,EAAGC,qBAAW;IAChBC,SAAS,EAAG;MAAEC,OAAO,EAAET;IAAQ;EAAG,CAClC,CAAC,EACF,IAAAf,MAAA,CAAAC,aAAA,EAACb,mBAAA,CAAA+B,OAAkB,CAACF,IAAI;IAACM,SAAS,EAAG;MAAER;IAAQ;EAAG,CAAE,CAAC,EACrD,IAAAf,MAAA,CAAAC,aAAA,EAACnB,WAAA,CAAAwC,SAAS,QACT,IAAAtB,MAAA,CAAAC,aAAA,EAACf,oBAAA,CAAAiC,OAAmB,MAAE,CACZ,CACV,CAEU,CAAC;AAEjB,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAP,OAAA,GAEavB,QAAQ","ignoreList":[]}
@@ -23,7 +23,9 @@ function PostPublishButtonOrToggle({
23
23
  isPublishSidebarOpened,
24
24
  isScheduled,
25
25
  togglePublishSidebar,
26
- setEntitiesSavedStatesCallback
26
+ setEntitiesSavedStatesCallback,
27
+ postStatusHasChanged,
28
+ postStatus
27
29
  }) {
28
30
  const IS_TOGGLE = 'toggle';
29
31
  const IS_BUTTON = 'button';
@@ -37,6 +39,7 @@ function PostPublishButtonOrToggle({
37
39
  * for a particular role (see https://wordpress.org/documentation/article/post-status/):
38
40
  *
39
41
  * - is published
42
+ * - post status has changed explicitely to something different than 'future' or 'publish'
40
43
  * - is scheduled to be published
41
44
  * - is pending and can't be published (but only for viewports >= medium).
42
45
  * Originally, we considered showing a button for pending posts that couldn't be published
@@ -52,11 +55,9 @@ function PostPublishButtonOrToggle({
52
55
  * - if it is enabled, we show a TOGGLE
53
56
  * - if it is disabled, we show a BUTTON
54
57
  */
55
- if (isPublished || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
58
+ if (isPublished || postStatusHasChanged && !['future', 'publish'].includes(postStatus) || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
56
59
  component = IS_BUTTON;
57
- } else if (isSmallerThanMediumViewport) {
58
- component = IS_TOGGLE;
59
- } else if (isPublishSidebarEnabled) {
60
+ } else if (isSmallerThanMediumViewport || isPublishSidebarEnabled) {
60
61
  component = IS_TOGGLE;
61
62
  } else {
62
63
  component = IS_BUTTON;
@@ -78,7 +79,9 @@ var _default = exports.default = (0, _compose.compose)((0, _data.withSelect)(sel
78
79
  isPublished: select(_editor.store).isCurrentPostPublished(),
79
80
  isPublishSidebarEnabled: select(_editor.store).isPublishSidebarEnabled(),
80
81
  isPublishSidebarOpened: select(_editor.store).isPublishSidebarOpened(),
81
- isScheduled: select(_editor.store).isCurrentPostScheduled()
82
+ isScheduled: select(_editor.store).isCurrentPostScheduled(),
83
+ postStatus: select(_editor.store).getEditedPostAttribute('status'),
84
+ postStatusHasChanged: select(_editor.store).getPostEdits()?.status
82
85
  };
83
86
  }), (0, _data.withDispatch)(dispatch => {
84
87
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_data","_editor","PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","useViewportMatch","component","_react","createElement","PostPublishButton","isOpen","isToggle","onToggle","_default","exports","default","compose","withSelect","select","_select$getCurrentPos","editorStore","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","withDispatch","dispatch"],"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { PostPublishButton, store as editorStore } from '@wordpress/editor';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else if ( isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened: select( editorStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editorStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKO,SAASG,yBAAyBA,CAAE;EAC1CC,YAAY;EACZC,gBAAgB;EAChBC,gBAAgB;EAChBC,SAAS;EACTC,WAAW;EACXC,uBAAuB;EACvBC,sBAAsB;EACtBC,WAAW;EACXC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,2BAA2B,GAAG,IAAAC,yBAAgB,EAAE,QAAQ,EAAE,GAAI,CAAC;EACrE,IAAIC,SAAS;;EAEb;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,IACCV,WAAW,IACTG,WAAW,IAA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mB,MAAM,CAAEE,aAAY,CAAC,CAACM,sBAAsB,CAAC;EAC3D,CAAC;AAAA,CAAG,CAAC,EACL,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAE5B;EAAqB,CAAC,GAAG4B,QAAQ,CAAER,aAAY,CAAC;EACxD,OAAO;IACNpB;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAET,yBAA0B,CAAC"}
1
+ {"version":3,"names":["_compose","require","_data","_editor","PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","postStatusHasChanged","postStatus","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","useViewportMatch","component","includes","_react","createElement","PostPublishButton","isOpen","isToggle","onToggle","_default","exports","default","compose","withSelect","select","_select$getCurrentPos","editorStore","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","getEditedPostAttribute","getPostEdits","status","withDispatch","dispatch"],"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { PostPublishButton, store as editorStore } from '@wordpress/editor';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n\tpostStatusHasChanged,\n\tpostStatus,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - post status has changed explicitely to something different than 'future' or 'publish'\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( postStatusHasChanged &&\n\t\t\t! [ 'future', 'publish' ].includes( postStatus ) ) ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport || isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened: select( editorStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t\tpostStatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tpostStatusHasChanged: select( editorStore ).getPostEdits()?.status,\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editorStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKO,SAASG,yBAAyBA,CAAE;EAC1CC,YAAY;EACZC,gBAAgB;EAChBC,gBAAgB;EAChBC,SAAS;EACTC,WAAW;EACXC,uBAAuB;EACvBC,sBAAsB;EACtBC,WAAW;EACXC,oBAAoB;EACpBC,8BAA8B;EAC9BC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,2BAA2B,GAAG,IAAAC,yBAAgB,EAAE,QAAQ,EAAE,GAAI,CAAC;EACrE,IAAIC,SAAS;;EAEb;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,IACCZ,WAAW,IACTM,oBAAoB,IACrB,CAAE,CAAE,QAAQ,EAAE,SAAS,CAAE,CAACO,QAAQ,CAAEN,UAAW,CAAG,IACjDJ,WAAW,IAAIL,gBAAkB,IACjCC,SAAS,IAAI,CAAEF,gBAAgB,IAAI,CAAEa,2BAA6B,EACnE;IAC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S,CAAC;IACpE5B,oBAAoB,EAAEmB,MAAM,CAAEE,aAAY,CAAC,CAACQ,YAAY,CAAC,CAAC,EAAEC;EAC7D,CAAC;AAAA,CAAG,CAAC,EACL,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAElC;EAAqB,CAAC,GAAGkC,QAAQ,CAAEX,aAAY,CAAC;EACxD,OAAO;IACNvB;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAET,yBAA0B,CAAC","ignoreList":[]}
@@ -8,12 +8,20 @@ var _react = require("react");
8
8
  var _data = require("@wordpress/data");
9
9
  var _i18n = require("@wordpress/i18n");
10
10
  var _components = require("@wordpress/components");
11
- var _interface = require("@wordpress/interface");
12
- var _preferencesModal = require("../../../components/preferences-modal");
11
+ var _editor = require("@wordpress/editor");
12
+ var _lockUnlock = require("../../../lock-unlock");
13
13
  /**
14
14
  * WordPress dependencies
15
15
  */
16
16
 
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+
21
+ const {
22
+ interfaceStore
23
+ } = (0, _lockUnlock.unlock)(_editor.privateApis);
24
+
17
25
  /**
18
26
  * Internal dependencies
19
27
  */
@@ -21,10 +29,10 @@ var _preferencesModal = require("../../../components/preferences-modal");
21
29
  function PreferencesMenuItem() {
22
30
  const {
23
31
  openModal
24
- } = (0, _data.useDispatch)(_interface.store);
32
+ } = (0, _data.useDispatch)(interfaceStore);
25
33
  return (0, _react.createElement)(_components.MenuItem, {
26
34
  onClick: () => {
27
- openModal(_preferencesModal.PREFERENCES_MODAL_NAME);
35
+ openModal('editor/preferences');
28
36
  }
29
37
  }, (0, _i18n.__)('Preferences'));
30
38
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_i18n","_components","_interface","_preferencesModal","PreferencesMenuItem","openModal","useDispatch","interfaceStore","_react","createElement","MenuItem","onClick","PREFERENCES_MODAL_NAME","__"],"sources":["@wordpress/edit-post/src/components/header/preferences-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_MODAL_NAME } from '../../../components/preferences-modal';\n\nexport default function PreferencesMenuItem() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Preferences' ) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAKA,IAAAI,iBAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGe,SAASK,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,iBAAW,EAAEC,gBAAe,CAAC;EACnD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACR,WAAA,CAAAS,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfN,SAAS,CAAEO,wCAAuB,CAAC;IACpC;EAAG,GAED,IAAAC,QAAE,EAAE,aAAc,CACX,CAAC;AAEb"}
1
+ {"version":3,"names":["_data","require","_i18n","_components","_editor","_lockUnlock","interfaceStore","unlock","editorPrivateApis","PreferencesMenuItem","openModal","useDispatch","_react","createElement","MenuItem","onClick","__"],"sources":["@wordpress/edit-post/src/components/header/preferences-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\n/**\n * Internal dependencies\n */\n\nexport default function PreferencesMenuItem() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( 'editor/preferences' );\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Preferences' ) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEK;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAEtD;AACA;AACA;;AAEe,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,iBAAW,EAAEL,cAAe,CAAC;EACnD,OACC,IAAAM,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAW,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfL,SAAS,CAAE,oBAAqB,CAAC;IAClC;EAAG,GAED,IAAAM,QAAE,EAAE,aAAc,CACX,CAAC;AAEb","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","Fill","ToolsMoreMenuGroup","Slot","createSlotFill","fillProps","_react","createElement","fills","length","MenuGroup","label","__","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } =\n\tcreateSlotFill( 'ToolsMoreMenuGroup' );\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\tfills.length > 0 && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAM;EAAEE,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GACvC,IAAAC,0BAAc,EAAE,oBAAqB,CAAC;AAEvCF,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEE;AAAU,CAAC,KACxC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,IAAI;EAACE,SAAS,EAAGA;AAAW,GACxBG,KAAK,IACRA,KAAK,CAACC,MAAM,GAAG,CAAC,IACf,IAAAH,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAY,SAAS;EAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,OAAQ;AAAG,GAAGJ,KAAkB,CAGpD,CACN;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEab,kBAAkB"}
1
+ {"version":3,"names":["_components","require","_i18n","Fill","ToolsMoreMenuGroup","Slot","createSlotFill","fillProps","_react","createElement","fills","length","MenuGroup","label","__","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } =\n\tcreateSlotFill( 'ToolsMoreMenuGroup' );\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\tfills.length > 0 && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAM;EAAEE,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GACvC,IAAAC,0BAAc,EAAE,oBAAqB,CAAC;AAEvCF,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEE;AAAU,CAAC,KACxC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,IAAI;EAACE,SAAS,EAAGA;AAAW,GACxBG,KAAK,IACRA,KAAK,CAACC,MAAM,GAAG,CAAC,IACf,IAAAH,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAY,SAAS;EAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,OAAQ;AAAG,GAAGJ,KAAkB,CAGpD,CACN;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEab,kBAAkB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_compose","_keycodes","_preferences","_editor","WritingMenu","set","setPreference","useDispatch","preferencesStore","toggleDistractionFree","editorStore","turnOffDistractionFree","isLargeViewport","useViewportMatch","_react","createElement","MenuGroup","label","_x","PreferenceToggleMenuItem","scope","name","onToggle","__","info","messageActivated","messageDeactivated","handleToggling","shortcut","displayShortcut","primaryShift","secondary","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/writing-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { MenuGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\nfunction WritingMenu() {\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tif ( ! isLargeViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\tinfo={ __(\n\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t) }\n\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"distractionFree\"\n\t\t\t\thandleToggling={ false }\n\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\tmessageActivated={ __( 'Distraction free mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Distraction free mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.primaryShift( '\\\\' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"focusMode\"\n\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Spotlight mode deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Fullscreen mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default WritingMenu;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAIA,IAAAM,OAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAYA,SAASO,WAAWA,CAAA,EAAG;EACtB,MAAM;IAAEC,GAAG,EAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEC,kBAAiB,CAAC;EAC9D,MAAM;IAAEC;EAAsB,CAAC,GAAG,IAAAF,iBAAW,EAAEG,aAAY,CAAC;EAE5D,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;IACpCL,aAAa,CAAE,MAAM,EAAE,iBAAiB,EAAE,KAAM,CAAC;EAClD,CAAC;EAED,MAAMM,eAAe,GAAG,IAAAC,yBAAgB,EAAE,QAAS,CAAC;EACpD,IAAK,CAAED,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAE,MAAA,CAAAC,aAAA,EAACjB,WAAA,CAAAkB,SAAS;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAM,EAAE,MAAO;EAAG,GACxC,IAAAJ,MAAA,CAAAC,aAAA,EAACb,YAAA,CAAAiB,wBAAwB;IACxBC,KAAK,EAAC,MAAM;IACZC,IAAI,EAAC,cAAc;IACnBC,QAAQ,EAAGX,sBAAwB;IACnCM,K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AG;IACvDE,gBAAgB,EAAG,IAAAF,QAAE,EAAE,2BAA4B,CAAG;IACtDG,kBAAkB,EAAG,IAAAH,QAAE,EAAE,6BAA8B,CAAG;IAC1DK,QAAQ,EAAGC,yBAAe,CAACE,SAAS,CAAE,GAAI;EAAG,CAC7C,CACS,CAAC;AAEd;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc9B,WAAW"}
1
+ {"version":3,"names":["_data","require","_components","_i18n","_compose","_keycodes","_preferences","_editor","WritingMenu","set","setPreference","useDispatch","preferencesStore","toggleDistractionFree","editorStore","turnOffDistractionFree","isLargeViewport","useViewportMatch","_react","createElement","MenuGroup","label","_x","PreferenceToggleMenuItem","scope","name","onToggle","__","info","messageActivated","messageDeactivated","handleToggling","shortcut","displayShortcut","primaryShift","secondary","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/writing-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { MenuGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\nfunction WritingMenu() {\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tif ( ! isLargeViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\tinfo={ __(\n\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t) }\n\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"distractionFree\"\n\t\t\t\thandleToggling={ false }\n\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\tmessageActivated={ __( 'Distraction free mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Distraction free mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.primaryShift( '\\\\' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"focusMode\"\n\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Spotlight mode deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Fullscreen mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default WritingMenu;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,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,QAAE,EAAE,kBAAmB,CAAG;IAClCC,IAAI,EAAG,IAAAD,QAAE,EAAE,qBAAsB,CAAG;IACpCE,gBAAgB,EAAG,IAAAF,QAAE,EAAE,iCAAkC,CAAG;IAC5DG,kBAAkB,EAAG,IAAAH,QAAE,EAAE,mCAAoC,CAAG;IAChEK,QAAQ,EAAGC,yBAAe,CAACC,YAAY,CAAE,IAAK;EAAG,CACjD,CAAC,EACF,IAAAhB,MAAA,CAAAC,aAAA,EAACb,YAAA,CAAAiB,wBAAwB;IACxBC,KAAK,EAAC,MAAM;IACZC,IAAI,EAAC,WAAW;IAChBJ,KAAK,EAAG,IAAAM,QAAE,EAAE,gBAAiB,CAAG;IAChCC,IAAI,EAAG,IAAAD,QAAE,EAAE,8BAA+B,CAAG;IAC7CE,gBAAgB,EAAG,IAAAF,QAAE,EAAE,0BAA2B,CAAG;IACrDG,kBAAkB,EAAG,IAAAH,QAAE,EAAE,4BAA6B;EAAG,CACzD,CAAC,EACF,IAAAT,MAAA,CAAAC,aAAA,EAACb,YAAA,CAAAiB,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAC,gBAAgB;IACrBJ,KAAK,EAAG,IAAAM,QAAE,EAAE,iBAAkB,CAAG;IACjCC,IAAI,EAAG,IAAAD,QAAE,EAAE,wCAAyC,CAAG;IACvDE,gBAAgB,EAAG,IAAAF,QAAE,EAAE,2BAA4B,CAAG;IACtDG,kBAAkB,EAAG,IAAAH,QAAE,EAAE,6BAA8B,CAAG;IAC1DK,QAAQ,EAAGC,yBAAe,CAACE,SAAS,CAAE,GAAI;EAAG,CAC7C,CACS,CAAC;AAEd;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc9B,WAAW","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_i18n","_components","_element","_editor","_blockEditor","_lockUnlock","ReusableBlocksRenameHint","unlock","blockEditorPrivateApis","InitPatternModal","editPost","useDispatch","editorStore","isModalOpen","setIsModalOpen","useState","syncType","setSyncType","undefined","title","setTitle","postType","isNewPost","useSelect","select","getEditedPostAttribute","isCleanNewPost","useEffect","_react","createElement","Fragment","Modal","__","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","__experimentalVStack","spacing","TextControl","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","ToggleControl","_x","help","checked","__experimentalHStack","justify","Button","variant","type","disabled","__experimentalIsFocusable"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\n\nconst { ReusableBlocksRenameHint } = unlock( blockEditorPrivateApis );\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isNewPost && postType === 'wp_block' ) {\n\t\t\tsetIsModalOpen( true );\n\t\t}\n\t\t// We only want the modal to open when the page is first loaded.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\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>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ReusableBlocksRenameHint />\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Synced',\n\t\t\t\t\t\t\t\t\t'Option that makes an individual pattern synchronized'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAMA,IAAAM,WAAA,GAAAN,OAAA;AArBA;AACA;AACA;;AAeA;AACA;AACA;;AAIA,MAAM;EAAEO;AAAyB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEtD,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEC,aAAY,CAAC;EAC/C,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACzD,MAAM,CAAEC,QAAQ,EAAEC,WAAW,CAAE,GAAG,IAAAF,iBAAQ,E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,WAAA,CAAAuC,oBAAM;IAACC,OAAO,EAAC;EAAG,GAClB,IAAAb,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAyC,WAAW;IACXC,KAAK,EAAG,IAAAX,QAAE,EAAE,MAAO,CAAG;IACtBY,KAAK,EAAGzB,KAAO;IACf0B,QAAQ,EAAGzB,QAAU;IACrB0B,WAAW,EAAG,IAAAd,QAAE,EAAE,YAAa,CAAG;IAClCe,SAAS,EAAC,mCAAmC;IAC7CC,uBAAuB;IACvBC,qBAAqB;EAAA,CACrB,CAAC,EACF,IAAArB,MAAA,CAAAC,aAAA,EAACvB,wBAAwB,MAAE,CAAC,EAC5B,IAAAsB,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAiD,aAAa;IACbP,KAAK,EAAG,IAAAQ,QAAE,EACT,QAAQ,EACR,sDACD,CAAG;IACHC,IAAI,EAAG,IAAApB,QAAE,EACR,8CACD,CAAG;IACHqB,OAAO,EAAG,CAAErC,QAAU;IACtB6B,QAAQ,EAAGA,CAAA,KAAM;MAChB5B,WAAW,CACV,CAAED,QAAQ,GAAG,UAAU,GAAGE,SAC3B,CAAC;IACF;EAAG,CACH,CAAC,EACF,IAAAU,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAqD,oBAAM;IAACC,OAAO,EAAC;EAAO,GACtB,IAAA3B,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAuD,MAAM;IACNC,OAAO,EAAC,SAAS;IACjBC,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAG,CAAExC,KAAO;IACpByC,yBAAyB;EAAA,GAEvB,IAAA5B,QAAE,EAAE,QAAS,CACR,CACD,CACD,CACH,CACA,CAEP,CAAC;AAEL"}
1
+ {"version":3,"names":["_data","require","_i18n","_components","_element","_editor","_blockEditor","_lockUnlock","ReusableBlocksRenameHint","unlock","blockEditorPrivateApis","InitPatternModal","editPost","useDispatch","editorStore","isModalOpen","setIsModalOpen","useState","syncType","setSyncType","undefined","title","setTitle","postType","isNewPost","useSelect","select","getEditedPostAttribute","isCleanNewPost","useEffect","_react","createElement","Fragment","Modal","__","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","__experimentalVStack","spacing","TextControl","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","ToggleControl","_x","help","checked","__experimentalHStack","justify","Button","variant","type","disabled","__experimentalIsFocusable"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\n\nconst { ReusableBlocksRenameHint } = unlock( blockEditorPrivateApis );\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isNewPost && postType === 'wp_block' ) {\n\t\t\tsetIsModalOpen( true );\n\t\t}\n\t\t// We only want the modal to open when the page is first loaded.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\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>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ReusableBlocksRenameHint />\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Synced',\n\t\t\t\t\t\t\t\t\t'Option that makes an individual pattern synchronized'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAMA,IAAAM,WAAA,GAAAN,OAAA;AArBA;AACA;AACA;;AAeA;AACA;AACA;;AAIA,MAAM;EAAEO;AAAyB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEtD,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEC,aAAY,CAAC;EAC/C,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACzD,MAAM,CAAEC,QAAQ,EAAEC,WAAW,CAAE,GAAG,IAAAF,iBAAQ,EAAEG,SAAU,CAAC;EACvD,MAAM,CAAEC,KAAK,EAA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GAClB,IAAAb,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAyC,WAAW;IACXC,KAAK,EAAG,IAAAX,QAAE,EAAE,MAAO,CAAG;IACtBY,KAAK,EAAGzB,KAAO;IACf0B,QAAQ,EAAGzB,QAAU;IACrB0B,WAAW,EAAG,IAAAd,QAAE,EAAE,YAAa,CAAG;IAClCe,SAAS,EAAC,mCAAmC;IAC7CC,uBAAuB;IACvBC,qBAAqB;EAAA,CACrB,CAAC,EACF,IAAArB,MAAA,CAAAC,aAAA,EAACvB,wBAAwB,MAAE,CAAC,EAC5B,IAAAsB,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAiD,aAAa;IACbP,KAAK,EAAG,IAAAQ,QAAE,EACT,QAAQ,EACR,sDACD,CAAG;IACHC,IAAI,EAAG,IAAApB,QAAE,EACR,8CACD,CAAG;IACHqB,OAAO,EAAG,CAAErC,QAAU;IACtB6B,QAAQ,EAAGA,CAAA,KAAM;MAChB5B,WAAW,CACV,CAAED,QAAQ,GAAG,UAAU,GAAGE,SAC3B,CAAC;IACF;EAAG,CACH,CAAC,EACF,IAAAU,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAqD,oBAAM;IAACC,OAAO,EAAC;EAAO,GACtB,IAAA3B,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAuD,MAAM;IACNC,OAAO,EAAC,SAAS;IACjBC,IAAI,EAAC,QAAQ;IACbC,QAAQ,EAAG,CAAExC,KAAO;IACpByC,yBAAyB;EAAA,GAEvB,IAAA5B,QAAE,EAAE,QAAS,CACR,CACD,CACD,CACH,CACA,CAEP,CAAC;AAEL","ignoreList":[]}
@@ -21,11 +21,6 @@ var _store = require("../../store");
21
21
 
22
22
  function KeyboardShortcuts() {
23
23
  const {
24
- isEditorSidebarOpened
25
- } = (0, _data.useSelect)(_store.store);
26
- const {
27
- openGeneralSidebar,
28
- closeGeneralSidebar,
29
24
  toggleFeature
30
25
  } = (0, _data.useDispatch)(_store.store);
31
26
  const {
@@ -37,8 +32,7 @@ function KeyboardShortcuts() {
37
32
  const {
38
33
  getBlockName,
39
34
  getSelectedBlockClientId,
40
- getBlockAttributes,
41
- getBlockSelectionStart
35
+ getBlockAttributes
42
36
  } = (0, _data.useSelect)(_blockEditor.store);
43
37
  const handleTextLevelShortcut = (event, level) => {
44
38
  event.preventDefault();
@@ -72,15 +66,6 @@ function KeyboardShortcuts() {
72
66
  character: 'f'
73
67
  }
74
68
  });
75
- registerShortcut({
76
- name: 'core/edit-post/toggle-sidebar',
77
- category: 'global',
78
- description: (0, _i18n.__)('Show or hide the Settings sidebar.'),
79
- keyCombination: {
80
- modifier: 'primaryShift',
81
- character: ','
82
- }
83
- });
84
69
  registerShortcut({
85
70
  name: 'core/edit-post/next-region',
86
71
  category: 'global',
@@ -110,15 +95,6 @@ function KeyboardShortcuts() {
110
95
  character: '~'
111
96
  }]
112
97
  });
113
- registerShortcut({
114
- name: 'core/edit-post/keyboard-shortcuts',
115
- category: 'main',
116
- description: (0, _i18n.__)('Display these keyboard shortcuts.'),
117
- keyCombination: {
118
- modifier: 'access',
119
- character: 'h'
120
- }
121
- });
122
98
  registerShortcut({
123
99
  name: 'core/edit-post/transform-heading-to-paragraph',
124
100
  category: 'block-library',
@@ -143,17 +119,6 @@ function KeyboardShortcuts() {
143
119
  (0, _keyboardShortcuts.useShortcut)('core/edit-post/toggle-fullscreen', () => {
144
120
  toggleFeature('fullscreenMode');
145
121
  });
146
- (0, _keyboardShortcuts.useShortcut)('core/edit-post/toggle-sidebar', event => {
147
- // This shortcut has no known clashes, but use preventDefault to prevent any
148
- // obscure shortcuts from triggering.
149
- event.preventDefault();
150
- if (isEditorSidebarOpened()) {
151
- closeGeneralSidebar();
152
- } else {
153
- const sidebarToOpen = getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document';
154
- openGeneralSidebar(sidebarToOpen);
155
- }
156
- });
157
122
  (0, _keyboardShortcuts.useShortcut)('core/edit-post/transform-heading-to-paragraph', event => handleTextLevelShortcut(event, 0));
158
123
  [1, 2, 3, 4, 5, 6].forEach(level => {
159
124
  //the loop is based off on a constant therefore
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_keyboardShortcuts","_i18n","_blockEditor","_blocks","_store","KeyboardShortcuts","isEditorSidebarOpened","useSelect","editPostStore","openGeneralSidebar","closeGeneralSidebar","toggleFeature","useDispatch","registerShortcut","keyboardShortcutsStore","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","getBlockSelectionStart","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","createBlock","content","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","forEach","useShortcut","sidebarToOpen","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { isEditorSidebarOpened } = useSelect( editPostStore );\n\tconst { openGeneralSidebar, closeGeneralSidebar, toggleFeature } =\n\t\tuseDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlockName,\n\t\tgetSelectedBlockClientId,\n\t\tgetBlockAttributes,\n\t\tgetBlockSelectionStart,\n\t} = useSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-fullscreen',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle fullscreen mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'f',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the Settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `0`,\n\t\t\t},\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [] );\n\n\tuseShortcut( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFeature( 'fullscreenMode' );\n\t} );\n\n\tuseShortcut( 'core/edit-post/toggle-sidebar', ( event ) => {\n\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t// obscure shortcuts from triggering.\n\t\tevent.preventDefault();\n\n\t\tif ( isEditorSidebarOpened() ) {\n\t\t\tcloseGeneralSidebar();\n\t\t} else {\n\t\t\tconst sidebarToOpen = getBlockSelectionStart()\n\t\t\t\t? 'edit-post/block'\n\t\t\t\t: 'edit-post/document';\n\t\t\topenGeneralSidebar( sidebarToOpen );\n\t\t}\n\t} );\n\n\tuseShortcut( 'core/edit-post/transform-heading-to-paragraph', ( event ) =>\n\t\thandleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcuts;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAhBA;AACA;AACA;;AAWA;AACA;AACA;;AAGA,SAASO,iBAAiBA,CAAA,EAAG;EAC5B,MAAM;IAAEC;EAAsB,CAAC,GAAG,IAAAC,eAAS,EAAEC,YAAc,CAAC;EAC5D,MAAM;IAAEC,kBAAkB;IAAEC,mBAAmB;IAAEC;EAAc,CAAC,GAC/D,IAAAC,iBAAW,EAAEJ,YAAc,CAAC;EAC7B,MAAM;IAAEK;EAAiB,CAAC,GAAG,IAAAD,iBAAW,EAAEE,wBAAuB,CAAC;EAClE,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAH,iBAAW,EAAEI,kBA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AAM,CACpD,CAAC;EACF,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAAC,IAAAsB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc1C,iBAAiB"}
1
+ {"version":3,"names":["_element","require","_data","_keyboardShortcuts","_i18n","_blockEditor","_blocks","_store","KeyboardShortcuts","toggleFeature","useDispatch","editPostStore","registerShortcut","keyboardShortcutsStore","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","useSelect","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","createBlock","content","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","forEach","useShortcut","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-fullscreen',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle fullscreen mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'f',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `0`,\n\t\t\t},\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [] );\n\n\tuseShortcut( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFeature( 'fullscreenMode' );\n\t} );\n\n\tuseShortcut( 'core/edit-post/transform-heading-to-paragraph', ( event ) =>\n\t\thandleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/edit-post/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcuts;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAhBA;AACA;AACA;;AAWA;A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AE;QACjBqB,IAAI,EAAG,iDAAiDX,KAAO,EAAC;QAChEY,QAAQ,EAAE,eAAe;QACzBC,WAAW,EAAE,IAAAC,QAAE,EAAE,iCAAkC,CAAC;QACpDC,cAAc,EAAE;UACfC,QAAQ,EAAE,QAAQ;UAClBC,SAAS,EAAG,GAAGjB,KAAO;QACvB;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAoB,8BAAW,EAAE,kCAAkC,EAAE,MAAM;IACtDjC,aAAa,CAAE,gBAAiB,CAAC;EAClC,CAAE,CAAC;EAEH,IAAAiC,8BAAW,EAAE,+CAA+C,EAAIrB,KAAK,IACpED,uBAAuB,CAAEC,KAAK,EAAE,CAAE,CACnC,CAAC;EAED,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACoB,OAAO,CAAInB,KAAK,IAAM;IAC1C;IACA;IACA;IACA,IAAAoB,8BAAW,EACT,iDAAiDpB,KAAO,EAAC,EACxDD,KAAK,IAAMD,uBAAuB,CAAEC,KAAK,EAAEC,KAAM,CACpD,CAAC;EACF,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrC,iBAAiB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_editor","require","_data","_components","_i18n","_element","_store","Fill","Slot","createSlotFill","ActionsPanelFill","exports","ActionsPanel","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","closePublishSidebar","togglePublishSidebar","useDispatch","editorStore","publishSidebarOpened","hasActiveMetaboxes","hasNonPostEntityChanges","useSelect","select","isPublishSidebarOpened","editPostStore","hasMetaBoxes","openEntitiesSavedStates","useCallback","unmountableContent","_react","createElement","PostPublishPanel","onClose","forceIsDirty","PrePublishExtension","PluginPrePublishPanel","PostPublishExtension","PluginPostPublishPanel","className","Button","variant","onClick","__","Fragment","EntitiesSavedStates","close","bubblesVirtually"],"sources":["@wordpress/edit-post/src/components/layout/actions-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tEntitiesSavedStates,\n\tPostPublishPanel,\n\tPluginPrePublishPanel,\n\tPluginPostPublishPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function ActionsPanel( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\thasActiveMetaboxes,\n\t\thasNonPostEntityChanges,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\tpublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( hasNonPostEntityChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-entities-saved-states-panel-button\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-publish-panel-button\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAlBA;AACA;AACA;;AAaA;AACA;AACA;;AAGA,MAAM;EAAEM,IAAI;EA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O,EAAC,WAAW;MACnBF,SAAS,EAAC,6DAA6D;MACvEG,OAAO,EAAGf,uBAAyB;MACnC,iBAAgB;IAAO,GAErB,IAAAgB,QAAE,EAAE,iBAAkB,CACjB,CACJ,CACL;EACF,CAAC,MAAM;IACNd,kBAAkB,GACjB,IAAAC,MAAA,CAAAC,aAAA;MAAKQ,SAAS,EAAC;IAAwC,GACtD,IAAAT,MAAA,CAAAC,aAAA,EAAC7B,WAAA,CAAAsC,MAAM;MACNC,OAAO,EAAC,WAAW;MACnBF,SAAS,EAAC,+CAA+C;MACzDG,OAAO,EAAG1B,oBAAsB;MAChC,iBAAgB;IAAO,GAErB,IAAA2B,QAAE,EAAE,oBAAqB,CACpB,CACJ,CACL;EACF;;EAEA;EACA;EACA,OACC,IAAAb,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAc,QAAA,QACG9B,yBAAyB,IAC1B,IAAAgB,MAAA,CAAAC,aAAA,EAAChC,OAAA,CAAA8C,mBAAmB;IAACC,KAAK,EAAGjC;EAA0B,CAAE,CACzD,EACD,IAAAiB,MAAA,CAAAC,aAAA,EAACxB,IAAI;IAACwC,gBAAgB;EAAA,CAAE,CAAC,EACvB,CAAEjC,yBAAyB,IAAIe,kBAChC,CAAC;AAEL"}
1
+ {"version":3,"names":["_editor","require","_data","_components","_i18n","_element","_store","Fill","Slot","createSlotFill","ActionsPanelFill","exports","ActionsPanel","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","closePublishSidebar","togglePublishSidebar","useDispatch","editorStore","publishSidebarOpened","hasActiveMetaboxes","hasNonPostEntityChanges","useSelect","select","isPublishSidebarOpened","editPostStore","hasMetaBoxes","openEntitiesSavedStates","useCallback","unmountableContent","_react","createElement","PostPublishPanel","onClose","forceIsDirty","PrePublishExtension","PluginPrePublishPanel","PostPublishExtension","PluginPostPublishPanel","className","Button","variant","onClick","__","Fragment","EntitiesSavedStates","close","bubblesVirtually"],"sources":["@wordpress/edit-post/src/components/layout/actions-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tEntitiesSavedStates,\n\tPostPublishPanel,\n\tPluginPrePublishPanel,\n\tPluginPostPublishPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function ActionsPanel( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\thasActiveMetaboxes,\n\t\thasNonPostEntityChanges,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\tpublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\thasNonPostEntityChanges:\n\t\t\t\tselect( editorStore ).hasNonPostEntityChanges(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( hasNonPostEntityChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-entities-saved-states-panel-button\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"edit-post-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-post-layout__toggle-publish-panel-button\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAlBA;AACA;AACA;;AAaA;AACA;AACA;;AAGA,MAAM;EAAEM,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,cAAe,CAAC;AAEhD,MAAMC,gBAAg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,iBAAgB;IAAO,GAErB,IAAAgB,QAAE,EAAE,iBAAkB,CACjB,CACJ,CACL;EACF,CAAC,MAAM;IACNd,kBAAkB,GACjB,IAAAC,MAAA,CAAAC,aAAA;MAAKQ,SAAS,EAAC;IAAwC,GACtD,IAAAT,MAAA,CAAAC,aAAA,EAAC7B,WAAA,CAAAsC,MAAM;MACNC,OAAO,EAAC,WAAW;MACnBF,SAAS,EAAC,+CAA+C;MACzDG,OAAO,EAAG1B,oBAAsB;MAChC,iBAAgB;IAAO,GAErB,IAAA2B,QAAE,EAAE,oBAAqB,CACpB,CACJ,CACL;EACF;;EAEA;EACA;EACA,OACC,IAAAb,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAc,QAAA,QACG9B,yBAAyB,IAC1B,IAAAgB,MAAA,CAAAC,aAAA,EAAChC,OAAA,CAAA8C,mBAAmB;IAACC,KAAK,EAAGjC;EAA0B,CAAE,CACzD,EACD,IAAAiB,MAAA,CAAAC,aAAA,EAACxB,IAAI;IAACwC,gBAAgB;EAAA,CAAE,CAAC,EACvB,CAAEjC,yBAAyB,IAAIe,kBAChC,CAAC;AAEL","ignoreList":[]}
@@ -14,7 +14,6 @@ var _components = require("@wordpress/components");
14
14
  var _compose = require("@wordpress/compose");
15
15
  var _plugins = require("@wordpress/plugins");
16
16
  var _i18n = require("@wordpress/i18n");
17
- var _interface = require("@wordpress/interface");
18
17
  var _element = require("@wordpress/element");
19
18
  var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
20
19
  var _notices = require("@wordpress/notices");
@@ -24,7 +23,6 @@ var _coreCommands = require("@wordpress/core-commands");
24
23
  var _textEditor = _interopRequireDefault(require("../text-editor"));
25
24
  var _visualEditor = _interopRequireDefault(require("../visual-editor"));
26
25
  var _keyboardShortcuts2 = _interopRequireDefault(require("../keyboard-shortcuts"));
27
- var _keyboardShortcutHelpModal = _interopRequireDefault(require("../keyboard-shortcut-help-modal"));
28
26
  var _preferencesModal = _interopRequireDefault(require("../preferences-modal"));
29
27
  var _initPatternModal = _interopRequireDefault(require("../init-pattern-modal"));
30
28
  var _browserUrl = _interopRequireDefault(require("../browser-url"));
@@ -33,7 +31,6 @@ var _settingsSidebar = _interopRequireDefault(require("../sidebar/settings-sideb
33
31
  var _metaBoxes = _interopRequireDefault(require("../meta-boxes"));
34
32
  var _welcomeGuide = _interopRequireDefault(require("../welcome-guide"));
35
33
  var _actionsPanel = _interopRequireDefault(require("./actions-panel"));
36
- var _startPageOptions = _interopRequireDefault(require("../start-page-options"));
37
34
  var _store = require("../../store");
38
35
  var _lockUnlock = require("../../lock-unlock");
39
36
  var _useCommonCommands = _interopRequireDefault(require("../../hooks/commands/use-common-commands"));
@@ -60,7 +57,11 @@ const {
60
57
  } = (0, _lockUnlock.unlock)(_commands.privateApis);
61
58
  const {
62
59
  InserterSidebar,
63
- ListViewSidebar
60
+ ListViewSidebar,
61
+ ComplementaryArea,
62
+ FullscreenMode,
63
+ InterfaceSkeleton,
64
+ interfaceStore
64
65
  } = (0, _lockUnlock.unlock)(_editor.privateApis);
65
66
  const interfaceLabels = {
66
67
  /* translators: accessibility text for the editor top bar landmark region. */
@@ -118,7 +119,6 @@ function Layout({
118
119
  const isWideViewport = (0, _compose.useViewportMatch)('large');
119
120
  const isLargeViewport = (0, _compose.useViewportMatch)('medium');
120
121
  const {
121
- openGeneralSidebar,
122
122
  closeGeneralSidebar
123
123
  } = (0, _data.useDispatch)(_store.store);
124
124
  const {
@@ -156,7 +156,7 @@ function Layout({
156
156
  const postTypeLabel = getPostTypeLabel();
157
157
  return {
158
158
  showMetaBoxes: select(_editor.store).getRenderingMode() === 'post-only',
159
- sidebarIsOpened: !!(select(_interface.store).getActiveComplementaryArea(_store.store.name) || select(_editor.store).isPublishSidebarOpened()),
159
+ sidebarIsOpened: !!(select(interfaceStore).getActiveComplementaryArea('core') || select(_editor.store).isPublishSidebarOpened()),
160
160
  isFullscreenActive: select(_store.store).isFeatureActive('fullscreenMode'),
161
161
  isInserterOpened: select(_editor.store).isInserterOpened(),
162
162
  isListViewOpened: select(_editor.store).isListViewOpened(),
@@ -179,7 +179,6 @@ function Layout({
179
179
  const commandContext = hasBlockSelected ? 'block-selection-edit' : 'post-editor-edit';
180
180
  useCommandContext(commandContext);
181
181
  const styles = useEditorStyles();
182
- const openSidebarPanel = () => openGeneralSidebar(hasBlockSelected ? 'edit-post/block' : 'edit-post/document');
183
182
 
184
183
  // Inserter and Sidebars are mutually exclusive
185
184
  (0, _element.useEffect)(() => {
@@ -232,11 +231,11 @@ function Layout({
232
231
  createErrorNotice((0, _i18n.sprintf)( /* translators: %s: plugin name */
233
232
  (0, _i18n.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name));
234
233
  }
235
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.FullscreenMode, {
234
+ return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(FullscreenMode, {
236
235
  isActive: isFullscreenActive
237
236
  }), (0, _react.createElement)(_browserUrl.default, {
238
237
  hasHistory: hasHistory
239
- }), (0, _react.createElement)(_editor.UnsavedChangesWarning, null), (0, _react.createElement)(_editor.AutosaveMonitor, null), (0, _react.createElement)(_editor.LocalAutosaveMonitor, null), (0, _react.createElement)(_keyboardShortcuts2.default, null), (0, _react.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _react.createElement)(_editor.EditorKeyboardShortcuts, null), (0, _react.createElement)(_interface.InterfaceSkeleton, {
238
+ }), (0, _react.createElement)(_editor.UnsavedChangesWarning, null), (0, _react.createElement)(_editor.AutosaveMonitor, null), (0, _react.createElement)(_editor.LocalAutosaveMonitor, null), (0, _react.createElement)(_keyboardShortcuts2.default, null), (0, _react.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _react.createElement)(_editor.EditorKeyboardShortcuts, null), (0, _react.createElement)(InterfaceSkeleton, {
240
239
  isDistractionFree: isDistractionFree && isWideViewport,
241
240
  className: className,
242
241
  labels: {
@@ -249,16 +248,9 @@ function Layout({
249
248
  }),
250
249
  editorNotices: (0, _react.createElement)(_editor.EditorNotices, null),
251
250
  secondarySidebar: secondarySidebar(),
252
- sidebar: (isMobileViewport && sidebarIsOpened || !isMobileViewport && !isDistractionFree) && (0, _react.createElement)(_react.Fragment, null, !isMobileViewport && !sidebarIsOpened && (0, _react.createElement)("div", {
253
- className: "edit-post-layout__toggle-sidebar-panel"
254
- }, (0, _react.createElement)(_components.Button, {
255
- variant: "secondary",
256
- className: "edit-post-layout__toggle-sidebar-panel-button",
257
- onClick: openSidebarPanel,
258
- "aria-expanded": false
259
- }, hasBlockSelected ? (0, _i18n.__)('Open block settings') : (0, _i18n.__)('Open document settings'))), (0, _react.createElement)(_interface.ComplementaryArea.Slot, {
260
- scope: "core/edit-post"
261
- })),
251
+ sidebar: !isDistractionFree && (0, _react.createElement)(ComplementaryArea.Slot, {
252
+ scope: "core"
253
+ }),
262
254
  notices: (0, _react.createElement)(_editor.EditorSnackbars, null),
263
255
  content: (0, _react.createElement)(_react.Fragment, null, !isDistractionFree && (0, _react.createElement)(_editor.EditorNotices, null), (mode === 'text' || !isRichEditingEnabled) && (0, _react.createElement)(_textEditor.default, null), !isLargeViewport && (0, _react.createElement)(_blockEditor.BlockToolbar, {
264
256
  hideDragHandle: true
@@ -285,7 +277,7 @@ function Layout({
285
277
  previous: previousShortcut,
286
278
  next: nextShortcut
287
279
  }
288
- }), (0, _react.createElement)(_preferencesModal.default, null), (0, _react.createElement)(_keyboardShortcutHelpModal.default, null), (0, _react.createElement)(_welcomeGuide.default, null), (0, _react.createElement)(_initPatternModal.default, null), (0, _react.createElement)(_startPageOptions.default, null), (0, _react.createElement)(_plugins.PluginArea, {
280
+ }), (0, _react.createElement)(_preferencesModal.default, null), (0, _react.createElement)(_welcomeGuide.default, null), (0, _react.createElement)(_initPatternModal.default, null), (0, _react.createElement)(_plugins.PluginArea, {
289
281
  onError: onPluginAreaError
290
282
  }), !isDistractionFree && (0, _react.createElement)(_settingsSidebar.default, null));
291
283
  }