@wordpress/edit-post 7.11.0 → 7.12.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 (283) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-manager/category.js +14 -22
  3. package/build/components/block-manager/category.js.map +1 -1
  4. package/build/components/block-manager/checklist.js +6 -13
  5. package/build/components/block-manager/checklist.js.map +1 -1
  6. package/build/components/block-manager/index.js +10 -14
  7. package/build/components/block-manager/index.js.map +1 -1
  8. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  9. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  10. package/build/components/device-preview/index.js +1 -1
  11. package/build/components/device-preview/index.js.map +1 -1
  12. package/build/components/editor-initialization/index.js +3 -4
  13. package/build/components/editor-initialization/index.js.map +1 -1
  14. package/build/components/header/document-title/index.js +103 -0
  15. package/build/components/header/document-title/index.js.map +1 -0
  16. package/build/components/header/fullscreen-mode-close/index.js +8 -9
  17. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  18. package/build/components/header/header-toolbar/index.native.js +12 -13
  19. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  20. package/build/components/header/index.js +7 -6
  21. package/build/components/header/index.js.map +1 -1
  22. package/build/components/header/main-dashboard-button/index.js +3 -4
  23. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  24. package/build/components/header/more-menu/index.js +19 -23
  25. package/build/components/header/more-menu/index.js.map +1 -1
  26. package/build/components/header/post-publish-button-or-toggle.js +15 -16
  27. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  28. package/build/components/header/tools-more-menu-group/index.js +7 -10
  29. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  30. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  31. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  32. package/build/components/keyboard-shortcut-help-modal/index.js +44 -54
  33. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  34. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  35. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  36. package/build/components/layout/actions-panel.js +5 -6
  37. package/build/components/layout/actions-panel.js.map +1 -1
  38. package/build/components/layout/index.js +3 -4
  39. package/build/components/layout/index.js.map +1 -1
  40. package/build/components/layout/index.native.js +3 -7
  41. package/build/components/layout/index.native.js.map +1 -1
  42. package/build/components/meta-boxes/index.js +9 -13
  43. package/build/components/meta-boxes/index.js.map +1 -1
  44. package/build/components/meta-boxes/meta-box-visibility.js +5 -8
  45. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  46. package/build/components/meta-boxes/meta-boxes-area/index.js +3 -4
  47. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  48. package/build/components/preferences-modal/meta-boxes-section.js +16 -23
  49. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  50. package/build/components/preferences-modal/options/enable-custom-fields.js +7 -9
  51. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  52. package/build/components/preferences-modal/options/enable-feature.js +12 -16
  53. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  54. package/build/components/preferences-modal/options/enable-panel.js +10 -17
  55. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  56. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  57. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  58. package/build/components/secondary-sidebar/list-view-sidebar.js +58 -44
  59. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  60. package/build/components/sidebar/discussion-panel/index.js +5 -7
  61. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  62. package/build/components/sidebar/featured-image/index.js +9 -17
  63. package/build/components/sidebar/featured-image/index.js.map +1 -1
  64. package/build/components/sidebar/page-attributes/index.js +3 -9
  65. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  66. package/build/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  67. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  68. package/build/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  69. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  70. package/build/components/sidebar/plugin-post-status-info/index.js +6 -9
  71. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  72. package/build/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  73. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  74. package/build/components/sidebar/plugin-sidebar/index.js +4 -5
  75. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  76. package/build/components/sidebar/post-excerpt/index.js +5 -7
  77. package/build/components/sidebar/post-excerpt/index.js.map +1 -1
  78. package/build/components/sidebar/post-schedule/index.js +16 -23
  79. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  80. package/build/components/sidebar/post-status/index.js +7 -11
  81. package/build/components/sidebar/post-status/index.js.map +1 -1
  82. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  83. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  84. package/build/components/sidebar/post-template/create-modal.js +3 -4
  85. package/build/components/sidebar/post-template/create-modal.js.map +1 -1
  86. package/build/components/sidebar/post-template/form.js +13 -20
  87. package/build/components/sidebar/post-template/form.js.map +1 -1
  88. package/build/components/sidebar/post-template/index.js +18 -25
  89. package/build/components/sidebar/post-template/index.js.map +1 -1
  90. package/build/components/sidebar/post-url/index.js +16 -23
  91. package/build/components/sidebar/post-url/index.js.map +1 -1
  92. package/build/components/sidebar/post-visibility/index.js +26 -36
  93. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  94. package/build/components/sidebar/settings-header/index.js +3 -4
  95. package/build/components/sidebar/settings-header/index.js.map +1 -1
  96. package/build/components/sidebar/template-summary/index.js +1 -1
  97. package/build/components/sidebar/template-summary/index.js.map +1 -1
  98. package/build/components/start-page-options/index.js +3 -4
  99. package/build/components/start-page-options/index.js.map +1 -1
  100. package/build/components/view-link/index.js +1 -1
  101. package/build/components/view-link/index.js.map +1 -1
  102. package/build/components/visual-editor/block-inspector-button.js +4 -5
  103. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  104. package/build/components/visual-editor/header.native.js +6 -7
  105. package/build/components/visual-editor/header.native.js.map +1 -1
  106. package/build/components/visual-editor/index.js +32 -48
  107. package/build/components/visual-editor/index.js.map +1 -1
  108. package/build/components/welcome-guide/image.js +4 -5
  109. package/build/components/welcome-guide/image.js.map +1 -1
  110. package/build/editor.js +14 -20
  111. package/build/editor.js.map +1 -1
  112. package/build/editor.native.js +3 -6
  113. package/build/editor.native.js.map +1 -1
  114. package/build/hooks/validate-multiple-use/index.js +18 -29
  115. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  116. package/build/plugins/index.js +20 -23
  117. package/build/plugins/index.js.map +1 -1
  118. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  119. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  120. package/build/store/actions.js +60 -88
  121. package/build/store/actions.js.map +1 -1
  122. package/build/store/reducer.js +11 -43
  123. package/build/store/reducer.js.map +1 -1
  124. package/build/store/selectors.js +11 -16
  125. package/build/store/selectors.js.map +1 -1
  126. package/build-module/components/block-manager/category.js +14 -22
  127. package/build-module/components/block-manager/category.js.map +1 -1
  128. package/build-module/components/block-manager/checklist.js +6 -13
  129. package/build-module/components/block-manager/checklist.js.map +1 -1
  130. package/build-module/components/block-manager/index.js +10 -14
  131. package/build-module/components/block-manager/index.js.map +1 -1
  132. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  133. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  134. package/build-module/components/device-preview/index.js +1 -1
  135. package/build-module/components/device-preview/index.js.map +1 -1
  136. package/build-module/components/editor-initialization/index.js +3 -4
  137. package/build-module/components/editor-initialization/index.js.map +1 -1
  138. package/build-module/components/header/document-title/index.js +88 -0
  139. package/build-module/components/header/document-title/index.js.map +1 -0
  140. package/build-module/components/header/fullscreen-mode-close/index.js +7 -8
  141. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  142. package/build-module/components/header/header-toolbar/index.native.js +12 -13
  143. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  144. package/build-module/components/header/index.js +7 -6
  145. package/build-module/components/header/index.js.map +1 -1
  146. package/build-module/components/header/main-dashboard-button/index.js +3 -4
  147. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  148. package/build-module/components/header/more-menu/index.js +19 -23
  149. package/build-module/components/header/more-menu/index.js.map +1 -1
  150. package/build-module/components/header/post-publish-button-or-toggle.js +15 -16
  151. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  152. package/build-module/components/header/tools-more-menu-group/index.js +7 -10
  153. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  154. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  155. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  156. package/build-module/components/keyboard-shortcut-help-modal/index.js +42 -52
  157. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  158. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  159. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  160. package/build-module/components/layout/actions-panel.js +5 -6
  161. package/build-module/components/layout/actions-panel.js.map +1 -1
  162. package/build-module/components/layout/index.js +3 -4
  163. package/build-module/components/layout/index.js.map +1 -1
  164. package/build-module/components/layout/index.native.js +3 -7
  165. package/build-module/components/layout/index.native.js.map +1 -1
  166. package/build-module/components/meta-boxes/index.js +9 -13
  167. package/build-module/components/meta-boxes/index.js.map +1 -1
  168. package/build-module/components/meta-boxes/meta-box-visibility.js +5 -8
  169. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  170. package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -4
  171. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  172. package/build-module/components/preferences-modal/meta-boxes-section.js +16 -23
  173. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  174. package/build-module/components/preferences-modal/options/enable-custom-fields.js +7 -9
  175. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  176. package/build-module/components/preferences-modal/options/enable-feature.js +12 -16
  177. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  178. package/build-module/components/preferences-modal/options/enable-panel.js +10 -17
  179. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  180. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  181. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  182. package/build-module/components/secondary-sidebar/list-view-sidebar.js +58 -44
  183. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  184. package/build-module/components/sidebar/discussion-panel/index.js +5 -7
  185. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  186. package/build-module/components/sidebar/featured-image/index.js +9 -17
  187. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  188. package/build-module/components/sidebar/page-attributes/index.js +3 -9
  189. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  190. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  191. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  192. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  193. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  194. package/build-module/components/sidebar/plugin-post-status-info/index.js +6 -9
  195. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  196. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  197. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  198. package/build-module/components/sidebar/plugin-sidebar/index.js +4 -5
  199. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  200. package/build-module/components/sidebar/post-excerpt/index.js +5 -7
  201. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  202. package/build-module/components/sidebar/post-schedule/index.js +16 -23
  203. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  204. package/build-module/components/sidebar/post-status/index.js +7 -11
  205. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  207. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  208. package/build-module/components/sidebar/post-template/create-modal.js +3 -4
  209. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
  210. package/build-module/components/sidebar/post-template/form.js +13 -20
  211. package/build-module/components/sidebar/post-template/form.js.map +1 -1
  212. package/build-module/components/sidebar/post-template/index.js +18 -25
  213. package/build-module/components/sidebar/post-template/index.js.map +1 -1
  214. package/build-module/components/sidebar/post-url/index.js +16 -23
  215. package/build-module/components/sidebar/post-url/index.js.map +1 -1
  216. package/build-module/components/sidebar/post-visibility/index.js +26 -36
  217. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  218. package/build-module/components/sidebar/settings-header/index.js +3 -4
  219. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  220. package/build-module/components/sidebar/template-summary/index.js +1 -1
  221. package/build-module/components/sidebar/template-summary/index.js.map +1 -1
  222. package/build-module/components/start-page-options/index.js +3 -4
  223. package/build-module/components/start-page-options/index.js.map +1 -1
  224. package/build-module/components/view-link/index.js +1 -1
  225. package/build-module/components/view-link/index.js.map +1 -1
  226. package/build-module/components/visual-editor/block-inspector-button.js +4 -5
  227. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  228. package/build-module/components/visual-editor/header.native.js +6 -7
  229. package/build-module/components/visual-editor/header.native.js.map +1 -1
  230. package/build-module/components/visual-editor/index.js +35 -49
  231. package/build-module/components/visual-editor/index.js.map +1 -1
  232. package/build-module/components/welcome-guide/image.js +4 -5
  233. package/build-module/components/welcome-guide/image.js.map +1 -1
  234. package/build-module/editor.js +14 -20
  235. package/build-module/editor.js.map +1 -1
  236. package/build-module/editor.native.js +3 -6
  237. package/build-module/editor.native.js.map +1 -1
  238. package/build-module/hooks/validate-multiple-use/index.js +18 -29
  239. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  240. package/build-module/plugins/index.js +20 -23
  241. package/build-module/plugins/index.js.map +1 -1
  242. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  243. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  244. package/build-module/store/actions.js +60 -88
  245. package/build-module/store/actions.js.map +1 -1
  246. package/build-module/store/reducer.js +11 -43
  247. package/build-module/store/reducer.js.map +1 -1
  248. package/build-module/store/selectors.js +11 -16
  249. package/build-module/store/selectors.js.map +1 -1
  250. package/build-style/style-rtl.css +63 -101
  251. package/build-style/style.css +63 -101
  252. package/package.json +32 -32
  253. package/src/components/header/document-title/index.js +86 -0
  254. package/src/components/header/document-title/style.scss +61 -0
  255. package/src/components/header/header-toolbar/style.scss +0 -1
  256. package/src/components/header/index.js +4 -2
  257. package/src/components/header/style.scss +6 -0
  258. package/src/components/secondary-sidebar/list-view-sidebar.js +68 -66
  259. package/src/components/secondary-sidebar/style.scss +28 -31
  260. package/src/components/visual-editor/index.js +10 -21
  261. package/src/components/visual-editor/style.scss +0 -13
  262. package/src/style.scss +1 -1
  263. package/build/components/header/template-title/delete-template.js +0 -117
  264. package/build/components/header/template-title/delete-template.js.map +0 -1
  265. package/build/components/header/template-title/edit-template-title.js +0 -95
  266. package/build/components/header/template-title/edit-template-title.js.map +0 -1
  267. package/build/components/header/template-title/index.js +0 -124
  268. package/build/components/header/template-title/index.js.map +0 -1
  269. package/build/components/header/template-title/template-description.js +0 -55
  270. package/build/components/header/template-title/template-description.js.map +0 -1
  271. package/build-module/components/header/template-title/delete-template.js +0 -104
  272. package/build-module/components/header/template-title/delete-template.js.map +0 -1
  273. package/build-module/components/header/template-title/edit-template-title.js +0 -83
  274. package/build-module/components/header/template-title/edit-template-title.js.map +0 -1
  275. package/build-module/components/header/template-title/index.js +0 -105
  276. package/build-module/components/header/template-title/index.js.map +0 -1
  277. package/build-module/components/header/template-title/template-description.js +0 -45
  278. package/build-module/components/header/template-title/template-description.js.map +0 -1
  279. package/src/components/header/template-title/delete-template.js +0 -106
  280. package/src/components/header/template-title/edit-template-title.js +0 -78
  281. package/src/components/header/template-title/index.js +0 -115
  282. package/src/components/header/template-title/style.scss +0 -94
  283. package/src/components/header/template-title/template-description.js +0 -42
@@ -0,0 +1,88 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * WordPress dependencies
5
+ */
6
+ import { __, isRTL } from '@wordpress/i18n';
7
+ import { useSelect, useDispatch } from '@wordpress/data';
8
+ import { BlockIcon, store as blockEditorStore } from '@wordpress/block-editor';
9
+ import { Button, VisuallyHidden, __experimentalHStack as HStack, __experimentalText as Text } from '@wordpress/components';
10
+ import { layout, chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
11
+ import { store as commandsStore } from '@wordpress/commands';
12
+ import { displayShortcut } from '@wordpress/keycodes';
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+
17
+ import { store as editPostStore } from '../../../store';
18
+
19
+ function DocumentTitle() {
20
+ const {
21
+ template,
22
+ isEditing
23
+ } = useSelect(select => {
24
+ const {
25
+ isEditingTemplate,
26
+ getEditedPostTemplate
27
+ } = select(editPostStore);
28
+
29
+ const _isEditing = isEditingTemplate();
30
+
31
+ return {
32
+ template: _isEditing ? getEditedPostTemplate() : null,
33
+ isEditing: _isEditing
34
+ };
35
+ }, []);
36
+ const {
37
+ clearSelectedBlock
38
+ } = useDispatch(blockEditorStore);
39
+ const {
40
+ setIsEditingTemplate
41
+ } = useDispatch(editPostStore);
42
+ const {
43
+ open: openCommandCenter
44
+ } = useDispatch(commandsStore);
45
+
46
+ if (!isEditing || !template) {
47
+ return null;
48
+ }
49
+
50
+ let templateTitle = __('Default');
51
+
52
+ if (template?.title) {
53
+ templateTitle = template.title;
54
+ } else if (!!template) {
55
+ templateTitle = template.slug;
56
+ }
57
+
58
+ return createElement("div", {
59
+ className: "edit-post-document-title"
60
+ }, createElement("span", {
61
+ className: "edit-post-document-title__left"
62
+ }, createElement(Button, {
63
+ onClick: () => {
64
+ clearSelectedBlock();
65
+ setIsEditingTemplate(false);
66
+ },
67
+ icon: isRTL() ? chevronRightSmall : chevronLeftSmall
68
+ }, __('Back'))), createElement(Button, {
69
+ className: "edit-post-document-title__title",
70
+ onClick: () => openCommandCenter()
71
+ }, createElement(HStack, {
72
+ spacing: 1,
73
+ justify: "center"
74
+ }, createElement(BlockIcon, {
75
+ icon: layout
76
+ }), createElement(Text, {
77
+ size: "body",
78
+ as: "h1"
79
+ }, createElement(VisuallyHidden, {
80
+ as: "span"
81
+ }, __('Editing template: ')), templateTitle))), createElement(Button, {
82
+ className: "edit-post-document-title__shortcut",
83
+ onClick: () => openCommandCenter()
84
+ }, displayShortcut.primary('k')));
85
+ }
86
+
87
+ export default DocumentTitle;
88
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/document-title/index.js"],"names":["__","isRTL","useSelect","useDispatch","BlockIcon","store","blockEditorStore","Button","VisuallyHidden","__experimentalHStack","HStack","__experimentalText","Text","layout","chevronLeftSmall","chevronRightSmall","commandsStore","displayShortcut","editPostStore","DocumentTitle","template","isEditing","select","isEditingTemplate","getEditedPostTemplate","_isEditing","clearSelectedBlock","setIsEditingTemplate","open","openCommandCenter","templateTitle","title","slug","primary"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,SAAT,EAAoBC,KAAK,IAAIC,gBA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AAa,GAAGV,QAAQ,CAACY,IAAzB;AACA;;AAED,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfN,MAAAA,kBAAkB;AAClBC,MAAAA,oBAAoB,CAAE,KAAF,CAApB;AACA,KAJF;AAKC,IAAA,IAAI,EAAG1B,KAAK,KAAKc,iBAAL,GAAyBD;AALtC,KAOGd,EAAE,CAAE,MAAF,CAPL,CADD,CADD,EAaC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,OAAO,EAAG,MAAM6B,iBAAiB;AAFlC,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG,CAAlB;AAAsB,IAAA,OAAO,EAAC;AAA9B,KACC,cAAC,SAAD;AAAW,IAAA,IAAI,EAAGhB;AAAlB,IADD,EAEC,cAAC,IAAD;AAAM,IAAA,IAAI,EAAC,MAAX;AAAkB,IAAA,EAAE,EAAC;AAArB,KACC,cAAC,cAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB,KACGb,EAAE,CAAE,oBAAF,CADL,CADD,EAIG8B,aAJH,CAFD,CAJD,CAbD,EA2BC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,OAAO,EAAG,MAAMD,iBAAiB;AAFlC,KAIGZ,eAAe,CAACgB,OAAhB,CAAyB,GAAzB,CAJH,CA3BD,CADD;AAoCA;;AAED,eAAed,aAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { BlockIcon, store as blockEditorStore } from '@wordpress/block-editor';\nimport {\n\tButton,\n\tVisuallyHidden,\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { layout, chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction DocumentTitle() {\n\tconst { template, isEditing } = useSelect( ( select ) => {\n\t\tconst { isEditingTemplate, getEditedPostTemplate } =\n\t\t\tselect( editPostStore );\n\t\tconst _isEditing = isEditingTemplate();\n\n\t\treturn {\n\t\t\ttemplate: _isEditing ? getEditedPostTemplate() : null,\n\t\t\tisEditing: _isEditing,\n\t\t};\n\t}, [] );\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { setIsEditingTemplate } = useDispatch( editPostStore );\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\tif ( ! isEditing || ! template ) {\n\t\treturn null;\n\t}\n\n\tlet templateTitle = __( 'Default' );\n\tif ( template?.title ) {\n\t\ttemplateTitle = template.title;\n\t} else if ( !! template ) {\n\t\ttemplateTitle = template.slug;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-post-document-title\">\n\t\t\t<span className=\"edit-post-document-title__left\">\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\t\tsetIsEditingTemplate( false );\n\t\t\t\t\t} }\n\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t</Button>\n\t\t\t</span>\n\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-document-title__title\"\n\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t>\n\t\t\t\t<HStack spacing={ 1 } justify=\"center\">\n\t\t\t\t\t<BlockIcon icon={ layout } />\n\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t{ __( 'Editing template: ' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t{ templateTitle }\n\t\t\t\t\t</Text>\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-document-title__shortcut\"\n\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t>\n\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n\nexport default DocumentTitle;\n"]}
@@ -22,14 +22,13 @@ import { useReducedMotion } from '@wordpress/compose';
22
22
 
23
23
  import { store as editPostStore } from '../../../store';
24
24
 
25
- function FullscreenModeClose(_ref) {
26
- var _postType$labels$view, _postType$labels;
25
+ function FullscreenModeClose({
26
+ showTooltip,
27
+ icon,
28
+ href
29
+ }) {
30
+ var _postType$labels$view;
27
31
 
28
- let {
29
- showTooltip,
30
- icon,
31
- href
32
- } = _ref;
33
32
  const {
34
33
  isActive,
35
34
  isRequestingSiteIcon,
@@ -107,7 +106,7 @@ function FullscreenModeClose(_ref) {
107
106
  href: href !== null && href !== void 0 ? href : addQueryArgs('edit.php', {
108
107
  post_type: postType.slug
109
108
  }),
110
- label: (_postType$labels$view = postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : __('Back'),
109
+ label: (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : __('Back'),
111
110
  showTooltip: showTooltip
112
111
  }, buttonIcon));
113
112
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"names":["classnames","useSelect","Button","Icon","__unstableMotion","motion","__","addQueryArgs","wordpress","store","editorStore","coreStore","useReducedMotion","editPostStore","FullscreenModeClose","showTooltip","icon","href","isActive","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","isFeatureActive","getEntityRecord","getPostType","isResolving","siteData","undefined","site_icon_url","disableMotion","buttonIcon","effect","expand","scale","transition","type","duration","classes","post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vB,KACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAGkB,OADb;AAEC,IAAA,IAAI,EACHtB,IADG,aACHA,IADG,cACHA,IADG,GAEHV,YAAY,CAAE,UAAF,EAAc;AACzBiC,MAAAA,SAAS,EAAEpB,QAAQ,CAACqB;AADK,KAAd,CAJd;AAQC,IAAA,KAAK,2BAAGrB,QAAH,aAAGA,QAAH,2CAAGA,QAAQ,CAAEsB,MAAb,qDAAG,iBAAkBC,UAArB,yEAAmCrC,EAAE,CAAE,MAAF,CAR3C;AASC,IAAA,WAAW,EAAGS;AATf,KAWGiB,UAXH,CADD,CADD;AAiBA;;AAED,eAAelB,mBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( getCurrentPostType() ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = classnames( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={\n\t\t\t\t\thref ??\n\t\t\t\t\taddQueryArgs( 'edit.php', {\n\t\t\t\t\t\tpost_type: postType.slug,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tlabel={ postType?.labels?.view_items ?? __( 'Back' ) }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"names":["classnames","useSelect","Button","Icon","__unstableMotion","motion","__","addQueryArgs","wordpress","store","editorStore","coreStore","useReducedMotion","editPostStore","FullscreenModeClose","showTooltip","icon","href","isActive","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","isFeatureActive","getEntityRecord","getPostType","isResolving","siteData","undefined","site_icon_url","disableMotion","buttonIcon","effect","expand","scale","transition","type","duration","classes","post_type","slug","labels","view_items"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,MADD,EAECC,IAFD,EAGCC,gBAAgB,IAAIC,MAHrB,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,gBAA7B;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,gBAAvC;;AAEA,SAASC,mBAAT,CAA8B;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,IAAf;AAAqBC,EAAAA;AAArB,CAA9B,EAA4D;AAAA;;AAC3D,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,oBAAZ;AAAkCC,IAAAA,QAAlC;AAA4CC,IAAAA;AAA5C,MAA4DpB,SAAS,CACxEqB,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAyBD,MAAM,CAAEZ,WAAF,CAArC;AACA,UAAM;AAAEc,MAAAA;AAAF,QAAsBF,MAAM,CAAET,aAAF,CAAlC;AACA,UAAM;AAAEY,MAAAA,eAAF;AAAmBC,MAAAA,WAAnB;AAAgCC,MAAAA;AAAhC,QACLL,MAAM,CAAEX,SAAF,CADP;AAEA,UAAMiB,QAAQ,GACbH,eAAe,CAAE,MAAF,E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X;AAAkB,MAAA,IAAI,EAAGhB;AAAzB,MAAb;AACA;;AAED,QAAMuB,OAAO,GAAGvC,UAAU,CAAE;AAC3B,uCAAmC,IADR;AAE3B,gBAAYqB;AAFe,GAAF,CAA1B;AAKA,SACC,cAAC,MAAD,CAAQ,GAAR;AAAY,IAAA,UAAU,EAAC;AAAvB,KACC,cAAC,MAAD;AACC,IAAA,SAAS,EAAGkB,OADb;AAEC,IAAA,IAAI,EACHtB,IADG,aACHA,IADG,cACHA,IADG,GAEHV,YAAY,CAAE,UAAF,EAAc;AACzBiC,MAAAA,SAAS,EAAEpB,QAAQ,CAACqB;AADK,KAAd,CAJd;AAQC,IAAA,KAAK,2BAAGrB,QAAQ,EAAEsB,MAAV,EAAkBC,UAArB,yEAAmCrC,EAAE,CAAE,MAAF,CAR3C;AASC,IAAA,WAAW,EAAGS;AATf,KAWGiB,UAXH,CADD,CADD;AAiBA;;AAED,eAAelB,mBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( getCurrentPostType() ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = classnames( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={\n\t\t\t\t\thref ??\n\t\t\t\t\taddQueryArgs( 'edit.php', {\n\t\t\t\t\t\tpost_type: postType.slug,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tlabel={ postType?.labels?.view_items ?? __( 'Back' ) }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"]}
@@ -24,19 +24,18 @@ import { store as editorStore } from '@wordpress/editor';
24
24
  import styles from './style.scss';
25
25
  import { store as editPostStore } from '../../../store';
26
26
 
27
- function HeaderToolbar(_ref) {
28
- let {
29
- hasRedo,
30
- hasUndo,
31
- redo,
32
- undo,
33
- showInserter,
34
- showKeyboardHideButton,
35
- getStylesFromColorScheme,
36
- onHideKeyboard,
37
- isRTL,
38
- noContentSelected
39
- } = _ref;
27
+ function HeaderToolbar({
28
+ hasRedo,
29
+ hasUndo,
30
+ redo,
31
+ undo,
32
+ showInserter,
33
+ showKeyboardHideButton,
34
+ getStylesFromColorScheme,
35
+ onHideKeyboard,
36
+ isRTL,
37
+ noContentSelected
38
+ }) {
40
39
  const wasNoContentSelected = useRef(noContentSelected);
41
40
  const [isInserterOpen, setIsInserterOpen] = useState(false);
42
41
  const scrollViewRef = useRef(null);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"names":["Platform","ScrollView","View","useCallback","useRef","useState","compose","withPreferredColorScheme","withSelect","withDispatch","withViewportMatch","__","Inserter","BlockToolbar","store","blockEditorStore","ToolbarGroup","ToolbarButton","keyboardClose","undo","undoIcon","redo","redoIcon","editorStore","styles","editPostStore","HeaderToolbar","hasRedo","hasUndo","showInserter","showKeyboardHideButton","getStylesFromColorScheme","onHideKeyboard","isRTL","noContentSelected","wasNoContentSelected","isInserterOpen","setIsInserterOpen","scrollViewRef","scrollToStart","isAndroid","OS","current","scrollToEnd","scrollTo","x","renderHistoryButtons","buttons","hint","reverse","onToggleInserter","isOpen","useExpandedMode","toolbarAriaLabel","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","getEditorSettings","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelect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AAc,GAAG;AAChBoC,MAAAA,kBAAkB;AAClBC,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA;;AANK,GAAP;AAQA,CAZW,CA1BW,EAuCvB3D,iBAAiB,CAAE;AAAE4D,EAAAA,eAAe,EAAE;AAAnB,CAAF,CAvCM,EAwCvB/D,wBAxCuB,CAAF,CAAP,CAyCVmB,aAzCU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, ScrollView, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useState } from '@wordpress/element';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\tundo as undoIcon,\n\tredo as redoIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tgetStylesFromColorScheme,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst wasNoContentSelected = useRef( noContentSelected );\n\tconst [ isInserterOpen, setIsInserterOpen ] = useState( false );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tconst isAndroid = Platform.OS === 'android';\n\t\tif ( isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\tconst renderHistoryButtons = () => {\n\t\tconst buttons = [\n\t\t\t/* TODO: replace with EditorHistoryRedo and EditorHistoryUndo. */\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"undoButton\"\n\t\t\t\ttitle={ __( 'Undo' ) }\n\t\t\t\ticon={ ! isRTL ? undoIcon : redoIcon }\n\t\t\t\tisDisabled={ ! hasUndo }\n\t\t\t\tonClick={ undo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to undo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"redoButton\"\n\t\t\t\ttitle={ __( 'Redo' ) }\n\t\t\t\ticon={ ! isRTL ? redoIcon : undoIcon }\n\t\t\t\tisDisabled={ ! hasRedo }\n\t\t\t\tonClick={ redo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to redo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t];\n\n\t\treturn isRTL ? buttons.reverse() : buttons;\n\t};\n\n\tconst onToggleInserter = useCallback(\n\t\t( isOpen ) => {\n\t\t\tif ( isOpen ) {\n\t\t\t\twasNoContentSelected.current = noContentSelected;\n\t\t\t}\n\t\t\tsetIsInserterOpen( isOpen );\n\t\t},\n\t\t[ noContentSelected ]\n\t);\n\n\t// Expanded mode should be preserved while the inserter is open.\n\t// This way we prevent style updates during the opening transition.\n\tconst useExpandedMode = isInserterOpen\n\t\t? wasNoContentSelected.current\n\t\t: noContentSelected;\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\treturn (\n\t\t<View\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ [\n\t\t\t\tgetStylesFromColorScheme(\n\t\t\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t\t\t),\n\t\t\t\tuseExpandedMode &&\n\t\t\t\t\tstyles[ 'header-toolbar__container--expanded' ],\n\t\t\t] }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal={ true }\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter\n\t\t\t\t\tdisabled={ ! showInserter }\n\t\t\t\t\tuseExpandedMode={ useExpandedMode }\n\t\t\t\t\tonToggle={ onToggleInserter }\n\t\t\t\t/>\n\t\t\t\t{ renderHistoryButtons() }\n\t\t\t\t<BlockToolbar />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup\n\t\t\t\t\tpassedStyle={\n\t\t\t\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ]\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n\twithPreferredColorScheme,\n] )( HeaderToolbar );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"names":["Platform","ScrollView","View","useCallback","useRef","useState","compose","withPreferredColorScheme","withSelect","withDispatch","withViewportMatch","__","Inserter","BlockToolbar","store","blockEditorStore","ToolbarGroup","ToolbarButton","keyboardClose","undo","undoIcon","redo","redoIcon","editorStore","styles","editPostStore","HeaderToolbar","hasRedo","hasUndo","showInserter","showKeyboardHideButton","getStylesFromColorScheme","onHideKeyboard","isRTL","noContentSelected","wasNoContentSelected","isInserterOpen","setIsInserterOpen","scrollViewRef","scrollToStart","isAndroid","OS","current","scrollToEnd","scrollTo","x","renderHistoryButtons","buttons","hint","reverse","onToggleInserter","isOpen","useExpandedMode","toolbarAriaLabel","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","getEditorSettings","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","dispatch","clearSelectedBlock","togglePostTitleSelection","isLargeViewport"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,UAAnB,EAA+BC,IAA/B,QAA2C,cAA3C;AAEA;AACA;AACA;;AACA,SAASC,WAAT,EAAsBC,MAAtB,EAA8BC,QAA9B,QAA8C,oBAA9C;AACA,SAASC,OAAT,EAAkBC,wBAAlB,QAAkD,oBAAlD;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,QADD,EAECC,YAFD,EAGCC,KAAK,IAAIC,gBAHV,QAIO,yBAJP;AAKA,SAASC,YAAT,EAAuBC,aAAvB,QAA4C,uBAA5C;AACA,SACCC,aADD,EAECC,IAAI,IAAIC,QAFT,EAGCC,IAAI,IAAIC,QAHT,QAIO,kBAJP;AAKA,SAASR,KAAK,IAAIS,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,SAASV,KAAK,IAAIW,aAAlB,QAAuC,gBAAvC;;AAEA,SAASC,aAAT,CAAwB;AACvBC,EAAAA,OADuB;AAEvBC,EAAAA,OAFuB;AAGvBP,EAAAA,IAHuB;AAIvBF,EAAAA,IAJuB;AAKvBU,EAAAA,YALuB;AAMvBC,EAAAA,sBANuB;AAOvBC,EAAAA,wBAPuB;AAQvBC,EAAAA,cARuB;AASvBC,EAAAA,KATuB;AAUvBC,EAAAA;AAVuB,CAAxB,EAWI;AACH,QAAMC,oBAAoB,GAAG/B,MAAM,CAAE8B,iBAAF,CAAnC;AACA,QAAM,CAAEE,cAAF,EAAkBC,iBAAlB,IAAwChC,QAAQ,CAAE,KAAF,CAAtD;AA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,CAAE5C,WAAF,CAAR,CAAwBF,IADxB;AAENF,IAAAA,IAAI,EAAEgD,QAAQ,CAAE5C,WAAF,CAAR,CAAwBJ,IAFxB;;AAGNa,IAAAA,cAAc,GAAG;AAChBoC,MAAAA,kBAAkB;AAClBC,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA;;AANK,GAAP;AAQA,CAZW,CA1BW,EAuCvB3D,iBAAiB,CAAE;AAAE4D,EAAAA,eAAe,EAAE;AAAnB,CAAF,CAvCM,EAwCvB/D,wBAxCuB,CAAF,CAAP,CAyCVmB,aAzCU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, ScrollView, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useState } from '@wordpress/element';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\tundo as undoIcon,\n\tredo as redoIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tgetStylesFromColorScheme,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst wasNoContentSelected = useRef( noContentSelected );\n\tconst [ isInserterOpen, setIsInserterOpen ] = useState( false );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tconst isAndroid = Platform.OS === 'android';\n\t\tif ( isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\tconst renderHistoryButtons = () => {\n\t\tconst buttons = [\n\t\t\t/* TODO: replace with EditorHistoryRedo and EditorHistoryUndo. */\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"undoButton\"\n\t\t\t\ttitle={ __( 'Undo' ) }\n\t\t\t\ticon={ ! isRTL ? undoIcon : redoIcon }\n\t\t\t\tisDisabled={ ! hasUndo }\n\t\t\t\tonClick={ undo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to undo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"redoButton\"\n\t\t\t\ttitle={ __( 'Redo' ) }\n\t\t\t\ticon={ ! isRTL ? redoIcon : undoIcon }\n\t\t\t\tisDisabled={ ! hasRedo }\n\t\t\t\tonClick={ redo }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Double tap to redo last change' ),\n\t\t\t\t} }\n\t\t\t/>,\n\t\t];\n\n\t\treturn isRTL ? buttons.reverse() : buttons;\n\t};\n\n\tconst onToggleInserter = useCallback(\n\t\t( isOpen ) => {\n\t\t\tif ( isOpen ) {\n\t\t\t\twasNoContentSelected.current = noContentSelected;\n\t\t\t}\n\t\t\tsetIsInserterOpen( isOpen );\n\t\t},\n\t\t[ noContentSelected ]\n\t);\n\n\t// Expanded mode should be preserved while the inserter is open.\n\t// This way we prevent style updates during the opening transition.\n\tconst useExpandedMode = isInserterOpen\n\t\t? wasNoContentSelected.current\n\t\t: noContentSelected;\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\treturn (\n\t\t<View\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ [\n\t\t\t\tgetStylesFromColorScheme(\n\t\t\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t\t\t),\n\t\t\t\tuseExpandedMode &&\n\t\t\t\t\tstyles[ 'header-toolbar__container--expanded' ],\n\t\t\t] }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal={ true }\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter\n\t\t\t\t\tdisabled={ ! showInserter }\n\t\t\t\t\tuseExpandedMode={ useExpandedMode }\n\t\t\t\t\tonToggle={ onToggleInserter }\n\t\t\t\t/>\n\t\t\t\t{ renderHistoryButtons() }\n\t\t\t\t<BlockToolbar />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup\n\t\t\t\t\tpassedStyle={\n\t\t\t\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ]\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n\twithPreferredColorScheme,\n] )( HeaderToolbar );\n"]}
@@ -20,12 +20,11 @@ import { default as DevicePreview } from '../device-preview';
20
20
  import ViewLink from '../view-link';
21
21
  import MainDashboardButton from './main-dashboard-button';
22
22
  import { store as editPostStore } from '../../store';
23
- import TemplateTitle from './template-title';
23
+ import DocumentTitle from './document-title';
24
24
 
25
- function Header(_ref) {
26
- let {
27
- setEntitiesSavedStatesCallback
28
- } = _ref;
25
+ function Header({
26
+ setEntitiesSavedStatesCallback
27
+ }) {
29
28
  const isLargeViewport = useViewportMatch('large');
30
29
  const {
31
30
  hasActiveMetaboxes,
@@ -86,7 +85,9 @@ function Header(_ref) {
86
85
  delay: 0.8
87
86
  },
88
87
  className: "edit-post-header__toolbar"
89
- }, createElement(HeaderToolbar, null), createElement(TemplateTitle, null)), createElement(motion.div, {
88
+ }, createElement(HeaderToolbar, null), createElement("div", {
89
+ className: "edit-post-header__document-title"
90
+ }, createElement(DocumentTitle, null))), createElement(motion.div, {
90
91
  variants: slideY,
91
92
  transition: {
92
93
  type: 'tween',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["PostSavedState","PostPreviewButton","useSelect","PinnedItems","useViewportMatch","__unstableMotion","motion","FullscreenModeClose","HeaderToolbar","MoreMenu","PostPublishButtonOrToggle","default","DevicePreview","ViewLink","MainDashboardButton","store","editPostStore","TemplateTitle","Header","setEntitiesSavedStatesCallback","isLargeViewport","hasActiveMetaboxes","isPublishSidebarOpened","isSaving","showIconLabels","isDistractionFreeMode","select","hasMetaBoxes","isSavingMetaBoxes","isFeatureActive","isDistractionFree","slideY","hidden","y","hover","transition","type","delay","slideX","x","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,iBAAzB,QAAkD,mBAAlD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,WAAT,QAA4B,sBAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAgB,IAAIC,MAA7B,QAA2C,uBAA3C;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,SAASC,OAAO,IAAIC,aAApB,QAAyC,mBAAzC;AACA,OAAOC,QAAP,MAAqB,cAArB;AACA,OAAOC,mBAAP,MAAgC,yBAAhC;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,aAAP,MAA0B,kBAA1B;;AAEA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EAuBC,cAAC,yBAAD;AACC,IAAA,YAAY,EAAGnB,kBADhB;AAEC,IAAA,aAAa,EAAGE,QAFjB;AAGC,IAAA,8BAA8B,EAC7BJ;AAJF,IAvBD,EA8BG,CAAEC,eAAe,IAAI,CAAEI,cAAvB,KACD,8BACC,cAAC,WAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IADD,EAEC,cAAC,QAAD;AAAU,IAAA,cAAc,EAAGA;AAA3B,IAFD,CA/BF,EAoCGA,cAAc,IAAI,CAAEJ,eAApB,IACD,cAAC,QAAD;AAAU,IAAA,cAAc,EAAGI;AAA3B,IArCF,CAjBD,CADD;AA4DA;;AAED,eAAeN,MAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostSavedState, PostPreviewButton } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport { default as DevicePreview } from '../device-preview';\nimport ViewLink from '../view-link';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport TemplateTitle from './template-title';\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst {\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tisSaving,\n\t\tshowIconLabels,\n\t\tisDistractionFreeMode,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\tisSaving: select( editPostStore ).isSavingMetaBoxes(),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFreeMode:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst isDistractionFree = isDistractionFreeMode && isLargeViewport;\n\n\tconst slideY = {\n\t\thidden: isDistractionFree ? { y: '-50' } : { y: 0 },\n\t\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n\t};\n\n\tconst slideX = {\n\t\thidden: isDistractionFree ? { x: '-100%' } : { x: 0 },\n\t\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n\t};\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<HeaderToolbar />\n\t\t\t\t<TemplateTitle />\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<ViewLink />\n\t\t\t\t<DevicePreview />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t\tforcePreviewLink={ isSaving ? null : undefined }\n\t\t\t\t/>\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isLargeViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["PostSavedState","PostPreviewButton","useSelect","PinnedItems","useViewportMatch","__unstableMotion","motion","FullscreenModeClose","HeaderToolbar","MoreMenu","PostPublishButtonOrToggle","default","DevicePreview","ViewLink","MainDashboardButton","store","editPostStore","DocumentTitle","Header","setEntitiesSavedStatesCallback","isLargeViewport","hasActiveMetaboxes","isPublishSidebarOpened","isSaving","showIconLabels","isDistractionFreeMode","select","hasMetaBoxes","isSavingMetaBoxes","isFeatureActive","isDistractionFree","slideY","hidden","y","hover","transition","type","delay","slideX","x","undefined"],"mappings":";;AAAA;AACA;AACA;AAC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S,EAAC;AAAf,KACC,cAAC,aAAD,OADD,CAND,CATD,EAmBC,cAAC,MAAD,CAAQ,GAAR;AACC,IAAA,QAAQ,EAAGN,MADZ;AAEC,IAAA,UAAU,EAAG;AAAEK,MAAAA,IAAI,EAAE,OAAR;AAAiBC,MAAAA,KAAK,EAAE;AAAxB,KAFd;AAGC,IAAA,SAAS,EAAC;AAHX,KAKG,CAAEf,sBAAF,IACD;AACA;AACA;AACA;AACA;AACA,gBAAC,cAAD;AACC,IAAA,YAAY,EAAGD,kBADhB;AAEC,IAAA,aAAa,EAAGE,QAFjB;AAGC,IAAA,cAAc,EAAGC;AAHlB,IAXF,EAiBC,cAAC,QAAD,OAjBD,EAkBC,cAAC,aAAD,OAlBD,EAmBC,cAAC,iBAAD;AACC,IAAA,mBAAmB,EAAGH,kBADvB;AAEC,IAAA,gBAAgB,EAAGE,QAAQ,GAAG,IAAH,GAAUiB;AAFtC,IAnBD,EAuBC,cAAC,yBAAD;AACC,IAAA,YAAY,EAAGnB,kBADhB;AAEC,IAAA,aAAa,EAAGE,QAFjB;AAGC,IAAA,8BAA8B,EAC7BJ;AAJF,IAvBD,EA8BG,CAAEC,eAAe,IAAI,CAAEI,cAAvB,KACD,8BACC,cAAC,WAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IADD,EAEC,cAAC,QAAD;AAAU,IAAA,cAAc,EAAGA;AAA3B,IAFD,CA/BF,EAoCGA,cAAc,IAAI,CAAEJ,eAApB,IACD,cAAC,QAAD;AAAU,IAAA,cAAc,EAAGI;AAA3B,IArCF,CAnBD,CADD;AA8DA;;AAED,eAAeN,MAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostSavedState, PostPreviewButton } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport { default as DevicePreview } from '../device-preview';\nimport ViewLink from '../view-link';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport DocumentTitle from './document-title';\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\tconst {\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tisSaving,\n\t\tshowIconLabels,\n\t\tisDistractionFreeMode,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\tisSaving: select( editPostStore ).isSavingMetaBoxes(),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\tisDistractionFreeMode:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'distractionFree' ),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst isDistractionFree = isDistractionFreeMode && isLargeViewport;\n\n\tconst slideY = {\n\t\thidden: isDistractionFree ? { y: '-50' } : { y: 0 },\n\t\thover: { y: 0, transition: { type: 'tween', delay: 0.2 } },\n\t};\n\n\tconst slideX = {\n\t\thidden: isDistractionFree ? { x: '-100%' } : { x: 0 },\n\t\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n\t};\n\n\treturn (\n\t\t<div className=\"edit-post-header\">\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<motion.div\n\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t>\n\t\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t\t</motion.div>\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__toolbar\"\n\t\t\t>\n\t\t\t\t<HeaderToolbar />\n\t\t\t\t<div className=\"edit-post-header__document-title\">\n\t\t\t\t\t<DocumentTitle />\n\t\t\t\t</div>\n\t\t\t</motion.div>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideY }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\tclassName=\"edit-post-header__settings\"\n\t\t\t>\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<ViewLink />\n\t\t\t\t<DevicePreview />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t\tforcePreviewLink={ isSaving ? null : undefined }\n\t\t\t\t/>\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isLargeViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t) }\n\t\t\t</motion.div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"]}
@@ -11,10 +11,9 @@ const {
11
11
  } = createSlotFill(slotName);
12
12
  const MainDashboardButton = Fill;
13
13
 
14
- const Slot = _ref => {
15
- let {
16
- children
17
- } = _ref;
14
+ const Slot = ({
15
+ children
16
+ }) => {
18
17
  const fills = useSlotFills(slotName);
19
18
  const hasFills = Boolean(fills && fills.length);
20
19
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/main-dashboard-button/index.js"],"names":["__experimentalUseSlotFills","useSlotFills","createSlotFill","slotName","Fill","Slot","MainDashboardButtonSlot","MainDashboardButton","children","fills","hasFills","Boolean","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,0BAA0B,IAAIC,YAD/B,EAECC,cAFD,QAGO,uBAHP;AAKA,MAAMC,QAAQ,GAAG,mCAAjB;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAI,EAAEC;AAAd,IAA0CJ,cAAc,CAAEC,QAAF,CAA9D;AAEA,MAAMI,mBAAmB,GAAGH,IAA5B;;AAEA,MAAMC,IAAI,GAAG,QAAoB;AAAA,MAAlB;AAAEG,IAAAA;AAAF,GAAkB;AAChC,QAAMC,KAAK,GAAGR,YAAY,CAAEE,QAAF,CAA1B;AACA,QAAMO,QAAQ,GAAGC,OAAO,CAAEF,KAAK,IAAIA,KAAK,CAACG,MAAjB,CAAxB;;AAEA,MAAK,CAAEF,QAAP,EAAkB;AACjB,WAAOF,QAAP;AACA;;AAED,SAAO,cAAC,uBAAD;AAAyB,IAAA,gBAAgB;AAAzC,IAAP;AACA,CATD;;AAWAD,mBAAmB,CAACF,IAApB,GAA2BA,IAA3B;AAEA,eAAeE,mBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseSlotFills as useSlotFills,\n\tcreateSlotFill,\n} from '@wordpress/components';\n\nconst slotName = '__experimentalMainDashboardButton';\n\nconst { Fill, Slot: MainDashboardButtonSlot } = createSlotFill( slotName );\n\nconst MainDashboardButton = Fill;\n\nconst Slot = ( { children } ) => {\n\tconst fills = useSlotFills( slotName );\n\tconst hasFills = Boolean( fills && fills.length );\n\n\tif ( ! hasFills ) {\n\t\treturn children;\n\t}\n\n\treturn <MainDashboardButtonSlot bubblesVirtually />;\n};\n\nMainDashboardButton.Slot = Slot;\n\nexport default MainDashboardButton;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/main-dashboard-button/index.js"],"names":["__experimentalUseSlotFills","useSlotFills","createSlotFill","slotName","Fill","Slot","MainDashboardButtonSlot","MainDashboardButton","children","fills","hasFills","Boolean","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,0BAA0B,IAAIC,YAD/B,EAECC,cAFD,QAGO,uBAHP;AAKA,MAAMC,QAAQ,GAAG,mCAAjB;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA,IAAI,EAAEC;AAAd,IAA0CJ,cAAc,CAAEC,QAAF,CAA9D;AAEA,MAAMI,mBAAmB,GAAGH,IAA5B;;AAEA,MAAMC,IAAI,GAAG,CAAE;AAAEG,EAAAA;AAAF,CAAF,KAAoB;AAChC,QAAMC,KAAK,GAAGR,YAAY,CAAEE,QAAF,CAA1B;AACA,QAAMO,QAAQ,GAAGC,OAAO,CAAEF,KAAK,IAAIA,KAAK,CAACG,MAAjB,CAAxB;;AAEA,MAAK,CAAEF,QAAP,EAAkB;AACjB,WAAOF,QAAP;AACA;;AAED,SAAO,cAAC,uBAAD;AAAyB,IAAA,gBAAgB;AAAzC,IAAP;AACA,CATD;;AAWAD,mBAAmB,CAACF,IAApB,GAA2BA,IAA3B;AAEA,eAAeE,mBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseSlotFills as useSlotFills,\n\tcreateSlotFill,\n} from '@wordpress/components';\n\nconst slotName = '__experimentalMainDashboardButton';\n\nconst { Fill, Slot: MainDashboardButtonSlot } = createSlotFill( slotName );\n\nconst MainDashboardButton = Fill;\n\nconst Slot = ( { children } ) => {\n\tconst fills = useSlotFills( slotName );\n\tconst hasFills = Boolean( fills && fills.length );\n\n\tif ( ! hasFills ) {\n\t\treturn children;\n\t}\n\n\treturn <MainDashboardButtonSlot bubblesVirtually />;\n};\n\nMainDashboardButton.Slot = Slot;\n\nexport default MainDashboardButton;\n"]}
@@ -16,10 +16,9 @@ import PreferencesMenuItem from '../preferences-menu-item';
16
16
  import ToolsMoreMenuGroup from '../tools-more-menu-group';
17
17
  import WritingMenu from '../writing-menu';
18
18
 
19
- const MoreMenu = _ref => {
20
- let {
21
- showIconLabels
22
- } = _ref;
19
+ const MoreMenu = ({
20
+ showIconLabels
21
+ }) => {
23
22
  const isLargeViewport = useViewportMatch('large');
24
23
  return createElement(MoreMenuDropdown, {
25
24
  toggleProps: {
@@ -28,26 +27,23 @@ const MoreMenu = _ref => {
28
27
  variant: 'tertiary'
29
28
  })
30
29
  }
31
- }, _ref2 => {
32
- let {
30
+ }, ({
31
+ onClose
32
+ }) => createElement(Fragment, null, showIconLabels && !isLargeViewport && createElement(PinnedItems.Slot, {
33
+ className: showIconLabels && 'show-icon-labels',
34
+ scope: "core/edit-post"
35
+ }), createElement(WritingMenu, null), createElement(ModeSwitcher, null), createElement(ActionItem.Slot, {
36
+ name: "core/edit-post/plugin-more-menu",
37
+ label: __('Plugins'),
38
+ as: MenuGroup,
39
+ fillProps: {
40
+ onClick: onClose
41
+ }
42
+ }), createElement(ToolsMoreMenuGroup.Slot, {
43
+ fillProps: {
33
44
  onClose
34
- } = _ref2;
35
- return createElement(Fragment, null, showIconLabels && !isLargeViewport && createElement(PinnedItems.Slot, {
36
- className: showIconLabels && 'show-icon-labels',
37
- scope: "core/edit-post"
38
- }), createElement(WritingMenu, null), createElement(ModeSwitcher, null), createElement(ActionItem.Slot, {
39
- name: "core/edit-post/plugin-more-menu",
40
- label: __('Plugins'),
41
- as: MenuGroup,
42
- fillProps: {
43
- onClick: onClose
44
- }
45
- }), createElement(ToolsMoreMenuGroup.Slot, {
46
- fillProps: {
47
- onClose
48
- }
49
- }), createElement(MenuGroup, null, createElement(PreferencesMenuItem, null)));
50
- });
45
+ }
46
+ }), createElement(MenuGroup, null, createElement(PreferencesMenuItem, null))));
51
47
  };
52
48
 
53
49
  export default MoreMenu;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"names":["__","MenuGroup","ActionItem","MoreMenuDropdown","PinnedItems","useViewportMatch","ModeSwitcher","PreferencesMenuItem","ToolsMoreMenuGroup","WritingMenu","MoreMenu","showIconLabels","isLargeViewport","showTooltip","variant","onClose","onClick"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SACCC,UADD,EAECC,gBAFD,EAGCC,WAHD,QAIO,sBAJP;AAKA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,kBAAP,MAA+B,0BAA/B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;;AAEA,MAAMC,QAAQ,GAAG,QAA0B;AAAA,MAAxB;AAAEC,IAAAA;AAAF,GAAwB;AAC1C,QAAMC,eAAe,GAAGP,gBAAgB,CAAE,OAAF,CAAxC;AAEA,SACC,cAAC,gBAAD;AACC,IAAA,WAAW,EAAG;AACbQ,MAAAA,WAAW,EAAE,CAAEF,cADF;AAEb,UAAKA,cAAc,IAAI;AAAEG,QAAAA,OAAO,EAAE;AAAX,OAAvB;AAFa;AADf,KAMG;AAAA,QAAE;AAAEC,MAAAA;AAAF,KAAF;AAAA,WACD,8BACGJ,cAAc,IAAI,CAAEC,eAApB,IACD,cAAC,WAAD,CAAa,IAAb;AACC,MAAA,SAAS,EAAGD,cAAc,IAAI,kBAD/B;AAEC,MAAA,KAAK,EAAC;AAFP,MAFF,EAOC,cAAC,WAAD,OAPD,EAQC,cAAC,YAAD,OARD,EASC,cAAC,UAAD,CAAY,IAAZ;AACC,MAAA,IAAI,EAAC,iCADN;AAEC,MAAA,KAAK,EAAGX,EAAE,CAAE,SAAF,CAFX;AAGC,MAAA,EAAE,EAAGC,SAHN;AAIC,MAAA,SAAS,EAAG;AAAEe,QAAAA,OAAO,EAAED;AAAX;AAJb,MATD,EAeC,cAAC,kBAAD,CAAoB,IAApB;AAAyB,MAAA,SAAS,EAAG;AAAEA,QAAAA;AAAF;AAArC,MAfD,EAgBC,cAAC,SAAD,QACC,cAAC,mBAAD,OADD,CAhBD,CADC;AAAA,GANH,CADD;AA+BA,CAlCD;;AAoCA,eAAeL,QAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuGroup } from '@wordpress/components';\nimport {\n\tActionItem,\n\tMoreMenuDropdown,\n\tPinnedItems,\n} from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport ModeSwitcher from '../mode-switcher';\nimport PreferencesMenuItem from '../preferences-menu-item';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport WritingMenu from '../writing-menu';\n\nconst MoreMenu = ( { showIconLabels } ) => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<MoreMenuDropdown\n\t\t\ttoggleProps={ {\n\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\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</MoreMenuDropdown>\n\t);\n};\n\nexport default MoreMenu;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/more-menu/index.js"],"names":["__","MenuGroup","ActionItem","MoreMenuDropdown","PinnedItems","useViewportMatch","ModeSwitcher","PreferencesMenuItem","ToolsMoreMenuGroup","WritingMenu","MoreMenu","showIconLabels","isLargeViewport","showTooltip","variant","onClose","onClick"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SACCC,UADD,EAECC,gBAFD,EAGCC,WAHD,QAIO,sBAJP;AAKA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,kBAAP,MAA+B,0BAA/B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;;AAEA,MAAMC,QAAQ,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAA0B;AAC1C,QAAMC,eAAe,GAAGP,gBAAgB,CAAE,OAAF,CAAxC;AAEA,SACC,cAAC,gBAAD;AACC,IAAA,WAAW,EAAG;AACbQ,MAAAA,WAAW,EAAE,CAAEF,cADF;AAEb,UAAKA,cAAc,IAAI;AAAEG,QAAAA,OAAO,EAAE;AAAX,OAAvB;AAFa;AADf,KAMG,CAAE;AAAEC,IAAAA;AAAF,GAAF,KACD,8BACGJ,cAAc,IAAI,CAAEC,eAApB,IACD,cAAC,WAAD,CAAa,IAAb;AACC,IAAA,SAAS,EAAGD,cAAc,IAAI,kBAD/B;AAEC,IAAA,KAAK,EAAC;AAFP,IAFF,EAOC,cAAC,WAAD,OAPD,EAQC,cAAC,YAAD,OARD,EASC,cAAC,UAAD,CAAY,IAAZ;AACC,IAAA,IAAI,EAAC,iCADN;AAEC,IAAA,KAAK,EAAGX,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,EAAE,EAAGC,SAHN;AAIC,IAAA,SAAS,EAAG;AAAEe,MAAAA,OAAO,EAAED;AAAX;AAJb,IATD,EAeC,cAAC,kBAAD,CAAoB,IAApB;AAAyB,IAAA,SAAS,EAAG;AAAEA,MAAAA;AAAF;AAArC,IAfD,EAgBC,cAAC,SAAD,QACC,cAAC,mBAAD,OADD,CAhBD,CAPF,CADD;AA+BA,CAlCD;;AAoCA,eAAeL,QAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuGroup } from '@wordpress/components';\nimport {\n\tActionItem,\n\tMoreMenuDropdown,\n\tPinnedItems,\n} from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport ModeSwitcher from '../mode-switcher';\nimport PreferencesMenuItem from '../preferences-menu-item';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport WritingMenu from '../writing-menu';\n\nconst MoreMenu = ( { showIconLabels } ) => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<MoreMenuDropdown\n\t\t\ttoggleProps={ {\n\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\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</MoreMenuDropdown>\n\t);\n};\n\nexport default MoreMenu;\n"]}
@@ -11,20 +11,19 @@ import { PostPublishButton, store as editorStore } from '@wordpress/editor';
11
11
  */
12
12
 
13
13
  import { store as editPostStore } from '../../store';
14
- export function PostPublishButtonOrToggle(_ref) {
15
- let {
16
- forceIsDirty,
17
- forceIsSaving,
18
- hasPublishAction,
19
- isBeingScheduled,
20
- isPending,
21
- isPublished,
22
- isPublishSidebarEnabled,
23
- isPublishSidebarOpened,
24
- isScheduled,
25
- togglePublishSidebar,
26
- setEntitiesSavedStatesCallback
27
- } = _ref;
14
+ export function PostPublishButtonOrToggle({
15
+ forceIsDirty,
16
+ forceIsSaving,
17
+ hasPublishAction,
18
+ isBeingScheduled,
19
+ isPending,
20
+ isPublished,
21
+ isPublishSidebarEnabled,
22
+ isPublishSidebarOpened,
23
+ isScheduled,
24
+ togglePublishSidebar,
25
+ setEntitiesSavedStatesCallback
26
+ }) {
28
27
  const IS_TOGGLE = 'toggle';
29
28
  const IS_BUTTON = 'button';
30
29
  const isSmallerThanMediumViewport = useViewportMatch('medium', '<');
@@ -72,10 +71,10 @@ export function PostPublishButtonOrToggle(_ref) {
72
71
  });
73
72
  }
74
73
  export default compose(withSelect(select => {
75
- var _select$getCurrentPos, _select$getCurrentPos2, _select$getCurrentPos3;
74
+ var _select$getCurrentPos;
76
75
 
77
76
  return {
78
- hasPublishAction: (_select$getCurrentPos = (_select$getCurrentPos2 = select(editorStore).getCurrentPost()) === null || _select$getCurrentPos2 === void 0 ? void 0 : (_select$getCurrentPos3 = _select$getCurrentPos2._links) === null || _select$getCurrentPos3 === void 0 ? void 0 : _select$getCurrentPos3['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false,
77
+ hasPublishAction: (_select$getCurrentPos = select(editorStore).getCurrentPost()?._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false,
79
78
  isBeingScheduled: select(editorStore).isEditedPostBeingScheduled(),
80
79
  isPending: select(editorStore).isCurrentPostPending(),
81
80
  isPublished: select(editorStore).isCurrentPostPublished(),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"names":["useViewportMatch","compose","withDispatch","withSelect","PostPublishButton","store","editorStore","editPostStore","PostPublishButtonOrToggle","forceIsDirty","forceIsSaving","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","select","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","dispatch"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,gBAAT,E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HV;AAIC,IAAA,QAAQ,EAAGO,SAAS,KAAKH,SAJ1B;AAKC,IAAA,QAAQ,EAAGF,oBALZ;AAMC,IAAA,8BAA8B,EAAGC;AANlC,IADD;AAUA;AAED,eAAelB,OAAO,CACrBE,UAAU,CAAIqB,MAAF;AAAA;;AAAA,SAAgB;AAC3Bb,IAAAA,gBAAgB,qDACfa,MAAM,CAAElB,WAAF,CAAN,CAAsBmB,cAAtB,EADe,qFACf,uBAAwCC,MADzB,2DACf,uBACC,mBADD,CADe,yEAGV,KAJqB;AAK3Bd,IAAAA,gBAAgB,EAAEY,MAAM,CAAElB,WAAF,CAAN,CAAsBqB,0BAAtB,EALS;AAM3Bd,IAAAA,SAAS,EAAEW,MAAM,CAAElB,WAAF,CAAN,CAAsBsB,oBAAtB,EANgB;AAO3Bd,IAAAA,WAAW,EAAEU,MAAM,CAAElB,WAAF,CAAN,CAAsBuB,sBAAtB,EAPc;AAQ3Bd,IAAAA,uBAAuB,EACtBS,MAAM,CAAElB,WAAF,CAAN,CAAsBS,uBAAtB,EAT0B;AAU3BC,IAAAA,sBAAsB,EACrBQ,MAAM,CAAEjB,aAAF,CAAN,CAAwBS,sBAAxB,EAX0B;AAY3BC,IAAAA,WAAW,EAAEO,MAAM,CAAElB,WAAF,CAAN,CAAsBwB,sBAAtB;AAZc,GAAhB;AAAA,CAAF,CADW,EAerB5B,YAAY,CAAI6B,QAAF,IAAgB;AAC7B,QAAM;AAAEb,IAAAA;AAAF,MAA2Ba,QAAQ,CAAExB,aAAF,CAAzC;AACA,SAAO;AACNW,IAAAA;AADM,GAAP;AAGA,CALW,CAfS,CAAP,CAqBZV,yBArBY,CAAf","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\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\tforceIsSaving,\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\tforceIsSaving={ forceIsSaving }\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:\n\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editPostStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"names":["useViewportMatch","compose","withDispatch","withSelect","PostPublishButton","store","editorStore","editPostStore","PostPublishButtonOrToggle","forceIsDirty","forceIsSaving","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","select","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","dispatch"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,gBAAT,EAA2BC,OAA3B,QAA0C,oBAA1C;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,iBAAT,EAA4BC,KAAK,IAAIC,WAArC,QAAwD,mBAAxD;AAEA;AACA;AACA;;AACA,SAASD,KAA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AA;;AAAA,SAAgB;AAC3Bb,IAAAA,gBAAgB,2BACfa,MAAM,CAAElB,WAAF,CAAN,CAAsBmB,cAAtB,IAAwCC,MAAxC,GACC,mBADD,CADe,yEAGV,KAJqB;AAK3Bd,IAAAA,gBAAgB,EAAEY,MAAM,CAAElB,WAAF,CAAN,CAAsBqB,0BAAtB,EALS;AAM3Bd,IAAAA,SAAS,EAAEW,MAAM,CAAElB,WAAF,CAAN,CAAsBsB,oBAAtB,EANgB;AAO3Bd,IAAAA,WAAW,EAAEU,MAAM,CAAElB,WAAF,CAAN,CAAsBuB,sBAAtB,EAPc;AAQ3Bd,IAAAA,uBAAuB,EACtBS,MAAM,CAAElB,WAAF,CAAN,CAAsBS,uBAAtB,EAT0B;AAU3BC,IAAAA,sBAAsB,EACrBQ,MAAM,CAAEjB,aAAF,CAAN,CAAwBS,sBAAxB,EAX0B;AAY3BC,IAAAA,WAAW,EAAEO,MAAM,CAAElB,WAAF,CAAN,CAAsBwB,sBAAtB;AAZc,GAAhB;AAAA,CAAF,CADW,EAerB5B,YAAY,CAAI6B,QAAF,IAAgB;AAC7B,QAAM;AAAEb,IAAAA;AAAF,MAA2Ba,QAAQ,CAAExB,aAAF,CAAzC;AACA,SAAO;AACNW,IAAAA;AADM,GAAP;AAGA,CALW,CAfS,CAAP,CAqBZV,yBArBY,CAAf","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\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\tforceIsSaving,\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\tforceIsSaving={ forceIsSaving }\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:\n\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editPostStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"]}
@@ -10,16 +10,13 @@ const {
10
10
  Slot
11
11
  } = createSlotFill('ToolsMoreMenuGroup');
12
12
 
13
- ToolsMoreMenuGroup.Slot = _ref => {
14
- let {
15
- fillProps
16
- } = _ref;
17
- return createElement(Slot, {
18
- fillProps: fillProps
19
- }, fills => fills.length > 0 && createElement(MenuGroup, {
20
- label: __('Tools')
21
- }, fills));
22
- };
13
+ ToolsMoreMenuGroup.Slot = ({
14
+ fillProps
15
+ }) => createElement(Slot, {
16
+ fillProps: fillProps
17
+ }, fills => fills.length > 0 && createElement(MenuGroup, {
18
+ label: __('Tools')
19
+ }, fills));
23
20
 
24
21
  export default ToolsMoreMenuGroup;
25
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"names":["createSlotFill","MenuGroup","__","Fill","ToolsMoreMenuGroup","Slot","fillProps","fills","length"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,SAAzB,QAA0C,uBAA1C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IACLL,cAAc,CAAE,oBAAF,CADf;;AAGAI,kBAAkB,CAACC,IAAnB,GAA0B;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACzB,cAAC,IAAD;AAAM,IAAA,SAAS,EAAGA;AAAlB,KACKC,KAAF,IACDA,KAAK,CAACC,MAAN,GAAe,CAAf,IACC,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGN,EAAE,CAAE,OAAF;AAArB,KAAqCK,KAArC,CAHH,CADyB;AAAA,CAA1B;;AAUA,eAAeH,kBAAf","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"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"names":["createSlotFill","MenuGroup","__","Fill","ToolsMoreMenuGroup","Slot","fillProps","fills","length"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,SAAzB,QAA0C,uBAA1C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IACLL,cAAc,CAAE,oBAAF,CADf;;AAGAI,kBAAkB,CAACC,IAAnB,GAA0B,CAAE;AAAEC,EAAAA;AAAF,CAAF,KACzB,cAAC,IAAD;AAAM,EAAA,SAAS,EAAGA;AAAlB,GACKC,KAAF,IACDA,KAAK,CAACC,MAAN,GAAe,CAAf,IACC,cAAC,SAAD;AAAW,EAAA,KAAK,EAAGN,EAAE,CAAE,OAAF;AAArB,GAAqCK,KAArC,CAHH,CADD;;AAUA,eAAeH,kBAAf","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"]}
@@ -11,10 +11,9 @@ import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
11
11
 
12
12
  import Shortcut from './shortcut';
13
13
 
14
- function DynamicShortcut(_ref) {
15
- let {
16
- name
17
- } = _ref;
14
+ function DynamicShortcut({
15
+ name
16
+ }) {
18
17
  const {
19
18
  keyCombination,
20
19
  description,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"names":["useSelect","store","keyboardShortcutsStore","Shortcut","DynamicShortcut","name","keyCombination","description","aliases","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,sBAAlB,QAAgD,+BAAhD;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,YAArB;;AAEA,SAASC,eAAT,OAAqC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACpC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,WAAlB;AAA+BC,IAAAA;AAA/B,MAA2CR,SAAS,CACvDS,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,yBADK;AAELC,MAAAA,sBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEP,sBAAF,CAJV;AAMA,WAAO;AACNI,MAAAA,cAAc,EAAEI,yBAAyB,CAAEL,IAAF,CADnC;AAENG,MAAAA,OAAO,EAAEI,kBAAkB,CAAEP,IAAF,CAFrB;AAGNE,MAAAA,WAAW,EAAEI,sBAAsB,CAAEN,IAAF;AAH7B,KAAP;AAKA,GAbwD,EAczD,CAAEA,IAAF,CAdyD,CAA1D;;AAiBA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,QAAD;AACC,IAAA,cAAc,EAAGA,cADlB;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,OAAO,EAAGC;AAHX,IADD;AAOA;;AAED,eAAeJ,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from './shortcut';\n\nfunction DynamicShortcut( { name } ) {\n\tconst { keyCombination, description, aliases } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetShortcutKeyCombination,\n\t\t\t\tgetShortcutDescription,\n\t\t\t\tgetShortcutAliases,\n\t\t\t} = select( keyboardShortcutsStore );\n\n\t\t\treturn {\n\t\t\t\tkeyCombination: getShortcutKeyCombination( name ),\n\t\t\t\taliases: getShortcutAliases( name ),\n\t\t\t\tdescription: getShortcutDescription( name ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\n\tif ( ! keyCombination ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Shortcut\n\t\t\tkeyCombination={ keyCombination }\n\t\t\tdescription={ description }\n\t\t\taliases={ aliases }\n\t\t/>\n\t);\n}\n\nexport default DynamicShortcut;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"names":["useSelect","store","keyboardShortcutsStore","Shortcut","DynamicShortcut","name","keyCombination","description","aliases","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,sBAAlB,QAAgD,+BAAhD;AAEA;AACA;AACA;;AACA,OAAOC,QAAP,MAAqB,YAArB;;AAEA,SAASC,eAAT,CAA0B;AAAEC,EAAAA;AAAF,CAA1B,EAAqC;AACpC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,WAAlB;AAA+BC,IAAAA;AAA/B,MAA2CR,SAAS,CACvDS,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,yBADK;AAELC,MAAAA,sBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEP,sBAAF,CAJV;AAMA,WAAO;AACNI,MAAAA,cAAc,EAAEI,yBAAyB,CAAEL,IAAF,CADnC;AAENG,MAAAA,OAAO,EAAEI,kBAAkB,CAAEP,IAAF,CAFrB;AAGNE,MAAAA,WAAW,EAAEI,sBAAsB,CAAEN,IAAF;AAH7B,KAAP;AAKA,GAbwD,EAczD,CAAEA,IAAF,CAdyD,CAA1D;;AAiBA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,QAAD;AACC,IAAA,cAAc,EAAGA,cADlB;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,OAAO,EAAGC;AAHX,IADD;AAOA;;AAED,eAAeJ,eAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from './shortcut';\n\nfunction DynamicShortcut( { name } ) {\n\tconst { keyCombination, description, aliases } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetShortcutKeyCombination,\n\t\t\t\tgetShortcutDescription,\n\t\t\t\tgetShortcutAliases,\n\t\t\t} = select( keyboardShortcutsStore );\n\n\t\t\treturn {\n\t\t\t\tkeyCombination: getShortcutKeyCombination( name ),\n\t\t\t\taliases: getShortcutAliases( name ),\n\t\t\t\tdescription: getShortcutDescription( name ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\n\tif ( ! keyCombination ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Shortcut\n\t\t\tkeyCombination={ keyCombination }\n\t\t\tdescription={ description }\n\t\t\taliases={ aliases }\n\t\t/>\n\t);\n}\n\nexport default DynamicShortcut;\n"]}