@wordpress/edit-post 7.15.0 → 7.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (442) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +6 -1
  3. package/build/components/block-manager/category.js +1 -14
  4. package/build/components/block-manager/category.js.map +1 -1
  5. package/build/components/block-manager/checklist.js +1 -5
  6. package/build/components/block-manager/checklist.js.map +1 -1
  7. package/build/components/block-manager/index.js +11 -23
  8. package/build/components/block-manager/index.js.map +1 -1
  9. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +3 -11
  10. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  11. package/build/components/browser-url/index.js +6 -23
  12. package/build/components/browser-url/index.js.map +1 -1
  13. package/build/components/device-preview/index.js +1 -11
  14. package/build/components/device-preview/index.js.map +1 -1
  15. package/build/components/editor-initialization/index.js +0 -2
  16. package/build/components/editor-initialization/index.js.map +1 -1
  17. package/build/components/editor-initialization/listener-hooks.js +1 -12
  18. package/build/components/editor-initialization/listener-hooks.js.map +1 -1
  19. package/build/components/header/{document-title → document-actions}/index.js +11 -28
  20. package/build/components/header/document-actions/index.js.map +1 -0
  21. package/build/components/header/fullscreen-mode-close/index.js +3 -22
  22. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  23. package/build/components/header/header-toolbar/index.js +5 -22
  24. package/build/components/header/header-toolbar/index.js.map +1 -1
  25. package/build/components/header/header-toolbar/index.native.js +4 -25
  26. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  27. package/build/components/header/index.js +6 -23
  28. package/build/components/header/index.js.map +1 -1
  29. package/build/components/header/index.native.js +1 -13
  30. package/build/components/header/index.native.js.map +1 -1
  31. package/build/components/header/main-dashboard-button/index.js +1 -7
  32. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  33. package/build/components/header/mode-switcher/index.js +23 -19
  34. package/build/components/header/mode-switcher/index.js.map +1 -1
  35. package/build/components/header/more-menu/index.js +1 -12
  36. package/build/components/header/more-menu/index.js.map +1 -1
  37. package/build/components/header/plugin-more-menu-item/index.js +0 -8
  38. package/build/components/header/plugin-more-menu-item/index.js.map +1 -1
  39. package/build/components/header/plugin-sidebar-more-menu-item/index.js +3 -4
  40. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
  41. package/build/components/header/post-publish-button-or-toggle.js +2 -11
  42. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  43. package/build/components/header/preferences-menu-item/index.js +1 -7
  44. package/build/components/header/preferences-menu-item/index.js.map +1 -1
  45. package/build/components/header/tools-more-menu-group/index.js +1 -6
  46. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  47. package/build/components/header/writing-menu/index.js +1 -15
  48. package/build/components/header/writing-menu/index.js.map +1 -1
  49. package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
  50. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  51. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -9
  52. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  53. package/build/components/keyboard-shortcut-help-modal/index.js +4 -25
  54. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  55. package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -6
  56. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  57. package/build/components/keyboard-shortcuts/index.js +4 -23
  58. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  59. package/build/components/layout/actions-panel.js +7 -17
  60. package/build/components/layout/actions-panel.js.map +1 -1
  61. package/build/components/layout/index.js +50 -52
  62. package/build/components/layout/index.js.map +1 -1
  63. package/build/components/layout/index.native.js +5 -34
  64. package/build/components/layout/index.native.js.map +1 -1
  65. package/build/components/meta-boxes/index.js +4 -12
  66. package/build/components/meta-boxes/index.js.map +1 -1
  67. package/build/components/meta-boxes/meta-box-visibility.js +1 -12
  68. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  69. package/build/components/meta-boxes/meta-boxes-area/index.js +0 -10
  70. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  71. package/build/components/preferences-modal/index.js +1 -18
  72. package/build/components/preferences-modal/index.js.map +1 -1
  73. package/build/components/preferences-modal/meta-boxes-section.js +3 -13
  74. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  75. package/build/components/preferences-modal/options/enable-custom-fields.js +10 -11
  76. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  77. package/build/components/preferences-modal/options/enable-feature.js +0 -7
  78. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  79. package/build/components/preferences-modal/options/enable-panel.js +0 -7
  80. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  81. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +1 -6
  82. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  83. package/build/components/preferences-modal/options/enable-publish-sidebar.js +2 -8
  84. package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
  85. package/build/components/preferences-modal/options/index.js +0 -6
  86. package/build/components/preferences-modal/options/index.js.map +1 -1
  87. package/build/components/secondary-sidebar/inserter-sidebar.js +1 -9
  88. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  89. package/build/components/secondary-sidebar/list-view-outline.js +1 -8
  90. package/build/components/secondary-sidebar/list-view-outline.js.map +1 -1
  91. package/build/components/secondary-sidebar/list-view-sidebar.js +34 -46
  92. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  93. package/build/components/sidebar/discussion-panel/index.js +19 -30
  94. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  95. package/build/components/sidebar/featured-image/index.js +0 -15
  96. package/build/components/sidebar/featured-image/index.js.map +1 -1
  97. package/build/components/sidebar/last-revision/index.js +1 -5
  98. package/build/components/sidebar/last-revision/index.js.map +1 -1
  99. package/build/components/sidebar/page-attributes/index.js +0 -14
  100. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  101. package/build/components/sidebar/plugin-document-setting-panel/index.js +44 -61
  102. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  103. package/build/components/sidebar/plugin-post-publish-panel/index.js +19 -25
  104. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  105. package/build/components/sidebar/plugin-post-status-info/index.js +2 -5
  106. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  107. package/build/components/sidebar/plugin-pre-publish-panel/index.js +19 -25
  108. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  109. package/build/components/sidebar/plugin-sidebar/index.js +0 -8
  110. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  111. package/build/components/sidebar/post-author/index.js +1 -5
  112. package/build/components/sidebar/post-author/index.js.map +1 -1
  113. package/build/components/sidebar/post-excerpt/index.js +0 -13
  114. package/build/components/sidebar/post-excerpt/index.js.map +1 -1
  115. package/build/components/sidebar/post-format/index.js +1 -5
  116. package/build/components/sidebar/post-format/index.js.map +1 -1
  117. package/build/components/sidebar/post-pending-status/index.js +1 -5
  118. package/build/components/sidebar/post-pending-status/index.js.map +1 -1
  119. package/build/components/sidebar/post-schedule/index.js +5 -9
  120. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  121. package/build/components/sidebar/post-slug/index.js +1 -5
  122. package/build/components/sidebar/post-slug/index.js.map +1 -1
  123. package/build/components/sidebar/post-status/index.js +0 -24
  124. package/build/components/sidebar/post-status/index.js.map +1 -1
  125. package/build/components/sidebar/post-sticky/index.js +1 -5
  126. package/build/components/sidebar/post-sticky/index.js.map +1 -1
  127. package/build/components/sidebar/post-taxonomies/index.js +1 -6
  128. package/build/components/sidebar/post-taxonomies/index.js.map +1 -1
  129. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +1 -11
  130. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  131. package/build/components/sidebar/post-template/create-modal.js +1 -16
  132. package/build/components/sidebar/post-template/create-modal.js.map +1 -1
  133. package/build/components/sidebar/post-template/form.js +3 -16
  134. package/build/components/sidebar/post-template/form.js.map +1 -1
  135. package/build/components/sidebar/post-template/index.js +5 -24
  136. package/build/components/sidebar/post-template/index.js.map +1 -1
  137. package/build/components/sidebar/post-trash/index.js +1 -3
  138. package/build/components/sidebar/post-trash/index.js.map +1 -1
  139. package/build/components/sidebar/post-url/index.js +5 -9
  140. package/build/components/sidebar/post-url/index.js.map +1 -1
  141. package/build/components/sidebar/post-visibility/index.js +5 -10
  142. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  143. package/build/components/sidebar/settings-header/index.js +12 -17
  144. package/build/components/sidebar/settings-header/index.js.map +1 -1
  145. package/build/components/sidebar/settings-sidebar/index.js +2 -29
  146. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  147. package/build/components/sidebar/template-summary/index.js +1 -9
  148. package/build/components/sidebar/template-summary/index.js.map +1 -1
  149. package/build/components/start-page-options/index.js +1 -15
  150. package/build/components/start-page-options/index.js.map +1 -1
  151. package/build/components/text-editor/index.js +1 -8
  152. package/build/components/text-editor/index.js.map +1 -1
  153. package/build/components/view-link/index.js +3 -10
  154. package/build/components/view-link/index.js.map +1 -1
  155. package/build/components/visual-editor/block-inspector-button.js +1 -11
  156. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  157. package/build/components/visual-editor/header.native.js +1 -12
  158. package/build/components/visual-editor/header.native.js.map +1 -1
  159. package/build/components/visual-editor/index.js +33 -53
  160. package/build/components/visual-editor/index.js.map +1 -1
  161. package/build/components/visual-editor/index.native.js +1 -9
  162. package/build/components/visual-editor/index.native.js.map +1 -1
  163. package/build/components/welcome-guide/default.js +1 -8
  164. package/build/components/welcome-guide/default.js.map +1 -1
  165. package/build/components/welcome-guide/image.js +0 -2
  166. package/build/components/welcome-guide/image.js.map +1 -1
  167. package/build/components/welcome-guide/index.js +1 -11
  168. package/build/components/welcome-guide/index.js.map +1 -1
  169. package/build/components/welcome-guide/template.js +1 -8
  170. package/build/components/welcome-guide/template.js.map +1 -1
  171. package/build/editor.js +9 -68
  172. package/build/editor.js.map +1 -1
  173. package/build/editor.native.js +10 -35
  174. package/build/editor.native.js.map +1 -1
  175. package/build/hooks/commands/use-common-commands.js +65 -22
  176. package/build/hooks/commands/use-common-commands.js.map +1 -1
  177. package/build/hooks/components/index.js +1 -3
  178. package/build/hooks/components/index.js.map +1 -1
  179. package/build/hooks/index.js +0 -1
  180. package/build/hooks/index.js.map +1 -1
  181. package/build/hooks/validate-multiple-use/index.js +10 -18
  182. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  183. package/build/index.js +16 -48
  184. package/build/index.js.map +1 -1
  185. package/build/index.native.js +0 -9
  186. package/build/index.native.js.map +1 -1
  187. package/build/lock-unlock.js +1 -2
  188. package/build/lock-unlock.js.map +1 -1
  189. package/build/plugins/copy-content-menu-item/index.js +1 -10
  190. package/build/plugins/copy-content-menu-item/index.js.map +1 -1
  191. package/build/plugins/index.js +5 -22
  192. package/build/plugins/index.js.map +1 -1
  193. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +1 -10
  194. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  195. package/build/plugins/welcome-guide-menu-item/index.js +1 -6
  196. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  197. package/build/store/actions.js +53 -120
  198. package/build/store/actions.js.map +1 -1
  199. package/build/store/constants.js +2 -3
  200. package/build/store/constants.js.map +1 -1
  201. package/build/store/index.js +0 -9
  202. package/build/store/index.js.map +1 -1
  203. package/build/store/reducer.js +9 -42
  204. package/build/store/reducer.js.map +1 -1
  205. package/build/store/selectors.js +63 -91
  206. package/build/store/selectors.js.map +1 -1
  207. package/build/utils/meta-boxes.js +0 -4
  208. package/build/utils/meta-boxes.js.map +1 -1
  209. package/build-module/components/block-manager/category.js +1 -8
  210. package/build-module/components/block-manager/category.js.map +1 -1
  211. package/build-module/components/block-manager/checklist.js +0 -3
  212. package/build-module/components/block-manager/checklist.js.map +1 -1
  213. package/build-module/components/block-manager/index.js +11 -14
  214. package/build-module/components/block-manager/index.js.map +1 -1
  215. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +2 -8
  216. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  217. package/build-module/components/browser-url/index.js +7 -14
  218. package/build-module/components/browser-url/index.js.map +1 -1
  219. package/build-module/components/device-preview/index.js +1 -3
  220. package/build-module/components/device-preview/index.js.map +1 -1
  221. package/build-module/components/editor-initialization/index.js +1 -1
  222. package/build-module/components/editor-initialization/index.js.map +1 -1
  223. package/build-module/components/editor-initialization/listener-hooks.js +3 -5
  224. package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
  225. package/build-module/components/header/{document-title → document-actions}/index.js +11 -21
  226. package/build-module/components/header/document-actions/index.js.map +1 -0
  227. package/build-module/components/header/fullscreen-mode-close/index.js +4 -13
  228. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  229. package/build-module/components/header/header-toolbar/index.js +5 -13
  230. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  231. package/build-module/components/header/header-toolbar/index.native.js +5 -12
  232. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  233. package/build-module/components/header/index.js +6 -8
  234. package/build-module/components/header/index.js.map +1 -1
  235. package/build-module/components/header/index.native.js +2 -9
  236. package/build-module/components/header/index.native.js.map +1 -1
  237. package/build-module/components/header/main-dashboard-button/index.js +0 -5
  238. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  239. package/build-module/components/header/mode-switcher/index.js +25 -14
  240. package/build-module/components/header/mode-switcher/index.js.map +1 -1
  241. package/build-module/components/header/more-menu/index.js +1 -4
  242. package/build-module/components/header/more-menu/index.js.map +1 -1
  243. package/build-module/components/header/plugin-more-menu-item/index.js +1 -2
  244. package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -1
  245. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +3 -2
  246. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
  247. package/build-module/components/header/post-publish-button-or-toggle.js +2 -5
  248. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  249. package/build-module/components/header/preferences-menu-item/index.js +1 -2
  250. package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
  251. package/build-module/components/header/tools-more-menu-group/index.js +0 -3
  252. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  253. package/build-module/components/header/writing-menu/index.js +1 -8
  254. package/build-module/components/header/writing-menu/index.js.map +1 -1
  255. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  256. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -6
  257. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  258. package/build-module/components/keyboard-shortcut-help-modal/index.js +5 -13
  259. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  260. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -5
  261. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  262. package/build-module/components/keyboard-shortcuts/index.js +4 -14
  263. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  264. package/build-module/components/layout/actions-panel.js +6 -8
  265. package/build-module/components/layout/actions-panel.js.map +1 -1
  266. package/build-module/components/layout/index.js +53 -28
  267. package/build-module/components/layout/index.js.map +1 -1
  268. package/build-module/components/layout/index.native.js +6 -20
  269. package/build-module/components/layout/index.native.js.map +1 -1
  270. package/build-module/components/meta-boxes/index.js +4 -6
  271. package/build-module/components/meta-boxes/index.js.map +1 -1
  272. package/build-module/components/meta-boxes/meta-box-visibility.js +1 -9
  273. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  274. package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -7
  275. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  276. package/build-module/components/preferences-modal/index.js +2 -5
  277. package/build-module/components/preferences-modal/index.js.map +1 -1
  278. package/build-module/components/preferences-modal/meta-boxes-section.js +3 -5
  279. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  280. package/build-module/components/preferences-modal/options/enable-custom-fields.js +9 -2
  281. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  282. package/build-module/components/preferences-modal/options/enable-feature.js +1 -1
  283. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  284. package/build-module/components/preferences-modal/options/enable-panel.js +1 -1
  285. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  286. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +1 -4
  287. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  288. package/build-module/components/preferences-modal/options/enable-publish-sidebar.js +2 -1
  289. package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
  290. package/build-module/components/preferences-modal/options/index.js.map +1 -1
  291. package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -2
  292. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  293. package/build-module/components/secondary-sidebar/list-view-outline.js +0 -3
  294. package/build-module/components/secondary-sidebar/list-view-outline.js.map +1 -1
  295. package/build-module/components/secondary-sidebar/list-view-sidebar.js +35 -33
  296. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  297. package/build-module/components/sidebar/discussion-panel/index.js +22 -25
  298. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  299. package/build-module/components/sidebar/featured-image/index.js +2 -7
  300. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  301. package/build-module/components/sidebar/last-revision/index.js +0 -3
  302. package/build-module/components/sidebar/last-revision/index.js.map +1 -1
  303. package/build-module/components/sidebar/page-attributes/index.js +2 -7
  304. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  305. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +46 -55
  306. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  307. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +19 -22
  308. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  309. package/build-module/components/sidebar/plugin-post-status-info/index.js +1 -3
  310. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  311. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +19 -22
  312. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  313. package/build-module/components/sidebar/plugin-sidebar/index.js +2 -3
  314. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  315. package/build-module/components/sidebar/post-author/index.js +0 -1
  316. package/build-module/components/sidebar/post-author/index.js.map +1 -1
  317. package/build-module/components/sidebar/post-excerpt/index.js +2 -7
  318. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  319. package/build-module/components/sidebar/post-format/index.js +0 -1
  320. package/build-module/components/sidebar/post-format/index.js.map +1 -1
  321. package/build-module/components/sidebar/post-pending-status/index.js +0 -1
  322. package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
  323. package/build-module/components/sidebar/post-schedule/index.js +4 -5
  324. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  325. package/build-module/components/sidebar/post-slug/index.js +0 -1
  326. package/build-module/components/sidebar/post-slug/index.js.map +1 -1
  327. package/build-module/components/sidebar/post-status/index.js +2 -6
  328. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  329. package/build-module/components/sidebar/post-sticky/index.js +0 -1
  330. package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
  331. package/build-module/components/sidebar/post-taxonomies/index.js +1 -4
  332. package/build-module/components/sidebar/post-taxonomies/index.js.map +1 -1
  333. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +1 -7
  334. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  335. package/build-module/components/sidebar/post-template/create-modal.js +1 -10
  336. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
  337. package/build-module/components/sidebar/post-template/form.js +3 -6
  338. package/build-module/components/sidebar/post-template/form.js.map +1 -1
  339. package/build-module/components/sidebar/post-template/index.js +5 -16
  340. package/build-module/components/sidebar/post-template/index.js.map +1 -1
  341. package/build-module/components/sidebar/post-trash/index.js +0 -1
  342. package/build-module/components/sidebar/post-trash/index.js.map +1 -1
  343. package/build-module/components/sidebar/post-url/index.js +4 -5
  344. package/build-module/components/sidebar/post-url/index.js.map +1 -1
  345. package/build-module/components/sidebar/post-visibility/index.js +4 -6
  346. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  347. package/build-module/components/sidebar/settings-header/index.js +12 -13
  348. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  349. package/build-module/components/sidebar/settings-sidebar/index.js +2 -9
  350. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  351. package/build-module/components/sidebar/template-summary/index.js +1 -6
  352. package/build-module/components/sidebar/template-summary/index.js.map +1 -1
  353. package/build-module/components/start-page-options/index.js +1 -8
  354. package/build-module/components/start-page-options/index.js.map +1 -1
  355. package/build-module/components/text-editor/index.js +1 -2
  356. package/build-module/components/text-editor/index.js.map +1 -1
  357. package/build-module/components/view-link/index.js +2 -3
  358. package/build-module/components/view-link/index.js.map +1 -1
  359. package/build-module/components/visual-editor/block-inspector-button.js +1 -5
  360. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  361. package/build-module/components/visual-editor/header.native.js +1 -4
  362. package/build-module/components/visual-editor/header.native.js.map +1 -1
  363. package/build-module/components/visual-editor/index.js +34 -43
  364. package/build-module/components/visual-editor/index.js.map +1 -1
  365. package/build-module/components/visual-editor/index.native.js +1 -5
  366. package/build-module/components/visual-editor/index.native.js.map +1 -1
  367. package/build-module/components/welcome-guide/default.js +1 -2
  368. package/build-module/components/welcome-guide/default.js.map +1 -1
  369. package/build-module/components/welcome-guide/image.js.map +1 -1
  370. package/build-module/components/welcome-guide/index.js +1 -6
  371. package/build-module/components/welcome-guide/index.js.map +1 -1
  372. package/build-module/components/welcome-guide/template.js +1 -2
  373. package/build-module/components/welcome-guide/template.js.map +1 -1
  374. package/build-module/editor.js +9 -52
  375. package/build-module/editor.js.map +1 -1
  376. package/build-module/editor.native.js +11 -23
  377. package/build-module/editor.native.js.map +1 -1
  378. package/build-module/hooks/commands/use-common-commands.js +66 -14
  379. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  380. package/build-module/hooks/components/index.js +0 -2
  381. package/build-module/hooks/components/index.js.map +1 -1
  382. package/build-module/hooks/index.js.map +1 -1
  383. package/build-module/hooks/validate-multiple-use/index.js +9 -11
  384. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  385. package/build-module/index.js +18 -26
  386. package/build-module/index.js.map +1 -1
  387. package/build-module/index.native.js +2 -3
  388. package/build-module/index.native.js.map +1 -1
  389. package/build-module/lock-unlock.js.map +1 -1
  390. package/build-module/plugins/copy-content-menu-item/index.js +0 -3
  391. package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
  392. package/build-module/plugins/index.js +5 -11
  393. package/build-module/plugins/index.js.map +1 -1
  394. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +1 -2
  395. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  396. package/build-module/plugins/welcome-guide-menu-item/index.js +1 -2
  397. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  398. package/build-module/store/actions.js +55 -66
  399. package/build-module/store/actions.js.map +1 -1
  400. package/build-module/store/constants.js +2 -2
  401. package/build-module/store/constants.js.map +1 -1
  402. package/build-module/store/index.js +2 -2
  403. package/build-module/store/index.js.map +1 -1
  404. package/build-module/store/reducer.js +10 -33
  405. package/build-module/store/reducer.js.map +1 -1
  406. package/build-module/store/selectors.js +63 -64
  407. package/build-module/store/selectors.js.map +1 -1
  408. package/build-module/utils/meta-boxes.js +0 -2
  409. package/build-module/utils/meta-boxes.js.map +1 -1
  410. package/build-style/style-rtl.css +40 -27
  411. package/build-style/style.css +40 -27
  412. package/package.json +32 -32
  413. package/src/components/header/{document-title → document-actions}/index.js +22 -23
  414. package/src/components/header/{document-title → document-actions}/style.scss +25 -22
  415. package/src/components/header/header-toolbar/index.native.js +1 -0
  416. package/src/components/header/header-toolbar/style.scss +4 -0
  417. package/src/components/header/index.js +3 -3
  418. package/src/components/header/mode-switcher/index.js +23 -4
  419. package/src/components/header/style.scss +1 -1
  420. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +29 -0
  421. package/src/components/keyboard-shortcuts/index.js +2 -2
  422. package/src/components/layout/index.js +64 -3
  423. package/src/components/preferences-modal/options/enable-custom-fields.js +15 -4
  424. package/src/components/preferences-modal/options/test/enable-custom-fields.js +6 -1
  425. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +5 -2
  426. package/src/components/preferences-modal/test/index.js +4 -4
  427. package/src/components/secondary-sidebar/list-view-sidebar.js +3 -3
  428. package/src/components/sidebar/discussion-panel/index.js +15 -20
  429. package/src/components/sidebar/plugin-document-setting-panel/index.js +54 -65
  430. package/src/components/sidebar/plugin-post-publish-panel/index.js +23 -27
  431. package/src/components/sidebar/plugin-pre-publish-panel/index.js +25 -28
  432. package/src/components/sidebar/post-schedule/style.scss +2 -0
  433. package/src/components/visual-editor/index.js +9 -8
  434. package/src/components/visual-editor/style.scss +5 -1
  435. package/src/editor.js +2 -47
  436. package/src/hooks/commands/use-common-commands.js +84 -22
  437. package/src/index.js +5 -1
  438. package/src/store/selectors.js +10 -3
  439. package/src/style.scss +1 -1
  440. package/src/test/editor.native.js +4 -3
  441. package/build/components/header/document-title/index.js.map +0 -1
  442. package/build-module/components/header/document-title/index.js.map +0 -1
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -9,46 +8,49 @@ import { useFocusOnMount, useFocusReturn, useMergeRefs } from '@wordpress/compos
9
8
  import { useDispatch } from '@wordpress/data';
10
9
  import { focus } from '@wordpress/dom';
11
10
  import { useRef, useState } from '@wordpress/element';
12
- import { __ } from '@wordpress/i18n';
11
+ import { __, _x } from '@wordpress/i18n';
13
12
  import { closeSmall } from '@wordpress/icons';
14
13
  import { useShortcut } from '@wordpress/keyboard-shortcuts';
15
14
  import { ESCAPE } from '@wordpress/keycodes';
15
+
16
16
  /**
17
17
  * Internal dependencies
18
18
  */
19
-
20
19
  import { store as editPostStore } from '../../store';
21
20
  import ListViewOutline from './list-view-outline';
22
21
  export default function ListViewSidebar() {
23
22
  const {
24
23
  setIsListViewOpened
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.
24
+ } = useDispatch(editPostStore);
28
25
 
26
+ // This hook handles focus when the sidebar first renders.
27
+ const focusOnMountRef = useFocusOnMount('firstElement');
28
+ // The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.
29
29
  const headerFocusReturnRef = useFocusReturn();
30
30
  const contentFocusReturnRef = useFocusReturn();
31
-
32
31
  function closeOnEscape(event) {
33
32
  if (event.keyCode === ESCAPE && !event.defaultPrevented) {
34
33
  event.preventDefault();
35
34
  setIsListViewOpened(false);
36
35
  }
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.
42
-
43
- const [tab, setTab] = useState('list-view'); // This ref refers to the sidebar as a whole.
44
-
45
- const sidebarRef = useRef(); // This ref refers to the tab panel.
46
-
47
- const tabPanelRef = useRef(); // This ref refers to the list view application area.
48
-
49
- const listViewRef = useRef(); // Must merge the refs together so focus can be handled properly in the next function.
36
+ }
50
37
 
38
+ // Use internal state instead of a ref to make sure that the component
39
+ // re-renders when the dropZoneElement updates.
40
+ const [dropZoneElement, setDropZoneElement] = useState(null);
41
+ // Tracks our current tab.
42
+ const [tab, setTab] = useState('list-view');
43
+
44
+ // This ref refers to the sidebar as a whole.
45
+ const sidebarRef = useRef();
46
+ // This ref refers to the tab panel.
47
+ const tabPanelRef = useRef();
48
+ // This ref refers to the list view application area.
49
+ const listViewRef = useRef();
50
+
51
+ // Must merge the refs together so focus can be handled properly in the next function.
51
52
  const listViewContainerRef = useMergeRefs([contentFocusReturnRef, focusOnMountRef, listViewRef, setDropZoneElement]);
53
+
52
54
  /*
53
55
  * Callback function to handle list view or outline focus.
54
56
  *
@@ -56,36 +58,37 @@ export default function ListViewSidebar() {
56
58
  *
57
59
  * @return void
58
60
  */
59
-
60
61
  function handleSidebarFocus(currentTab) {
61
62
  // Tab panel focus.
62
- const tabPanelFocus = focus.tabbable.find(tabPanelRef.current)[0]; // List view tab is selected.
63
-
63
+ const tabPanelFocus = focus.tabbable.find(tabPanelRef.current)[0];
64
+ // List view tab is selected.
64
65
  if (currentTab === 'list-view') {
65
66
  // 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.
66
67
  const listViewApplicationFocus = focus.tabbable.find(listViewRef.current)[0];
67
68
  const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : tabPanelFocus;
68
- listViewFocusArea.focus(); // Outline tab is selected.
69
+ listViewFocusArea.focus();
70
+ // Outline tab is selected.
69
71
  } else {
70
72
  tabPanelFocus.focus();
71
73
  }
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.
73
-
74
+ }
74
75
 
76
+ // 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.
75
77
  useShortcut('core/edit-post/toggle-list-view', () => {
76
78
  // If the sidebar has focus, it is safe to close.
77
79
  if (sidebarRef.current.contains(sidebarRef.current.ownerDocument.activeElement)) {
78
- setIsListViewOpened(false); // If the list view or outline does not have focus, focus should be moved to it.
80
+ setIsListViewOpened(false);
81
+ // If the list view or outline does not have focus, focus should be moved to it.
79
82
  } else {
80
83
  handleSidebarFocus(tab);
81
84
  }
82
85
  });
86
+
83
87
  /**
84
88
  * Render tab content for a given tab name.
85
89
  *
86
90
  * @param {string} tabName The name of the tab to render.
87
91
  */
88
-
89
92
  function renderTabContent(tabName) {
90
93
  if (tabName === 'list-view') {
91
94
  return createElement("div", {
@@ -94,11 +97,10 @@ export default function ListViewSidebar() {
94
97
  dropZoneElement: dropZoneElement
95
98
  }));
96
99
  }
97
-
98
100
  return createElement(ListViewOutline, null);
99
101
  }
100
-
101
- return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
102
+ return (
103
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
102
104
  createElement("div", {
103
105
  className: "edit-post-editor__document-overview-panel",
104
106
  onKeyDown: closeOnEscape,
@@ -116,11 +118,11 @@ export default function ListViewSidebar() {
116
118
  selectOnMove: false,
117
119
  tabs: [{
118
120
  name: 'list-view',
119
- title: 'List View',
121
+ title: _x('List View', 'Post overview'),
120
122
  className: 'edit-post-sidebar__panel-tab'
121
123
  }, {
122
124
  name: 'outline',
123
- title: 'Outline',
125
+ title: _x('Outline', 'Post overview'),
124
126
  className: 'edit-post-sidebar__panel-tab'
125
127
  }]
126
128
  }, currentTab => createElement("div", {
@@ -1 +1 @@
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":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport ListViewOutline from './list-view-outline';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editPostStore );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\t// The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabPanelRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tcontentFocusReturnRef,\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabPanelRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\t// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tsetIsListViewOpened( false );\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t} else {\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t} );\n\n\t/**\n\t * Render tab content for a given tab name.\n\t *\n\t * @param {string} tabName The name of the tab to render.\n\t */\n\tfunction renderTabContent( tabName ) {\n\t\tif ( tabName === 'list-view' ) {\n\t\t\treturn (\n\t\t\t\t<div className=\"edit-post-editor__list-view-panel-content\">\n\t\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn <ListViewOutline />;\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-post-editor__document-overview-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__close-button\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t/>\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__tab-panel\"\n\t\t\t\tref={ tabPanelRef }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tselectOnMove={ false }\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: 'List View',\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: 'Outline',\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ ( currentTab ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-post-editor__list-view-container\"\n\t\t\t\t\t\tref={ listViewContainerRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ renderTabContent( currentTab.name ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TabPanel>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"names":["__experimentalListView","ListView","Button","TabPanel","useFocusOnMount","useFocusReturn","useMergeRefs","useDispatch","focus","useRef","useState","__","_x","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","createElement","className","onKeyDown","ref","icon","label","onClick","onSelect","selectOnMove","tabs","name","title"],"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __, _x } 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: _x( 'List View', 'Post overview' ),\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: _x( 'Outline', 'Post overview' ),\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"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,QAAQ,QAAQ,yBAAyB;AAC5E,SAASC,MAAM,EAAEC,QAAQ,QAAQ,uBAAuB;AACxD,SACCC,eAAe,EACfC,cAAc,EACdC,YAAY,QACN,oBAAoB;AAC3B,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,QAAQ,gBAAgB;AACtC,SAASC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AACrD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,WAAW,QAAQ,+BAA+B;AAC3D,SAASC,MAAM,QAAQ,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,OAAOC,eAAe,MAAM,qBAAqB;AAEjD,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC;EAAoB,CAAC,GAAGb,WAAW,CAAEU,aAAc,CAAC;;EAE5D;EACA,MAAMI,eAAe,GAAGjB,eAAe,CAAE,cAAe,CAAC;EACzD;EACA,MAAMkB,oBAAoB,GAAGjB,cAAc,CAAC,CAAC;EAC7C,MAAMkB,qBAAqB,GAAGlB,cAAc,CAAC,CAAC;EAE9C,SAASmB,aAAaA,CAAEC,KAAK,EAAG;IAC/B,IAAKA,KAAK,CAACC,OAAO,KAAKX,MAAM,IAAI,CAAEU,KAAK,CAACE,gBAAgB,EAAG;MAC3DF,KAAK,CAACG,cAAc,CAAC,CAAC;MACtBR,mBAAmB,CAAE,KAAM,CAAC;IAC7B;EACD;;EAEA;EACA;EACA,MAAM,CAAES,eAAe,EAAEC,kBAAkB,CAAE,GAAGpB,QAAQ,CAAE,IAAK,CAAC;EAChE;EACA,MAAM,CAAEqB,GAAG,EAAEC,MAAM,CAAE,GAAGtB,QAAQ,CAAE,WAAY,CAAC;;EAE/C;EACA,MAAMuB,UAAU,GAAGxB,MAAM,CAAC,CAAC;EAC3B;EACA,MAAMyB,WAAW,GAAGzB,MAAM,CAAC,CAAC;EAC5B;EACA,MAAM0B,WAAW,GAAG1B,MAAM,CAAC,CAAC;;EAE5B;EACA,MAAM2B,oBAAoB,GAAG9B,YAAY,CAAE,CAC1CiB,qBAAqB,EACrBF,eAAe,EACfc,WAAW,EACXL,kBAAkB,CACjB,CAAC;;EAEH;AACD;AACA;AACA;AACA;AACA;AACA;EACC,SAASO,kBAAkBA,CAAEC,UAAU,EAAG;IACzC;IACA,MAAMC,aAAa,GAAG/B,KAAK,CAACgC,QAAQ,CAACC,IAAI,CAAEP,WAAW,CAACQ,OAAQ,CAAC,CAAE,CAAC,CAAE;IACrE;IACA,IAAKJ,UAAU,KAAK,WAAW,EAAG;MACjC;MACA,MAAMK,wBAAwB,GAAGnC,KAAK,CAACgC,QAAQ,CAACC,IAAI,CACnDN,WAAW,CAACO,OACb,CAAC,CAAE,CAAC,CAAE;MACN,MAAME,iBAAiB,GAAGX,UAAU,CAACS,OAAO,CAACG,QAAQ,CACpDF,wBACD,CAAC,GACEA,wBAAwB,GACxBJ,aAAa;MAChBK,iBAAiB,CAACpC,KAAK,CAAC,CAAC;MACzB;IACD,CAAC,MAAM;MACN+B,aAAa,CAAC/B,KAAK,CAAC,CAAC;IACtB;EACD;;EAEA;EACAM,WAAW,CAAE,iCAAiC,EAAE,MAAM;IACrD;IACA,IACCmB,UAAU,CAACS,OAAO,CAACG,QAAQ,CAC1BZ,UAAU,CAACS,OAAO,CAACI,aAAa,CAACC,aAClC,CAAC,EACA;MACD3B,mBAAmB,CAAE,KAAM,CAAC;MAC5B;IACD,CAAC,MAAM;MACNiB,kBAAkB,CAAEN,GAAI,CAAC;IAC1B;EACD,CAAE,CAAC;;EAEH;AACD;AACA;AACA;AACA;EACC,SAASiB,gBAAgBA,CAAEC,OAAO,EAAG;IACpC,IAAKA,OAAO,KAAK,WAAW,EAAG;MAC9B,OACCC,aAAA;QAAKC,SAAS,EAAC;MAA2C,GACzDD,aAAA,CAACjD,QAAQ;QAAC4B,eAAe,EAAGA;MAAiB,CAAE,CAC3C,CAAC;IAER;IACA,OAAOqB,aAAA,CAAChC,eAAe,MAAE,CAAC;EAC3B;EAEA;IACC;IACAgC,aAAA;MACCC,SAAS,EAAC,2CAA2C;MACrDC,SAAS,EAAG5B,aAAe;MAC3B6B,GAAG,EAAGpB;IAAY,GAElBiB,aAAA,CAAChD,MAAM;MACNiD,SAAS,EAAC,yDAAyD;MACnEE,GAAG,EAAG/B,oBAAsB;MAC5BgC,IAAI,EAAGzC,UAAY;MACnB0C,KAAK,EAAG5C,EAAE,CAAE,OAAQ,CAAG;MACvB6C,OAAO,EAAGA,CAAA,KAAMpC,mBAAmB,CAAE,KAAM;IAAG,CAC9C,CAAC,EACF8B,aAAA,CAAC/C,QAAQ;MACRgD,SAAS,EAAC,sDAAsD;MAChEE,GAAG,EAAGnB,WAAa;MACnBuB,QAAQ,EAAKR,OAAO,IAAMjB,MAAM,CAAEiB,OAAQ,CAAG;MAC7CS,YAAY,EAAG,KAAO;MACtBC,IAAI,EAAG,CACN;QACCC,IAAI,EAAE,WAAW;QACjBC,KAAK,EAAEjD,EAAE,CAAE,WAAW,EAAE,eAAgB,CAAC;QACzCuC,SAAS,EAAE;MACZ,CAAC,EACD;QACCS,IAAI,EAAE,SAAS;QACfC,KAAK,EAAEjD,EAAE,CAAE,SAAS,EAAE,eAAgB,CAAC;QACvCuC,SAAS,EAAE;MACZ,CAAC;IACC,GAECb,UAAU,IACbY,aAAA;MACCC,SAAS,EAAC,uCAAuC;MACjDE,GAAG,EAAGjB;IAAsB,GAE1BY,gBAAgB,CAAEV,UAAU,CAACsB,IAAK,CAChC,CAEG,CACN;EAAC;AAER"}
@@ -1,55 +1,52 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
6
5
  import { __ } from '@wordpress/i18n';
7
6
  import { PanelBody, PanelRow } from '@wordpress/components';
8
7
  import { PostComments, PostPingbacks, PostTypeSupportCheck } from '@wordpress/editor';
9
- import { compose } from '@wordpress/compose';
10
- import { withSelect, withDispatch } from '@wordpress/data';
8
+ import { useDispatch, useSelect } from '@wordpress/data';
9
+
11
10
  /**
12
11
  * Internal dependencies
13
12
  */
14
-
15
13
  import { store as editPostStore } from '../../../store';
14
+
16
15
  /**
17
16
  * Module Constants
18
17
  */
19
-
20
18
  const PANEL_NAME = 'discussion-panel';
21
-
22
- function DiscussionPanel({
23
- isEnabled,
24
- isOpened,
25
- onTogglePanel
26
- }) {
19
+ function DiscussionPanel() {
20
+ const {
21
+ isEnabled,
22
+ isOpened
23
+ } = useSelect(select => {
24
+ const {
25
+ isEditorPanelEnabled,
26
+ isEditorPanelOpened
27
+ } = select(editPostStore);
28
+ return {
29
+ isEnabled: isEditorPanelEnabled(PANEL_NAME),
30
+ isOpened: isEditorPanelOpened(PANEL_NAME)
31
+ };
32
+ }, []);
33
+ const {
34
+ toggleEditorPanelOpened
35
+ } = useDispatch(editPostStore);
27
36
  if (!isEnabled) {
28
37
  return null;
29
38
  }
30
-
31
39
  return createElement(PostTypeSupportCheck, {
32
40
  supportKeys: ['comments', 'trackbacks']
33
41
  }, createElement(PanelBody, {
34
42
  title: __('Discussion'),
35
43
  opened: isOpened,
36
- onToggle: onTogglePanel
44
+ onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
37
45
  }, createElement(PostTypeSupportCheck, {
38
46
  supportKeys: "comments"
39
47
  }, createElement(PanelRow, null, createElement(PostComments, null))), createElement(PostTypeSupportCheck, {
40
48
  supportKeys: "trackbacks"
41
49
  }, createElement(PanelRow, null, createElement(PostPingbacks, null)))));
42
50
  }
43
-
44
- export default compose([withSelect(select => {
45
- return {
46
- isEnabled: select(editPostStore).isEditorPanelEnabled(PANEL_NAME),
47
- isOpened: select(editPostStore).isEditorPanelOpened(PANEL_NAME)
48
- };
49
- }), withDispatch(dispatch => ({
50
- onTogglePanel() {
51
- return dispatch(editPostStore).toggleEditorPanelOpened(PANEL_NAME);
52
- }
53
-
54
- }))])(DiscussionPanel);
51
+ export default DiscussionPanel;
55
52
  //# sourceMappingURL=index.js.map
@@ -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,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"]}
1
+ {"version":3,"names":["__","PanelBody","PanelRow","PostComments","PostPingbacks","PostTypeSupportCheck","useDispatch","useSelect","store","editPostStore","PANEL_NAME","DiscussionPanel","isEnabled","isOpened","select","isEditorPanelEnabled","isEditorPanelOpened","toggleEditorPanelOpened","createElement","supportKeys","title","opened","onToggle"],"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"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 { useDispatch, useSelect } 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() {\n\tconst { isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\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={ () => toggleEditorPanelOpened( PANEL_NAME ) }\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 DiscussionPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,uBAAuB;AAC3D,SACCC,YAAY,EACZC,aAAa,EACbC,oBAAoB,QACd,mBAAmB;AAC1B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,MAAMC,UAAU,GAAG,kBAAkB;AAErC,SAASC,eAAeA,CAAA,EAAG;EAC1B,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IACxD,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEL,aAAc,CAAC;IACxB,OAAO;MACNG,SAAS,EAAEG,oBAAoB,CAAEL,UAAW,CAAC;MAC7CG,QAAQ,EAAEG,mBAAmB,CAAEN,UAAW;IAC3C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEO;EAAwB,CAAC,GAAGX,WAAW,CAAEG,aAAc,CAAC;EAEhE,IAAK,CAAEG,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACCM,aAAA,CAACb,oBAAoB;IAACc,WAAW,EAAG,CAAE,UAAU,EAAE,YAAY;EAAI,GACjED,aAAA,CAACjB,SAAS;IACTmB,KAAK,EAAGpB,EAAE,CAAE,YAAa,CAAG;IAC5BqB,MAAM,EAAGR,QAAU;IACnBS,QAAQ,EAAGA,CAAA,KAAML,uBAAuB,CAAEP,UAAW;EAAG,GAExDQ,aAAA,CAACb,oBAAoB;IAACc,WAAW,EAAC;EAAU,GAC3CD,aAAA,CAAChB,QAAQ,QACRgB,aAAA,CAACf,YAAY,MAAE,CACN,CACW,CAAC,EAEvBe,aAAA,CAACb,oBAAoB;IAACc,WAAW,EAAC;EAAY,GAC7CD,aAAA,CAAChB,QAAQ,QACRgB,aAAA,CAACd,aAAa,MAAE,CACP,CACW,CACZ,CACU,CAAC;AAEzB;AAEA,eAAeO,eAAe"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -9,17 +8,16 @@ import { PostFeaturedImage, PostFeaturedImageCheck, store as editorStore } from
9
8
  import { compose } from '@wordpress/compose';
10
9
  import { withSelect, withDispatch } from '@wordpress/data';
11
10
  import { store as coreStore } from '@wordpress/core-data';
11
+
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
-
16
15
  import { store as editPostStore } from '../../../store';
16
+
17
17
  /**
18
18
  * Module Constants
19
19
  */
20
-
21
20
  const PANEL_NAME = 'featured-image';
22
-
23
21
  function FeaturedImage({
24
22
  isEnabled,
25
23
  isOpened,
@@ -27,18 +25,15 @@ function FeaturedImage({
27
25
  onTogglePanel
28
26
  }) {
29
27
  var _postType$labels$feat;
30
-
31
28
  if (!isEnabled) {
32
29
  return null;
33
30
  }
34
-
35
31
  return createElement(PostFeaturedImageCheck, null, createElement(PanelBody, {
36
32
  title: (_postType$labels$feat = postType?.labels?.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : __('Featured image'),
37
33
  opened: isOpened,
38
34
  onToggle: onTogglePanel
39
35
  }, createElement(PostFeaturedImage, null)));
40
36
  }
41
-
42
37
  const applyWithSelect = withSelect(select => {
43
38
  const {
44
39
  getEditedPostAttribute
@@ -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,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"]}
1
+ {"version":3,"names":["__","PanelBody","PostFeaturedImage","PostFeaturedImageCheck","store","editorStore","compose","withSelect","withDispatch","coreStore","editPostStore","PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","_postType$labels$feat","createElement","title","labels","featured_image","opened","onToggle","applyWithSelect","select","getEditedPostAttribute","getPostType","isEditorPanelEnabled","isEditorPanelOpened","applyWithDispatch","dispatch","toggleEditorPanelOpened","args"],"sources":["@wordpress/edit-post/src/components/sidebar/featured-image/index.js"],"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"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SACCC,iBAAiB,EACjBC,sBAAsB,EACtBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASJ,KAAK,IAAIK,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASL,KAAK,IAAIM,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,MAAMC,UAAU,GAAG,gBAAgB;AAEnC,SAASC,aAAaA,CAAE;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAc,CAAC,EAAG;EAAA,IAAAC,qBAAA;EAC1E,IAAK,CAAEJ,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACCK,aAAA,CAACf,sBAAsB,QACtBe,aAAA,CAACjB,SAAS;IACTkB,KAAK,GAAAF,qBAAA,GACJF,QAAQ,EAAEK,MAAM,EAAEC,cAAc,cAAAJ,qBAAA,cAAAA,qBAAA,GAAIjB,EAAE,CAAE,gBAAiB,CACzD;IACDsB,MAAM,EAAGR,QAAU;IACnBS,QAAQ,EAAGP;EAAe,GAE1BE,aAAA,CAAChB,iBAAiB,MAAE,CACV,CACY,CAAC;AAE3B;AAEA,MAAMsB,eAAe,GAAGjB,UAAU,CAAIkB,MAAM,IAAM;EACjD,MAAM;IAAEC;EAAuB,CAAC,GAAGD,MAAM,CAAEpB,WAAY,CAAC;EACxD,MAAM;IAAEsB;EAAY,CAAC,GAAGF,MAAM,CAAEhB,SAAU,CAAC;EAC3C,MAAM;IAAEmB,oBAAoB;IAAEC;EAAoB,CAAC,GAClDJ,MAAM,CAAEf,aAAc,CAAC;EAExB,OAAO;IACNK,QAAQ,EAAEY,WAAW,CAAED,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDb,SAAS,EAAEe,oBAAoB,CAAEjB,UAAW,CAAC;IAC7CG,QAAQ,EAAEe,mBAAmB,CAAElB,UAAW;EAC3C,CAAC;AACF,CAAE,CAAC;AAEH,MAAMmB,iBAAiB,GAAGtB,YAAY,CAAIuB,QAAQ,IAAM;EACvD,MAAM;IAAEC;EAAwB,CAAC,GAAGD,QAAQ,CAAErB,aAAc,CAAC;EAE7D,OAAO;IACNM,aAAa,EAAEA,CAAE,GAAGiB,IAAI,KACvBD,uBAAuB,CAAErB,UAAU,EAAE,GAAGsB,IAAK;EAC/C,CAAC;AACF,CAAE,CAAC;AAEH,eAAe3B,OAAO,CAAEkB,eAAe,EAAEM,iBAAkB,CAAC,CAAElB,aAAc,CAAC"}
@@ -1,16 +1,13 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
6
5
  import { PanelBody } from '@wordpress/components';
7
6
  import { PostLastRevision, PostLastRevisionCheck } from '@wordpress/editor';
8
-
9
7
  function LastRevision() {
10
8
  return createElement(PostLastRevisionCheck, null, createElement(PanelBody, {
11
9
  className: "edit-post-last-revision__panel"
12
10
  }, createElement(PostLastRevision, null)));
13
11
  }
14
-
15
12
  export default LastRevision;
16
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/last-revision/index.js"],"names":["PanelBody","PostLastRevision","PostLastRevisionCheck","LastRevision"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,uBAA1B;AACA,SAASC,gBAAT,EAA2BC,qBAA3B,QAAwD,mBAAxD;;AAEA,SAASC,YAAT,GAAwB;AACvB,SACC,cAAC,qBAAD,QACC,cAAC,SAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,cAAC,gBAAD,OADD,CADD,CADD;AAOA;;AAED,eAAeA,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { PostLastRevision, PostLastRevisionCheck } from '@wordpress/editor';\n\nfunction LastRevision() {\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PanelBody className=\"edit-post-last-revision__panel\">\n\t\t\t\t<PostLastRevision />\n\t\t\t</PanelBody>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default LastRevision;\n"]}
1
+ {"version":3,"names":["PanelBody","PostLastRevision","PostLastRevisionCheck","LastRevision","createElement","className"],"sources":["@wordpress/edit-post/src/components/sidebar/last-revision/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { PostLastRevision, PostLastRevisionCheck } from '@wordpress/editor';\n\nfunction LastRevision() {\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PanelBody className=\"edit-post-last-revision__panel\">\n\t\t\t\t<PostLastRevision />\n\t\t\t</PanelBody>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default LastRevision;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;AACjD,SAASC,gBAAgB,EAAEC,qBAAqB,QAAQ,mBAAmB;AAE3E,SAASC,YAAYA,CAAA,EAAG;EACvB,OACCC,aAAA,CAACF,qBAAqB,QACrBE,aAAA,CAACJ,SAAS;IAACK,SAAS,EAAC;EAAgC,GACpDD,aAAA,CAACH,gBAAgB,MAAE,CACT,CACW,CAAC;AAE1B;AAEA,eAAeE,YAAY"}
@@ -1,5 +1,4 @@
1
1
  import { createElement } from "@wordpress/element";
2
-
3
2
  /**
4
3
  * WordPress dependencies
5
4
  */
@@ -8,19 +7,18 @@ import { PanelBody, PanelRow } from '@wordpress/components';
8
7
  import { store as editorStore, PageAttributesCheck, PageAttributesOrder, PageAttributesParent } from '@wordpress/editor';
9
8
  import { useSelect, useDispatch } from '@wordpress/data';
10
9
  import { store as coreStore } from '@wordpress/core-data';
10
+
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
-
15
14
  import { store as editPostStore } from '../../../store';
15
+
16
16
  /**
17
17
  * Module Constants
18
18
  */
19
-
20
19
  const PANEL_NAME = 'page-attributes';
21
20
  export function PageAttributes() {
22
21
  var _postType$labels$attr;
23
-
24
22
  const {
25
23
  isEnabled,
26
24
  isOpened,
@@ -45,13 +43,10 @@ export function PageAttributes() {
45
43
  const {
46
44
  toggleEditorPanelOpened
47
45
  } = useDispatch(editPostStore);
48
-
49
46
  if (!isEnabled || !postType) {
50
47
  return null;
51
48
  }
52
-
53
49
  const onTogglePanel = (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args);
54
-
55
50
  return createElement(PageAttributesCheck, null, createElement(PanelBody, {
56
51
  title: (_postType$labels$attr = postType?.labels?.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : __('Page attributes'),
57
52
  opened: isOpened,
@@ -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,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"]}
1
+ {"version":3,"names":["__","PanelBody","PanelRow","store","editorStore","PageAttributesCheck","PageAttributesOrder","PageAttributesParent","useSelect","useDispatch","coreStore","editPostStore","PANEL_NAME","PageAttributes","_postType$labels$attr","isEnabled","isOpened","postType","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","getPostType","toggleEditorPanelOpened","onTogglePanel","args","createElement","title","labels","attributes","opened","onToggle"],"sources":["@wordpress/edit-post/src/components/sidebar/page-attributes/index.js"],"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"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,uBAAuB;AAC3D,SACCC,KAAK,IAAIC,WAAW,EACpBC,mBAAmB,EACnBC,mBAAmB,EACnBC,oBAAoB,QACd,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASN,KAAK,IAAIO,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,MAAMC,UAAU,GAAG,iBAAiB;AAEpC,OAAO,SAASC,cAAcA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EAChC,MAAM;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IAClE,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEd,WAAY,CAAC;IACxD,MAAM;MAAEgB,oBAAoB;MAAEC;IAAoB,CAAC,GAClDH,MAAM,CAAEP,aAAc,CAAC;IACxB,MAAM;MAAEW;IAAY,CAAC,GAAGJ,MAAM,CAAER,SAAU,CAAC;IAC3C,OAAO;MACNK,SAAS,EAAEK,oBAAoB,CAAER,UAAW,CAAC;MAC7CI,QAAQ,EAAEK,mBAAmB,CAAET,UAAW,CAAC;MAC3CK,QAAQ,EAAEK,WAAW,CAAEH,sBAAsB,CAAE,MAAO,CAAE;IACzD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEI;EAAwB,CAAC,GAAGd,WAAW,CAAEE,aAAc,CAAC;EAEhE,IAAK,CAAEI,SAAS,IAAI,CAAEE,QAAQ,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,MAAMO,aAAa,GAAGA,CAAE,GAAGC,IAAI,KAC9BF,uBAAuB,CAAEX,UAAU,EAAE,GAAGa,IAAK,CAAC;EAE/C,OACCC,aAAA,CAACrB,mBAAmB,QACnBqB,aAAA,CAACzB,SAAS;IACT0B,KAAK,GAAAb,qBAAA,GACJG,QAAQ,EAAEW,MAAM,EAAEC,UAAU,cAAAf,qBAAA,cAAAA,qBAAA,GAAId,EAAE,CAAE,iBAAkB,CACtD;IACD8B,MAAM,EAAGd,QAAU;IACnBe,QAAQ,EAAGP;EAAe,GAE1BE,aAAA,CAACnB,oBAAoB,MAAE,CAAC,EACxBmB,aAAA,CAACxB,QAAQ,QACRwB,aAAA,CAACpB,mBAAmB,MAAE,CACb,CACA,CACS,CAAC;AAExB;AAEA,eAAeO,cAAc"}
@@ -1,21 +1,15 @@
1
1
  import { createElement, Fragment } from "@wordpress/element";
2
-
3
- /**
4
- * Defines as extensibility slot for the Settings sidebar
5
- */
6
-
7
2
  /**
8
3
  * WordPress dependencies
9
4
  */
10
5
  import { createSlotFill, PanelBody } from '@wordpress/components';
11
- import { compose } from '@wordpress/compose';
12
- import { withPluginContext } from '@wordpress/plugins';
13
- import { withDispatch, withSelect } from '@wordpress/data';
6
+ import { usePluginContext } from '@wordpress/plugins';
7
+ import { useDispatch, useSelect } from '@wordpress/data';
14
8
  import warning from '@wordpress/warning';
9
+
15
10
  /**
16
11
  * Internal dependencies
17
12
  */
18
-
19
13
  import { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';
20
14
  import { store as editPostStore } from '../../../store';
21
15
  const {
@@ -23,35 +17,15 @@ const {
23
17
  Slot
24
18
  } = createSlotFill('PluginDocumentSettingPanel');
25
19
 
26
- const PluginDocumentSettingFill = ({
27
- isEnabled,
28
- panelName,
29
- opened,
30
- onToggle,
31
- className,
32
- title,
33
- icon,
34
- children
35
- }) => {
36
- return createElement(Fragment, null, createElement(EnablePluginDocumentSettingPanelOption, {
37
- label: title,
38
- panelName: panelName
39
- }), createElement(Fill, null, isEnabled && createElement(PanelBody, {
40
- className: className,
41
- title: title,
42
- icon: icon,
43
- opened: opened,
44
- onToggle: onToggle
45
- }, children)));
46
- };
47
20
  /**
48
21
  * Renders items below the Status & Availability panel in the Document Sidebar.
49
22
  *
50
23
  * @param {Object} props Component properties.
51
- * @param {string} [props.name] The machine-friendly name for the panel.
24
+ * @param {string} props.name Required. A machine-friendly name for the panel.
52
25
  * @param {string} [props.className] An optional class name added to the row.
53
26
  * @param {string} [props.title] The title of the panel
54
27
  * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
28
+ * @param {WPElement} props.children Children to be rendered
55
29
  *
56
30
  * @example
57
31
  * ```js
@@ -67,6 +41,7 @@ const PluginDocumentSettingFill = ({
67
41
  * {
68
42
  * className: 'my-document-setting-plugin',
69
43
  * title: 'My Panel',
44
+ * name: 'my-panel',
70
45
  * },
71
46
  * __( 'My Document Setting Panel' )
72
47
  * );
@@ -84,7 +59,7 @@ const PluginDocumentSettingFill = ({
84
59
  * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
85
60
  *
86
61
  * const MyDocumentSettingTest = () => (
87
- * <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel">
62
+ * <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel" name="my-panel">
88
63
  * <p>My Document Setting Panel</p>
89
64
  * </PluginDocumentSettingPanel>
90
65
  * );
@@ -94,31 +69,47 @@ const PluginDocumentSettingFill = ({
94
69
  *
95
70
  * @return {WPComponent} The component to be rendered.
96
71
  */
97
-
98
-
99
- const PluginDocumentSettingPanel = compose(withPluginContext((context, ownProps) => {
100
- if (undefined === ownProps.name) {
101
- typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warning('PluginDocumentSettingPanel requires a name property.') : void 0;
102
- }
103
-
104
- return {
105
- panelName: `${context.name}/${ownProps.name}`
106
- };
107
- }), withSelect((select, {
108
- panelName
72
+ const PluginDocumentSettingPanel = ({
73
+ name,
74
+ className,
75
+ title,
76
+ icon,
77
+ children
109
78
  }) => {
110
- return {
111
- opened: select(editPostStore).isEditorPanelOpened(panelName),
112
- isEnabled: select(editPostStore).isEditorPanelEnabled(panelName)
113
- };
114
- }), withDispatch((dispatch, {
115
- panelName
116
- }) => ({
117
- onToggle() {
118
- return dispatch(editPostStore).toggleEditorPanelOpened(panelName);
79
+ const {
80
+ name: pluginName
81
+ } = usePluginContext();
82
+ const panelName = `${pluginName}/${name}`;
83
+ const {
84
+ opened,
85
+ isEnabled
86
+ } = useSelect(select => {
87
+ const {
88
+ isEditorPanelOpened,
89
+ isEditorPanelEnabled
90
+ } = select(editPostStore);
91
+ return {
92
+ opened: isEditorPanelOpened(panelName),
93
+ isEnabled: isEditorPanelEnabled(panelName)
94
+ };
95
+ }, [panelName]);
96
+ const {
97
+ toggleEditorPanelOpened
98
+ } = useDispatch(editPostStore);
99
+ if (undefined === name) {
100
+ typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? warning('PluginDocumentSettingPanel requires a name property.') : void 0;
119
101
  }
120
-
121
- })))(PluginDocumentSettingFill);
102
+ return createElement(Fragment, null, createElement(EnablePluginDocumentSettingPanelOption, {
103
+ label: title,
104
+ panelName: panelName
105
+ }), createElement(Fill, null, isEnabled && createElement(PanelBody, {
106
+ className: className,
107
+ title: title,
108
+ icon: icon,
109
+ opened: opened,
110
+ onToggle: () => toggleEditorPanelOpened(panelName)
111
+ }, children)));
112
+ };
122
113
  PluginDocumentSettingPanel.Slot = Slot;
123
114
  export default PluginDocumentSettingPanel;
124
115
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"names":["createSlotFill","PanelBody","compose","withPluginContext","withDispatch","withSelect","warning","EnablePluginDocumentSettingPanelOption","store","editPostStore","Fill","Slot","PluginDocumentSettingFill","isEnabled","panelName","opened","onToggle","className","title","icon","children","PluginDocumentSettingPanel","context","ownProps","undefined","name","select","isEditorPanelOpened","isEditorPanelEnabled","dispatch","toggleEditorPanelOpened"],"mappings":";;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAT,EAAyBC,SAAzB,QAA0C,uBAA1C;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,iBAAT,QAAkC,oBAAlC;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,OAAOC,OAAP,MAAoB,oBAApB;AAEA;AACA;AACA;;AACA,SAASC,sCAAT,QAAuD,iCAAvD;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiBX,cAAc,CAAE,4BAAF,CAArC;;AAEA,MAAMY,yBAAyB,GAAG,CAAE;AACnCC,EAAAA,SADmC;AAEnCC,EAAAA,SAFmC;AAGnCC,EAAAA,MAHmC;AAInCC,EAAAA,QAJmC;AAKnCC,EAAAA,SALmC;AAMnCC,EAAAA,KANmC;AAOnCC,EAAAA,IAPmC;AAQnCC,EAAAA;AARmC,CAAF,KAS3B;AACN,SACC,8BACC,cAAC,sCAAD;AACC,IAAA,KAAK,EAAGF,KADT;AAEC,IAAA,SAAS,EAAGJ;AAFb,IADD,EAKC,cAAC,IAAD,QACGD,SAAS,IACV,cAAC,SAAD;AACC,IAAA,SAAS,EAAGI,SADb;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,IAAI,EAAGC,IAHR;AAIC,IAAA,MAAM,EAAGJ,MAJV;AAKC,IAAA,QAAQ,EAAGC;AALZ,KAOGI,QAPH,CAFF,CALD,CADD;AAqBA,CA/BD;AAiCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,0BAA0B,GAAGnB,OAAO,CACzCC,iBAAiB,CAAE,CAAEmB,OAAF,EAAWC,QAAX,KAAyB;AAC3C,MAAKC,SAAS,KAAKD,QAAQ,CAACE,IAA5B,EAAmC;AAClC,6FAAAnB,OAAO,CAAE,sDAAF,CAAP;AACA;;AACD,SAAO;AACNQ,IAAAA,SAAS,EAAG,GAAGQ,OAAO,CAACG,IAAM,IAAIF,QAAQ,CAACE,IAAM;AAD1C,GAAP;AAGA,CAPgB,CADwB,EASzCpB,UAAU,CAAE,CAAEqB,MAAF,EAAU;AAAEZ,EAAAA;AAAF,CAAV,KAA6B;AACxC,SAAO;AACNC,IAAAA,MAAM,EAAEW,MAAM,CAAEjB,aAAF,CAAN,CAAwBkB,mBAAxB,CAA6Cb,SAA7C,CADF;AAEND,IAAAA,SAAS,EACRa,MAAM,CAAEjB,aAAF,CAAN,CAAwBmB,oBAAxB,CAA8Cd,SAA9C;AAHK,GAAP;AAKA,CANS,CAT+B,EAgBzCV,YAAY,CAAE,CAAEyB,QAAF,EAAY;AAAEf,EAAAA;AAAF,CAAZ,MAAiC;AAC9CE,EAAAA,QAAQ,GAAG;AACV,WAAOa,QAAQ,CAAEpB,aAAF,CAAR,CAA0BqB,uBAA1B,CACNhB,SADM,CAAP;AAGA;;AAL6C,CAAjC,CAAF,CAhB6B,CAAP,CAuBhCF,yBAvBgC,CAAnC;AAyBAS,0BAA0B,CAACV,IAA3B,GAAkCA,IAAlC;AAEA,eAAeU,0BAAf","sourcesContent":["/**\n * Defines as extensibility slot for the Settings sidebar\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';\nimport { store as editPostStore } from '../../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\nconst PluginDocumentSettingFill = ( {\n\tisEnabled,\n\tpanelName,\n\topened,\n\tonToggle,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.name] The machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = wp.element.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\tif ( undefined === ownProps.name ) {\n\t\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t\t}\n\t\treturn {\n\t\t\tpanelName: `${ context.name }/${ ownProps.name }`,\n\t\t};\n\t} ),\n\twithSelect( ( select, { panelName } ) => {\n\t\treturn {\n\t\t\topened: select( editPostStore ).isEditorPanelOpened( panelName ),\n\t\t\tisEnabled:\n\t\t\t\tselect( editPostStore ).isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonToggle() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tpanelName\n\t\t\t);\n\t\t},\n\t} ) )\n)( PluginDocumentSettingFill );\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"]}
1
+ {"version":3,"names":["createSlotFill","PanelBody","usePluginContext","useDispatch","useSelect","warning","EnablePluginDocumentSettingPanelOption","store","editPostStore","Fill","Slot","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","panelName","opened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","undefined","process","env","NODE_ENV","createElement","Fragment","label","onToggle"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';\nimport { store as editPostStore } from '../../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {WPElement} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = wp.element.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editPostStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,SAASC,sCAAsC,QAAQ,iCAAiC;AACxF,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;AAEvD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGV,cAAc,CAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMW,0BAA0B,GAAGA,CAAE;EACpCC,IAAI;EACJC,SAAS;EACTC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KAAM;EACN,MAAM;IAAEJ,IAAI,EAAEK;EAAW,CAAC,GAAGf,gBAAgB,CAAC,CAAC;EAC/C,MAAMgB,SAAS,GAAI,GAAGD,UAAY,IAAIL,IAAM,EAAC;EAC7C,MAAM;IAAEO,MAAM;IAAEC;EAAU,CAAC,GAAGhB,SAAS,CACpCiB,MAAM,IAAM;IACb,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEb,aAAc,CAAC;IAExB,OAAO;MACNW,MAAM,EAAEG,mBAAmB,CAAEJ,SAAU,CAAC;MACxCE,SAAS,EAAEG,oBAAoB,CAAEL,SAAU;IAC5C,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,CACZ,CAAC;EACD,MAAM;IAAEM;EAAwB,CAAC,GAAGrB,WAAW,CAAEK,aAAc,CAAC;EAEhE,IAAKiB,SAAS,KAAKb,IAAI,EAAG;IACzB,OAAAc,OAAA,oBAAAA,OAAA,CAAAC,GAAA,IAAAD,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAAvB,OAAO,CAAE,sDAAuD,CAAC;EAClE;EAEA,OACCwB,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACvB,sCAAsC;IACtCyB,KAAK,EAAGjB,KAAO;IACfI,SAAS,EAAGA;EAAW,CACvB,CAAC,EACFW,aAAA,CAACpB,IAAI,QACFW,SAAS,IACVS,aAAA,CAAC5B,SAAS;IACTY,SAAS,EAAGA,SAAW;IACvBC,KAAK,EAAGA,KAAO;IACfC,IAAI,EAAGA,IAAM;IACbI,MAAM,EAAGA,MAAQ;IACjBa,QAAQ,EAAGA,CAAA,KAAMR,uBAAuB,CAAEN,SAAU;EAAG,GAErDF,QACQ,CAEP,CACL,CAAC;AAEL,CAAC;AAEDL,0BAA0B,CAACD,IAAI,GAAGA,IAAI;AAEtC,eAAeC,0BAA0B"}