@wordpress/edit-post 7.16.0 → 7.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (428) hide show
  1. package/CHANGELOG.md +2 -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-actions/index.js +1 -17
  20. package/build/components/header/document-actions/index.js.map +1 -1
  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 +2 -24
  26. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  27. package/build/components/header/index.js +3 -20
  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 +6 -21
  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 +47 -82
  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 +32 -44
  92. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  93. package/build/components/sidebar/discussion-panel/index.js +0 -11
  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 +21 -29
  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 +7 -29
  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 +10 -24
  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 +14 -47
  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-actions/index.js +1 -10
  226. package/build-module/components/header/document-actions/index.js.map +1 -1
  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 +3 -11
  232. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  233. package/build-module/components/header/index.js +3 -5
  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 +8 -16
  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 +50 -57
  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 +32 -30
  296. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  297. package/build-module/components/sidebar/discussion-panel/index.js +2 -7
  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 +22 -26
  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 +7 -14
  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 +11 -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 +16 -25
  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 +21 -10
  411. package/build-style/style.css +21 -10
  412. package/package.json +32 -32
  413. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +29 -0
  414. package/src/components/keyboard-shortcuts/index.js +2 -2
  415. package/src/components/layout/index.js +56 -40
  416. package/src/components/preferences-modal/options/enable-custom-fields.js +15 -4
  417. package/src/components/preferences-modal/options/test/enable-custom-fields.js +6 -1
  418. package/src/components/preferences-modal/test/index.js +7 -3
  419. package/src/components/secondary-sidebar/style.scss +2 -1
  420. package/src/components/sidebar/plugin-document-setting-panel/index.js +54 -65
  421. package/src/components/sidebar/plugin-post-publish-panel/index.js +23 -27
  422. package/src/components/sidebar/plugin-pre-publish-panel/index.js +25 -28
  423. package/src/components/sidebar/post-schedule/style.scss +2 -0
  424. package/src/components/sidebar/post-taxonomies/taxonomy-panel.js +19 -32
  425. package/src/components/visual-editor/index.js +9 -8
  426. package/src/components/visual-editor/style.scss +5 -1
  427. package/src/hooks/commands/use-common-commands.js +8 -12
  428. package/src/store/selectors.js +10 -3
@@ -1,36 +1,22 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = ListViewSidebar;
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _blockEditor = require("@wordpress/block-editor");
13
-
14
10
  var _components = require("@wordpress/components");
15
-
16
11
  var _compose = require("@wordpress/compose");
17
-
18
12
  var _data = require("@wordpress/data");
19
-
20
13
  var _dom = require("@wordpress/dom");
21
-
22
14
  var _i18n = require("@wordpress/i18n");
23
-
24
15
  var _icons = require("@wordpress/icons");
25
-
26
16
  var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
27
-
28
17
  var _keycodes = require("@wordpress/keycodes");
29
-
30
18
  var _store = require("../../store");
31
-
32
19
  var _listViewOutline = _interopRequireDefault(require("./list-view-outline"));
33
-
34
20
  /**
35
21
  * WordPress dependencies
36
22
  */
@@ -38,36 +24,40 @@ var _listViewOutline = _interopRequireDefault(require("./list-view-outline"));
38
24
  /**
39
25
  * Internal dependencies
40
26
  */
27
+
41
28
  function ListViewSidebar() {
42
29
  const {
43
30
  setIsListViewOpened
44
- } = (0, _data.useDispatch)(_store.store); // This hook handles focus when the sidebar first renders.
45
-
46
- const focusOnMountRef = (0, _compose.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.
31
+ } = (0, _data.useDispatch)(_store.store);
47
32
 
33
+ // This hook handles focus when the sidebar first renders.
34
+ const focusOnMountRef = (0, _compose.useFocusOnMount)('firstElement');
35
+ // The next 2 hooks handle focus for when the sidebar closes and returning focus to the element that had focus before sidebar opened.
48
36
  const headerFocusReturnRef = (0, _compose.useFocusReturn)();
49
37
  const contentFocusReturnRef = (0, _compose.useFocusReturn)();
50
-
51
38
  function closeOnEscape(event) {
52
39
  if (event.keyCode === _keycodes.ESCAPE && !event.defaultPrevented) {
53
40
  event.preventDefault();
54
41
  setIsListViewOpened(false);
55
42
  }
56
- } // Use internal state instead of a ref to make sure that the component
57
- // re-renders when the dropZoneElement updates.
58
-
59
-
60
- const [dropZoneElement, setDropZoneElement] = (0, _element.useState)(null); // Tracks our current tab.
61
-
62
- const [tab, setTab] = (0, _element.useState)('list-view'); // This ref refers to the sidebar as a whole.
63
-
64
- const sidebarRef = (0, _element.useRef)(); // This ref refers to the tab panel.
65
-
66
- const tabPanelRef = (0, _element.useRef)(); // This ref refers to the list view application area.
67
-
68
- const listViewRef = (0, _element.useRef)(); // Must merge the refs together so focus can be handled properly in the next function.
43
+ }
69
44
 
45
+ // Use internal state instead of a ref to make sure that the component
46
+ // re-renders when the dropZoneElement updates.
47
+ const [dropZoneElement, setDropZoneElement] = (0, _element.useState)(null);
48
+ // Tracks our current tab.
49
+ const [tab, setTab] = (0, _element.useState)('list-view');
50
+
51
+ // This ref refers to the sidebar as a whole.
52
+ const sidebarRef = (0, _element.useRef)();
53
+ // This ref refers to the tab panel.
54
+ const tabPanelRef = (0, _element.useRef)();
55
+ // This ref refers to the list view application area.
56
+ const listViewRef = (0, _element.useRef)();
57
+
58
+ // Must merge the refs together so focus can be handled properly in the next function.
70
59
  const listViewContainerRef = (0, _compose.useMergeRefs)([contentFocusReturnRef, focusOnMountRef, listViewRef, setDropZoneElement]);
60
+
71
61
  /*
72
62
  * Callback function to handle list view or outline focus.
73
63
  *
@@ -75,38 +65,37 @@ function ListViewSidebar() {
75
65
  *
76
66
  * @return void
77
67
  */
78
-
79
68
  function handleSidebarFocus(currentTab) {
80
69
  // Tab panel focus.
81
- const tabPanelFocus = _dom.focus.tabbable.find(tabPanelRef.current)[0]; // List view tab is selected.
82
-
83
-
70
+ const tabPanelFocus = _dom.focus.tabbable.find(tabPanelRef.current)[0];
71
+ // List view tab is selected.
84
72
  if (currentTab === 'list-view') {
85
73
  // 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.
86
74
  const listViewApplicationFocus = _dom.focus.tabbable.find(listViewRef.current)[0];
87
-
88
75
  const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : tabPanelFocus;
89
- listViewFocusArea.focus(); // Outline tab is selected.
76
+ listViewFocusArea.focus();
77
+ // Outline tab is selected.
90
78
  } else {
91
79
  tabPanelFocus.focus();
92
80
  }
93
- } // 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.
94
-
81
+ }
95
82
 
83
+ // 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.
96
84
  (0, _keyboardShortcuts.useShortcut)('core/edit-post/toggle-list-view', () => {
97
85
  // If the sidebar has focus, it is safe to close.
98
86
  if (sidebarRef.current.contains(sidebarRef.current.ownerDocument.activeElement)) {
99
- setIsListViewOpened(false); // If the list view or outline does not have focus, focus should be moved to it.
87
+ setIsListViewOpened(false);
88
+ // If the list view or outline does not have focus, focus should be moved to it.
100
89
  } else {
101
90
  handleSidebarFocus(tab);
102
91
  }
103
92
  });
93
+
104
94
  /**
105
95
  * Render tab content for a given tab name.
106
96
  *
107
97
  * @param {string} tabName The name of the tab to render.
108
98
  */
109
-
110
99
  function renderTabContent(tabName) {
111
100
  if (tabName === 'list-view') {
112
101
  return (0, _element.createElement)("div", {
@@ -115,11 +104,10 @@ function ListViewSidebar() {
115
104
  dropZoneElement: dropZoneElement
116
105
  }));
117
106
  }
118
-
119
107
  return (0, _element.createElement)(_listViewOutline.default, null);
120
108
  }
121
-
122
- return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
109
+ return (
110
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
123
111
  (0, _element.createElement)("div", {
124
112
  className: "edit-post-editor__document-overview-panel",
125
113
  onKeyDown: closeOnEscape,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["ListViewSidebar","setIsListViewOpened","editPostStore","focusOnMountRef","headerFocusReturnRef","contentFocusReturnRef","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabPanelRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","focus","tabbable","find","current","listViewApplicationFocus","listViewFocusArea","contains","ownerDocument","activeElement","renderTabContent","tabName","closeSmall","name","title","className"],"mappings":";;;;;;;;;AAYA;;AATA;;AACA;;AACA;;AAKA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAtBA;AACA;AACA;;AAgBA;AACA;AACA;AAIe,SAASA,eAAT,GAA2B;AACzC,QAAM;AAAEC,IAAAA;AAAF,MAA0B,uBAAaC,YAAb,CAAhC,CADyC,CAGzC;;AACA,QAAMC,eAAe,GAAG,8BAAiB,cAAjB,CAAxB,CAJyC,CAKzC;;AACA,QAAMC,oBAAoB,GAAG,8BAA7B;AACA,Q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AAE;AAHZ,OADM,EAMN;AACCF,QAAAA,IAAI,EAAE,SADP;AAECC,QAAAA,KAAK,EAAE,cAAI,SAAJ,EAAe,eAAf,CAFR;AAGCC,QAAAA,SAAS,EAAE;AAHZ,OANM;AALR,OAkBKhB,UAAF,IACD;AACC,MAAA,SAAS,EAAC,uCADX;AAEC,MAAA,GAAG,EAAGF;AAFP,OAIGa,gBAAgB,CAAEX,UAAU,CAACc,IAAb,CAJnB,CAnBF,CAZD;AAFD;AA2CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __, _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"]}
1
+ {"version":3,"names":["_element","require","_blockEditor","_components","_compose","_data","_dom","_i18n","_icons","_keyboardShortcuts","_keycodes","_store","_listViewOutline","_interopRequireDefault","ListViewSidebar","setIsListViewOpened","useDispatch","editPostStore","focusOnMountRef","useFocusOnMount","headerFocusReturnRef","useFocusReturn","contentFocusReturnRef","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","useState","tab","setTab","sidebarRef","useRef","tabPanelRef","listViewRef","listViewContainerRef","useMergeRefs","handleSidebarFocus","currentTab","tabPanelFocus","focus","tabbable","find","current","listViewApplicationFocus","listViewFocusArea","contains","useShortcut","ownerDocument","activeElement","renderTabContent","tabName","createElement","className","__experimentalListView","default","onKeyDown","ref","Button","icon","closeSmall","label","__","onClick","TabPanel","onSelect","selectOnMove","tabs","name","title","_x"],"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":";;;;;;;AAYA,IAAAA,QAAA,GAAAC,OAAA;AATA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAC,sBAAA,CAAAZ,OAAA;AAtBA;AACA;AACA;;AAgBA;AACA;AACA;;AAIe,SAASa,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAc,CAAC;;EAE5D;EACA,MAAMC,eAAe,GAAG,IAAAC,wBAAe,EAAE,cAAe,CAAC;EACzD;EACA,MAAMC,oBAAoB,GAAG,IAAAC,uBAAc,EAAC,CAAC;EAC7C,MAAMC,qBAAqB,GAAG,IAA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Q,EAAKd,OAAO,IAAMrB,MAAM,CAAEqB,OAAQ,CAAG;MAC7Ce,YAAY,EAAG,KAAO;MACtBC,IAAI,EAAG,CACN;QACCC,IAAI,EAAE,WAAW;QACjBC,KAAK,EAAE,IAAAC,QAAE,EAAE,WAAW,EAAE,eAAgB,CAAC;QACzCjB,SAAS,EAAE;MACZ,CAAC,EACD;QACCe,IAAI,EAAE,SAAS;QACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAS,EAAE,eAAgB,CAAC;QACvCjB,SAAS,EAAE;MACZ,CAAC;IACC,GAECf,UAAU,IACb,IAAAzC,QAAA,CAAAuD,aAAA;MACCC,SAAS,EAAC,uCAAuC;MACjDI,GAAG,EAAGtB;IAAsB,GAE1Be,gBAAgB,CAAEZ,UAAU,CAAC8B,IAAK,CAChC,CAEG,CACN;EAAC;AAER"}
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _i18n = require("@wordpress/i18n");
11
-
12
9
  var _components = require("@wordpress/components");
13
-
14
10
  var _editor = require("@wordpress/editor");
15
-
16
11
  var _data = require("@wordpress/data");
17
-
18
12
  var _store = require("../../../store");
19
-
20
13
  /**
21
14
  * WordPress dependencies
22
15
  */
@@ -29,7 +22,6 @@ var _store = require("../../../store");
29
22
  * Module Constants
30
23
  */
31
24
  const PANEL_NAME = 'discussion-panel';
32
-
33
25
  function DiscussionPanel() {
34
26
  const {
35
27
  isEnabled,
@@ -47,11 +39,9 @@ function DiscussionPanel() {
47
39
  const {
48
40
  toggleEditorPanelOpened
49
41
  } = (0, _data.useDispatch)(_store.store);
50
-
51
42
  if (!isEnabled) {
52
43
  return null;
53
44
  }
54
-
55
45
  return (0, _element.createElement)(_editor.PostTypeSupportCheck, {
56
46
  supportKeys: ['comments', 'trackbacks']
57
47
  }, (0, _element.createElement)(_components.PanelBody, {
@@ -64,7 +54,6 @@ function DiscussionPanel() {
64
54
  supportKeys: "trackbacks"
65
55
  }, (0, _element.createElement)(_components.PanelRow, null, (0, _element.createElement)(_editor.PostPingbacks, null)))));
66
56
  }
67
-
68
57
  var _default = DiscussionPanel;
69
58
  exports.default = _default;
70
59
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"names":["PANEL_NAME","DiscussionPanel","isEnabled","isOpened","select","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,kBAAnB;;AAEA,SAASC,eAAT,GAA2B;AAC1B,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0B,qBAAaC,MAAF,IAAc;AACxD,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLF,MAAM,CAAEG,YAAF,CADP;AAEA,WAAO;AACNL,MAAAA,SAAS,EAAEG,oBAAoB,CAAEL,UAAF,CADzB;AAENG,MAAAA,QAAQ,EAAEG,mBAAmB,CAAEN,UAAF;AAFvB,KAAP;AAIA,GAP+B,EAO7B,EAP6B,CAAhC;AASA,QAAM;AAAEQ,IAAAA;AAAF,MAA8B,uBAAaD,YAAb,CAApC;;AAEA,MAAK,CAAEL,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAG,CAAE,UAAF,EAAc,YAAd;AAApC,KACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAG,cAAI,YAAJ,CADT;AAEC,IAAA,MAAM,EAAGC,QAFV;AAGC,IAAA,QAAQ,EAAG,MAAMK,uBAAuB,CAAER,UAAF;AAHzC,KAKC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,4BAAC,oBAAD,QACC,4BAAC,oBAAD,OADD,CADD,CALD,EAWC,4BAAC,4BAAD;AAAsB,IAAA,WAAW,EAAC;AAAlC,KACC,4BAAC,oBAAD,QACC,4BAAC,qBAAD,OADD,CADD,CAXD,CADD,CADD;AAqBA;;eAEcC,e","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"]}
1
+ {"version":3,"names":["_i18n","require","_components","_editor","_data","_store","PANEL_NAME","DiscussionPanel","isEnabled","isOpened","useSelect","select","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","toggleEditorPanelOpened","useDispatch","_element","createElement","PostTypeSupportCheck","supportKeys","PanelBody","title","__","opened","onToggle","PanelRow","PostComments","PostPingbacks","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMK,UAAU,GAAG,kBAAkB;AAErC,SAASC,eAAeA,CAAA,EAAG;EAC1B,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxD,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEG,YAAc,CAAC;IACxB,OAAO;MACNN,SAAS,EAAEI,oBAAoB,CAAEN,UAAW,CAAC;MAC7CG,QAAQ,EAAEI,mBAAmB,CAAEP,UAAW;IAC3C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAES;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,YAAc,CAAC;EAEhE,IAAK,CAAEN,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAS,QAAA,CAAAC,aAAA,EAACf,OAAA,CAAAgB,oBAAoB;IAACC,WAAW,EAAG,CAAE,UAAU,EAAE,YAAY;EAAI,GACjE,IAAAH,QAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAmB,SAAS;IACTC,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa,CAAG;IAC5BC,MAAM,EAAGf,QAAU;IACnBgB,QAAQ,EAAGA,CAAA,KAAMV,uBAAuB,CAAET,UAAW;EAAG,GAExD,IAAAW,QAAA,CAAAC,aAAA,EAACf,OAAA,CAAAgB,oBAAoB;IAACC,WAAW,EAAC;EAAU,GAC3C,IAAAH,QAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAwB,QAAQ,QACR,IAAAT,QAAA,CAAAC,aAAA,EAACf,OAAA,CAAAwB,YAAY,MAAE,CACN,CACW,CAAC,EAEvB,IAAAV,QAAA,CAAAC,aAAA,EAACf,OAAA,CAAAgB,oBAAoB;IAACC,WAAW,EAAC;EAAY,GAC7C,IAAAH,QAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAwB,QAAQ,QACR,IAAAT,QAAA,CAAAC,aAAA,EAACf,OAAA,CAAAyB,aAAa,MAAE,CACP,CACW,CACZ,CACU,CAAC;AAEzB;AAAC,IAAAC,QAAA,GAEctB,eAAe;AAAAuB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _i18n = require("@wordpress/i18n");
11
-
12
9
  var _components = require("@wordpress/components");
13
-
14
10
  var _editor = require("@wordpress/editor");
15
-
16
11
  var _compose = require("@wordpress/compose");
17
-
18
12
  var _data = require("@wordpress/data");
19
-
20
13
  var _coreData = require("@wordpress/core-data");
21
-
22
14
  var _store = require("../../../store");
23
-
24
15
  /**
25
16
  * WordPress dependencies
26
17
  */
@@ -33,7 +24,6 @@ var _store = require("../../../store");
33
24
  * Module Constants
34
25
  */
35
26
  const PANEL_NAME = 'featured-image';
36
-
37
27
  function FeaturedImage({
38
28
  isEnabled,
39
29
  isOpened,
@@ -41,18 +31,15 @@ function FeaturedImage({
41
31
  onTogglePanel
42
32
  }) {
43
33
  var _postType$labels$feat;
44
-
45
34
  if (!isEnabled) {
46
35
  return null;
47
36
  }
48
-
49
37
  return (0, _element.createElement)(_editor.PostFeaturedImageCheck, null, (0, _element.createElement)(_components.PanelBody, {
50
38
  title: (_postType$labels$feat = postType?.labels?.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : (0, _i18n.__)('Featured image'),
51
39
  opened: isOpened,
52
40
  onToggle: onTogglePanel
53
41
  }, (0, _element.createElement)(_editor.PostFeaturedImage, null)));
54
42
  }
55
-
56
43
  const applyWithSelect = (0, _data.withSelect)(select => {
57
44
  const {
58
45
  getEditedPostAttribute
@@ -78,8 +65,6 @@ const applyWithDispatch = (0, _data.withDispatch)(dispatch => {
78
65
  onTogglePanel: (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args)
79
66
  };
80
67
  });
81
-
82
68
  var _default = (0, _compose.compose)(applyWithSelect, applyWithDispatch)(FeaturedImage);
83
-
84
69
  exports.default = _default;
85
70
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/featured-image/index.js"],"names":["PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","labels","featured_image","applyWithSelect","select","getEditedPostAttribute","editorStore","getPostType","coreStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","applyWithDispatch","dispatch","toggleEditorPanelOpened","args"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,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,4BAAC,8BAAD,QACC,4BAAC,qBAAD;AACC,IAAA,KAAK,2BACJE,QAAQ,EAAEE,MAAV,EAAkBC,cADd,yEACgC,cAAI,gBAAJ,CAFtC;AAIC,IAAA,MAAM,EAAGJ,QAJV;AAKC,IAAA,QAAQ,EAAGE;AALZ,KAOC,4BAAC,yBAAD,OAPD,CADD,CADD;AAaA;;AAED,MAAMG,eAAe,GAAG,sBAAcC,MAAF,IAAc;AACjD,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAEE,aAAF,CAAzC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAkBH,MAAM,CAAEI,eAAF,CAA9B;AACA,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MACLN,MAAM,CAAEO,YAAF,CADP;AAGA,SAAO;AACNZ,IAAAA,QAAQ,EAAEQ,WAAW,CAAEF,sBAAsB,CAAE,MAAF,CAAxB,CADf;AAENR,IAAAA,SAAS,EAAEY,oBAAoB,CAAEd,UAAF,CAFzB;AAGNG,IAAAA,QAAQ,EAAEY,mBAAmB,CAAEf,UAAF;AAHvB,GAAP;AAKA,CAXuB,CAAxB;AAaA,MAAMiB,iBAAiB,GAAG,wBAAgBC,QAAF,IAAgB;AACvD,QAAM;AAAEC,IAAAA;AAAF,MAA8BD,QAAQ,CAAEF,YAAF,CAA5C;AAEA,SAAO;AACNX,IAAAA,aAAa,EAAE,CAAE,GAAGe,IAAL,KACdD,uBAAuB,CAAEnB,UAAF,EAAc,GAAGoB,IAAjB;AAFlB,GAAP;AAIA,CAPyB,CAA1B;;eASe,sBAASZ,eAAT,EAA0BS,iBAA1B,EAA+ChB,aAA/C,C","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":["_i18n","require","_components","_editor","_compose","_data","_coreData","_store","PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","_postType$labels$feat","_element","createElement","PostFeaturedImageCheck","PanelBody","title","labels","featured_image","__","opened","onToggle","PostFeaturedImage","applyWithSelect","withSelect","select","getEditedPostAttribute","editorStore","getPostType","coreStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","applyWithDispatch","withDispatch","dispatch","toggleEditorPanelOpened","args","_default","compose","exports","default"],"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};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O;IACNvB,QAAQ,EAAEmB,WAAW,CAAEF,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDnB,SAAS,EAAEuB,oBAAoB,CAAEzB,UAAW,CAAC;IAC7CG,QAAQ,EAAEuB,mBAAmB,CAAE1B,UAAW;EAC3C,CAAC;AACF,CAAE,CAAC;AAEH,MAAM4B,iBAAiB,GAAG,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EACvD,MAAM;IAAEC;EAAwB,CAAC,GAAGD,QAAQ,CAAEH,YAAc,CAAC;EAE7D,OAAO;IACNtB,aAAa,EAAEA,CAAE,GAAG2B,IAAI,KACvBD,uBAAuB,CAAE/B,UAAU,EAAE,GAAGgC,IAAK;EAC/C,CAAC;AACF,CAAE,CAAC;AAAC,IAAAC,QAAA,GAEW,IAAAC,gBAAO,EAAEhB,eAAe,EAAEU,iBAAkB,CAAC,CAAE3B,aAAc,CAAC;AAAAkC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
@@ -4,22 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _element = require("@wordpress/element");
9
-
10
8
  var _components = require("@wordpress/components");
11
-
12
9
  var _editor = require("@wordpress/editor");
13
-
14
10
  /**
15
11
  * WordPress dependencies
16
12
  */
13
+
17
14
  function LastRevision() {
18
15
  return (0, _element.createElement)(_editor.PostLastRevisionCheck, null, (0, _element.createElement)(_components.PanelBody, {
19
16
  className: "edit-post-last-revision__panel"
20
17
  }, (0, _element.createElement)(_editor.PostLastRevision, null)));
21
18
  }
22
-
23
19
  var _default = LastRevision;
24
20
  exports.default = _default;
25
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/last-revision/index.js"],"names":["LastRevision"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,SAASA,YAAT,GAAwB;AACvB,SACC,4BAAC,6BAAD,QACC,4BAAC,qBAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,4BAAC,wBAAD,OADD,CADD,CADD;AAOA;;eAEcA,Y","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":["_components","require","_editor","LastRevision","_element","createElement","PostLastRevisionCheck","PanelBody","className","PostLastRevision","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,SAASE,YAAYA,CAAA,EAAG;EACvB,OACC,IAAAC,QAAA,CAAAC,aAAA,EAACH,OAAA,CAAAI,qBAAqB,QACrB,IAAAF,QAAA,CAAAC,aAAA,EAACL,WAAA,CAAAO,SAAS;IAACC,SAAS,EAAC;EAAgC,GACpD,IAAAJ,QAAA,CAAAC,aAAA,EAACH,OAAA,CAAAO,gBAAgB,MAAE,CACT,CACW,CAAC;AAE1B;AAAC,IAAAC,QAAA,GAEcP,YAAY;AAAAQ,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -5,21 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.PageAttributes = PageAttributes;
7
7
  exports.default = void 0;
8
-
9
8
  var _element = require("@wordpress/element");
10
-
11
9
  var _i18n = require("@wordpress/i18n");
12
-
13
10
  var _components = require("@wordpress/components");
14
-
15
11
  var _editor = require("@wordpress/editor");
16
-
17
12
  var _data = require("@wordpress/data");
18
-
19
13
  var _coreData = require("@wordpress/core-data");
20
-
21
14
  var _store = require("../../../store");
22
-
23
15
  /**
24
16
  * WordPress dependencies
25
17
  */
@@ -32,10 +24,8 @@ var _store = require("../../../store");
32
24
  * Module Constants
33
25
  */
34
26
  const PANEL_NAME = 'page-attributes';
35
-
36
27
  function PageAttributes() {
37
28
  var _postType$labels$attr;
38
-
39
29
  const {
40
30
  isEnabled,
41
31
  isOpened,
@@ -60,20 +50,16 @@ function PageAttributes() {
60
50
  const {
61
51
  toggleEditorPanelOpened
62
52
  } = (0, _data.useDispatch)(_store.store);
63
-
64
53
  if (!isEnabled || !postType) {
65
54
  return null;
66
55
  }
67
-
68
56
  const onTogglePanel = (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args);
69
-
70
57
  return (0, _element.createElement)(_editor.PageAttributesCheck, null, (0, _element.createElement)(_components.PanelBody, {
71
58
  title: (_postType$labels$attr = postType?.labels?.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : (0, _i18n.__)('Page attributes'),
72
59
  opened: isOpened,
73
60
  onToggle: onTogglePanel
74
61
  }, (0, _element.createElement)(_editor.PageAttributesParent, null), (0, _element.createElement)(_components.PanelRow, null, (0, _element.createElement)(_editor.PageAttributesOrder, null))));
75
62
  }
76
-
77
63
  var _default = PageAttributes;
78
64
  exports.default = _default;
79
65
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/page-attributes/index.js"],"names":["PANEL_NAME","PageAttributes","isEnabled","isOpened","postType","select","getEditedPostAttribute","editorStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","getPostType","coreStore","toggleEditorPanelOpened","onTogglePanel","args","labels","attributes"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AAMA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,iBAAnB;;AAEO,SAASC,cAAT,GAA0B;AAAA;;AAChC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA;AAAvB,MAAoC,qBAAaC,MAAF,IAAc;AAClE,UAAM;AAAEC,MAAAA;AAAF,QAA6BD,MAAM,CAAEE,aAAF,CAAzC;AACA,UAAM;AAAEC,MAAAA,oBAAF;AAAwBC,MAAAA;AAAxB,QACLJ,MAAM,CAAEK,YAAF,CADP;AAEA,UAAM;AAAEC,MAAAA;AAAF,QAAkBN,MAAM,CAAEO,eAAF,CAA9B;AACA,WAAO;AACNV,MAAAA,SAAS,EAAEM,oBAAoB,CAAER,UAAF,CADzB;AAENG,MAAAA,QAAQ,EAAEM,mBAAmB,CAAET,UAAF,CAFvB;AAGNI,MAAAA,QAAQ,EAAEO,WAAW,CAAEL,sBAAsB,CAAE,MAAF,CAAxB;AAHf,KAAP;AAKA,GAVyC,EAUvC,EAVuC,CAA1C;AAYA,QAAM;AAAEO,IAAAA;AAAF,MAA8B,uBAAaH,YAAb,CAApC;;AAEA,MAAK,CAAER,SAAF,IAAe,CAAEE,QAAtB,EAAiC;AAChC,WAAO,IAAP;AACA;;AAED,QAAMU,aAAa,GAAG,CAAE,GAAGC,IAAL,KACrBF,uBAAuB,CAAEb,UAAF,EAAc,GAAGe,IAAjB,CADxB;;AAGA,SACC,4BAAC,2BAAD,QACC,4BAAC,qBAAD;AACC,IAAA,KAAK,2BACJX,QAAQ,EAAEY,MAAV,EAAkBC,UADd,yEAC4B,cAAI,iBAAJ,CAFlC;AAIC,IAAA,MAAM,EAAGd,QAJV;AAKC,IAAA,QAAQ,EAAGW;AALZ,KAOC,4BAAC,4BAAD,OAPD,EAQC,4BAAC,oBAAD,QACC,4BAAC,2BAAD,OADD,CARD,CADD,CADD;AAgBA;;eAEcb,c","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":["_i18n","require","_components","_editor","_data","_coreData","_store","PANEL_NAME","PageAttributes","_postType$labels$attr","isEnabled","isOpened","postType","useSelect","select","getEditedPostAttribute","editorStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","getPostType","coreStore","toggleEditorPanelOpened","useDispatch","onTogglePanel","args","_element","createElement","PageAttributesCheck","PanelBody","title","labels","attributes","__","opened","onToggle","PageAttributesParent","PanelRow","PageAttributesOrder","_default","exports","default"],"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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMM,UAAU,GAAG,iBAAiB;AAE7B,SAASC,cAAcA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EAChC,MAAM;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAClE,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IACxD,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDJ,MAAM,CAAEK,YAAc,CAAC;IACxB,MAAM;MAAEC;IAAY,CAAC,GAAGN,MAAM,CAAEO,eAAU,CAAC;IAC3C,OAAO;MACNX,SAAS,EAAEO,oBAAoB,CAAEV,UAAW,CAAC;MAC7CI,QAAQ,EAAEO,mBAAmB,CAAEX,UAAW,CAAC;MAC3CK,QAAQ,EAAEQ,WAAW,CAAEL,sBAAsB,CAAE,MAAO,CAAE;IACzD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEO;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEJ,YAAc,CAAC;EAEhE,IAAK,CAAET,SAAS,IAAI,CAAEE,QAAQ,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,MAAMY,aAAa,GAAGA,CAAE,GAAGC,IAAI,KAC9BH,uBAAuB,CAAEf,UAAU,EAAE,GAAGkB,IAAK,CAAC;EAE/C,OACC,IAAAC,QAAA,CAAAC,aAAA,EAACxB,OAAA,CAAAyB,mBAAmB,QACnB,IAAAF,QAAA,CAAAC,aAAA,EAACzB,WAAA,CAAA2B,SAAS;IACTC,KAAK,GAAArB,qBAAA,GACJG,QAAQ,EAAEmB,MAAM,EAAEC,UAAU,cAAAvB,qBAAA,cAAAA,qBAAA,GAAI,IAAAwB,QAAE,EAAE,iBAAkB,CACtD;IACDC,MAAM,EAAGvB,QAAU;IACnBwB,QAAQ,EAAGX;EAAe,GAE1B,IAAAE,QAAA,CAAAC,aAAA,EAACxB,OAAA,CAAAiC,oBAAoB,MAAE,CAAC,EACxB,IAAAV,QAAA,CAAAC,aAAA,EAACzB,WAAA,CAAAmC,QAAQ,QACR,IAAAX,QAAA,CAAAC,aAAA,EAACxB,OAAA,CAAAmC,mBAAmB,MAAE,CACb,CACA,CACS,CAAC;AAExB;AAAC,IAAAC,QAAA,GAEc/B,cAAc;AAAAgC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -1,32 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  var _element = require("@wordpress/element");
11
-
12
9
  var _components = require("@wordpress/components");
13
-
14
- var _compose = require("@wordpress/compose");
15
-
16
10
  var _plugins = require("@wordpress/plugins");
17
-
18
11
  var _data = require("@wordpress/data");
19
-
20
12
  var _warning = _interopRequireDefault(require("@wordpress/warning"));
21
-
22
13
  var _options = require("../../preferences-modal/options");
23
-
24
14
  var _store = require("../../../store");
25
-
26
- /**
27
- * Defines as extensibility slot for the Settings sidebar
28
- */
29
-
30
15
  /**
31
16
  * WordPress dependencies
32
17
  */
@@ -34,40 +19,21 @@ var _store = require("../../../store");
34
19
  /**
35
20
  * Internal dependencies
36
21
  */
22
+
37
23
  const {
38
24
  Fill,
39
25
  Slot
40
26
  } = (0, _components.createSlotFill)('PluginDocumentSettingPanel');
41
27
 
42
- const PluginDocumentSettingFill = ({
43
- isEnabled,
44
- panelName,
45
- opened,
46
- onToggle,
47
- className,
48
- title,
49
- icon,
50
- children
51
- }) => {
52
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_options.EnablePluginDocumentSettingPanelOption, {
53
- label: title,
54
- panelName: panelName
55
- }), (0, _element.createElement)(Fill, null, isEnabled && (0, _element.createElement)(_components.PanelBody, {
56
- className: className,
57
- title: title,
58
- icon: icon,
59
- opened: opened,
60
- onToggle: onToggle
61
- }, children)));
62
- };
63
28
  /**
64
29
  * Renders items below the Status & Availability panel in the Document Sidebar.
65
30
  *
66
31
  * @param {Object} props Component properties.
67
- * @param {string} [props.name] The machine-friendly name for the panel.
32
+ * @param {string} props.name Required. A machine-friendly name for the panel.
68
33
  * @param {string} [props.className] An optional class name added to the row.
69
34
  * @param {string} [props.title] The title of the panel
70
35
  * @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.
36
+ * @param {WPElement} props.children Children to be rendered
71
37
  *
72
38
  * @example
73
39
  * ```js
@@ -83,6 +49,7 @@ const PluginDocumentSettingFill = ({
83
49
  * {
84
50
  * className: 'my-document-setting-plugin',
85
51
  * title: 'My Panel',
52
+ * name: 'my-panel',
86
53
  * },
87
54
  * __( 'My Document Setting Panel' )
88
55
  * );
@@ -100,7 +67,7 @@ const PluginDocumentSettingFill = ({
100
67
  * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';
101
68
  *
102
69
  * const MyDocumentSettingTest = () => (
103
- * <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel">
70
+ * <PluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel" name="my-panel">
104
71
  * <p>My Document Setting Panel</p>
105
72
  * </PluginDocumentSettingPanel>
106
73
  * );
@@ -110,31 +77,47 @@ const PluginDocumentSettingFill = ({
110
77
  *
111
78
  * @return {WPComponent} The component to be rendered.
112
79
  */
113
-
114
-
115
- const PluginDocumentSettingPanel = (0, _compose.compose)((0, _plugins.withPluginContext)((context, ownProps) => {
116
- if (undefined === ownProps.name) {
117
- typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production" ? (0, _warning.default)('PluginDocumentSettingPanel requires a name property.') : void 0;
118
- }
119
-
120
- return {
121
- panelName: `${context.name}/${ownProps.name}`
122
- };
123
- }), (0, _data.withSelect)((select, {
124
- panelName
80
+ const PluginDocumentSettingPanel = ({
81
+ name,
82
+ className,
83
+ title,
84
+ icon,
85
+ children
125
86
  }) => {
126
- return {
127
- opened: select(_store.store).isEditorPanelOpened(panelName),
128
- isEnabled: select(_store.store).isEditorPanelEnabled(panelName)
129
- };
130
- }), (0, _data.withDispatch)((dispatch, {
131
- panelName
132
- }) => ({
133
- onToggle() {
134
- return dispatch(_store.store).toggleEditorPanelOpened(panelName);
87
+ const {
88
+ name: pluginName
89
+ } = (0, _plugins.usePluginContext)();
90
+ const panelName = `${pluginName}/${name}`;
91
+ const {
92
+ opened,
93
+ isEnabled
94
+ } = (0, _data.useSelect)(select => {
95
+ const {
96
+ isEditorPanelOpened,
97
+ isEditorPanelEnabled
98
+ } = select(_store.store);
99
+ return {
100
+ opened: isEditorPanelOpened(panelName),
101
+ isEnabled: isEditorPanelEnabled(panelName)
102
+ };
103
+ }, [panelName]);
104
+ const {
105
+ toggleEditorPanelOpened
106
+ } = (0, _data.useDispatch)(_store.store);
107
+ if (undefined === name) {
108
+ typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? (0, _warning.default)('PluginDocumentSettingPanel requires a name property.') : void 0;
135
109
  }
136
-
137
- })))(PluginDocumentSettingFill);
110
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_options.EnablePluginDocumentSettingPanelOption, {
111
+ label: title,
112
+ panelName: panelName
113
+ }), (0, _element.createElement)(Fill, null, isEnabled && (0, _element.createElement)(_components.PanelBody, {
114
+ className: className,
115
+ title: title,
116
+ icon: icon,
117
+ opened: opened,
118
+ onToggle: () => toggleEditorPanelOpened(panelName)
119
+ }, children)));
120
+ };
138
121
  PluginDocumentSettingPanel.Slot = Slot;
139
122
  var _default = PluginDocumentSettingPanel;
140
123
  exports.default = _default;