@wordpress/edit-post 7.11.0 → 7.12.1

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 (328) 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 +29 -17
  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 +3 -5
  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 +2 -2
  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 +14 -20
  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/plugin-sidebar-more-menu-item/index.js +4 -7
  29. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
  30. package/build/components/header/post-publish-button-or-toggle.js +15 -16
  31. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  32. package/build/components/header/tools-more-menu-group/index.js +7 -10
  33. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  34. package/build/components/header/writing-menu/index.js +0 -8
  35. package/build/components/header/writing-menu/index.js.map +1 -1
  36. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  37. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  38. package/build/components/keyboard-shortcut-help-modal/index.js +45 -54
  39. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  40. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  41. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  42. package/build/components/keyboard-shortcuts/index.js +1 -1
  43. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  44. package/build/components/layout/actions-panel.js +5 -6
  45. package/build/components/layout/actions-panel.js.map +1 -1
  46. package/build/components/layout/index.js +3 -4
  47. package/build/components/layout/index.js.map +1 -1
  48. package/build/components/layout/index.native.js +3 -7
  49. package/build/components/layout/index.native.js.map +1 -1
  50. package/build/components/meta-boxes/index.js +9 -13
  51. package/build/components/meta-boxes/index.js.map +1 -1
  52. package/build/components/meta-boxes/meta-box-visibility.js +5 -8
  53. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  54. package/build/components/meta-boxes/meta-boxes-area/index.js +3 -4
  55. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  56. package/build/components/preferences-modal/meta-boxes-section.js +18 -24
  57. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  58. package/build/components/preferences-modal/options/enable-custom-fields.js +8 -10
  59. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  60. package/build/components/preferences-modal/options/enable-feature.js +12 -16
  61. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  62. package/build/components/preferences-modal/options/enable-panel.js +10 -17
  63. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  64. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  65. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  66. package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
  67. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  68. package/build/components/secondary-sidebar/list-view-sidebar.js +58 -44
  69. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  70. package/build/components/sidebar/discussion-panel/index.js +5 -7
  71. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  72. package/build/components/sidebar/featured-image/index.js +9 -17
  73. package/build/components/sidebar/featured-image/index.js.map +1 -1
  74. package/build/components/sidebar/page-attributes/index.js +3 -9
  75. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  76. package/build/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  77. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  78. package/build/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  79. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  80. package/build/components/sidebar/plugin-post-status-info/index.js +6 -9
  81. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  82. package/build/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  83. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  84. package/build/components/sidebar/plugin-sidebar/index.js +8 -12
  85. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  86. package/build/components/sidebar/post-excerpt/index.js +5 -7
  87. package/build/components/sidebar/post-excerpt/index.js.map +1 -1
  88. package/build/components/sidebar/post-schedule/index.js +16 -23
  89. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  90. package/build/components/sidebar/post-status/index.js +8 -12
  91. package/build/components/sidebar/post-status/index.js.map +1 -1
  92. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  93. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  94. package/build/components/sidebar/post-template/create-modal.js +3 -4
  95. package/build/components/sidebar/post-template/create-modal.js.map +1 -1
  96. package/build/components/sidebar/post-template/form.js +13 -20
  97. package/build/components/sidebar/post-template/form.js.map +1 -1
  98. package/build/components/sidebar/post-template/index.js +18 -25
  99. package/build/components/sidebar/post-template/index.js.map +1 -1
  100. package/build/components/sidebar/post-url/index.js +16 -23
  101. package/build/components/sidebar/post-url/index.js.map +1 -1
  102. package/build/components/sidebar/post-visibility/index.js +26 -36
  103. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  104. package/build/components/sidebar/settings-header/index.js +3 -4
  105. package/build/components/sidebar/settings-header/index.js.map +1 -1
  106. package/build/components/sidebar/template-summary/index.js +1 -1
  107. package/build/components/sidebar/template-summary/index.js.map +1 -1
  108. package/build/components/start-page-options/index.js +3 -4
  109. package/build/components/start-page-options/index.js.map +1 -1
  110. package/build/components/view-link/index.js +1 -1
  111. package/build/components/view-link/index.js.map +1 -1
  112. package/build/components/visual-editor/block-inspector-button.js +4 -5
  113. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  114. package/build/components/visual-editor/header.native.js +6 -7
  115. package/build/components/visual-editor/header.native.js.map +1 -1
  116. package/build/components/visual-editor/index.js +49 -57
  117. package/build/components/visual-editor/index.js.map +1 -1
  118. package/build/components/welcome-guide/image.js +4 -5
  119. package/build/components/welcome-guide/image.js.map +1 -1
  120. package/build/editor.js +42 -30
  121. package/build/editor.js.map +1 -1
  122. package/build/editor.native.js +7 -11
  123. package/build/editor.native.js.map +1 -1
  124. package/build/hooks/validate-multiple-use/index.js +24 -37
  125. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  126. package/build/index.js +18 -2
  127. package/build/index.js.map +1 -1
  128. package/build/{private-apis.js → lock-unlock.js} +1 -1
  129. package/build/lock-unlock.js.map +1 -0
  130. package/build/plugins/index.js +20 -23
  131. package/build/plugins/index.js.map +1 -1
  132. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  133. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  134. package/build/store/actions.js +60 -88
  135. package/build/store/actions.js.map +1 -1
  136. package/build/store/reducer.js +11 -43
  137. package/build/store/reducer.js.map +1 -1
  138. package/build/store/selectors.js +11 -16
  139. package/build/store/selectors.js.map +1 -1
  140. package/build-module/components/block-manager/category.js +14 -22
  141. package/build-module/components/block-manager/category.js.map +1 -1
  142. package/build-module/components/block-manager/checklist.js +6 -13
  143. package/build-module/components/block-manager/checklist.js.map +1 -1
  144. package/build-module/components/block-manager/index.js +32 -20
  145. package/build-module/components/block-manager/index.js.map +1 -1
  146. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  147. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  148. package/build-module/components/device-preview/index.js +3 -5
  149. package/build-module/components/device-preview/index.js.map +1 -1
  150. package/build-module/components/editor-initialization/index.js +3 -4
  151. package/build-module/components/editor-initialization/index.js.map +1 -1
  152. package/build-module/components/header/document-title/index.js +88 -0
  153. package/build-module/components/header/document-title/index.js.map +1 -0
  154. package/build-module/components/header/fullscreen-mode-close/index.js +7 -8
  155. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  156. package/build-module/components/header/header-toolbar/index.js +1 -1
  157. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  158. package/build-module/components/header/header-toolbar/index.native.js +12 -13
  159. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  160. package/build-module/components/header/index.js +14 -20
  161. package/build-module/components/header/index.js.map +1 -1
  162. package/build-module/components/header/main-dashboard-button/index.js +3 -4
  163. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  164. package/build-module/components/header/more-menu/index.js +19 -23
  165. package/build-module/components/header/more-menu/index.js.map +1 -1
  166. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +4 -4
  167. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
  168. package/build-module/components/header/post-publish-button-or-toggle.js +15 -16
  169. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  170. package/build-module/components/header/tools-more-menu-group/index.js +7 -10
  171. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  172. package/build-module/components/header/writing-menu/index.js +0 -8
  173. package/build-module/components/header/writing-menu/index.js.map +1 -1
  174. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  175. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  176. package/build-module/components/keyboard-shortcut-help-modal/index.js +43 -52
  177. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  178. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  179. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  180. package/build-module/components/keyboard-shortcuts/index.js +1 -1
  181. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  182. package/build-module/components/layout/actions-panel.js +5 -6
  183. package/build-module/components/layout/actions-panel.js.map +1 -1
  184. package/build-module/components/layout/index.js +3 -4
  185. package/build-module/components/layout/index.js.map +1 -1
  186. package/build-module/components/layout/index.native.js +3 -7
  187. package/build-module/components/layout/index.native.js.map +1 -1
  188. package/build-module/components/meta-boxes/index.js +9 -13
  189. package/build-module/components/meta-boxes/index.js.map +1 -1
  190. package/build-module/components/meta-boxes/meta-box-visibility.js +5 -8
  191. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  192. package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -4
  193. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  194. package/build-module/components/preferences-modal/meta-boxes-section.js +18 -24
  195. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  196. package/build-module/components/preferences-modal/options/enable-custom-fields.js +8 -10
  197. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  198. package/build-module/components/preferences-modal/options/enable-feature.js +12 -16
  199. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  200. package/build-module/components/preferences-modal/options/enable-panel.js +10 -17
  201. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  202. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  203. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  204. package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
  205. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  206. package/build-module/components/secondary-sidebar/list-view-sidebar.js +58 -44
  207. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  208. package/build-module/components/sidebar/discussion-panel/index.js +5 -7
  209. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  210. package/build-module/components/sidebar/featured-image/index.js +9 -17
  211. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  212. package/build-module/components/sidebar/page-attributes/index.js +3 -9
  213. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  214. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  215. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  216. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  217. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  218. package/build-module/components/sidebar/plugin-post-status-info/index.js +6 -9
  219. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  220. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  221. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  222. package/build-module/components/sidebar/plugin-sidebar/index.js +8 -9
  223. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  224. package/build-module/components/sidebar/post-excerpt/index.js +5 -7
  225. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  226. package/build-module/components/sidebar/post-schedule/index.js +16 -23
  227. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  228. package/build-module/components/sidebar/post-status/index.js +9 -13
  229. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  230. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  231. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  232. package/build-module/components/sidebar/post-template/create-modal.js +3 -4
  233. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
  234. package/build-module/components/sidebar/post-template/form.js +13 -20
  235. package/build-module/components/sidebar/post-template/form.js.map +1 -1
  236. package/build-module/components/sidebar/post-template/index.js +18 -25
  237. package/build-module/components/sidebar/post-template/index.js.map +1 -1
  238. package/build-module/components/sidebar/post-url/index.js +16 -23
  239. package/build-module/components/sidebar/post-url/index.js.map +1 -1
  240. package/build-module/components/sidebar/post-visibility/index.js +26 -36
  241. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  242. package/build-module/components/sidebar/settings-header/index.js +3 -4
  243. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  244. package/build-module/components/sidebar/template-summary/index.js +1 -1
  245. package/build-module/components/sidebar/template-summary/index.js.map +1 -1
  246. package/build-module/components/start-page-options/index.js +3 -4
  247. package/build-module/components/start-page-options/index.js.map +1 -1
  248. package/build-module/components/view-link/index.js +1 -1
  249. package/build-module/components/view-link/index.js.map +1 -1
  250. package/build-module/components/visual-editor/block-inspector-button.js +4 -5
  251. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  252. package/build-module/components/visual-editor/header.native.js +6 -7
  253. package/build-module/components/visual-editor/header.native.js.map +1 -1
  254. package/build-module/components/visual-editor/index.js +47 -54
  255. package/build-module/components/visual-editor/index.js.map +1 -1
  256. package/build-module/components/welcome-guide/image.js +4 -5
  257. package/build-module/components/welcome-guide/image.js.map +1 -1
  258. package/build-module/editor.js +38 -26
  259. package/build-module/editor.js.map +1 -1
  260. package/build-module/editor.native.js +7 -10
  261. package/build-module/editor.native.js.map +1 -1
  262. package/build-module/hooks/validate-multiple-use/index.js +24 -34
  263. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  264. package/build-module/index.js +18 -2
  265. package/build-module/index.js.map +1 -1
  266. package/build-module/{private-apis.js → lock-unlock.js} +1 -1
  267. package/build-module/lock-unlock.js.map +1 -0
  268. package/build-module/plugins/index.js +20 -23
  269. package/build-module/plugins/index.js.map +1 -1
  270. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  271. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  272. package/build-module/store/actions.js +60 -88
  273. package/build-module/store/actions.js.map +1 -1
  274. package/build-module/store/reducer.js +11 -43
  275. package/build-module/store/reducer.js.map +1 -1
  276. package/build-module/store/selectors.js +11 -16
  277. package/build-module/store/selectors.js.map +1 -1
  278. package/build-style/style-rtl.css +66 -102
  279. package/build-style/style.css +66 -102
  280. package/package.json +32 -32
  281. package/src/components/block-manager/index.js +51 -31
  282. package/src/components/block-manager/style.scss +3 -1
  283. package/src/components/device-preview/index.js +1 -2
  284. package/src/components/header/document-title/index.js +86 -0
  285. package/src/components/header/document-title/style.scss +61 -0
  286. package/src/components/header/header-toolbar/index.js +1 -1
  287. package/src/components/header/header-toolbar/style.scss +0 -1
  288. package/src/components/header/index.js +7 -10
  289. package/src/components/header/style.scss +6 -0
  290. package/src/components/header/writing-menu/index.js +0 -10
  291. package/src/components/keyboard-shortcuts/index.js +1 -1
  292. package/src/components/preferences-modal/options/enable-custom-fields.js +2 -2
  293. package/src/components/preferences-modal/options/test/__snapshots__/enable-custom-fields.js.snap +2 -2
  294. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +10 -4
  295. package/src/components/secondary-sidebar/list-view-sidebar.js +68 -66
  296. package/src/components/secondary-sidebar/style.scss +28 -31
  297. package/src/components/sidebar/post-status/index.js +2 -1
  298. package/src/components/visual-editor/index.js +22 -32
  299. package/src/components/visual-editor/style.scss +0 -13
  300. package/src/editor.js +22 -1
  301. package/src/index.js +30 -3
  302. package/src/plugins/index.js +1 -1
  303. package/src/style.scss +1 -1
  304. package/src/test/editor.native.js +34 -9
  305. package/build/components/header/template-title/delete-template.js +0 -117
  306. package/build/components/header/template-title/delete-template.js.map +0 -1
  307. package/build/components/header/template-title/edit-template-title.js +0 -95
  308. package/build/components/header/template-title/edit-template-title.js.map +0 -1
  309. package/build/components/header/template-title/index.js +0 -124
  310. package/build/components/header/template-title/index.js.map +0 -1
  311. package/build/components/header/template-title/template-description.js +0 -55
  312. package/build/components/header/template-title/template-description.js.map +0 -1
  313. package/build/private-apis.js.map +0 -1
  314. package/build-module/components/header/template-title/delete-template.js +0 -104
  315. package/build-module/components/header/template-title/delete-template.js.map +0 -1
  316. package/build-module/components/header/template-title/edit-template-title.js +0 -83
  317. package/build-module/components/header/template-title/edit-template-title.js.map +0 -1
  318. package/build-module/components/header/template-title/index.js +0 -105
  319. package/build-module/components/header/template-title/index.js.map +0 -1
  320. package/build-module/components/header/template-title/template-description.js +0 -45
  321. package/build-module/components/header/template-title/template-description.js.map +0 -1
  322. package/build-module/private-apis.js.map +0 -1
  323. package/src/components/header/template-title/delete-template.js +0 -106
  324. package/src/components/header/template-title/edit-template-title.js +0 -78
  325. package/src/components/header/template-title/index.js +0 -115
  326. package/src/components/header/template-title/style.scss +0 -94
  327. package/src/components/header/template-title/template-description.js +0 -42
  328. /package/src/{private-apis.js → lock-unlock.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-custom-fields.js"],"names":["useState","__","Button","withSelect","store","editorStore","___unstablePreferencesModalBaseOption","BaseOption","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","document","getElementById","submit","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","select","getEditorSettings","enableCustomFields"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,qCAAqC,IAAIC,UAAlD,QAAoE,sBAApE;AAEA,OAAO,SAASC,wBAAT,OAAoD;AAAA,MAAjB;AAAEC,IAAAA;AAAF,GAAiB;AAC1D,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkCX,QAAQ,CAAE,KAAF,CAAhD;AAEA,SACC,8BACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACGC,EAAE,CACH,8FADG,CADL,CADD,EAMC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,gEADX;AAEC,IAAA,OAAO,EAAC,WAFT;AAGC,IAAA,MAAM,EAAGS,WAHV;AAIC,IAAA,QAAQ,EAAGA,WAJZ;AAKC,IAAA,OAAO,EAAG,MAAM;AACfC,MAAAA,cAAc,CAAE,IAAF,CAAd;AACAC,MAAAA,QAAQ,CACNC,cADF,CACkB,2BADlB,EAEEC,MAFF;AAGA;AAVF,KAYGL,UAAU,GACTR,EAAE,CAAE,iBAAF,CADO,GAETA,EAAE,CAAE,kBAAF,CAdN,CAND,CADD;AAyBA;AAED,OAAO,SAASc,wBAAT,QAAuE;AAAA,MAApC;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAoC;AAC7E,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8BnB,QAAQ,CAAEiB,sBAAF,CAA5C;AAEA,SACC,cAAC,UAAD;AACC,IAAA,KAAK,EAAGD,KADT;AAEC,IAAA,SAAS,EAAGE,SAFb;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKGD,SAAS,KAAKD,sBAAd,IACD,cAAC,wBAAD;AAA0B,IAAA,UAAU,EAAGC;AAAvC,IANF,CADD;AAWA;AAED,eAAef,UAAU,CAAIiB,MAAF,KAAgB;AAC1CH,EAAAA,sBAAsB,EACrB,CAAC,CAAEG,MAAM,CAAEf,WAAF,CAAN,CAAsBgB,iBAAtB,GAA0CC;AAFJ,CAAhB,CAAF,CAAV,CAGRP,wBAHQ,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tdocument\n\t\t\t\t\t\t.getElementById( 'toggle-custom-fields-form' )\n\t\t\t\t\t\t.submit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Enable & Reload' )\n\t\t\t\t\t: __( 'Disable & Reload' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<BaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</BaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-custom-fields.js"],"names":["useState","__","Button","withSelect","store","editorStore","___unstablePreferencesModalBaseOption","BaseOption","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","document","getElementById","submit","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","select","getEditorSettings","enableCustomFields"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,qCAAqC,IAAIC,UAAlD,QAAoE,sBAApE;AAEA,OAAO,SAASC,wBAAT,CAAmC;AAAEC,EAAAA;AAAF,CAAnC,EAAoD;AAC1D,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkCX,QAAQ,CAAE,KAAF,CAAhD;AAEA,SACC,8BACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACGC,EAAE,CACH,8FADG,CADL,CADD,EAMC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,gEADX;AAEC,IAAA,OAAO,EAAC,WAFT;AAGC,IAAA,MAAM,EAAGS,WAHV;AAIC,IAAA,QAAQ,EAAGA,WAJZ;AAKC,IAAA,OAAO,EAAG,MAAM;AACfC,MAAAA,cAAc,CAAE,IAAF,CAAd;AACAC,MAAAA,QAAQ,CACNC,cADF,CACkB,2BADlB,EAEEC,MAFF;AAGA;AAVF,KAYGL,UAAU,GACTR,EAAE,CAAE,oBAAF,CADO,GAETA,EAAE,CAAE,oBAAF,CAdN,CAND,CADD;AAyBA;AAED,OAAO,SAASc,wBAAT,CAAmC;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAnC,EAAuE;AAC7E,QAAM,CAAEC,SAAF,EAAaC,YAAb,IAA8BnB,QAAQ,CAAEiB,sBAAF,CAA5C;AAEA,SACC,cAAC,UAAD;AACC,IAAA,KAAK,EAAGD,KADT;AAEC,IAAA,SAAS,EAAGE,SAFb;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKGD,SAAS,KAAKD,sBAAd,IACD,cAAC,wBAAD;AAA0B,IAAA,UAAU,EAAGC;AAAvC,IANF,CADD;AAWA;AAED,eAAef,UAAU,CAAIiB,MAAF,KAAgB;AAC1CH,EAAAA,sBAAsB,EACrB,CAAC,CAAEG,MAAM,CAAEf,WAAF,CAAN,CAAsBgB,iBAAtB,GAA0CC;AAFJ,CAAhB,CAAF,CAAV,CAGRP,wBAHQ,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tdocument\n\t\t\t\t\t\t.getElementById( 'toggle-custom-fields-form' )\n\t\t\t\t\t\t.submit();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<BaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</BaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"]}
@@ -9,26 +9,22 @@ 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
- featureName
15
- } = _ref;
12
+ export default compose(withSelect((select, {
13
+ featureName
14
+ }) => {
16
15
  const {
17
16
  isFeatureActive
18
17
  } = select(editPostStore);
19
18
  return {
20
19
  isChecked: isFeatureActive(featureName)
21
20
  };
22
- }), withDispatch((dispatch, _ref2) => {
23
- let {
24
- featureName,
25
- onToggle = () => {}
26
- } = _ref2;
27
- return {
28
- onChange: () => {
29
- onToggle();
30
- dispatch(editPostStore).toggleFeature(featureName);
31
- }
32
- };
33
- }))(BaseOption);
21
+ }), withDispatch((dispatch, {
22
+ featureName,
23
+ onToggle = () => {}
24
+ }) => ({
25
+ onChange: () => {
26
+ onToggle();
27
+ dispatch(editPostStore).toggleFeature(featureName);
28
+ }
29
+ })))(BaseOption);
34
30
  //# sourceMappingURL=enable-feature.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-feature.js"],"names":["compose","withSelect","withDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","editPostStore","select","featureName","isFeatureActive","isChecked","dispatch","onToggle","onChange","toggleFeature"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;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,eAAeN,OAAO,CACrBC,UAAU,CAAE,CAAEM,MAAF,WAA+B;AAAA,MAArB;AAAEC,IAAAA;AAAF,GAAqB;AAC1C,QAAM;AAAEC,IAAAA;AAAF,MAAsBF,MAAM,CAAED,aAAF,CAAlC;AACA,SAAO;AACNI,IAAAA,SAAS,EAAED,eAAe,CAAED,WAAF;AADpB,GAAP;AAGA,CALS,CADW,EAOrBN,YAAY,CAAE,CAAES,QAAF;AAAA,MAAY;AAAEH,IAAAA,WAAF;AAAeI,IAAAA,QAAQ,GAAG,MAAM,CAAE;AAAlC,GAAZ;AAAA,SAAwD;AACrEC,IAAAA,QAAQ,EAAE,MAAM;AACfD,MAAAA,QAAQ;AACRD,MAAAA,QAAQ,CAAEL,aAAF,CAAR,CAA0BQ,aAA1B,CAAyCN,WAAzC;AACA;AAJoE,GAAxD;AAAA,CAAF,CAPS,CAAP,CAaZJ,UAbY,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } 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, { featureName } ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\treturn {\n\t\t\tisChecked: isFeatureActive( featureName ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { featureName, onToggle = () => {} } ) => ( {\n\t\tonChange: () => {\n\t\t\tonToggle();\n\t\t\tdispatch( editPostStore ).toggleFeature( featureName );\n\t\t},\n\t} ) )\n)( BaseOption );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-feature.js"],"names":["compose","withSelect","withDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","editPostStore","select","featureName","isFeatureActive","isChecked","dispatch","onToggle","onChange","toggleFeature"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;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,eAAeN,OAAO,CACrBC,UAAU,CAAE,CAAEM,MAAF,EAAU;AAAEC,EAAAA;AAAF,CAAV,KAA+B;AAC1C,QAAM;AAAEC,IAAAA;AAAF,MAAsBF,MAAM,CAAED,aAAF,CAAlC;AACA,SAAO;AACNI,IAAAA,SAAS,EAAED,eAAe,CAAED,WAAF;AADpB,GAAP;AAGA,CALS,CADW,EAOrBN,YAAY,CAAE,CAAES,QAAF,EAAY;AAAEH,EAAAA,WAAF;AAAeI,EAAAA,QAAQ,GAAG,MAAM,CAAE;AAAlC,CAAZ,MAAwD;AACrEC,EAAAA,QAAQ,EAAE,MAAM;AACfD,IAAAA,QAAQ;AACRD,IAAAA,QAAQ,CAAEL,aAAF,CAAR,CAA0BQ,aAA1B,CAAyCN,WAAzC;AACA;AAJoE,CAAxD,CAAF,CAPS,CAAP,CAaZJ,UAbY,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } 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, { featureName } ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\treturn {\n\t\t\tisChecked: isFeatureActive( featureName ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { featureName, onToggle = () => {} } ) => ( {\n\t\tonChange: () => {\n\t\t\tonToggle();\n\t\t\tdispatch( editPostStore ).toggleFeature( featureName );\n\t\t},\n\t} ) )\n)( BaseOption );\n"]}
@@ -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,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -43,11 +42,11 @@ export default function InserterSidebar() {
43
42
  useEffect(() => {
44
43
  libraryRef.current.focusSearch();
45
44
  }, []);
46
- return createElement("div", _extends({
47
- ref: inserterDialogRef
48
- }, inserterDialogProps, {
45
+ return createElement("div", {
46
+ ref: inserterDialogRef,
47
+ ...inserterDialogProps,
49
48
  className: "edit-post-editor__inserter-panel"
50
- }), createElement(TagName, {
49
+ }, createElement(TagName, {
51
50
  className: "edit-post-editor__inserter-panel-header"
52
51
  }, createElement(Button, {
53
52
  icon: close,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["useDispatch","useSelect","Button","VisuallyHidden","__experimentalLibrary","Library","close","useViewportMatch","__experimentalUseDialog","useDialog","__","useEffect","useRef","store","editPostStore","InserterSidebar","insertionPoint","showMostUsedBlocks","select","isFeatureActive","__experimentalGetInsertionPoint","setIsInserterOpened","isMobileViewport","TagName","inserterDialogRef","inserterDialogProps","onClose","focusOnMount","libraryRef","current","focusSearch","rootClientId","insertionIndex","filterValue"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,MAAT,EAAiBC,cAAjB,QAAuC,uBAAvC;AACA,SAASC,qBAAqB,IAAIC,OAAlC,QAAiD,yBAAjD;AACA,S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A,SAAS,EAAC;AAAnB,KACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAGnB,KADR;AAEC,IAAA,KAAK,EAAGI,EAAE,CAAE,sBAAF,CAFX;AAGC,IAAA,OAAO,EAAG,MAAMW,mBAAmB,CAAE,KAAF;AAHpC,IADD,CALD,EAYC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,OAAD;AACC,IAAA,kBAAkB,EAAGJ,kBADtB;AAEC,IAAA,qBAAqB,MAFtB;AAGC,IAAA,gBAAgB,EAAGK,gBAHpB;AAIC,IAAA,YAAY,EAAGN,cAAc,CAACe,YAJ/B;AAKC,IAAA,4BAA4B,EAC3Bf,cAAc,CAACgB,cANjB;AAQC,IAAA,yBAAyB,EAAGhB,cAAc,CAACiB,WAR5C;AASC,IAAA,GAAG,EAAGL;AATP,IADD,CAZD,CADD;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { close } from '@wordpress/icons';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst { insertionPoint, showMostUsedBlocks } = useSelect( ( select ) => {\n\t\tconst { isFeatureActive, __experimentalGetInsertionPoint } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tinsertionPoint: __experimentalGetInsertionPoint(),\n\t\t\tshowMostUsedBlocks: isFeatureActive( 'mostUsedBlocks' ),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editPostStore );\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: () => setIsInserterOpened( false ),\n\t\tfocusOnMount: null,\n\t} );\n\n\tconst libraryRef = useRef();\n\tuseEffect( () => {\n\t\tlibraryRef.current.focusSearch();\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-post-editor__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-post-editor__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t\tonClick={ () => setIsInserterOpened( false ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-post-editor__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ insertionPoint.rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\tinsertionPoint.insertionIndex\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFilterValue={ insertionPoint.filterValue }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/inserter-sidebar.js"],"names":["useDispatch","useSelect","Button","VisuallyHidden","__experimentalLibrary","Library","close","useViewportMatch","__experimentalUseDialog","useDialog","__","useEffect","useRef","store","editPostStore","InserterSidebar","insertionPoint","showMostUsedBlocks","select","isFeatureActive","__experimentalGetInsertionPoint","setIsInserterOpened","isMobileViewport","TagName","inserterDialogRef","inserterDialogProps","onClose","focusOnMount","libraryRef","current","focusSearch","rootClientId","insertionIndex","filterValue"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAt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FM,CAAT;AAIA,SACC;AACC,IAAA,GAAG,EAAGN,iBADP;AAAA,OAEMC,mBAFN;AAGC,IAAA,SAAS,EAAC;AAHX,KAKC,cAAC,OAAD;AAAS,IAAA,SAAS,EAAC;AAAnB,KACC,cAAC,MAAD;AACC,IAAA,IAAI,EAAGnB,KADR;AAEC,IAAA,KAAK,EAAGI,EAAE,CAAE,sBAAF,CAFX;AAGC,IAAA,OAAO,EAAG,MAAMW,mBAAmB,CAAE,KAAF;AAHpC,IADD,CALD,EAYC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,OAAD;AACC,IAAA,kBAAkB,EAAGJ,kBADtB;AAEC,IAAA,qBAAqB,MAFtB;AAGC,IAAA,gBAAgB,EAAGK,gBAHpB;AAIC,IAAA,YAAY,EAAGN,cAAc,CAACe,YAJ/B;AAKC,IAAA,4BAA4B,EAC3Bf,cAAc,CAACgB,cANjB;AAQC,IAAA,yBAAyB,EAAGhB,cAAc,CAACiB,WAR5C;AASC,IAAA,GAAG,EAAGL;AATP,IADD,CAZD,CADD;AA4BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { close } from '@wordpress/icons';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst { insertionPoint, showMostUsedBlocks } = useSelect( ( select ) => {\n\t\tconst { isFeatureActive, __experimentalGetInsertionPoint } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tinsertionPoint: __experimentalGetInsertionPoint(),\n\t\t\tshowMostUsedBlocks: isFeatureActive( 'mostUsedBlocks' ),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editPostStore );\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: () => setIsInserterOpened( false ),\n\t\tfocusOnMount: null,\n\t} );\n\n\tconst libraryRef = useRef();\n\tuseEffect( () => {\n\t\tlibraryRef.current.focusSearch();\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-post-editor__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-post-editor__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t\tonClick={ () => setIsInserterOpened( false ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-post-editor__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ insertionPoint.rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\tinsertionPoint.insertionIndex\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFilterValue={ insertionPoint.filterValue }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\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;;AAED,QAAM,CAAES,GAAF,EAAOC,MAAP,IAAkBnB,QAAQ,CAAE,WA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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,QAAQ,CAAE,IAAF,CAAxD,CAlByC,CAmBzC;;AACA,QAAM,CAAEoB,G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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,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAA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AQ,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,iBAAnB;AAEA,OAAO,SAASC,cAAT,GAA0B;AAAA;;AAChC,QAAM;AAAEC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\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"]}