@wordpress/edit-post 7.10.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 (298) hide show
  1. package/CHANGELOG.md +4 -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.js +4 -3
  19. package/build/components/header/header-toolbar/index.js.map +1 -1
  20. package/build/components/header/header-toolbar/index.native.js +12 -13
  21. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  22. package/build/components/header/index.js +7 -6
  23. package/build/components/header/index.js.map +1 -1
  24. package/build/components/header/main-dashboard-button/index.js +3 -4
  25. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  26. package/build/components/header/more-menu/index.js +19 -23
  27. package/build/components/header/more-menu/index.js.map +1 -1
  28. package/build/components/header/post-publish-button-or-toggle.js +15 -16
  29. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  30. package/build/components/header/tools-more-menu-group/index.js +7 -10
  31. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  32. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  33. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  34. package/build/components/keyboard-shortcut-help-modal/index.js +44 -54
  35. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  36. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  37. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  38. package/build/components/layout/actions-panel.js +5 -6
  39. package/build/components/layout/actions-panel.js.map +1 -1
  40. package/build/components/layout/index.js +3 -4
  41. package/build/components/layout/index.js.map +1 -1
  42. package/build/components/layout/index.native.js +3 -7
  43. package/build/components/layout/index.native.js.map +1 -1
  44. package/build/components/meta-boxes/index.js +9 -13
  45. package/build/components/meta-boxes/index.js.map +1 -1
  46. package/build/components/meta-boxes/meta-box-visibility.js +5 -8
  47. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  48. package/build/components/meta-boxes/meta-boxes-area/index.js +3 -4
  49. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  50. package/build/components/preferences-modal/meta-boxes-section.js +16 -23
  51. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  52. package/build/components/preferences-modal/options/enable-custom-fields.js +7 -9
  53. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  54. package/build/components/preferences-modal/options/enable-feature.js +12 -16
  55. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  56. package/build/components/preferences-modal/options/enable-panel.js +10 -17
  57. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  58. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  59. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  60. package/build/components/secondary-sidebar/list-view-sidebar.js +58 -44
  61. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  62. package/build/components/sidebar/discussion-panel/index.js +5 -7
  63. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  64. package/build/components/sidebar/featured-image/index.js +9 -17
  65. package/build/components/sidebar/featured-image/index.js.map +1 -1
  66. package/build/components/sidebar/page-attributes/index.js +3 -9
  67. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  68. package/build/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  69. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  70. package/build/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  71. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  72. package/build/components/sidebar/plugin-post-status-info/index.js +6 -9
  73. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  74. package/build/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  75. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  76. package/build/components/sidebar/plugin-sidebar/index.js +4 -5
  77. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  78. package/build/components/sidebar/post-excerpt/index.js +5 -7
  79. package/build/components/sidebar/post-excerpt/index.js.map +1 -1
  80. package/build/components/sidebar/post-schedule/index.js +16 -23
  81. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  82. package/build/components/sidebar/post-status/index.js +7 -11
  83. package/build/components/sidebar/post-status/index.js.map +1 -1
  84. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  85. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  86. package/build/components/sidebar/post-template/create-modal.js +3 -4
  87. package/build/components/sidebar/post-template/create-modal.js.map +1 -1
  88. package/build/components/sidebar/post-template/form.js +13 -20
  89. package/build/components/sidebar/post-template/form.js.map +1 -1
  90. package/build/components/sidebar/post-template/index.js +18 -25
  91. package/build/components/sidebar/post-template/index.js.map +1 -1
  92. package/build/components/sidebar/post-url/index.js +16 -23
  93. package/build/components/sidebar/post-url/index.js.map +1 -1
  94. package/build/components/sidebar/post-visibility/index.js +26 -36
  95. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  96. package/build/components/sidebar/settings-header/index.js +3 -4
  97. package/build/components/sidebar/settings-header/index.js.map +1 -1
  98. package/build/components/sidebar/template-summary/index.js +1 -1
  99. package/build/components/sidebar/template-summary/index.js.map +1 -1
  100. package/build/components/start-page-options/index.js +3 -4
  101. package/build/components/start-page-options/index.js.map +1 -1
  102. package/build/components/view-link/index.js +1 -1
  103. package/build/components/view-link/index.js.map +1 -1
  104. package/build/components/visual-editor/block-inspector-button.js +4 -5
  105. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  106. package/build/components/visual-editor/header.native.js +6 -7
  107. package/build/components/visual-editor/header.native.js.map +1 -1
  108. package/build/components/visual-editor/index.js +32 -48
  109. package/build/components/visual-editor/index.js.map +1 -1
  110. package/build/components/welcome-guide/image.js +4 -5
  111. package/build/components/welcome-guide/image.js.map +1 -1
  112. package/build/editor.js +15 -23
  113. package/build/editor.js.map +1 -1
  114. package/build/editor.native.js +3 -6
  115. package/build/editor.native.js.map +1 -1
  116. package/build/hooks/validate-multiple-use/index.js +18 -29
  117. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  118. package/build/index.js +2 -2
  119. package/build/index.js.map +1 -1
  120. package/build/plugins/index.js +20 -23
  121. package/build/plugins/index.js.map +1 -1
  122. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  123. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  124. package/build/store/actions.js +60 -88
  125. package/build/store/actions.js.map +1 -1
  126. package/build/store/reducer.js +11 -43
  127. package/build/store/reducer.js.map +1 -1
  128. package/build/store/selectors.js +11 -16
  129. package/build/store/selectors.js.map +1 -1
  130. package/build-module/components/block-manager/category.js +14 -22
  131. package/build-module/components/block-manager/category.js.map +1 -1
  132. package/build-module/components/block-manager/checklist.js +6 -13
  133. package/build-module/components/block-manager/checklist.js.map +1 -1
  134. package/build-module/components/block-manager/index.js +10 -14
  135. package/build-module/components/block-manager/index.js.map +1 -1
  136. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  137. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  138. package/build-module/components/device-preview/index.js +1 -1
  139. package/build-module/components/device-preview/index.js.map +1 -1
  140. package/build-module/components/editor-initialization/index.js +3 -4
  141. package/build-module/components/editor-initialization/index.js.map +1 -1
  142. package/build-module/components/header/document-title/index.js +88 -0
  143. package/build-module/components/header/document-title/index.js.map +1 -0
  144. package/build-module/components/header/fullscreen-mode-close/index.js +7 -8
  145. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  146. package/build-module/components/header/header-toolbar/index.js +3 -3
  147. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  148. package/build-module/components/header/header-toolbar/index.native.js +12 -13
  149. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  150. package/build-module/components/header/index.js +7 -6
  151. package/build-module/components/header/index.js.map +1 -1
  152. package/build-module/components/header/main-dashboard-button/index.js +3 -4
  153. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  154. package/build-module/components/header/more-menu/index.js +19 -23
  155. package/build-module/components/header/more-menu/index.js.map +1 -1
  156. package/build-module/components/header/post-publish-button-or-toggle.js +15 -16
  157. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  158. package/build-module/components/header/tools-more-menu-group/index.js +7 -10
  159. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  160. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  161. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  162. package/build-module/components/keyboard-shortcut-help-modal/index.js +42 -52
  163. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  164. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  165. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  166. package/build-module/components/layout/actions-panel.js +5 -6
  167. package/build-module/components/layout/actions-panel.js.map +1 -1
  168. package/build-module/components/layout/index.js +3 -4
  169. package/build-module/components/layout/index.js.map +1 -1
  170. package/build-module/components/layout/index.native.js +3 -7
  171. package/build-module/components/layout/index.native.js.map +1 -1
  172. package/build-module/components/meta-boxes/index.js +9 -13
  173. package/build-module/components/meta-boxes/index.js.map +1 -1
  174. package/build-module/components/meta-boxes/meta-box-visibility.js +5 -8
  175. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  176. package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -4
  177. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  178. package/build-module/components/preferences-modal/meta-boxes-section.js +16 -23
  179. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  180. package/build-module/components/preferences-modal/options/enable-custom-fields.js +7 -9
  181. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  182. package/build-module/components/preferences-modal/options/enable-feature.js +12 -16
  183. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  184. package/build-module/components/preferences-modal/options/enable-panel.js +10 -17
  185. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  186. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  187. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  188. package/build-module/components/secondary-sidebar/list-view-sidebar.js +58 -44
  189. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  190. package/build-module/components/sidebar/discussion-panel/index.js +5 -7
  191. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  192. package/build-module/components/sidebar/featured-image/index.js +9 -17
  193. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  194. package/build-module/components/sidebar/page-attributes/index.js +3 -9
  195. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  196. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  197. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  198. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  199. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  200. package/build-module/components/sidebar/plugin-post-status-info/index.js +6 -9
  201. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  202. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  203. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  204. package/build-module/components/sidebar/plugin-sidebar/index.js +4 -5
  205. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-excerpt/index.js +5 -7
  207. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  208. package/build-module/components/sidebar/post-schedule/index.js +16 -23
  209. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  210. package/build-module/components/sidebar/post-status/index.js +7 -11
  211. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  212. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  213. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  214. package/build-module/components/sidebar/post-template/create-modal.js +3 -4
  215. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
  216. package/build-module/components/sidebar/post-template/form.js +13 -20
  217. package/build-module/components/sidebar/post-template/form.js.map +1 -1
  218. package/build-module/components/sidebar/post-template/index.js +18 -25
  219. package/build-module/components/sidebar/post-template/index.js.map +1 -1
  220. package/build-module/components/sidebar/post-url/index.js +16 -23
  221. package/build-module/components/sidebar/post-url/index.js.map +1 -1
  222. package/build-module/components/sidebar/post-visibility/index.js +26 -36
  223. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  224. package/build-module/components/sidebar/settings-header/index.js +3 -4
  225. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  226. package/build-module/components/sidebar/template-summary/index.js +1 -1
  227. package/build-module/components/sidebar/template-summary/index.js.map +1 -1
  228. package/build-module/components/start-page-options/index.js +3 -4
  229. package/build-module/components/start-page-options/index.js.map +1 -1
  230. package/build-module/components/view-link/index.js +1 -1
  231. package/build-module/components/view-link/index.js.map +1 -1
  232. package/build-module/components/visual-editor/block-inspector-button.js +4 -5
  233. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  234. package/build-module/components/visual-editor/header.native.js +6 -7
  235. package/build-module/components/visual-editor/header.native.js.map +1 -1
  236. package/build-module/components/visual-editor/index.js +35 -49
  237. package/build-module/components/visual-editor/index.js.map +1 -1
  238. package/build-module/components/welcome-guide/image.js +4 -5
  239. package/build-module/components/welcome-guide/image.js.map +1 -1
  240. package/build-module/editor.js +15 -23
  241. package/build-module/editor.js.map +1 -1
  242. package/build-module/editor.native.js +3 -6
  243. package/build-module/editor.native.js.map +1 -1
  244. package/build-module/hooks/validate-multiple-use/index.js +18 -29
  245. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  246. package/build-module/index.js +2 -2
  247. package/build-module/index.js.map +1 -1
  248. package/build-module/plugins/index.js +20 -23
  249. package/build-module/plugins/index.js.map +1 -1
  250. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  251. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  252. package/build-module/store/actions.js +60 -88
  253. package/build-module/store/actions.js.map +1 -1
  254. package/build-module/store/reducer.js +11 -43
  255. package/build-module/store/reducer.js.map +1 -1
  256. package/build-module/store/selectors.js +11 -16
  257. package/build-module/store/selectors.js.map +1 -1
  258. package/build-style/classic-rtl.css +1 -1
  259. package/build-style/classic.css +1 -1
  260. package/build-style/style-rtl.css +74 -114
  261. package/build-style/style.css +74 -114
  262. package/package.json +33 -33
  263. package/src/components/header/document-title/index.js +86 -0
  264. package/src/components/header/document-title/style.scss +61 -0
  265. package/src/components/header/header-toolbar/index.js +2 -2
  266. package/src/components/header/header-toolbar/style.scss +0 -1
  267. package/src/components/header/index.js +4 -2
  268. package/src/components/header/style.scss +6 -0
  269. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +1 -3
  270. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +2 -6
  271. package/src/components/secondary-sidebar/list-view-sidebar.js +68 -66
  272. package/src/components/secondary-sidebar/style.scss +28 -31
  273. package/src/components/visual-editor/index.js +10 -21
  274. package/src/components/visual-editor/style.scss +0 -13
  275. package/src/editor.js +1 -3
  276. package/src/index.js +3 -2
  277. package/src/style.scss +1 -1
  278. package/build/components/header/template-title/delete-template.js +0 -117
  279. package/build/components/header/template-title/delete-template.js.map +0 -1
  280. package/build/components/header/template-title/edit-template-title.js +0 -95
  281. package/build/components/header/template-title/edit-template-title.js.map +0 -1
  282. package/build/components/header/template-title/index.js +0 -124
  283. package/build/components/header/template-title/index.js.map +0 -1
  284. package/build/components/header/template-title/template-description.js +0 -55
  285. package/build/components/header/template-title/template-description.js.map +0 -1
  286. package/build-module/components/header/template-title/delete-template.js +0 -104
  287. package/build-module/components/header/template-title/delete-template.js.map +0 -1
  288. package/build-module/components/header/template-title/edit-template-title.js +0 -83
  289. package/build-module/components/header/template-title/edit-template-title.js.map +0 -1
  290. package/build-module/components/header/template-title/index.js +0 -105
  291. package/build-module/components/header/template-title/index.js.map +0 -1
  292. package/build-module/components/header/template-title/template-description.js +0 -45
  293. package/build-module/components/header/template-title/template-description.js.map +0 -1
  294. package/src/components/header/template-title/delete-template.js +0 -106
  295. package/src/components/header/template-title/edit-template-title.js +0 -78
  296. package/src/components/header/template-title/index.js +0 -115
  297. package/src/components/header/template-title/style.scss +0 -94
  298. package/src/components/header/template-title/template-description.js +0 -42
@@ -9,10 +9,9 @@ import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/
9
9
  */
10
10
 
11
11
  import { store as editPostStore } from '../../../store';
12
- export default compose(withSelect((select, _ref) => {
13
- let {
14
- panelName
15
- } = _ref;
12
+ export default compose(withSelect((select, {
13
+ panelName
14
+ }) => {
16
15
  const {
17
16
  isEditorPanelEnabled,
18
17
  isEditorPanelRemoved
@@ -21,17 +20,11 @@ export default compose(withSelect((select, _ref) => {
21
20
  isRemoved: isEditorPanelRemoved(panelName),
22
21
  isChecked: isEditorPanelEnabled(panelName)
23
22
  };
24
- }), ifCondition(_ref2 => {
25
- let {
26
- isRemoved
27
- } = _ref2;
28
- return !isRemoved;
29
- }), withDispatch((dispatch, _ref3) => {
30
- let {
31
- panelName
32
- } = _ref3;
33
- return {
34
- onChange: () => dispatch(editPostStore).toggleEditorPanelEnabled(panelName)
35
- };
36
- }))(BaseOption);
23
+ }), ifCondition(({
24
+ isRemoved
25
+ }) => !isRemoved), withDispatch((dispatch, {
26
+ panelName
27
+ }) => ({
28
+ onChange: () => dispatch(editPostStore).toggleEditorPanelEnabled(panelName)
29
+ })))(BaseOption);
37
30
  //# sourceMappingURL=enable-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-panel.js"],"names":["compose","ifCondition","withSelect","withDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","editPostStore","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,EAAkBC,WAAlB,QAAqC,oBAArC;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,qCAAqC,IAAIC,UAAlD,QAAoE,sBAApE;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA,eAAeP,OAAO,CACrBE,UAAU,CAAE,CAAEM,MAAF,WAA6B;AAAA,MAAnB;AAAEC,IAAAA;AAAF,GAAmB;AACxC,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MACLH,MAAM,CAAED,aAAF,CADP;AAEA,SAAO;AACNK,IAAAA,SAAS,EAAED,oBAAoB,CAAEF,SAAF,CADzB;AAENI,IAAAA,SAAS,EAAEH,oBAAoB,CAAED,SAAF;AAFzB,GAAP;AAIA,CAPS,CADW,EASrBR,WAAW,CAAE;AAAA,MAAE;AAAEW,IAAAA;AAAF,GAAF;AAAA,SAAqB,CAAEA,SAAvB;AAAA,CAAF,CATU,EAUrBT,YAAY,CAAE,CAAEW,QAAF;AAAA,MAAY;AAAEL,IAAAA;AAAF,GAAZ;AAAA,SAAiC;AAC9CM,IAAAA,QAAQ,EAAE,MACTD,QAAQ,CAAEP,aAAF,CAAR,CAA0BS,wBAA1B,CAAoDP,SAApD;AAF6C,GAAjC;AAAA,CAAF,CAVS,CAAP,CAcZJ,UAdY,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editPostStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( BaseOption );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-panel.js"],"names":["compose","ifCondition","withSelect","withDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","editPostStore","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,EAAkBC,WAAlB,QAAqC,oBAArC;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,qCAAqC,IAAIC,UAAlD,QAAoE,sBAApE;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA,eAAeP,OAAO,CACrBE,UAAU,CAAE,CAAEM,MAAF,EAAU;AAAEC,EAAAA;AAAF,CAAV,KAA6B;AACxC,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MACLH,MAAM,CAAED,aAAF,CADP;AAEA,SAAO;AACNK,IAAAA,SAAS,EAAED,oBAAoB,CAAEF,SAAF,CADzB;AAENI,IAAAA,SAAS,EAAEH,oBAAoB,CAAED,SAAF;AAFzB,GAAP;AAIA,CAPS,CADW,EASrBR,WAAW,CAAE,CAAE;AAAEW,EAAAA;AAAF,CAAF,KAAqB,CAAEA,SAAzB,CATU,EAUrBT,YAAY,CAAE,CAAEW,QAAF,EAAY;AAAEL,EAAAA;AAAF,CAAZ,MAAiC;AAC9CM,EAAAA,QAAQ,EAAE,MACTD,QAAQ,CAAEP,aAAF,CAAR,CAA0BS,wBAA1B,CAAoDP,SAApD;AAF6C,CAAjC,CAAF,CAVS,CAAP,CAcZJ,UAdY,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editPostStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( BaseOption );\n"]}
@@ -14,16 +14,13 @@ const {
14
14
  Slot
15
15
  } = createSlotFill('EnablePluginDocumentSettingPanelOption');
16
16
 
17
- const EnablePluginDocumentSettingPanelOption = _ref => {
18
- let {
19
- label,
20
- panelName
21
- } = _ref;
22
- return createElement(Fill, null, createElement(EnablePanelOption, {
23
- label: label,
24
- panelName: panelName
25
- }));
26
- };
17
+ const EnablePluginDocumentSettingPanelOption = ({
18
+ label,
19
+ panelName
20
+ }) => createElement(Fill, null, createElement(EnablePanelOption, {
21
+ label: label,
22
+ panelName: panelName
23
+ }));
27
24
 
28
25
  EnablePluginDocumentSettingPanelOption.Slot = Slot;
29
26
  export default EnablePluginDocumentSettingPanelOption;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js"],"names":["createSlotFill","EnablePanelOption","Fill","Slot","EnablePluginDocumentSettingPanelOption","label","panelName"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,QAA+B,uBAA/B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,SAAlC;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiBH,cAAc,CACpC,wCADoC,CAArC;;AAIA,MAAMI,sCAAsC,GAAG;AAAA,MAAE;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAF;AAAA,SAC9C,cAAC,IAAD,QACC,cAAC,iBAAD;AAAmB,IAAA,KAAK,EAAGD,KAA3B;AAAmC,IAAA,SAAS,EAAGC;AAA/C,IADD,CAD8C;AAAA,CAA/C;;AAMAF,sCAAsC,CAACD,IAAvC,GAA8CA,IAA9C;AAEA,eAAeC,sCAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { EnablePanelOption } from './index';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js"],"names":["createSlotFill","EnablePanelOption","Fill","Slot","EnablePluginDocumentSettingPanelOption","label","panelName"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,cAAT,QAA+B,uBAA/B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,SAAlC;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiBH,cAAc,CACpC,wCADoC,CAArC;;AAIA,MAAMI,sCAAsC,GAAG,CAAE;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAF,KAC9C,cAAC,IAAD,QACC,cAAC,iBAAD;AAAmB,EAAA,KAAK,EAAGD,KAA3B;AAAmC,EAAA,SAAS,EAAGC;AAA/C,EADD,CADD;;AAMAF,sCAAsC,CAACD,IAAvC,GAA8CA,IAA9C;AAEA,eAAeC,sCAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { EnablePanelOption } from './index';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"]}
@@ -1,15 +1,10 @@
1
1
  import { createElement } from "@wordpress/element";
2
2
 
3
- /**
4
- * External dependencies
5
- */
6
- import classnames from 'classnames';
7
3
  /**
8
4
  * WordPress dependencies
9
5
  */
10
-
11
6
  import { __experimentalListView as ListView } from '@wordpress/block-editor';
12
- import { Button } from '@wordpress/components';
7
+ import { Button, TabPanel } from '@wordpress/components';
13
8
  import { useFocusOnMount, useFocusReturn, useMergeRefs } from '@wordpress/compose';
14
9
  import { useDispatch } from '@wordpress/data';
15
10
  import { focus } from '@wordpress/dom';
@@ -27,8 +22,10 @@ import ListViewOutline from './list-view-outline';
27
22
  export default function ListViewSidebar() {
28
23
  const {
29
24
  setIsListViewOpened
30
- } = useDispatch(editPostStore);
31
- const focusOnMountRef = useFocusOnMount('firstElement');
25
+ } = useDispatch(editPostStore); // This hook handles focus when the sidebar first renders.
26
+
27
+ const focusOnMountRef = useFocusOnMount('firstElement'); // The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.
28
+
32
29
  const headerFocusReturnRef = useFocusReturn();
33
30
  const contentFocusReturnRef = useFocusReturn();
34
31
 
@@ -37,17 +34,21 @@ export default function ListViewSidebar() {
37
34
  event.preventDefault();
38
35
  setIsListViewOpened(false);
39
36
  }
40
- }
37
+ } // Use internal state instead of a ref to make sure that the component
38
+ // re-renders when the dropZoneElement updates.
39
+
40
+
41
+ const [dropZoneElement, setDropZoneElement] = useState(null); // Tracks our current tab.
41
42
 
42
43
  const [tab, setTab] = useState('list-view'); // This ref refers to the sidebar as a whole.
43
44
 
44
- const sidebarRef = useRef(); // This ref refers to the list view tab button.
45
+ const sidebarRef = useRef(); // This ref refers to the tab panel.
45
46
 
46
- const listViewTabRef = useRef(); // This ref refers to the outline tab button.
47
+ const tabPanelRef = useRef(); // This ref refers to the list view application area.
47
48
 
48
- const outlineTabRef = useRef(); // This ref refers to the list view application area.
49
+ const listViewRef = useRef(); // Must merge the refs together so focus can be handled properly in the next function.
49
50
 
50
- const listViewRef = useRef();
51
+ const listViewContainerRef = useMergeRefs([contentFocusReturnRef, focusOnMountRef, listViewRef, setDropZoneElement]);
51
52
  /*
52
53
  * Callback function to handle list view or outline focus.
53
54
  *
@@ -57,14 +58,16 @@ export default function ListViewSidebar() {
57
58
  */
58
59
 
59
60
  function handleSidebarFocus(currentTab) {
60
- // List view tab is selected.
61
+ // Tab panel focus.
62
+ const tabPanelFocus = focus.tabbable.find(tabPanelRef.current)[0]; // List view tab is selected.
63
+
61
64
  if (currentTab === 'list-view') {
62
- // Either focus the list view or the list view tab button. Must have a fallback because the list view does not render when there are no blocks.
65
+ // Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.
63
66
  const listViewApplicationFocus = focus.tabbable.find(listViewRef.current)[0];
64
- const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : listViewTabRef.current;
67
+ const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : tabPanelFocus;
65
68
  listViewFocusArea.focus(); // Outline tab is selected.
66
69
  } else {
67
- outlineTabRef.current.focus();
70
+ tabPanelFocus.focus();
68
71
  }
69
72
  } // This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
70
73
 
@@ -77,42 +80,53 @@ export default function ListViewSidebar() {
77
80
  handleSidebarFocus(tab);
78
81
  }
79
82
  });
83
+ /**
84
+ * Render tab content for a given tab name.
85
+ *
86
+ * @param {string} tabName The name of the tab to render.
87
+ */
88
+
89
+ function renderTabContent(tabName) {
90
+ if (tabName === 'list-view') {
91
+ return createElement("div", {
92
+ className: "edit-post-editor__list-view-panel-content"
93
+ }, createElement(ListView, {
94
+ dropZoneElement: dropZoneElement
95
+ }));
96
+ }
97
+
98
+ return createElement(ListViewOutline, null);
99
+ }
100
+
80
101
  return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
81
102
  createElement("div", {
82
103
  className: "edit-post-editor__document-overview-panel",
83
104
  onKeyDown: closeOnEscape,
84
105
  ref: sidebarRef
85
- }, createElement("div", {
86
- className: "edit-post-editor__document-overview-panel-header components-panel__header edit-post-sidebar__panel-tabs",
87
- ref: headerFocusReturnRef
88
106
  }, createElement(Button, {
107
+ className: "edit-post-editor__document-overview-panel__close-button",
108
+ ref: headerFocusReturnRef,
89
109
  icon: closeSmall,
90
110
  label: __('Close'),
91
111
  onClick: () => setIsListViewOpened(false)
92
- }), createElement("ul", null, createElement("li", null, createElement(Button, {
93
- ref: listViewTabRef,
94
- onClick: () => {
95
- setTab('list-view');
96
- },
97
- className: classnames('edit-post-sidebar__panel-tab', {
98
- 'is-active': tab === 'list-view'
99
- }),
100
- "aria-current": tab === 'list-view'
101
- }, __('List View'))), createElement("li", null, createElement(Button, {
102
- ref: outlineTabRef,
103
- onClick: () => {
104
- setTab('outline');
105
- },
106
- className: classnames('edit-post-sidebar__panel-tab', {
107
- 'is-active': tab === 'outline'
108
- }),
109
- "aria-current": tab === 'outline'
110
- }, __('Outline'))))), createElement("div", {
111
- ref: useMergeRefs([contentFocusReturnRef, focusOnMountRef, listViewRef]),
112
- className: "edit-post-editor__list-view-container"
113
- }, tab === 'list-view' && createElement("div", {
114
- className: "edit-post-editor__list-view-panel-content"
115
- }, createElement(ListView, null)), tab === 'outline' && createElement(ListViewOutline, null)))
112
+ }), createElement(TabPanel, {
113
+ className: "edit-post-editor__document-overview-panel__tab-panel",
114
+ ref: tabPanelRef,
115
+ onSelect: tabName => setTab(tabName),
116
+ selectOnMove: false,
117
+ tabs: [{
118
+ name: 'list-view',
119
+ title: 'List View',
120
+ className: 'edit-post-sidebar__panel-tab'
121
+ }, {
122
+ name: 'outline',
123
+ title: 'Outline',
124
+ className: 'edit-post-sidebar__panel-tab'
125
+ }]
126
+ }, currentTab => createElement("div", {
127
+ className: "edit-post-editor__list-view-container",
128
+ ref: listViewContainerRef
129
+ }, renderTabContent(currentTab.name))))
116
130
  );
117
131
  }
118
132
  //# sourceMappingURL=list-view-sidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["classnames","__experimentalListView","ListView","Button","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","focus","useRef","useState","__","closeSmall","useShortcut","ESCAPE","store","editPostStore","ListViewOutline","ListViewSidebar","setIsListViewOpened","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","tab","setTab","sidebarRef","listViewTabRef","outlineTabRef","listViewRef","handleSidebarFocus","currentTab","listViewApplicationFocus","tabbable","find","current","listViewFocusArea","contains","ownerDocument","activeElement"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,sBAAsB,IAAIC,QAAnC,QAAmD,yBAAnD;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SACCC,eADD,EAECC,cAFD,EAGCC,YAHD,QAIO,oBAJP;AAKA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SAASC,MAAT,EAAiBC,QAAjB,QAAiC,oBAAjC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,WAAT,QAA4B,+BAA5B;AACA,SAASC,MAAT,QAAuB,qBAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AAEA,eAAe,SAASC,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0BZ,WAAW,CAAES,aAAF,CAA3C;AAEA,QAAMI,eAAe,GAAGhB,eAAe,CAAE,cAAF,CAAvC;AACA,QAAMiB,oBAAoB,GAAGhB,cAAc,EAA3C;AACA,QAAMiB,qBAAqB,GAAGjB,cAAc,EAA5C;;AAEA,WAASkB,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QAAKA,KAAK,CAACC,OAAN,KAAkBX,MAAlB,IAA4B,CAAEU,KAAK,CAACE,gBAAzC,EAA4D;AAC3DF,MAAAA,KAAK,CAACG,cAAN;AACAR,MAAAA,mBAAmB,CAAE,KAAF,CAAnB;AACA;AACD;;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EAAC,yGADX;AAEC,MAAA,GAAG,EAAGT;AAFP,OAIC,cAAC,MAAD;AACC,MAAA,IAAI,EAAGT,UADR;AAEC,MAAA,KAAK,EAAGD,EAAE,CAAE,OAAF,CAFX;AAGC,MAAA,OAAO,EAAG,MAAMQ,mBAAmB,CAAE,KAAF;AAHpC,MAJD,EASC,0BACC,0BACC,cAAC,MAAD;AACC,MAAA,GAAG,EAAGY,cADP;AAEC,MAAA,OAAO,EAAG,MAAM;AACfF,QAAAA,MAAM,CAAE,WAAF,CAAN;AACA,OAJF;AAKC,MAAA,SAAS,EAAG7B,UAAU,CACrB,8BADqB,EAErB;AAAE,qBAAa4B,GAAG,KAAK;AAAvB,OAFqB,CALvB;AASC,sBAAeA,GAAG,KAAK;AATxB,OAWGjB,EAAE,CAAE,WAAF,CAXL,CADD,CADD,EAgBC,0BACC,cAAC,MAAD;AACC,MAAA,GAAG,EAAGqB,aADP;AAEC,MAAA,OAAO,EAAG,MAAM;AACfH,QAAAA,MAAM,CAAE,SAAF,CAAN;AACA,OAJF;AAKC,MAAA,SAAS,EAAG7B,UAAU,CACrB,8BADqB,EAErB;AAAE,qBAAa4B,GAAG,KAAK;AAAvB,OAFqB,CALvB;AASC,sBAAeA,GAAG,KAAK;AATxB,OAWGjB,EAAE,CAAE,SAAF,CAXL,CADD,CAhBD,CATD,CALD,EA+CC;AACC,MAAA,GAAG,EAAGL,YAAY,CAAE,CACnBgB,qBADmB,EAEnBF,eAFmB,EAGnBa,WAHmB,CAAF,CADnB;AAMC,MAAA,SAAS,EAAC;AANX,OAQGL,GAAG,KAAK,WAAR,IACD;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,cAAC,QAAD,OADD,CATF,EAaGA,GAAG,KAAK,SAAR,IAAqB,cAAC,eAAD,OAbxB,CA/CD;AAFD;AAkEA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport ListViewOutline from './list-view-outline';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editPostStore );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the list view tab button.\n\tconst listViewTabRef = useRef();\n\t// This ref refers to the outline tab button.\n\tconst outlineTabRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the list view tab button. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: listViewTabRef.current;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\toutlineTabRef.current.focus();\n\t\t}\n\t}\n\n\t// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tsetIsListViewOpened( false );\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t} else {\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t} );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-post-editor__document-overview-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel-header components-panel__header edit-post-sidebar__panel-tabs\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t\t/>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tref={ listViewTabRef }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetTab( 'list-view' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-post-sidebar__panel-tab',\n\t\t\t\t\t\t\t\t{ 'is-active': tab === 'list-view' }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\taria-current={ tab === 'list-view' }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'List View' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tref={ outlineTabRef }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetTab( 'outline' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-post-sidebar__panel-tab',\n\t\t\t\t\t\t\t\t{ 'is-active': tab === 'outline' }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\taria-current={ tab === 'outline' }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Outline' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tcontentFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\tlistViewRef,\n\t\t\t\t] ) }\n\t\t\t\tclassName=\"edit-post-editor__list-view-container\"\n\t\t\t>\n\t\t\t\t{ tab === 'list-view' && (\n\t\t\t\t\t<div className=\"edit-post-editor__list-view-panel-content\">\n\t\t\t\t\t\t<ListView />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ tab === 'outline' && <ListViewOutline /> }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["__experimentalListView","ListView","Button","TabPanel","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","focus","useRef","useState","__","closeSmall","useShortcut","ESCAPE","store","editPostStore","ListViewOutline","ListViewSidebar","setIsListViewOpened","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabPanelRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","tabbable","find","current","listViewApplicationFocus","listViewFocusArea","contains","ownerDocument","activeElement","renderTabContent","tabName","name","title","className"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,QAAnC,QAAmD,yBAAnD;AACA,SAASC,MAAT,EAAiBC,QAAjB,QAAiC,uBAAjC;AACA,SACCC,eADD,EAECC,cAFD,EAGCC,YAHD,QAIO,oBAJP;AAKA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,KAAT,QAAsB,gBAAtB;AACA,SAASC,MAAT,EAAiBC,QAAjB,QAAiC,oBAAjC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,QAA2B,kBAA3B;AACA,SAASC,WAAT,QAA4B,+BAA5B;AACA,SAASC,MAAT,QAAuB,qBAAvB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AAEA,eAAe,SAASC,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0BZ,WAAW,CAAES,aAAF,CAA3C,CADyC,CAGzC;;AACA,QAAMI,eAAe,GAAGhB,eAAe,CAAE,cAAF,CAAvC,CAJyC,CAKzC;;AACA,QAAMiB,oBAAoB,GAAGhB,cAAc,EAA3C;AACA,QAAMiB,qBAAqB,GAAGjB,cAAc,EAA5C;;AAEA,WAASkB,aAAT,CAAwBC,KAAxB,EAAgC;AAC/B,QAAKA,KAAK,CAACC,OAAN,KAAkBX,MAAlB,IAA4B,CAAEU,KAAK,CAACE,gBAAzC,EAA4D;AAC3DF,MAAAA,KAAK,CAACG,cAAN;AACAR,MAAAA,mBAAmB,CAAE,KAAF,CAAnB;AACA;AACD,GAdwC,CAgBzC;AACA;;;AACA,QAAM,CAAES,eAAF,EAAmBC,kBAAnB,IAA0CnB,QA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AZD;AAFD;AA2CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport ListViewOutline from './list-view-outline';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editPostStore );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\t// The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabPanelRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tcontentFocusReturnRef,\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabPanelRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\t// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tsetIsListViewOpened( false );\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t} else {\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t} );\n\n\t/**\n\t * Render tab content for a given tab name.\n\t *\n\t * @param {string} tabName The name of the tab to render.\n\t */\n\tfunction renderTabContent( tabName ) {\n\t\tif ( tabName === 'list-view' ) {\n\t\t\treturn (\n\t\t\t\t<div className=\"edit-post-editor__list-view-panel-content\">\n\t\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn <ListViewOutline />;\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-post-editor__document-overview-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__close-button\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t/>\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__tab-panel\"\n\t\t\t\tref={ tabPanelRef }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tselectOnMove={ false }\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: 'List View',\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: 'Outline',\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ ( currentTab ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-post-editor__list-view-container\"\n\t\t\t\t\t\tref={ listViewContainerRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ renderTabContent( currentTab.name ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TabPanel>\n\t\t</div>\n\t);\n}\n"]}
@@ -19,13 +19,11 @@ import { store as editPostStore } from '../../../store';
19
19
 
20
20
  const PANEL_NAME = 'discussion-panel';
21
21
 
22
- function DiscussionPanel(_ref) {
23
- let {
24
- isEnabled,
25
- isOpened,
26
- onTogglePanel
27
- } = _ref;
28
-
22
+ function DiscussionPanel({
23
+ isEnabled,
24
+ isOpened,
25
+ onTogglePanel
26
+ }) {
29
27
  if (!isEnabled) {
30
28
  return null;
31
29
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"names":["__","PanelBody","PanelRow","PostComments","PostPingbacks","PostTypeSupportCheck","compose","withSelect","withDispatch","store","editPostStore","PANEL_NAME","DiscussionPanel","isEnabled","isOpened","onTogglePanel","select","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,uBAApC;AACA,SACCC,YADD,EAECC,aAFD,EAGCC,oBAHD,QAIO,mBAJP;AAKA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG,kBAAnB;;AAEA,SAASC,eAAT,OAAmE;AAAA,MAAzC;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA;AAAvB,GAAyC;;AAClE,MAAK,CAAEF,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAG,CAAE,UAAF,EAAc,YAAd;AAApC,KACC,cAAC,SAAD;AACC,IAAA,KAAK,EAAGb,EAAE,CAAE,YAAF,CADX;AAEC,IAAA,MAAM,EAAGc,QAFV;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,cAAC,QAAD,QACC,cAAC,YAAD,OADD,CADD,CALD,EAWC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,cAAC,QAAD,QACC,cAAC,aAAD,OADD,CADD,CAXD,CADD,CADD;AAqBA;;AAED,eAAeT,OAAO,CAAE,CACvBC,UAAU,CAAIS,MAAF,IAAc;AACzB,SAAO;AACNH,IAAAA,SAAS,EACRG,MAAM,CAAEN,aAAF,CAAN,CAAwBO,oBAAxB,CAA8CN,UAA9C,CAFK;AAGNG,IAAAA,QAAQ,EAAEE,MAAM,CAAEN,aAAF,CAAN,CAAwBQ,mBAAxB,CAA6CP,UAA7C;AAHJ,GAAP;AAKA,CANS,CADa,EAQvBH,YAAY,CAAIW,QAAF,KAAkB;AAC/BJ,EAAAA,aAAa,GAAG;AACf,WAAOI,QAAQ,CAAET,aAAF,CAAR,CAA0BU,uBAA1B,CACNT,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAF,CARW,CAAF,CAAP,CAeVC,eAfU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPostComments,\n\tPostPingbacks,\n\tPostTypeSupportCheck,\n} from '@wordpress/editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'discussion-panel';\n\nfunction DiscussionPanel( { isEnabled, isOpened, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</PanelBody>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tisEnabled:\n\t\t\t\tselect( editPostStore ).isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: select( editPostStore ).isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonTogglePanel() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tPANEL_NAME\n\t\t\t);\n\t\t},\n\t} ) ),\n] )( DiscussionPanel );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"names":["__","PanelBody","PanelRow","PostComments","PostPingbacks","PostTypeSupportCheck","compose","withSelect","withDispatch","store","editPostStore","PANEL_NAME","DiscussionPanel","isEnabled","isOpened","onTogglePanel","select","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,uBAApC;AACA,SACCC,YADD,EAECC,aAFD,EAGCC,oBAHD,QAIO,mBAJP;AAKA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG,kBAAnB;;AAEA,SAASC,eAAT,CAA0B;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,QAAb;AAAuBC,EAAAA;AAAvB,CAA1B,EAAmE;AAClE,MAAK,CAAEF,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAG,CAAE,UAAF,EAAc,YAAd;AAApC,KACC,cAAC,SAAD;AACC,IAAA,KAAK,EAAGb,EAAE,CAAE,YAAF,CADX;AAEC,IAAA,MAAM,EAAGc,QAFV;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,cAAC,QAAD,QACC,cAAC,YAAD,OADD,CADD,CALD,EAWC,cAAC,oBAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,cAAC,QAAD,QACC,cAAC,aAAD,OADD,CADD,CAXD,CADD,CADD;AAqBA;;AAED,eAAeT,OAAO,CAAE,CACvBC,UAAU,CAAIS,MAAF,IAAc;AACzB,SAAO;AACNH,IAAAA,SAAS,EACRG,MAAM,CAAEN,aAAF,CAAN,CAAwBO,oBAAxB,CAA8CN,UAA9C,CAFK;AAGNG,IAAAA,QAAQ,EAAEE,MAAM,CAAEN,aAAF,CAAN,CAAwBQ,mBAAxB,CAA6CP,UAA7C;AAHJ,GAAP;AAKA,CANS,CADa,EAQvBH,YAAY,CAAIW,QAAF,KAAkB;AAC/BJ,EAAAA,aAAa,GAAG;AACf,WAAOI,QAAQ,CAAET,aAAF,CAAR,CAA0BU,uBAA1B,CACNT,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAF,CARW,CAAF,CAAP,CAeVC,eAfU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPostComments,\n\tPostPingbacks,\n\tPostTypeSupportCheck,\n} from '@wordpress/editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'discussion-panel';\n\nfunction DiscussionPanel( { isEnabled, isOpened, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</PanelBody>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tisEnabled:\n\t\t\t\tselect( editPostStore ).isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: select( editPostStore ).isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonTogglePanel() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tPANEL_NAME\n\t\t\t);\n\t\t},\n\t} ) ),\n] )( DiscussionPanel );\n"]}
@@ -20,22 +20,20 @@ import { store as editPostStore } from '../../../store';
20
20
 
21
21
  const PANEL_NAME = 'featured-image';
22
22
 
23
- function FeaturedImage(_ref) {
24
- var _postType$labels$feat, _postType$labels;
25
-
26
- let {
27
- isEnabled,
28
- isOpened,
29
- postType,
30
- onTogglePanel
31
- } = _ref;
23
+ function FeaturedImage({
24
+ isEnabled,
25
+ isOpened,
26
+ postType,
27
+ onTogglePanel
28
+ }) {
29
+ var _postType$labels$feat;
32
30
 
33
31
  if (!isEnabled) {
34
32
  return null;
35
33
  }
36
34
 
37
35
  return createElement(PostFeaturedImageCheck, null, createElement(PanelBody, {
38
- title: (_postType$labels$feat = postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : __('Featured image'),
36
+ title: (_postType$labels$feat = postType?.labels?.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : __('Featured image'),
39
37
  opened: isOpened,
40
38
  onToggle: onTogglePanel
41
39
  }, createElement(PostFeaturedImage, null)));
@@ -63,13 +61,7 @@ const applyWithDispatch = withDispatch(dispatch => {
63
61
  toggleEditorPanelOpened
64
62
  } = dispatch(editPostStore);
65
63
  return {
66
- onTogglePanel: function () {
67
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
68
- args[_key] = arguments[_key];
69
- }
70
-
71
- return toggleEditorPanelOpened(PANEL_NAME, ...args);
72
- }
64
+ onTogglePanel: (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args)
73
65
  };
74
66
  });
75
67
  export default compose(applyWithSelect, applyWithDispatch)(FeaturedImage);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/featured-image/index.js"],"names":["__","PanelBody","PostFeaturedImage","PostFeaturedImageCheck","store","editorStore","compose","withSelect","withDispatch","coreStore","editPostStore","PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","labels","featured_image","applyWithSelect","select","getEditedPostAttribute","getPostType","isEditorPanelEnabled","isEditorPanelOpened","applyWithDispatch","dispatch","toggleEditorPanelOpened","args"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SACCC,iBADD,EAECC,sBAFD,EAGCC,KAAK,IAAIC,WAHV,QAIO,mBAJP;AAKA,SAASC,OAA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IkB,QAAF,IAAgB;AACvD,QAAM;AAAEC,IAAAA;AAAF,MAA8BD,QAAQ,CAAEhB,aAAF,CAA5C;AAEA,SAAO;AACNM,IAAAA,aAAa,EAAE;AAAA,wCAAKY,IAAL;AAAKA,QAAAA,IAAL;AAAA;;AAAA,aACdD,uBAAuB,CAAEhB,UAAF,EAAc,GAAGiB,IAAjB,CADT;AAAA;AADT,GAAP;AAIA,CAPqC,CAAtC;AASA,eAAetB,OAAO,CAAEa,eAAF,EAAmBM,iBAAnB,CAAP,CAA+Cb,aAA/C,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPostFeaturedImage,\n\tPostFeaturedImageCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'featured-image';\n\nfunction FeaturedImage( { isEnabled, isOpened, postType, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getEditedPostAttribute } = select( editorStore );\n\tconst { getPostType } = select( coreStore );\n\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\tselect( editPostStore );\n\n\treturn {\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch ) => {\n\tconst { toggleEditorPanelOpened } = dispatch( editPostStore );\n\n\treturn {\n\t\tonTogglePanel: ( ...args ) =>\n\t\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args ),\n\t};\n} );\n\nexport default compose( applyWithSelect, applyWithDispatch )( FeaturedImage );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/featured-image/index.js"],"names":["__","PanelBody","PostFeaturedImage","PostFeaturedImageCheck","store","editorStore","compose","withSelect","withDispatch","coreStore","editPostStore","PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","labels","featured_image","applyWithSelect","select","getEditedPostAttribute","getPostType","isEditorPanelEnabled","isEditorPanelOpened","applyWithDispatch","dispatch","toggleEditorPanelOpened","args"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,uBAA1B;AACA,SACCC,iBADD,EAECC,sBAFD,EAGCC,KAAK,IAAIC,WAHV,QAIO,mBAJP;AAKA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASJ,KAAK,IAAIK,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASL,KAAK,IAAIM,aAAlB,QAAuC,gBAAvC;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG,gBAAnB;;AAEA,SAASC,aAAT,CAAwB;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,QAAb;AAAuBC,EAAAA,QAAvB;AAAiCC,EAAAA;AAAjC,CAAxB,EAA2E;AAAA;;AAC1E,MAAK,CAAEH,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,sBAAD,QACC,cAAC,SAAD;AACC,IAAA,KAAK,2BACJE,QAAQ,EAAEE,MAAV,EAAkBC,cADd,yEACgClB,EAAE,CAAE,gBAAF,CAFxC;AAIC,IAAA,MAAM,EAAGc,QAJV;AAKC,IAAA,QAAQ,EAAGE;AALZ,KAOC,cAAC,iBAAD,OAPD,CADD,CADD;AAaA;;AAED,MAAMG,eAAe,GAAGZ,UAAU,CAAIa,MAAF,IAAc;AACjD,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAEf,WAAF,CAAzC;AACA,QAAM;AAAEiB,IAAAA;AAAF,MAAkBF,MAAM,CAAEX,SAAF,CAA9B;AACA,QAAM;AAAEc,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MACLJ,MAAM,CAAEV,aAAF,CADP;AAGA,SAAO;AACNK,IAAAA,QAAQ,EAAEO,WAAW,CAAED,sBAAsB,CAAE,MAAF,CAAxB,CADf;AAENR,IAAAA,SAAS,EAAEU,oBAAoB,CAAEZ,UAAF,CAFzB;AAGNG,IAAAA,QAAQ,EAAEU,mBAAmB,CAAEb,UAAF;AAHvB,GAAP;AAKA,CAXiC,CAAlC;AAaA,MAAMc,iBAAiB,GAAGjB,YAAY,CAAIkB,QAAF,IAAgB;AACvD,QAAM;AAAEC,IAAAA;AAAF,MAA8BD,QAAQ,CAAEhB,aAAF,CAA5C;AAEA,SAAO;AACNM,IAAAA,aAAa,EAAE,CAAE,GAAGY,IAAL,KACdD,uBAAuB,CAAEhB,UAAF,EAAc,GAAGiB,IAAjB;AAFlB,GAAP;AAIA,CAPqC,CAAtC;AASA,eAAetB,OAAO,CAAEa,eAAF,EAAmBM,iBAAnB,CAAP,CAA+Cb,aAA/C,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPostFeaturedImage,\n\tPostFeaturedImageCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'featured-image';\n\nfunction FeaturedImage( { isEnabled, isOpened, postType, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getEditedPostAttribute } = select( editorStore );\n\tconst { getPostType } = select( coreStore );\n\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\tselect( editPostStore );\n\n\treturn {\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch ) => {\n\tconst { toggleEditorPanelOpened } = dispatch( editPostStore );\n\n\treturn {\n\t\tonTogglePanel: ( ...args ) =>\n\t\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args ),\n\t};\n} );\n\nexport default compose( applyWithSelect, applyWithDispatch )( FeaturedImage );\n"]}
@@ -19,7 +19,7 @@ import { store as editPostStore } from '../../../store';
19
19
 
20
20
  const PANEL_NAME = 'page-attributes';
21
21
  export function PageAttributes() {
22
- var _postType$labels$attr, _postType$labels;
22
+ var _postType$labels$attr;
23
23
 
24
24
  const {
25
25
  isEnabled,
@@ -50,16 +50,10 @@ export function PageAttributes() {
50
50
  return null;
51
51
  }
52
52
 
53
- const onTogglePanel = function () {
54
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
55
- args[_key] = arguments[_key];
56
- }
57
-
58
- return toggleEditorPanelOpened(PANEL_NAME, ...args);
59
- };
53
+ const onTogglePanel = (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args);
60
54
 
61
55
  return createElement(PageAttributesCheck, null, createElement(PanelBody, {
62
- title: (_postType$labels$attr = postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : __('Page attributes'),
56
+ title: (_postType$labels$attr = postType?.labels?.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : __('Page attributes'),
63
57
  opened: isOpened,
64
58
  onToggle: onTogglePanel
65
59
  }, createElement(PageAttributesParent, null), createElement(PanelRow, null, createElement(PageAttributesOrder, null))));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/page-attributes/index.js"],"names":["__","PanelBody","PanelRow","store","editorStore","PageAttributesCheck","PageAttributesOrder","PageAttributesParent","useSelect","useDispatch","coreStore","editPostStore","PANEL_NAME","PageAttributes","isEnabled","isOpened","postType","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","getPostType","toggleEditorPanelOpened","onTogglePanel","args","labels","attributes"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,uBAApC;AACA,SACCC,KAAK,IAAIC,WADV,EAECC,mBAFD,EAGCC,mBAHD,EAICC,oBAJD,QAKO,mBALP;AAMA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASN,KAAK,IAAIO,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASP,KAAK,IAAIQ,aAAlB,QAAuC,gBAAvC;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG,iBA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V,cAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tstore as editorStore,\n\tPageAttributesCheck,\n\tPageAttributesOrder,\n\tPageAttributesParent,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'page-attributes';\n\nexport function PageAttributes() {\n\tconst { isEnabled, isOpened, postType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled || ! postType ) {\n\t\treturn null;\n\t}\n\n\tconst onTogglePanel = ( ...args ) =>\n\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args );\n\n\treturn (\n\t\t<PageAttributesCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.attributes ?? __( 'Page attributes' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PageAttributesParent />\n\t\t\t\t<PanelRow>\n\t\t\t\t\t<PageAttributesOrder />\n\t\t\t\t</PanelRow>\n\t\t\t</PanelBody>\n\t\t</PageAttributesCheck>\n\t);\n}\n\nexport default PageAttributes;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/page-attributes/index.js"],"names":["__","PanelBody","PanelRow","store","editorStore","PageAttributesCheck","PageAttributesOrder","PageAttributesParent","useSelect","useDispatch","coreStore","editPostStore","PANEL_NAME","PageAttributes","isEnabled","isOpened","postType","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","getPostType","toggleEditorPanelOpened","onTogglePanel","args","labels","attributes"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,EAAoBC,QAApB,QAAoC,uBAApC;AACA,SACCC,KAAK,IAAIC,WADV,EAECC,mBAFD,EAGCC,mBAHD,EAICC,oBAJD,QAKO,mBALP;AAMA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASN,KAAK,IAAIO,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASP,KAAK,IAAIQ,aAAlB,QAAuC,gBAAvC;AAEA;AACA;AACA;;AACA,MAAMC,UAAU,GAAG,iBAAnB;AAEA,OAAO,SAASC,cAAT,GAA0B;AAAA;;AAChC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA;AAAvB,MAAoCR,SAAS,CAAIS,MAAF,IAAc;AAClE,UAAM;AAAEC,MAAAA;AAAF,QAA6BD,MAAM,CAAEb,WAAF,CAAzC;AACA,UAAM;AAAEe,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLH,MAAM,CAAEN,aAAF,CADP;AAEA,UAAM;AAAEU,MAAAA;AAAF,QAAkBJ,MAAM,CAAEP,SAAF,CAA9B;AACA,WAAO;AACNI,MAAAA,SAAS,EAAEK,oBAAoB,CAAEP,UAAF,CADzB;AAENG,MAAAA,QAAQ,EAAEK,mBAAmB,CAAER,UAAF,CAFvB;AAGNI,MAAAA,QAAQ,EAAEK,WAAW,CAAEH,sBAAsB,CAAE,MAAF,CAAxB;AAHf,KAAP;AAKA,GAVkD,EAUhD,EAVgD,CAAnD;AAYA,QAAM;AAAEI,IAAAA;AAAF,MAA8Bb,WAAW,CAAEE,aAAF,CAA/C;;AAEA,MAAK,CAAEG,SAAF,IAAe,CAAEE,QAAtB,EAAiC;AAChC,WAAO,IAAP;AACA;;AAED,QAAMO,aAAa,GAAG,CAAE,GAAGC,IAAL,KACrBF,uBAAuB,CAAEV,UAAF,EAAc,GAAGY,IAAjB,CADxB;;AAGA,SACC,cAAC,mBAAD,QACC,cAAC,SAAD;AACC,IAAA,KAAK,2BACJR,QAAQ,EAAES,MAAV,EAAkBC,UADd,yEAC4B1B,EAAE,CAAE,iBAAF,CAFpC;AAIC,IAAA,MAAM,EAAGe,QAJV;AAKC,IAAA,QAAQ,EAAGQ;AALZ,KAOC,cAAC,oBAAD,OAPD,EAQC,cAAC,QAAD,QACC,cAAC,mBAAD,OADD,CARD,CADD,CADD;AAgBA;AAED,eAAeV,cAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tstore as editorStore,\n\tPageAttributesCheck,\n\tPageAttributesOrder,\n\tPageAttributesParent,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'page-attributes';\n\nexport function PageAttributes() {\n\tconst { isEnabled, isOpened, postType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled || ! postType ) {\n\t\treturn null;\n\t}\n\n\tconst onTogglePanel = ( ...args ) =>\n\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args );\n\n\treturn (\n\t\t<PageAttributesCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.attributes ?? __( 'Page attributes' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PageAttributesParent />\n\t\t\t\t<PanelRow>\n\t\t\t\t\t<PageAttributesOrder />\n\t\t\t\t</PanelRow>\n\t\t\t</PanelBody>\n\t\t</PageAttributesCheck>\n\t);\n}\n\nexport default PageAttributes;\n"]}
@@ -23,17 +23,16 @@ const {
23
23
  Slot
24
24
  } = createSlotFill('PluginDocumentSettingPanel');
25
25
 
26
- const PluginDocumentSettingFill = _ref => {
27
- let {
28
- isEnabled,
29
- panelName,
30
- opened,
31
- onToggle,
32
- className,
33
- title,
34
- icon,
35
- children
36
- } = _ref;
26
+ const PluginDocumentSettingFill = ({
27
+ isEnabled,
28
+ panelName,
29
+ opened,
30
+ onToggle,
31
+ className,
32
+ title,
33
+ icon,
34
+ children
35
+ }) => {
37
36
  return createElement(Fragment, null, createElement(EnablePluginDocumentSettingPanelOption, {
38
37
  label: title,
39
38
  panelName: panelName
@@ -105,25 +104,21 @@ const PluginDocumentSettingPanel = compose(withPluginContext((context, ownProps)
105
104
  return {
106
105
  panelName: `${context.name}/${ownProps.name}`
107
106
  };
108
- }), withSelect((select, _ref2) => {
109
- let {
110
- panelName
111
- } = _ref2;
107
+ }), withSelect((select, {
108
+ panelName
109
+ }) => {
112
110
  return {
113
111
  opened: select(editPostStore).isEditorPanelOpened(panelName),
114
112
  isEnabled: select(editPostStore).isEditorPanelEnabled(panelName)
115
113
  };
116
- }), withDispatch((dispatch, _ref3) => {
117
- let {
118
- panelName
119
- } = _ref3;
120
- return {
121
- onToggle() {
122
- return dispatch(editPostStore).toggleEditorPanelOpened(panelName);
123
- }
114
+ }), withDispatch((dispatch, {
115
+ panelName
116
+ }) => ({
117
+ onToggle() {
118
+ return dispatch(editPostStore).toggleEditorPanelOpened(panelName);
119
+ }
124
120
 
125
- };
126
- }))(PluginDocumentSettingFill);
121
+ })))(PluginDocumentSettingFill);
127
122
  PluginDocumentSettingPanel.Slot = Slot;
128
123
  export default PluginDocumentSettingPanel;
129
124
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"names":["createSlotFill","PanelBody","compose","withPluginContext","withDispatch","withSelect","warning","EnablePluginDocumentSettingPanelOption","store","editPostStore","Fill","Slot","PluginDocumentSettingFill","isEnabled","panelName","opened","onToggle","className","title","icon","children","PluginDocumentSettingPanel","context","ownProps","undefined","name","select","isEditorPanelOpened","isEditorPanelEnabled","dispatch","toggleEditorPanelOpened"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,SAAzB,QAA0C,uBAA1C;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,iBAAT,QAAkC,oBAAlC;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,OAAOC,OAAP,MAAoB,oBAApB;AAEA;AACA;AACA;;AACA,SAASC,sCAAT,QAAuD,iCAAvD;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiBX,cAAc,CAAE,4BAAF,CAArC;;AAEA,MAAMY,yBAAyB,GAAG,QAS3B;AAAA,MAT6B;AACnCC,IAAAA,SADmC;AAEnCC,IAAAA,SAFmC;AAGnCC,IAAAA,MAHmC;AAInCC,IAAAA,QAJmC;AAKnCC,IAAAA,SALmC;AAMnCC,IAAAA,KANmC;AAOnCC,IAAAA,IAPmC;A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T+B,EAgBzCV,YAAY,CAAE,CAAEyB,QAAF;AAAA,MAAY;AAAEf,IAAAA;AAAF,GAAZ;AAAA,SAAiC;AAC9CE,IAAAA,QAAQ,GAAG;AACV,aAAOa,QAAQ,CAAEpB,aAAF,CAAR,CAA0BqB,uBAA1B,CACNhB,SADM,CAAP;AAGA;;AAL6C,GAAjC;AAAA,CAAF,CAhB6B,CAAP,CAuBhCF,yBAvBgC,CAAnC;AAyBAS,0BAA0B,CAACV,IAA3B,GAAkCA,IAAlC;AAEA,eAAeU,0BAAf","sourcesContent":["/**\n * Defines as extensibility slot for the Settings sidebar\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';\nimport { store as editPostStore } from '../../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\nconst PluginDocumentSettingFill = ( {\n\tisEnabled,\n\tpanelName,\n\topened,\n\tonToggle,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.name] The machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = wp.element.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\tif ( undefined === ownProps.name ) {\n\t\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t\t}\n\t\treturn {\n\t\t\tpanelName: `${ context.name }/${ ownProps.name }`,\n\t\t};\n\t} ),\n\twithSelect( ( select, { panelName } ) => {\n\t\treturn {\n\t\t\topened: select( editPostStore ).isEditorPanelOpened( panelName ),\n\t\t\tisEnabled:\n\t\t\t\tselect( editPostStore ).isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonToggle() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tpanelName\n\t\t\t);\n\t\t},\n\t} ) )\n)( PluginDocumentSettingFill );\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"names":["createSlotFill","PanelBody","compose","withPluginContext","withDispatch","withSelect","warning","EnablePluginDocumentSettingPanelOption","store","editPostStore","Fill","Slot","PluginDocumentSettingFill","isEnabled","panelName","opened","onToggle","className","title","icon","children","PluginDocumentSettingPanel","context","ownProps","undefined","name","select","isEditorPanelOpened","isEditorPanelEnabled","dispatch","toggleEditorPanelOpened"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,SAAzB,QAA0C,uBAA1C;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,iBAAT,QAAkC,oBAAlC;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,OAAOC,OAAP,MAAoB,oBAApB;AAEA;AACA;AACA;;AACA,SAASC,sCAAT,QAAuD,iCAAvD;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiBX,cAAc,CAAE,4BAAF,CAArC;;AAEA,MAAMY,yBAAyB,GAAG,CAAE;AACnCC,EAAAA,SADmC;AAEnCC,EAAAA,SAFmC;AAGnCC,EAAAA,MAHmC;AAInCC,EAAAA,QAJmC;AAKnCC,EAAAA,SALmC;AAMnCC,EAAAA,KANmC;AAOnCC,EAAAA,IAPmC;AAQnCC,EAAAA;AARmC,CAAF,KAS3B;AACN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,EAAY;AAAEf,EAAAA;AAAF,CAAZ,MAAiC;AAC9CE,EAAAA,QAAQ,GAAG;AACV,WAAOa,QAAQ,CAAEpB,aAAF,CAAR,CAA0BqB,uBAA1B,CACNhB,SADM,CAAP;AAGA;;AAL6C,CAAjC,CAAF,CAhB6B,CAAP,CAuBhCF,yBAvBgC,CAAnC;AAyBAS,0BAA0B,CAACV,IAA3B,GAAkCA,IAAlC;AAEA,eAAeU,0BAAf","sourcesContent":["/**\n * Defines as extensibility slot for the Settings sidebar\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';\nimport { store as editPostStore } from '../../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\nconst PluginDocumentSettingFill = ( {\n\tisEnabled,\n\tpanelName,\n\topened,\n\tonToggle,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.name] The machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = wp.element.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\tif ( undefined === ownProps.name ) {\n\t\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t\t}\n\t\treturn {\n\t\t\tpanelName: `${ context.name }/${ ownProps.name }`,\n\t\t};\n\t} ),\n\twithSelect( ( select, { panelName } ) => {\n\t\treturn {\n\t\t\topened: select( editPostStore ).isEditorPanelOpened( panelName ),\n\t\t\tisEnabled:\n\t\t\t\tselect( editPostStore ).isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonToggle() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tpanelName\n\t\t\t);\n\t\t},\n\t} ) )\n)( PluginDocumentSettingFill );\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"]}
@@ -11,21 +11,18 @@ const {
11
11
  Slot
12
12
  } = createSlotFill('PluginPostPublishPanel');
13
13
 
14
- const PluginPostPublishPanelFill = _ref => {
15
- let {
16
- children,
17
- className,
18
- title,
19
- initialOpen = false,
20
- icon
21
- } = _ref;
22
- return createElement(Fill, null, createElement(PanelBody, {
23
- className: className,
24
- initialOpen: initialOpen || !title,
25
- title: title,
26
- icon: icon
27
- }, children));
28
- };
14
+ const PluginPostPublishPanelFill = ({
15
+ children,
16
+ className,
17
+ title,
18
+ initialOpen = false,
19
+ icon
20
+ }) => createElement(Fill, null, createElement(PanelBody, {
21
+ className: className,
22
+ initialOpen: initialOpen || !title,
23
+ title: title,
24
+ icon: icon
25
+ }, children));
29
26
  /**
30
27
  * Renders provided content to the post-publish panel in the publish flow
31
28
  * (side panel that opens after a user publishes the post).