@wordpress/edit-post 7.11.0 → 7.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-manager/category.js +14 -22
  3. package/build/components/block-manager/category.js.map +1 -1
  4. package/build/components/block-manager/checklist.js +6 -13
  5. package/build/components/block-manager/checklist.js.map +1 -1
  6. package/build/components/block-manager/index.js +10 -14
  7. package/build/components/block-manager/index.js.map +1 -1
  8. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  9. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  10. package/build/components/device-preview/index.js +1 -1
  11. package/build/components/device-preview/index.js.map +1 -1
  12. package/build/components/editor-initialization/index.js +3 -4
  13. package/build/components/editor-initialization/index.js.map +1 -1
  14. package/build/components/header/document-title/index.js +103 -0
  15. package/build/components/header/document-title/index.js.map +1 -0
  16. package/build/components/header/fullscreen-mode-close/index.js +8 -9
  17. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  18. package/build/components/header/header-toolbar/index.native.js +12 -13
  19. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  20. package/build/components/header/index.js +7 -6
  21. package/build/components/header/index.js.map +1 -1
  22. package/build/components/header/main-dashboard-button/index.js +3 -4
  23. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  24. package/build/components/header/more-menu/index.js +19 -23
  25. package/build/components/header/more-menu/index.js.map +1 -1
  26. package/build/components/header/post-publish-button-or-toggle.js +15 -16
  27. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  28. package/build/components/header/tools-more-menu-group/index.js +7 -10
  29. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  30. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  31. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  32. package/build/components/keyboard-shortcut-help-modal/index.js +44 -54
  33. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  34. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  35. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  36. package/build/components/layout/actions-panel.js +5 -6
  37. package/build/components/layout/actions-panel.js.map +1 -1
  38. package/build/components/layout/index.js +3 -4
  39. package/build/components/layout/index.js.map +1 -1
  40. package/build/components/layout/index.native.js +3 -7
  41. package/build/components/layout/index.native.js.map +1 -1
  42. package/build/components/meta-boxes/index.js +9 -13
  43. package/build/components/meta-boxes/index.js.map +1 -1
  44. package/build/components/meta-boxes/meta-box-visibility.js +5 -8
  45. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  46. package/build/components/meta-boxes/meta-boxes-area/index.js +3 -4
  47. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  48. package/build/components/preferences-modal/meta-boxes-section.js +16 -23
  49. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  50. package/build/components/preferences-modal/options/enable-custom-fields.js +7 -9
  51. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  52. package/build/components/preferences-modal/options/enable-feature.js +12 -16
  53. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  54. package/build/components/preferences-modal/options/enable-panel.js +10 -17
  55. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  56. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  57. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  58. package/build/components/secondary-sidebar/list-view-sidebar.js +58 -44
  59. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  60. package/build/components/sidebar/discussion-panel/index.js +5 -7
  61. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  62. package/build/components/sidebar/featured-image/index.js +9 -17
  63. package/build/components/sidebar/featured-image/index.js.map +1 -1
  64. package/build/components/sidebar/page-attributes/index.js +3 -9
  65. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  66. package/build/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  67. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  68. package/build/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  69. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  70. package/build/components/sidebar/plugin-post-status-info/index.js +6 -9
  71. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  72. package/build/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  73. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  74. package/build/components/sidebar/plugin-sidebar/index.js +4 -5
  75. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  76. package/build/components/sidebar/post-excerpt/index.js +5 -7
  77. package/build/components/sidebar/post-excerpt/index.js.map +1 -1
  78. package/build/components/sidebar/post-schedule/index.js +16 -23
  79. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  80. package/build/components/sidebar/post-status/index.js +7 -11
  81. package/build/components/sidebar/post-status/index.js.map +1 -1
  82. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  83. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  84. package/build/components/sidebar/post-template/create-modal.js +3 -4
  85. package/build/components/sidebar/post-template/create-modal.js.map +1 -1
  86. package/build/components/sidebar/post-template/form.js +13 -20
  87. package/build/components/sidebar/post-template/form.js.map +1 -1
  88. package/build/components/sidebar/post-template/index.js +18 -25
  89. package/build/components/sidebar/post-template/index.js.map +1 -1
  90. package/build/components/sidebar/post-url/index.js +16 -23
  91. package/build/components/sidebar/post-url/index.js.map +1 -1
  92. package/build/components/sidebar/post-visibility/index.js +26 -36
  93. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  94. package/build/components/sidebar/settings-header/index.js +3 -4
  95. package/build/components/sidebar/settings-header/index.js.map +1 -1
  96. package/build/components/sidebar/template-summary/index.js +1 -1
  97. package/build/components/sidebar/template-summary/index.js.map +1 -1
  98. package/build/components/start-page-options/index.js +3 -4
  99. package/build/components/start-page-options/index.js.map +1 -1
  100. package/build/components/view-link/index.js +1 -1
  101. package/build/components/view-link/index.js.map +1 -1
  102. package/build/components/visual-editor/block-inspector-button.js +4 -5
  103. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  104. package/build/components/visual-editor/header.native.js +6 -7
  105. package/build/components/visual-editor/header.native.js.map +1 -1
  106. package/build/components/visual-editor/index.js +32 -48
  107. package/build/components/visual-editor/index.js.map +1 -1
  108. package/build/components/welcome-guide/image.js +4 -5
  109. package/build/components/welcome-guide/image.js.map +1 -1
  110. package/build/editor.js +14 -20
  111. package/build/editor.js.map +1 -1
  112. package/build/editor.native.js +3 -6
  113. package/build/editor.native.js.map +1 -1
  114. package/build/hooks/validate-multiple-use/index.js +18 -29
  115. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  116. package/build/plugins/index.js +20 -23
  117. package/build/plugins/index.js.map +1 -1
  118. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  119. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  120. package/build/store/actions.js +60 -88
  121. package/build/store/actions.js.map +1 -1
  122. package/build/store/reducer.js +11 -43
  123. package/build/store/reducer.js.map +1 -1
  124. package/build/store/selectors.js +11 -16
  125. package/build/store/selectors.js.map +1 -1
  126. package/build-module/components/block-manager/category.js +14 -22
  127. package/build-module/components/block-manager/category.js.map +1 -1
  128. package/build-module/components/block-manager/checklist.js +6 -13
  129. package/build-module/components/block-manager/checklist.js.map +1 -1
  130. package/build-module/components/block-manager/index.js +10 -14
  131. package/build-module/components/block-manager/index.js.map +1 -1
  132. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  133. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  134. package/build-module/components/device-preview/index.js +1 -1
  135. package/build-module/components/device-preview/index.js.map +1 -1
  136. package/build-module/components/editor-initialization/index.js +3 -4
  137. package/build-module/components/editor-initialization/index.js.map +1 -1
  138. package/build-module/components/header/document-title/index.js +88 -0
  139. package/build-module/components/header/document-title/index.js.map +1 -0
  140. package/build-module/components/header/fullscreen-mode-close/index.js +7 -8
  141. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  142. package/build-module/components/header/header-toolbar/index.native.js +12 -13
  143. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  144. package/build-module/components/header/index.js +7 -6
  145. package/build-module/components/header/index.js.map +1 -1
  146. package/build-module/components/header/main-dashboard-button/index.js +3 -4
  147. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  148. package/build-module/components/header/more-menu/index.js +19 -23
  149. package/build-module/components/header/more-menu/index.js.map +1 -1
  150. package/build-module/components/header/post-publish-button-or-toggle.js +15 -16
  151. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  152. package/build-module/components/header/tools-more-menu-group/index.js +7 -10
  153. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  154. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  155. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  156. package/build-module/components/keyboard-shortcut-help-modal/index.js +42 -52
  157. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  158. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  159. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  160. package/build-module/components/layout/actions-panel.js +5 -6
  161. package/build-module/components/layout/actions-panel.js.map +1 -1
  162. package/build-module/components/layout/index.js +3 -4
  163. package/build-module/components/layout/index.js.map +1 -1
  164. package/build-module/components/layout/index.native.js +3 -7
  165. package/build-module/components/layout/index.native.js.map +1 -1
  166. package/build-module/components/meta-boxes/index.js +9 -13
  167. package/build-module/components/meta-boxes/index.js.map +1 -1
  168. package/build-module/components/meta-boxes/meta-box-visibility.js +5 -8
  169. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  170. package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -4
  171. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  172. package/build-module/components/preferences-modal/meta-boxes-section.js +16 -23
  173. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  174. package/build-module/components/preferences-modal/options/enable-custom-fields.js +7 -9
  175. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  176. package/build-module/components/preferences-modal/options/enable-feature.js +12 -16
  177. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  178. package/build-module/components/preferences-modal/options/enable-panel.js +10 -17
  179. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  180. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  181. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  182. package/build-module/components/secondary-sidebar/list-view-sidebar.js +58 -44
  183. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  184. package/build-module/components/sidebar/discussion-panel/index.js +5 -7
  185. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  186. package/build-module/components/sidebar/featured-image/index.js +9 -17
  187. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  188. package/build-module/components/sidebar/page-attributes/index.js +3 -9
  189. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  190. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  191. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  192. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  193. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  194. package/build-module/components/sidebar/plugin-post-status-info/index.js +6 -9
  195. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  196. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  197. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  198. package/build-module/components/sidebar/plugin-sidebar/index.js +4 -5
  199. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  200. package/build-module/components/sidebar/post-excerpt/index.js +5 -7
  201. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  202. package/build-module/components/sidebar/post-schedule/index.js +16 -23
  203. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  204. package/build-module/components/sidebar/post-status/index.js +7 -11
  205. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  207. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  208. package/build-module/components/sidebar/post-template/create-modal.js +3 -4
  209. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
  210. package/build-module/components/sidebar/post-template/form.js +13 -20
  211. package/build-module/components/sidebar/post-template/form.js.map +1 -1
  212. package/build-module/components/sidebar/post-template/index.js +18 -25
  213. package/build-module/components/sidebar/post-template/index.js.map +1 -1
  214. package/build-module/components/sidebar/post-url/index.js +16 -23
  215. package/build-module/components/sidebar/post-url/index.js.map +1 -1
  216. package/build-module/components/sidebar/post-visibility/index.js +26 -36
  217. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  218. package/build-module/components/sidebar/settings-header/index.js +3 -4
  219. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  220. package/build-module/components/sidebar/template-summary/index.js +1 -1
  221. package/build-module/components/sidebar/template-summary/index.js.map +1 -1
  222. package/build-module/components/start-page-options/index.js +3 -4
  223. package/build-module/components/start-page-options/index.js.map +1 -1
  224. package/build-module/components/view-link/index.js +1 -1
  225. package/build-module/components/view-link/index.js.map +1 -1
  226. package/build-module/components/visual-editor/block-inspector-button.js +4 -5
  227. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  228. package/build-module/components/visual-editor/header.native.js +6 -7
  229. package/build-module/components/visual-editor/header.native.js.map +1 -1
  230. package/build-module/components/visual-editor/index.js +35 -49
  231. package/build-module/components/visual-editor/index.js.map +1 -1
  232. package/build-module/components/welcome-guide/image.js +4 -5
  233. package/build-module/components/welcome-guide/image.js.map +1 -1
  234. package/build-module/editor.js +14 -20
  235. package/build-module/editor.js.map +1 -1
  236. package/build-module/editor.native.js +3 -6
  237. package/build-module/editor.native.js.map +1 -1
  238. package/build-module/hooks/validate-multiple-use/index.js +18 -29
  239. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  240. package/build-module/plugins/index.js +20 -23
  241. package/build-module/plugins/index.js.map +1 -1
  242. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  243. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  244. package/build-module/store/actions.js +60 -88
  245. package/build-module/store/actions.js.map +1 -1
  246. package/build-module/store/reducer.js +11 -43
  247. package/build-module/store/reducer.js.map +1 -1
  248. package/build-module/store/selectors.js +11 -16
  249. package/build-module/store/selectors.js.map +1 -1
  250. package/build-style/style-rtl.css +63 -101
  251. package/build-style/style.css +63 -101
  252. package/package.json +32 -32
  253. package/src/components/header/document-title/index.js +86 -0
  254. package/src/components/header/document-title/style.scss +61 -0
  255. package/src/components/header/header-toolbar/style.scss +0 -1
  256. package/src/components/header/index.js +4 -2
  257. package/src/components/header/style.scss +6 -0
  258. package/src/components/secondary-sidebar/list-view-sidebar.js +68 -66
  259. package/src/components/secondary-sidebar/style.scss +28 -31
  260. package/src/components/visual-editor/index.js +10 -21
  261. package/src/components/visual-editor/style.scss +0 -13
  262. package/src/style.scss +1 -1
  263. package/build/components/header/template-title/delete-template.js +0 -117
  264. package/build/components/header/template-title/delete-template.js.map +0 -1
  265. package/build/components/header/template-title/edit-template-title.js +0 -95
  266. package/build/components/header/template-title/edit-template-title.js.map +0 -1
  267. package/build/components/header/template-title/index.js +0 -124
  268. package/build/components/header/template-title/index.js.map +0 -1
  269. package/build/components/header/template-title/template-description.js +0 -55
  270. package/build/components/header/template-title/template-description.js.map +0 -1
  271. package/build-module/components/header/template-title/delete-template.js +0 -104
  272. package/build-module/components/header/template-title/delete-template.js.map +0 -1
  273. package/build-module/components/header/template-title/edit-template-title.js +0 -83
  274. package/build-module/components/header/template-title/edit-template-title.js.map +0 -1
  275. package/build-module/components/header/template-title/index.js +0 -105
  276. package/build-module/components/header/template-title/index.js.map +0 -1
  277. package/build-module/components/header/template-title/template-description.js +0 -45
  278. package/build-module/components/header/template-title/template-description.js.map +0 -1
  279. package/src/components/header/template-title/delete-template.js +0 -106
  280. package/src/components/header/template-title/edit-template-title.js +0 -78
  281. package/src/components/header/template-title/index.js +0 -115
  282. package/src/components/header/template-title/style.scss +0 -94
  283. package/src/components/header/template-title/template-description.js +0 -42
@@ -23,16 +23,13 @@ const {
23
23
  Slot
24
24
  } = (0, _components.createSlotFill)('EnablePluginDocumentSettingPanelOption');
25
25
 
26
- const EnablePluginDocumentSettingPanelOption = _ref => {
27
- let {
28
- label,
29
- panelName
30
- } = _ref;
31
- return (0, _element.createElement)(Fill, null, (0, _element.createElement)(_index.EnablePanelOption, {
32
- label: label,
33
- panelName: panelName
34
- }));
35
- };
26
+ const EnablePluginDocumentSettingPanelOption = ({
27
+ label,
28
+ panelName
29
+ }) => (0, _element.createElement)(Fill, null, (0, _element.createElement)(_index.EnablePanelOption, {
30
+ label: label,
31
+ panelName: panelName
32
+ }));
36
33
 
37
34
  EnablePluginDocumentSettingPanelOption.Slot = Slot;
38
35
  var _default = EnablePluginDocumentSettingPanelOption;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js"],"names":["Fill","Slot","EnablePluginDocumentSettingPanelOption","label","panelName"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCACtB,wCADsB,CAAvB;;AAIA,MAAMC,sCAAsC,GAAG;AAAA,MAAE;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAF;AAAA,SAC9C,4BAAC,IAAD,QACC,4BAAC,wBAAD;AAAmB,IAAA,KAAK,EAAGD,KAA3B;AAAmC,IAAA,SAAS,EAAGC;AAA/C,IADD,CAD8C;AAAA,CAA/C;;AAMAF,sCAAsC,CAACD,IAAvC,GAA8CA,IAA9C;eAEeC,sC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { EnablePanelOption } from './index';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js"],"names":["Fill","Slot","EnablePluginDocumentSettingPanelOption","label","panelName"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCACtB,wCADsB,CAAvB;;AAIA,MAAMC,sCAAsC,GAAG,CAAE;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAF,KAC9C,4BAAC,IAAD,QACC,4BAAC,wBAAD;AAAmB,EAAA,KAAK,EAAGD,KAA3B;AAAmC,EAAA,SAAS,EAAGC;AAA/C,EADD,CADD;;AAMAF,sCAAsC,CAACD,IAAvC,GAA8CA,IAA9C;eAEeC,sC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { EnablePanelOption } from './index';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"]}
@@ -9,8 +9,6 @@ exports.default = ListViewSidebar;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
12
  var _blockEditor = require("@wordpress/block-editor");
15
13
 
16
14
  var _components = require("@wordpress/components");
@@ -33,10 +31,6 @@ var _store = require("../../store");
33
31
 
34
32
  var _listViewOutline = _interopRequireDefault(require("./list-view-outline"));
35
33
 
36
- /**
37
- * External dependencies
38
- */
39
-
40
34
  /**
41
35
  * WordPress dependencies
42
36
  */
@@ -47,8 +41,10 @@ var _listViewOutline = _interopRequireDefault(require("./list-view-outline"));
47
41
  function ListViewSidebar() {
48
42
  const {
49
43
  setIsListViewOpened
50
- } = (0, _data.useDispatch)(_store.store);
51
- const focusOnMountRef = (0, _compose.useFocusOnMount)('firstElement');
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.
47
+
52
48
  const headerFocusReturnRef = (0, _compose.useFocusReturn)();
53
49
  const contentFocusReturnRef = (0, _compose.useFocusReturn)();
54
50
 
@@ -57,17 +53,21 @@ function ListViewSidebar() {
57
53
  event.preventDefault();
58
54
  setIsListViewOpened(false);
59
55
  }
60
- }
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
61
 
62
62
  const [tab, setTab] = (0, _element.useState)('list-view'); // This ref refers to the sidebar as a whole.
63
63
 
64
- const sidebarRef = (0, _element.useRef)(); // This ref refers to the list view tab button.
64
+ const sidebarRef = (0, _element.useRef)(); // This ref refers to the tab panel.
65
65
 
66
- const listViewTabRef = (0, _element.useRef)(); // This ref refers to the outline tab button.
66
+ const tabPanelRef = (0, _element.useRef)(); // This ref refers to the list view application area.
67
67
 
68
- const outlineTabRef = (0, _element.useRef)(); // This ref refers to the list view application area.
68
+ const listViewRef = (0, _element.useRef)(); // Must merge the refs together so focus can be handled properly in the next function.
69
69
 
70
- const listViewRef = (0, _element.useRef)();
70
+ const listViewContainerRef = (0, _compose.useMergeRefs)([contentFocusReturnRef, focusOnMountRef, listViewRef, setDropZoneElement]);
71
71
  /*
72
72
  * Callback function to handle list view or outline focus.
73
73
  *
@@ -77,15 +77,18 @@ function ListViewSidebar() {
77
77
  */
78
78
 
79
79
  function handleSidebarFocus(currentTab) {
80
- // List view tab is selected.
80
+ // Tab panel focus.
81
+ const tabPanelFocus = _dom.focus.tabbable.find(tabPanelRef.current)[0]; // List view tab is selected.
82
+
83
+
81
84
  if (currentTab === 'list-view') {
82
- // Either focus the list view or the list view tab button. Must have a fallback because the list view does not render when there are no blocks.
85
+ // 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.
83
86
  const listViewApplicationFocus = _dom.focus.tabbable.find(listViewRef.current)[0];
84
87
 
85
- const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : listViewTabRef.current;
88
+ const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : tabPanelFocus;
86
89
  listViewFocusArea.focus(); // Outline tab is selected.
87
90
  } else {
88
- outlineTabRef.current.focus();
91
+ tabPanelFocus.focus();
89
92
  }
90
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.
91
94
 
@@ -98,42 +101,53 @@ function ListViewSidebar() {
98
101
  handleSidebarFocus(tab);
99
102
  }
100
103
  });
104
+ /**
105
+ * Render tab content for a given tab name.
106
+ *
107
+ * @param {string} tabName The name of the tab to render.
108
+ */
109
+
110
+ function renderTabContent(tabName) {
111
+ if (tabName === 'list-view') {
112
+ return (0, _element.createElement)("div", {
113
+ className: "edit-post-editor__list-view-panel-content"
114
+ }, (0, _element.createElement)(_blockEditor.__experimentalListView, {
115
+ dropZoneElement: dropZoneElement
116
+ }));
117
+ }
118
+
119
+ return (0, _element.createElement)(_listViewOutline.default, null);
120
+ }
121
+
101
122
  return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
102
123
  (0, _element.createElement)("div", {
103
124
  className: "edit-post-editor__document-overview-panel",
104
125
  onKeyDown: closeOnEscape,
105
126
  ref: sidebarRef
106
- }, (0, _element.createElement)("div", {
107
- className: "edit-post-editor__document-overview-panel-header components-panel__header edit-post-sidebar__panel-tabs",
108
- ref: headerFocusReturnRef
109
127
  }, (0, _element.createElement)(_components.Button, {
128
+ className: "edit-post-editor__document-overview-panel__close-button",
129
+ ref: headerFocusReturnRef,
110
130
  icon: _icons.closeSmall,
111
131
  label: (0, _i18n.__)('Close'),
112
132
  onClick: () => setIsListViewOpened(false)
113
- }), (0, _element.createElement)("ul", null, (0, _element.createElement)("li", null, (0, _element.createElement)(_components.Button, {
114
- ref: listViewTabRef,
115
- onClick: () => {
116
- setTab('list-view');
117
- },
118
- className: (0, _classnames.default)('edit-post-sidebar__panel-tab', {
119
- 'is-active': tab === 'list-view'
120
- }),
121
- "aria-current": tab === 'list-view'
122
- }, (0, _i18n.__)('List View'))), (0, _element.createElement)("li", null, (0, _element.createElement)(_components.Button, {
123
- ref: outlineTabRef,
124
- onClick: () => {
125
- setTab('outline');
126
- },
127
- className: (0, _classnames.default)('edit-post-sidebar__panel-tab', {
128
- 'is-active': tab === 'outline'
129
- }),
130
- "aria-current": tab === 'outline'
131
- }, (0, _i18n.__)('Outline'))))), (0, _element.createElement)("div", {
132
- ref: (0, _compose.useMergeRefs)([contentFocusReturnRef, focusOnMountRef, listViewRef]),
133
- className: "edit-post-editor__list-view-container"
134
- }, tab === 'list-view' && (0, _element.createElement)("div", {
135
- className: "edit-post-editor__list-view-panel-content"
136
- }, (0, _element.createElement)(_blockEditor.__experimentalListView, null)), tab === 'outline' && (0, _element.createElement)(_listViewOutline.default, null)))
133
+ }), (0, _element.createElement)(_components.TabPanel, {
134
+ className: "edit-post-editor__document-overview-panel__tab-panel",
135
+ ref: tabPanelRef,
136
+ onSelect: tabName => setTab(tabName),
137
+ selectOnMove: false,
138
+ tabs: [{
139
+ name: 'list-view',
140
+ title: 'List View',
141
+ className: 'edit-post-sidebar__panel-tab'
142
+ }, {
143
+ name: 'outline',
144
+ title: 'Outline',
145
+ className: 'edit-post-sidebar__panel-tab'
146
+ }]
147
+ }, currentTab => (0, _element.createElement)("div", {
148
+ className: "edit-post-editor__list-view-container",
149
+ ref: listViewContainerRef
150
+ }, renderTabContent(currentTab.name))))
137
151
  );
138
152
  }
139
153
  //# sourceMappingURL=list-view-sidebar.js.map
@@ -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","tab","setTab","sidebarRef","listViewTabRef","outlineTabRef","listViewRef","handleSidebarFocus","currentTab","listViewApplicationFocus","focus","tabbable","find","current","listViewFocusArea","contains","ownerDocument","activeElement","closeSmall"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport {\n\tuseFocusOnMount,\n\tuseFocusReturn,\n\tuseMergeRefs,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport ListViewOutline from './list-view-outline';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editPostStore );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst headerFocusReturnRef = useFocusReturn();\n\tconst contentFocusReturnRef = useFocusReturn();\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}\n\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the list view tab button.\n\tconst listViewTabRef = useRef();\n\t// This ref refers to the outline tab button.\n\tconst outlineTabRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the list view tab button. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: listViewTabRef.current;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\toutlineTabRef.current.focus();\n\t\t}\n\t}\n\n\t// This only fires when the sidebar is open because of the conditional rendering. It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/edit-post/toggle-list-view', () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tsetIsListViewOpened( false );\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t} else {\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t} );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-post-editor__document-overview-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel-header components-panel__header edit-post-sidebar__panel-tabs\"\n\t\t\t\tref={ headerFocusReturnRef }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ () => setIsListViewOpened( false ) }\n\t\t\t\t/>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tref={ listViewTabRef }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetTab( 'list-view' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-post-sidebar__panel-tab',\n\t\t\t\t\t\t\t\t{ 'is-active': tab === 'list-view' }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\taria-current={ tab === 'list-view' }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'List View' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tref={ outlineTabRef }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetTab( 'outline' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-post-sidebar__panel-tab',\n\t\t\t\t\t\t\t\t{ 'is-active': tab === 'outline' }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\taria-current={ tab === 'outline' }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Outline' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\tcontentFocusReturnRef,\n\t\t\t\t\tfocusOnMountRef,\n\t\t\t\t\tlistViewRef,\n\t\t\t\t] ) }\n\t\t\t\tclassName=\"edit-post-editor__list-view-container\"\n\t\t\t>\n\t\t\t\t{ tab === 'list-view' && (\n\t\t\t\t\t<div className=\"edit-post-editor__list-view-panel-content\">\n\t\t\t\t\t\t<ListView />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t{ tab === 'outline' && <ListViewOutline /> }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"names":["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":"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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"]}
@@ -32,13 +32,11 @@ var _store = require("../../../store");
32
32
  */
33
33
  const PANEL_NAME = 'discussion-panel';
34
34
 
35
- function DiscussionPanel(_ref) {
36
- let {
37
- isEnabled,
38
- isOpened,
39
- onTogglePanel
40
- } = _ref;
41
-
35
+ function DiscussionPanel({
36
+ isEnabled,
37
+ isOpened,
38
+ onTogglePanel
39
+ }) {
42
40
  if (!isEnabled) {
43
41
  return null;
44
42
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"names":["PANEL_NAME","DiscussionPanel","isEnabled","isOpened","onTogglePanel","select","editPostStore","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,kBAAnB;;AAEA,SAASC,eAAT,OAAmE;AAAA,MAAzC;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA;AAAvB,GAAyC;;AAClE,MAAK,CAAEF,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,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,EAAGC;AAHZ,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;;eAEc,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AACzB,SAAO;AACNH,IAAAA,SAAS,EACRG,MAAM,CAAEC,YAAF,CAAN,CAAwBC,oBAAxB,CAA8CP,UAA9C,CAFK;AAGNG,IAAAA,QAAQ,EAAEE,MAAM,CAAEC,YAAF,CAAN,CAAwBE,mBAAxB,CAA6CR,UAA7C;AAHJ,GAAP;AAKA,CAND,CADuB,EAQvB,wBAAgBS,QAAF,KAAkB;AAC/BL,EAAAA,aAAa,GAAG;AACf,WAAOK,QAAQ,CAAEH,YAAF,CAAR,CAA0BI,uBAA1B,CACNV,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAd,CARuB,CAAT,EAeVC,eAfU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPostComments,\n\tPostPingbacks,\n\tPostTypeSupportCheck,\n} from '@wordpress/editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'discussion-panel';\n\nfunction DiscussionPanel( { isEnabled, isOpened, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</PanelBody>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\treturn {\n\t\t\tisEnabled:\n\t\t\t\tselect( editPostStore ).isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: select( editPostStore ).isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonTogglePanel() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tPANEL_NAME\n\t\t\t);\n\t\t},\n\t} ) ),\n] )( DiscussionPanel );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"names":["PANEL_NAME","DiscussionPanel","isEnabled","isOpened","onTogglePanel","select","editPostStore","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,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,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,EAAGC;AAHZ,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;;eAEc,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AACzB,SAAO;AACNH,IAAAA,SAAS,EACRG,MAAM,CAAEC,YAAF,CAAN,CAAwBC,oBAAxB,CAA8CP,UAA9C,CAFK;AAGNG,IAAAA,QAAQ,EAAEE,MAAM,CAAEC,YAAF,CAAN,CAAwBE,mBAAxB,CAA6CR,UAA7C;AAHJ,GAAP;AAKA,CAND,CADuB,EAQvB,wBAAgBS,QAAF,KAAkB;AAC/BL,EAAAA,aAAa,GAAG;AACf,WAAOK,QAAQ,CAAEH,YAAF,CAAR,CAA0BI,uBAA1B,CACNV,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAd,CARuB,CAAT,EAeVC,eAfU,C","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"]}
@@ -34,22 +34,20 @@ var _store = require("../../../store");
34
34
  */
35
35
  const PANEL_NAME = 'featured-image';
36
36
 
37
- function FeaturedImage(_ref) {
38
- var _postType$labels$feat, _postType$labels;
39
-
40
- let {
41
- isEnabled,
42
- isOpened,
43
- postType,
44
- onTogglePanel
45
- } = _ref;
37
+ function FeaturedImage({
38
+ isEnabled,
39
+ isOpened,
40
+ postType,
41
+ onTogglePanel
42
+ }) {
43
+ var _postType$labels$feat;
46
44
 
47
45
  if (!isEnabled) {
48
46
  return null;
49
47
  }
50
48
 
51
49
  return (0, _element.createElement)(_editor.PostFeaturedImageCheck, null, (0, _element.createElement)(_components.PanelBody, {
52
- title: (_postType$labels$feat = postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : (0, _i18n.__)('Featured image'),
50
+ title: (_postType$labels$feat = postType?.labels?.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : (0, _i18n.__)('Featured image'),
53
51
  opened: isOpened,
54
52
  onToggle: onTogglePanel
55
53
  }, (0, _element.createElement)(_editor.PostFeaturedImage, null)));
@@ -77,13 +75,7 @@ const applyWithDispatch = (0, _data.withDispatch)(dispatch => {
77
75
  toggleEditorPanelOpened
78
76
  } = dispatch(_store.store);
79
77
  return {
80
- onTogglePanel: function () {
81
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
82
- args[_key] = arguments[_key];
83
- }
84
-
85
- return toggleEditorPanelOpened(PANEL_NAME, ...args);
86
- }
78
+ onTogglePanel: (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args)
87
79
  };
88
80
  });
89
81
 
@@ -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,OAA2E;AAAA;;AAAA,MAAnD;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA,QAAvB;AAAiCC,IAAAA;AAAjC,GAAmD;;AAC1E,MAAK,CAAEH,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,8BAAD,QACC,4BAAC,qBAAD;AACC,IAAA,KAAK,2BACJE,QADI,aACJA,QADI,2CACJA,QAAQ,CAAEE,MADN,qDACJ,iBAAkBC,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;AAAA,wCAAKe,IAAL;AAAKA,QAAAA,IAAL;AAAA;;AAAA,aACdD,uBAAuB,CAAEnB,UAAF,EAAc,GAAGoB,IAAjB,CADT;AAAA;AADT,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,"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"]}
@@ -34,7 +34,7 @@ var _store = require("../../../store");
34
34
  const PANEL_NAME = 'page-attributes';
35
35
 
36
36
  function PageAttributes() {
37
- var _postType$labels$attr, _postType$labels;
37
+ var _postType$labels$attr;
38
38
 
39
39
  const {
40
40
  isEnabled,
@@ -65,16 +65,10 @@ function PageAttributes() {
65
65
  return null;
66
66
  }
67
67
 
68
- const onTogglePanel = function () {
69
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
70
- args[_key] = arguments[_key];
71
- }
72
-
73
- return toggleEditorPanelOpened(PANEL_NAME, ...args);
74
- };
68
+ const onTogglePanel = (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args);
75
69
 
76
70
  return (0, _element.createElement)(_editor.PageAttributesCheck, null, (0, _element.createElement)(_components.PanelBody, {
77
- title: (_postType$labels$attr = postType === null || postType === void 0 ? void 0 : (_postType$labels = postType.labels) === null || _postType$labels === void 0 ? void 0 : _postType$labels.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : (0, _i18n.__)('Page attributes'),
71
+ title: (_postType$labels$attr = postType?.labels?.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : (0, _i18n.__)('Page attributes'),
78
72
  opened: isOpened,
79
73
  onToggle: onTogglePanel
80
74
  }, (0, _element.createElement)(_editor.PageAttributesParent, null), (0, _element.createElement)(_components.PanelRow, null, (0, _element.createElement)(_editor.PageAttributesOrder, null))));
@@ -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;AAAA,sCAAKC,IAAL;AAAKA,MAAAA,IAAL;AAAA;;AAAA,WACrBF,uBAAuB,CAAEb,UAAF,EAAc,GAAGe,IAAjB,CADF;AAAA,GAAtB;;AAGA,SACC,4BAAC,2BAAD,QACC,4BAAC,qBAAD;AACC,IAAA,KAAK,2BACJX,QADI,aACJA,QADI,2CACJA,QAAQ,CAAEY,MADN,qDACJ,iBAAkBC,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,"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"]}
@@ -39,17 +39,16 @@ const {
39
39
  Slot
40
40
  } = (0, _components.createSlotFill)('PluginDocumentSettingPanel');
41
41
 
42
- const PluginDocumentSettingFill = _ref => {
43
- let {
44
- isEnabled,
45
- panelName,
46
- opened,
47
- onToggle,
48
- className,
49
- title,
50
- icon,
51
- children
52
- } = _ref;
42
+ const PluginDocumentSettingFill = ({
43
+ isEnabled,
44
+ panelName,
45
+ opened,
46
+ onToggle,
47
+ className,
48
+ title,
49
+ icon,
50
+ children
51
+ }) => {
53
52
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_options.EnablePluginDocumentSettingPanelOption, {
54
53
  label: title,
55
54
  panelName: panelName
@@ -121,25 +120,21 @@ const PluginDocumentSettingPanel = (0, _compose.compose)((0, _plugins.withPlugin
121
120
  return {
122
121
  panelName: `${context.name}/${ownProps.name}`
123
122
  };
124
- }), (0, _data.withSelect)((select, _ref2) => {
125
- let {
126
- panelName
127
- } = _ref2;
123
+ }), (0, _data.withSelect)((select, {
124
+ panelName
125
+ }) => {
128
126
  return {
129
127
  opened: select(_store.store).isEditorPanelOpened(panelName),
130
128
  isEnabled: select(_store.store).isEditorPanelEnabled(panelName)
131
129
  };
132
- }), (0, _data.withDispatch)((dispatch, _ref3) => {
133
- let {
134
- panelName
135
- } = _ref3;
136
- return {
137
- onToggle() {
138
- return dispatch(_store.store).toggleEditorPanelOpened(panelName);
139
- }
130
+ }), (0, _data.withDispatch)((dispatch, {
131
+ panelName
132
+ }) => ({
133
+ onToggle() {
134
+ return dispatch(_store.store).toggleEditorPanelOpened(panelName);
135
+ }
140
136
 
141
- };
142
- }))(PluginDocumentSettingFill);
137
+ })))(PluginDocumentSettingFill);
143
138
  PluginDocumentSettingPanel.Slot = Slot;
144
139
  var _default = PluginDocumentSettingPanel;
145
140
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"names":["Fill","Slot","PluginDocumentSettingFill","isEnabled","panelName","opened","onToggle","className","title","icon","children","PluginDocumentSettingPanel","context","ownProps","undefined","name","select","editPostStore","isEditorPanelOpened","isEditorPanelEnabled","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;;;AAOA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAEA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,4BAAhB,CAAvB;;AAEA,MAAMC,yBAAyB,GAAG,QAS3B;AAAA,MAT6B;AACnCC,IAAAA,SADmC;AAEnCC,IAAAA,SAFmC;AAGnCC,IAAAA,MAHmC;AAInCC,IAAAA,QAJmC;AAKnCC,IAAAA,SALmC;AAMnCC,IAAAA,KANmC;AAOnCC,IAAAA,IAPmC;AAQnCC,IAAAA;AARmC,GAS7B;AACN,SACC,qDACC,4BAAC,+CAAD;AACC,IAAA,KAAK,EAAGF,KADT;AAEC,IAAA,SAAS,EAAGJ;AAFb,IADD,EAKC,4BAAC,IAAD,QACGD,SAAS,IACV,4BAAC,qBAAD;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,GAAG,sBAClC,gCAAmB,CAAEC,OAAF,EAAWC,QAAX,KAAyB;AAC3C,MAAKC,SAAS,KAAKD,QAAQ,CAACE,IAA5B,EAAmC;AAClC,mHAAS,sDAAT;AACA;;AACD,SAAO;AACNX,IAAAA,SAAS,EAAG,GAAGQ,OAAO,CAACG,IAAM,IAAIF,QAAQ,CAACE,IAAM;AAD1C,GAAP;AAGA,CAPD,CADkC,EASlC,sBAAY,CAAEC,MAAF,YAA6B;AAAA,MAAnB;AAAEZ,IAAAA;AAAF,GAAmB;AACxC,SAAO;AACNC,IAAAA,MAAM,EAAEW,MAAM,CAAEC,YAAF,CAAN,CAAwBC,mBAAxB,CAA6Cd,SAA7C,CADF;AAEND,IAAAA,SAAS,EACRa,MAAM,CAAEC,YAAF,CAAN,CAAwBE,oBAAxB,CAA8Cf,SAA9C;AAHK,GAAP;AAKA,CAND,CATkC,EAgBlC,wBAAc,CAAEgB,QAAF;AAAA,MAAY;AAAEhB,IAAAA;AAAF,GAAZ;AAAA,SAAiC;AAC9CE,IAAAA,QAAQ,GAAG;AACV,aAAOc,QAAQ,CAAEH,YAAF,CAAR,CAA0BI,uBAA1B,CACNjB,SADM,CAAP;AAGA;;AAL6C,GAAjC;AAAA,CAAd,CAhBkC,EAuBhCF,yBAvBgC,CAAnC;AAyBAS,0BAA0B,CAACV,IAA3B,GAAkCA,IAAlC;eAEeU,0B","sourcesContent":["/**\n * Defines as extensibility slot for the Settings sidebar\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';\nimport { store as editPostStore } from '../../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\nconst PluginDocumentSettingFill = ( {\n\tisEnabled,\n\tpanelName,\n\topened,\n\tonToggle,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.name] The machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = wp.element.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\tif ( undefined === ownProps.name ) {\n\t\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t\t}\n\t\treturn {\n\t\t\tpanelName: `${ context.name }/${ ownProps.name }`,\n\t\t};\n\t} ),\n\twithSelect( ( select, { panelName } ) => {\n\t\treturn {\n\t\t\topened: select( editPostStore ).isEditorPanelOpened( panelName ),\n\t\t\tisEnabled:\n\t\t\t\tselect( editPostStore ).isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonToggle() {\n\t\t\treturn dispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\tpanelName\n\t\t\t);\n\t\t},\n\t} ) )\n)( PluginDocumentSettingFill );\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"names":["Fill","Slot","PluginDocumentSettingFill","isEnabled","panelName","opened","onToggle","className","title","icon","children","PluginDocumentSettingPanel","context","ownProps","undefined","name","select","editPostStore","isEditorPanelOpened","isEditorPanelEnabled","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;;;AAOA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAEA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,4BAAhB,CAAvB;;AAEA,MAAMC,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,qDACC,4BAAC,+CAAD;AACC,IAAA,KAAK,EAAGF,KADT;AAEC,IAAA,SAAS,EAAGJ;AAFb,IADD,EAKC,4BAAC,IAAD,QACGD,SAAS,IACV,4BAAC,qBAAD;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,GAAG,sBAClC,gCAAmB,CAAEC,OAAF,EAAWC,QAAX,KAAyB;AAC3C,MAAKC,SAAS,KAAKD,QAAQ,CAACE,IAA5B,EAAmC;AAClC,mHAAS,sDAAT;AACA;;AACD,SAAO;AACNX,IAAAA,SAAS,EAAG,GAAGQ,OAAO,CAACG,IAAM,IAAIF,QAAQ,CAACE,IAAM;AAD1C,GAAP;AAGA,CAPD,CADkC,EASlC,sBAAY,CAAEC,MAAF,EAAU;AAAEZ,EAAAA;AAAF,CAAV,KAA6B;AACxC,SAAO;AACNC,IAAAA,MAAM,EAAEW,MAAM,CAAEC,YAAF,CAAN,CAAwBC,mBAAxB,CAA6Cd,SAA7C,CADF;AAEND,IAAAA,SAAS,EACRa,MAAM,CAAEC,YAAF,CAAN,CAAwBE,oBAAxB,CAA8Cf,SAA9C;AAHK,GAAP;AAKA,CAND,CATkC,EAgBlC,wBAAc,CAAEgB,QAAF,EAAY;AAAEhB,EAAAA;AAAF,CAAZ,MAAiC;AAC9CE,EAAAA,QAAQ,GAAG;AACV,WAAOc,QAAQ,CAAEH,YAAF,CAAR,CAA0BI,uBAA1B,CACNjB,SADM,CAAP;AAGA;;AAL6C,CAAjC,CAAd,CAhBkC,EAuBhCF,yBAvBgC,CAAnC;AAyBAS,0BAA0B,CAACV,IAA3B,GAAkCA,IAAlC;eAEeU,0B","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"]}
@@ -21,21 +21,18 @@ const {
21
21
  Slot
22
22
  } = (0, _components.createSlotFill)('PluginPostPublishPanel');
23
23
 
24
- const PluginPostPublishPanelFill = _ref => {
25
- let {
26
- children,
27
- className,
28
- title,
29
- initialOpen = false,
30
- icon
31
- } = _ref;
32
- return (0, _element.createElement)(Fill, null, (0, _element.createElement)(_components.PanelBody, {
33
- className: className,
34
- initialOpen: initialOpen || !title,
35
- title: title,
36
- icon: icon
37
- }, children));
38
- };
24
+ const PluginPostPublishPanelFill = ({
25
+ children,
26
+ className,
27
+ title,
28
+ initialOpen = false,
29
+ icon
30
+ }) => (0, _element.createElement)(Fill, null, (0, _element.createElement)(_components.PanelBody, {
31
+ className: className,
32
+ initialOpen: initialOpen || !title,
33
+ title: title,
34
+ icon: icon
35
+ }, children));
39
36
  /**
40
37
  * Renders provided content to the post-publish panel in the publish flow
41
38
  * (side panel that opens after a user publishes the post).
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js"],"names":["Fill","Slot","PluginPostPublishPanelFill","children","className","title","initialOpen","icon","PluginPostPublishPanel","context","ownProps"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,wBAAhB,CAAvB;;AAEA,MAAMC,0BAA0B,GAAG;AAAA,MAAE;AACpCC,IAAAA,QADoC;AAEpCC,IAAAA,SAFoC;AAGpCC,IAAAA,KAHoC;AAIpCC,IAAAA,WAAW,GAAG,KAJsB;AAKpCC,IAAAA;AALoC,GAAF;AAAA,SAOlC,4BAAC,IAAD,QACC,4BAAC,qBAAD;AACC,IAAA,SAAS,EAAGH,SADb;AAEC,IAAA,WAAW,EAAGE,WAAW,IAAI,CAAED,KAFhC;AAGC,IAAA,KAAK,EAAGA,KAHT;AAIC,IAAA,IAAI,EAAGE;AAJR,KAMGJ,QANH,CADD,CAPkC;AAAA,CAAnC;AAkBA;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;;;AAEA,MAAMK,sBAAsB,GAAG,sBAC9B,gCAAmB,CAAEC,OAAF,EAAWC,QAAX,KAAyB;AAC3C,SAAO;AACNH,IAAAA,IAAI,EAAEG,QAAQ,CAACH,IAAT,IAAiBE,OAAO,CAACF;AADzB,GAAP;AAGA,CAJD,CAD8B,EAM5BL,0BAN4B,CAA/B;AAQAM,sBAAsB,CAACP,IAAvB,GAA8BA,IAA9B;eAEeO,sB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\nimport { createSlotFill, PanelBody } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostPublishPanel' );\n\nconst PluginPostPublishPanelFill = ( {\n\tchildren,\n\tclassName,\n\ttitle,\n\tinitialOpen = false,\n\ticon,\n} ) => (\n\t<Fill>\n\t\t<PanelBody\n\t\t\tclassName={ className }\n\t\t\tinitialOpen={ initialOpen || ! title }\n\t\t\ttitle={ title }\n\t\t\ticon={ icon }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t</Fill>\n);\n/**\n * Renders provided content to the post-publish panel in the publish flow\n * (side panel that opens after a user publishes the post).\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the panel.\n * @param {string} [props.title] Title displayed at the top of the panel.\n * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.\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 __ = wp.i18n.__;\n * var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel;\n *\n * function MyPluginPostPublishPanel() {\n * \treturn wp.element.createElement(\n * \t\tPluginPostPublishPanel,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-publish-panel',\n * \t\t\ttitle: __( 'My panel title' ),\n * \t\t\tinitialOpen: true,\n * \t\t},\n * \t\t__( 'My panel content' )\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPostPublishPanel } from '@wordpress/edit-post';\n *\n * const MyPluginPostPublishPanel = () => (\n * \t<PluginPostPublishPanel\n * \t\tclassName=\"my-plugin-post-publish-panel\"\n * \t\ttitle={ __( 'My panel title' ) }\n * \t\tinitialOpen={ true }\n * \t>\n * { __( 'My panel content' ) }\n * \t</PluginPostPublishPanel>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\n\nconst PluginPostPublishPanel = compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t};\n\t} )\n)( PluginPostPublishPanelFill );\n\nPluginPostPublishPanel.Slot = Slot;\n\nexport default PluginPostPublishPanel;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js"],"names":["Fill","Slot","PluginPostPublishPanelFill","children","className","title","initialOpen","icon","PluginPostPublishPanel","context","ownProps"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,wBAAhB,CAAvB;;AAEA,MAAMC,0BAA0B,GAAG,CAAE;AACpCC,EAAAA,QADoC;AAEpCC,EAAAA,SAFoC;AAGpCC,EAAAA,KAHoC;AAIpCC,EAAAA,WAAW,GAAG,KAJsB;AAKpCC,EAAAA;AALoC,CAAF,KAOlC,4BAAC,IAAD,QACC,4BAAC,qBAAD;AACC,EAAA,SAAS,EAAGH,SADb;AAEC,EAAA,WAAW,EAAGE,WAAW,IAAI,CAAED,KAFhC;AAGC,EAAA,KAAK,EAAGA,KAHT;AAIC,EAAA,IAAI,EAAGE;AAJR,GAMGJ,QANH,CADD,CAPD;AAkBA;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;;;AAEA,MAAMK,sBAAsB,GAAG,sBAC9B,gCAAmB,CAAEC,OAAF,EAAWC,QAAX,KAAyB;AAC3C,SAAO;AACNH,IAAAA,IAAI,EAAEG,QAAQ,CAACH,IAAT,IAAiBE,OAAO,CAACF;AADzB,GAAP;AAGA,CAJD,CAD8B,EAM5BL,0BAN4B,CAA/B;AAQAM,sBAAsB,CAACP,IAAvB,GAA8BA,IAA9B;eAEeO,sB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\nimport { createSlotFill, PanelBody } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostPublishPanel' );\n\nconst PluginPostPublishPanelFill = ( {\n\tchildren,\n\tclassName,\n\ttitle,\n\tinitialOpen = false,\n\ticon,\n} ) => (\n\t<Fill>\n\t\t<PanelBody\n\t\t\tclassName={ className }\n\t\t\tinitialOpen={ initialOpen || ! title }\n\t\t\ttitle={ title }\n\t\t\ticon={ icon }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t</Fill>\n);\n/**\n * Renders provided content to the post-publish panel in the publish flow\n * (side panel that opens after a user publishes the post).\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the panel.\n * @param {string} [props.title] Title displayed at the top of the panel.\n * @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.\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 __ = wp.i18n.__;\n * var PluginPostPublishPanel = wp.editPost.PluginPostPublishPanel;\n *\n * function MyPluginPostPublishPanel() {\n * \treturn wp.element.createElement(\n * \t\tPluginPostPublishPanel,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-publish-panel',\n * \t\t\ttitle: __( 'My panel title' ),\n * \t\t\tinitialOpen: true,\n * \t\t},\n * \t\t__( 'My panel content' )\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPostPublishPanel } from '@wordpress/edit-post';\n *\n * const MyPluginPostPublishPanel = () => (\n * \t<PluginPostPublishPanel\n * \t\tclassName=\"my-plugin-post-publish-panel\"\n * \t\ttitle={ __( 'My panel title' ) }\n * \t\tinitialOpen={ true }\n * \t>\n * { __( 'My panel content' ) }\n * \t</PluginPostPublishPanel>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\n\nconst PluginPostPublishPanel = compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t};\n\t} )\n)( PluginPostPublishPanelFill );\n\nPluginPostPublishPanel.Slot = Slot;\n\nexport default PluginPostPublishPanel;\n"]}
@@ -64,15 +64,12 @@ const {
64
64
  * @return {WPComponent} The component to be rendered.
65
65
  */
66
66
 
67
- const PluginPostStatusInfo = _ref => {
68
- let {
69
- children,
70
- className
71
- } = _ref;
72
- return (0, _element.createElement)(Fill, null, (0, _element.createElement)(_components.PanelRow, {
73
- className: className
74
- }, children));
75
- };
67
+ const PluginPostStatusInfo = ({
68
+ children,
69
+ className
70
+ }) => (0, _element.createElement)(Fill, null, (0, _element.createElement)(_components.PanelRow, {
71
+ className: className
72
+ }, children));
76
73
 
77
74
  PluginPostStatusInfo.Slot = Slot;
78
75
  var _default = PluginPostStatusInfo;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-status-info/index.js"],"names":["Fill","Slot","PluginPostStatusInfo","children","className"],"mappings":";;;;;;;;;AAOA;;AAPA;AACA;AACA;;AAEA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,sBAAhB,CAAvB;AAEA;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,oBAAoB,GAAG;AAAA,MAAE;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAF;AAAA,SAC5B,4BAAC,IAAD,QACC,4BAAC,oBAAD;AAAU,IAAA,SAAS,EAAGA;AAAtB,KAAoCD,QAApC,CADD,CAD4B;AAAA,CAA7B;;AAMAD,oBAAoB,CAACD,IAArB,GAA4BA,IAA5B;eAEeC,oB","sourcesContent":["/**\n * Defines as extensibility slot for the Summary panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostStatusInfo' );\n\n/**\n * Renders a row in the Summary panel of the Document sidebar.\n * It should be noted that this is named and implemented around the function it serves\n * and not its location, which may change in future iterations.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {WPElement} props.children Children to be rendered.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;\n *\n * function MyPluginPostStatusInfo() {\n * \treturn wp.element.createElement(\n * \t\tPluginPostStatusInfo,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-status-info',\n * \t\t},\n * \t\t__( 'My post status info' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPostStatusInfo } from '@wordpress/edit-post';\n *\n * const MyPluginPostStatusInfo = () => (\n * \t<PluginPostStatusInfo\n * \t\tclassName=\"my-plugin-post-status-info\"\n * \t>\n * \t\t{ __( 'My post status info' ) }\n * \t</PluginPostStatusInfo>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginPostStatusInfo = ( { children, className } ) => (\n\t<Fill>\n\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t</Fill>\n);\n\nPluginPostStatusInfo.Slot = Slot;\n\nexport default PluginPostStatusInfo;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-status-info/index.js"],"names":["Fill","Slot","PluginPostStatusInfo","children","className"],"mappings":";;;;;;;;;AAOA;;AAPA;AACA;AACA;;AAEA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,sBAAhB,CAAvB;AAEA;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,oBAAoB,GAAG,CAAE;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAAF,KAC5B,4BAAC,IAAD,QACC,4BAAC,oBAAD;AAAU,EAAA,SAAS,EAAGA;AAAtB,GAAoCD,QAApC,CADD,CADD;;AAMAD,oBAAoB,CAACD,IAArB,GAA4BA,IAA5B;eAEeC,oB","sourcesContent":["/**\n * Defines as extensibility slot for the Summary panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostStatusInfo' );\n\n/**\n * Renders a row in the Summary panel of the Document sidebar.\n * It should be noted that this is named and implemented around the function it serves\n * and not its location, which may change in future iterations.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {WPElement} props.children Children to be rendered.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;\n *\n * function MyPluginPostStatusInfo() {\n * \treturn wp.element.createElement(\n * \t\tPluginPostStatusInfo,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-status-info',\n * \t\t},\n * \t\t__( 'My post status info' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPostStatusInfo } from '@wordpress/edit-post';\n *\n * const MyPluginPostStatusInfo = () => (\n * \t<PluginPostStatusInfo\n * \t\tclassName=\"my-plugin-post-status-info\"\n * \t>\n * \t\t{ __( 'My post status info' ) }\n * \t</PluginPostStatusInfo>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginPostStatusInfo = ( { children, className } ) => (\n\t<Fill>\n\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t</Fill>\n);\n\nPluginPostStatusInfo.Slot = Slot;\n\nexport default PluginPostStatusInfo;\n"]}