@wordpress/edit-post 7.10.0 → 7.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/block-manager/category.js +14 -22
  3. package/build/components/block-manager/category.js.map +1 -1
  4. package/build/components/block-manager/checklist.js +6 -13
  5. package/build/components/block-manager/checklist.js.map +1 -1
  6. package/build/components/block-manager/index.js +10 -14
  7. package/build/components/block-manager/index.js.map +1 -1
  8. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  9. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  10. package/build/components/device-preview/index.js +1 -1
  11. package/build/components/device-preview/index.js.map +1 -1
  12. package/build/components/editor-initialization/index.js +3 -4
  13. package/build/components/editor-initialization/index.js.map +1 -1
  14. package/build/components/header/document-title/index.js +103 -0
  15. package/build/components/header/document-title/index.js.map +1 -0
  16. package/build/components/header/fullscreen-mode-close/index.js +8 -9
  17. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  18. package/build/components/header/header-toolbar/index.js +4 -3
  19. package/build/components/header/header-toolbar/index.js.map +1 -1
  20. package/build/components/header/header-toolbar/index.native.js +12 -13
  21. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  22. package/build/components/header/index.js +7 -6
  23. package/build/components/header/index.js.map +1 -1
  24. package/build/components/header/main-dashboard-button/index.js +3 -4
  25. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  26. package/build/components/header/more-menu/index.js +19 -23
  27. package/build/components/header/more-menu/index.js.map +1 -1
  28. package/build/components/header/post-publish-button-or-toggle.js +15 -16
  29. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  30. package/build/components/header/tools-more-menu-group/index.js +7 -10
  31. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  32. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  33. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  34. package/build/components/keyboard-shortcut-help-modal/index.js +44 -54
  35. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  36. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  37. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  38. package/build/components/layout/actions-panel.js +5 -6
  39. package/build/components/layout/actions-panel.js.map +1 -1
  40. package/build/components/layout/index.js +3 -4
  41. package/build/components/layout/index.js.map +1 -1
  42. package/build/components/layout/index.native.js +3 -7
  43. package/build/components/layout/index.native.js.map +1 -1
  44. package/build/components/meta-boxes/index.js +9 -13
  45. package/build/components/meta-boxes/index.js.map +1 -1
  46. package/build/components/meta-boxes/meta-box-visibility.js +5 -8
  47. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  48. package/build/components/meta-boxes/meta-boxes-area/index.js +3 -4
  49. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  50. package/build/components/preferences-modal/meta-boxes-section.js +16 -23
  51. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  52. package/build/components/preferences-modal/options/enable-custom-fields.js +7 -9
  53. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  54. package/build/components/preferences-modal/options/enable-feature.js +12 -16
  55. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  56. package/build/components/preferences-modal/options/enable-panel.js +10 -17
  57. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  58. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  59. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  60. package/build/components/secondary-sidebar/list-view-sidebar.js +58 -44
  61. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  62. package/build/components/sidebar/discussion-panel/index.js +5 -7
  63. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  64. package/build/components/sidebar/featured-image/index.js +9 -17
  65. package/build/components/sidebar/featured-image/index.js.map +1 -1
  66. package/build/components/sidebar/page-attributes/index.js +3 -9
  67. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  68. package/build/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  69. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  70. package/build/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  71. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  72. package/build/components/sidebar/plugin-post-status-info/index.js +6 -9
  73. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  74. package/build/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  75. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  76. package/build/components/sidebar/plugin-sidebar/index.js +4 -5
  77. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  78. package/build/components/sidebar/post-excerpt/index.js +5 -7
  79. package/build/components/sidebar/post-excerpt/index.js.map +1 -1
  80. package/build/components/sidebar/post-schedule/index.js +16 -23
  81. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  82. package/build/components/sidebar/post-status/index.js +7 -11
  83. package/build/components/sidebar/post-status/index.js.map +1 -1
  84. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  85. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  86. package/build/components/sidebar/post-template/create-modal.js +3 -4
  87. package/build/components/sidebar/post-template/create-modal.js.map +1 -1
  88. package/build/components/sidebar/post-template/form.js +13 -20
  89. package/build/components/sidebar/post-template/form.js.map +1 -1
  90. package/build/components/sidebar/post-template/index.js +18 -25
  91. package/build/components/sidebar/post-template/index.js.map +1 -1
  92. package/build/components/sidebar/post-url/index.js +16 -23
  93. package/build/components/sidebar/post-url/index.js.map +1 -1
  94. package/build/components/sidebar/post-visibility/index.js +26 -36
  95. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  96. package/build/components/sidebar/settings-header/index.js +3 -4
  97. package/build/components/sidebar/settings-header/index.js.map +1 -1
  98. package/build/components/sidebar/template-summary/index.js +1 -1
  99. package/build/components/sidebar/template-summary/index.js.map +1 -1
  100. package/build/components/start-page-options/index.js +3 -4
  101. package/build/components/start-page-options/index.js.map +1 -1
  102. package/build/components/view-link/index.js +1 -1
  103. package/build/components/view-link/index.js.map +1 -1
  104. package/build/components/visual-editor/block-inspector-button.js +4 -5
  105. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  106. package/build/components/visual-editor/header.native.js +6 -7
  107. package/build/components/visual-editor/header.native.js.map +1 -1
  108. package/build/components/visual-editor/index.js +32 -48
  109. package/build/components/visual-editor/index.js.map +1 -1
  110. package/build/components/welcome-guide/image.js +4 -5
  111. package/build/components/welcome-guide/image.js.map +1 -1
  112. package/build/editor.js +15 -23
  113. package/build/editor.js.map +1 -1
  114. package/build/editor.native.js +3 -6
  115. package/build/editor.native.js.map +1 -1
  116. package/build/hooks/validate-multiple-use/index.js +18 -29
  117. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  118. package/build/index.js +2 -2
  119. package/build/index.js.map +1 -1
  120. package/build/plugins/index.js +20 -23
  121. package/build/plugins/index.js.map +1 -1
  122. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  123. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  124. package/build/store/actions.js +60 -88
  125. package/build/store/actions.js.map +1 -1
  126. package/build/store/reducer.js +11 -43
  127. package/build/store/reducer.js.map +1 -1
  128. package/build/store/selectors.js +11 -16
  129. package/build/store/selectors.js.map +1 -1
  130. package/build-module/components/block-manager/category.js +14 -22
  131. package/build-module/components/block-manager/category.js.map +1 -1
  132. package/build-module/components/block-manager/checklist.js +6 -13
  133. package/build-module/components/block-manager/checklist.js.map +1 -1
  134. package/build-module/components/block-manager/index.js +10 -14
  135. package/build-module/components/block-manager/index.js.map +1 -1
  136. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  137. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  138. package/build-module/components/device-preview/index.js +1 -1
  139. package/build-module/components/device-preview/index.js.map +1 -1
  140. package/build-module/components/editor-initialization/index.js +3 -4
  141. package/build-module/components/editor-initialization/index.js.map +1 -1
  142. package/build-module/components/header/document-title/index.js +88 -0
  143. package/build-module/components/header/document-title/index.js.map +1 -0
  144. package/build-module/components/header/fullscreen-mode-close/index.js +7 -8
  145. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  146. package/build-module/components/header/header-toolbar/index.js +3 -3
  147. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  148. package/build-module/components/header/header-toolbar/index.native.js +12 -13
  149. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  150. package/build-module/components/header/index.js +7 -6
  151. package/build-module/components/header/index.js.map +1 -1
  152. package/build-module/components/header/main-dashboard-button/index.js +3 -4
  153. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  154. package/build-module/components/header/more-menu/index.js +19 -23
  155. package/build-module/components/header/more-menu/index.js.map +1 -1
  156. package/build-module/components/header/post-publish-button-or-toggle.js +15 -16
  157. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  158. package/build-module/components/header/tools-more-menu-group/index.js +7 -10
  159. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  160. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  161. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  162. package/build-module/components/keyboard-shortcut-help-modal/index.js +42 -52
  163. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  164. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  165. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  166. package/build-module/components/layout/actions-panel.js +5 -6
  167. package/build-module/components/layout/actions-panel.js.map +1 -1
  168. package/build-module/components/layout/index.js +3 -4
  169. package/build-module/components/layout/index.js.map +1 -1
  170. package/build-module/components/layout/index.native.js +3 -7
  171. package/build-module/components/layout/index.native.js.map +1 -1
  172. package/build-module/components/meta-boxes/index.js +9 -13
  173. package/build-module/components/meta-boxes/index.js.map +1 -1
  174. package/build-module/components/meta-boxes/meta-box-visibility.js +5 -8
  175. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  176. package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -4
  177. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  178. package/build-module/components/preferences-modal/meta-boxes-section.js +16 -23
  179. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  180. package/build-module/components/preferences-modal/options/enable-custom-fields.js +7 -9
  181. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  182. package/build-module/components/preferences-modal/options/enable-feature.js +12 -16
  183. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  184. package/build-module/components/preferences-modal/options/enable-panel.js +10 -17
  185. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  186. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  187. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  188. package/build-module/components/secondary-sidebar/list-view-sidebar.js +58 -44
  189. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  190. package/build-module/components/sidebar/discussion-panel/index.js +5 -7
  191. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  192. package/build-module/components/sidebar/featured-image/index.js +9 -17
  193. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  194. package/build-module/components/sidebar/page-attributes/index.js +3 -9
  195. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  196. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  197. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  198. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  199. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  200. package/build-module/components/sidebar/plugin-post-status-info/index.js +6 -9
  201. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  202. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  203. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  204. package/build-module/components/sidebar/plugin-sidebar/index.js +4 -5
  205. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-excerpt/index.js +5 -7
  207. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  208. package/build-module/components/sidebar/post-schedule/index.js +16 -23
  209. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  210. package/build-module/components/sidebar/post-status/index.js +7 -11
  211. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  212. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  213. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  214. package/build-module/components/sidebar/post-template/create-modal.js +3 -4
  215. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
  216. package/build-module/components/sidebar/post-template/form.js +13 -20
  217. package/build-module/components/sidebar/post-template/form.js.map +1 -1
  218. package/build-module/components/sidebar/post-template/index.js +18 -25
  219. package/build-module/components/sidebar/post-template/index.js.map +1 -1
  220. package/build-module/components/sidebar/post-url/index.js +16 -23
  221. package/build-module/components/sidebar/post-url/index.js.map +1 -1
  222. package/build-module/components/sidebar/post-visibility/index.js +26 -36
  223. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  224. package/build-module/components/sidebar/settings-header/index.js +3 -4
  225. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  226. package/build-module/components/sidebar/template-summary/index.js +1 -1
  227. package/build-module/components/sidebar/template-summary/index.js.map +1 -1
  228. package/build-module/components/start-page-options/index.js +3 -4
  229. package/build-module/components/start-page-options/index.js.map +1 -1
  230. package/build-module/components/view-link/index.js +1 -1
  231. package/build-module/components/view-link/index.js.map +1 -1
  232. package/build-module/components/visual-editor/block-inspector-button.js +4 -5
  233. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  234. package/build-module/components/visual-editor/header.native.js +6 -7
  235. package/build-module/components/visual-editor/header.native.js.map +1 -1
  236. package/build-module/components/visual-editor/index.js +35 -49
  237. package/build-module/components/visual-editor/index.js.map +1 -1
  238. package/build-module/components/welcome-guide/image.js +4 -5
  239. package/build-module/components/welcome-guide/image.js.map +1 -1
  240. package/build-module/editor.js +15 -23
  241. package/build-module/editor.js.map +1 -1
  242. package/build-module/editor.native.js +3 -6
  243. package/build-module/editor.native.js.map +1 -1
  244. package/build-module/hooks/validate-multiple-use/index.js +18 -29
  245. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  246. package/build-module/index.js +2 -2
  247. package/build-module/index.js.map +1 -1
  248. package/build-module/plugins/index.js +20 -23
  249. package/build-module/plugins/index.js.map +1 -1
  250. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  251. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  252. package/build-module/store/actions.js +60 -88
  253. package/build-module/store/actions.js.map +1 -1
  254. package/build-module/store/reducer.js +11 -43
  255. package/build-module/store/reducer.js.map +1 -1
  256. package/build-module/store/selectors.js +11 -16
  257. package/build-module/store/selectors.js.map +1 -1
  258. package/build-style/classic-rtl.css +1 -1
  259. package/build-style/classic.css +1 -1
  260. package/build-style/style-rtl.css +74 -114
  261. package/build-style/style.css +74 -114
  262. package/package.json +33 -33
  263. package/src/components/header/document-title/index.js +86 -0
  264. package/src/components/header/document-title/style.scss +61 -0
  265. package/src/components/header/header-toolbar/index.js +2 -2
  266. package/src/components/header/header-toolbar/style.scss +0 -1
  267. package/src/components/header/index.js +4 -2
  268. package/src/components/header/style.scss +6 -0
  269. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +1 -3
  270. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +2 -6
  271. package/src/components/secondary-sidebar/list-view-sidebar.js +68 -66
  272. package/src/components/secondary-sidebar/style.scss +28 -31
  273. package/src/components/visual-editor/index.js +10 -21
  274. package/src/components/visual-editor/style.scss +0 -13
  275. package/src/editor.js +1 -3
  276. package/src/index.js +3 -2
  277. package/src/style.scss +1 -1
  278. package/build/components/header/template-title/delete-template.js +0 -117
  279. package/build/components/header/template-title/delete-template.js.map +0 -1
  280. package/build/components/header/template-title/edit-template-title.js +0 -95
  281. package/build/components/header/template-title/edit-template-title.js.map +0 -1
  282. package/build/components/header/template-title/index.js +0 -124
  283. package/build/components/header/template-title/index.js.map +0 -1
  284. package/build/components/header/template-title/template-description.js +0 -55
  285. package/build/components/header/template-title/template-description.js.map +0 -1
  286. package/build-module/components/header/template-title/delete-template.js +0 -104
  287. package/build-module/components/header/template-title/delete-template.js.map +0 -1
  288. package/build-module/components/header/template-title/edit-template-title.js +0 -83
  289. package/build-module/components/header/template-title/edit-template-title.js.map +0 -1
  290. package/build-module/components/header/template-title/index.js +0 -105
  291. package/build-module/components/header/template-title/index.js.map +0 -1
  292. package/build-module/components/header/template-title/template-description.js +0 -45
  293. package/build-module/components/header/template-title/template-description.js.map +0 -1
  294. package/src/components/header/template-title/delete-template.js +0 -106
  295. package/src/components/header/template-title/edit-template-title.js +0 -78
  296. package/src/components/header/template-title/index.js +0 -115
  297. package/src/components/header/template-title/style.scss +0 -94
  298. package/src/components/header/template-title/template-description.js +0 -42
@@ -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"]}
@@ -21,21 +21,18 @@ const {
21
21
  Slot
22
22
  } = (0, _components.createSlotFill)('PluginPrePublishPanel');
23
23
 
24
- const PluginPrePublishPanelFill = _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 PluginPrePublishPanelFill = ({
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 pre-publish side panel in the publish flow
41
38
  * (side panel that opens when a user first pushes "Publish" from the main editor).
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-pre-publish-panel/index.js"],"names":["Fill","Slot","PluginPrePublishPanelFill","children","className","title","initialOpen","icon","PluginPrePublishPanel","context","ownProps"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,uBAAhB,CAAvB;;AAEA,MAAMC,yBAAyB,GAAG;AAAA,MAAE;AACnCC,IAAAA,QADmC;AAEnCC,IAAAA,SAFmC;AAGnCC,IAAAA,KAHmC;AAInCC,IAAAA,WAAW,GAAG,KAJqB;AAKnCC,IAAAA;AALmC,GAAF;AAAA,SAOjC,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,CAPiC;AAAA,CAAlC;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMK,qBAAqB,GAAG,sBAC7B,gCAAmB,CAAEC,OAAF,EAAWC,QAAX,KAAyB;AAC3C,SAAO;AACNH,IAAAA,IAAI,EAAEG,QAAQ,CAACH,IAAT,IAAiBE,OAAO,CAACF;AADzB,GAAP;AAGA,CAJD,CAD6B,EAM3BL,yBAN2B,CAA9B;AAQAM,qBAAqB,CAACP,IAAtB,GAA6BA,IAA7B;eAEeO,qB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\nconst { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );\n\nconst PluginPrePublishPanelFill = ( {\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/**\n * Renders provided content to the pre-publish side panel in the publish flow\n * (side panel that opens when a user first pushes \"Publish\" from the main editor).\n *\n * @param {Object} props Component props.\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.\n * 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/)\n * icon slug string, or an SVG WP element, to be rendered when\n * the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;\n *\n * function MyPluginPrePublishPanel() {\n * \treturn wp.element.createElement(\n * \t\tPluginPrePublishPanel,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-pre-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 { PluginPrePublishPanel } from '@wordpress/edit-post';\n *\n * const MyPluginPrePublishPanel = () => (\n * \t<PluginPrePublishPanel\n * \t\tclassName=\"my-plugin-pre-publish-panel\"\n * \t\ttitle={ __( 'My panel title' ) }\n * \t\tinitialOpen={ true }\n * \t>\n * \t { __( 'My panel content' ) }\n * \t</PluginPrePublishPanel>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginPrePublishPanel = compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t};\n\t} )\n)( PluginPrePublishPanelFill );\n\nPluginPrePublishPanel.Slot = Slot;\n\nexport default PluginPrePublishPanel;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-pre-publish-panel/index.js"],"names":["Fill","Slot","PluginPrePublishPanelFill","children","className","title","initialOpen","icon","PluginPrePublishPanel","context","ownProps"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IAAiB,gCAAgB,uBAAhB,CAAvB;;AAEA,MAAMC,yBAAyB,GAAG,CAAE;AACnCC,EAAAA,QADmC;AAEnCC,EAAAA,SAFmC;AAGnCC,EAAAA,KAHmC;AAInCC,EAAAA,WAAW,GAAG,KAJqB;AAKnCC,EAAAA;AALmC,CAAF,KAOjC,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;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMK,qBAAqB,GAAG,sBAC7B,gCAAmB,CAAEC,OAAF,EAAWC,QAAX,KAAyB;AAC3C,SAAO;AACNH,IAAAA,IAAI,EAAEG,QAAQ,CAACH,IAAT,IAAiBE,OAAO,CAACF;AADzB,GAAP;AAGA,CAJD,CAD6B,EAM3BL,yBAN2B,CAA9B;AAQAM,qBAAqB,CAACP,IAAtB,GAA6BA,IAA7B;eAEeO,qB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { withPluginContext } from '@wordpress/plugins';\nconst { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );\n\nconst PluginPrePublishPanelFill = ( {\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/**\n * Renders provided content to the pre-publish side panel in the publish flow\n * (side panel that opens when a user first pushes \"Publish\" from the main editor).\n *\n * @param {Object} props Component props.\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.\n * 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/)\n * icon slug string, or an SVG WP element, to be rendered when\n * the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;\n *\n * function MyPluginPrePublishPanel() {\n * \treturn wp.element.createElement(\n * \t\tPluginPrePublishPanel,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-pre-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 { PluginPrePublishPanel } from '@wordpress/edit-post';\n *\n * const MyPluginPrePublishPanel = () => (\n * \t<PluginPrePublishPanel\n * \t\tclassName=\"my-plugin-pre-publish-panel\"\n * \t\ttitle={ __( 'My panel title' ) }\n * \t\tinitialOpen={ true }\n * \t>\n * \t { __( 'My panel content' ) }\n * \t</PluginPrePublishPanel>\n * );\n * ```\n *\n * @return {WPComponent} The component to be rendered.\n */\nconst PluginPrePublishPanel = compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t};\n\t} )\n)( PluginPrePublishPanelFill );\n\nPluginPrePublishPanel.Slot = Slot;\n\nexport default PluginPrePublishPanel;\n"]}
@@ -96,11 +96,10 @@ var _store = require("../../../store");
96
96
  * );
97
97
  * ```
98
98
  */
99
- function PluginSidebarEditPost(_ref) {
100
- let {
101
- className,
102
- ...props
103
- } = _ref;
99
+ function PluginSidebarEditPost({
100
+ className,
101
+ ...props
102
+ }) {
104
103
  const {
105
104
  postTitle,
106
105
  shortcut,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-sidebar/index.js"],"names":["PluginSidebarEditPost","className","props","postTitle","shortcut","showIconLabels","select","editorStore","getEditedPostAttribute","keyboardShortcutsStore","getShortcutRepresentation","editPostStore","isFeatureActive"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,OAA0D;AAAA,MAA1B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA0B;AACxE,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA;AAAvB,MAA0C,qBAAaC,MAAF,IAAc;AACxE,WAAO;AACNH,MAAAA,SAAS,EAAEG,MAAM,CAAEC,aAAF,CAAN,CAAsBC,sBAAtB,CAA8C,OAA9C,CADL;AAENJ,MAAAA,QAAQ,EAAEE,MAAM,CACfG,wBADe,CAAN,CAERC,yBAFQ,CAEmB,+BAFnB,CAFJ;AAKNL,MAAAA,cAAc,EACbC,MAAM,CAAEK,YAAF,CAAN,CAAwBC,eAAxB,CAAyC,gBAAzC;AANK,KAAP;AAQA,GAT+C,EAS7C,EAT6C,CAAhD;AAUA,SACC,4BAAC,4BAAD;AACC,IAAA,cAAc,EAAGX,SADlB;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,gBAAgB,EAAGE,SAAS,IAAI,cAAI,YAAJ,CAHjC;AAIC,IAAA,KAAK,EAAC,gBAJP;AAKC,IAAA,cAAc,EAAGC,QALlB;AAMC,IAAA,cAAc,EAAGC;AANlB,KAOMH,KAPN,EADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\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 el = wp.element.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editPost.PluginSidebar;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditPost( { className, ...props } ) {\n\tconst { postTitle, shortcut, showIconLabels } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostTitle: select( editorStore ).getEditedPostAttribute( 'title' ),\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-post-sidebar\"\n\t\t\tsmallScreenTitle={ postTitle || __( '(no title)' ) }\n\t\t\tscope=\"core/edit-post\"\n\t\t\ttoggleShortcut={ shortcut }\n\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/plugin-sidebar/index.js"],"names":["PluginSidebarEditPost","className","props","postTitle","shortcut","showIconLabels","select","editorStore","getEditedPostAttribute","keyboardShortcutsStore","getShortcutRepresentation","editPostStore","isFeatureActive"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,CAAgC;AAAEC,EAAAA,SAAF;AAAa,KAAGC;AAAhB,CAAhC,EAA0D;AACxE,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA;AAAvB,MAA0C,qBAAaC,MAAF,IAAc;AACxE,WAAO;AACNH,MAAAA,SAAS,EAAEG,MAAM,CAAEC,aAAF,CAAN,CAAsBC,sBAAtB,CAA8C,OAA9C,CADL;AAENJ,MAAAA,QAAQ,EAAEE,MAAM,CACfG,wBADe,CAAN,CAERC,yBAFQ,CAEmB,+BAFnB,CAFJ;AAKNL,MAAAA,cAAc,EACbC,MAAM,CAAEK,YAAF,CAAN,CAAwBC,eAAxB,CAAyC,gBAAzC;AANK,KAAP;AAQA,GAT+C,EAS7C,EAT6C,CAAhD;AAUA,SACC,4BAAC,4BAAD;AACC,IAAA,cAAc,EAAGX,SADlB;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,gBAAgB,EAAGE,SAAS,IAAI,cAAI,YAAJ,CAHjC;AAIC,IAAA,KAAK,EAAC,gBAJP;AAKC,IAAA,cAAc,EAAGC,QALlB;AAMC,IAAA,cAAc,EAAGC;AANlB,KAOMH,KAPN,EADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\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 el = wp.element.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editPost.PluginSidebar;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditPost( { className, ...props } ) {\n\tconst { postTitle, shortcut, showIconLabels } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostTitle: select( editorStore ).getEditedPostAttribute( 'title' ),\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-post-sidebar\"\n\t\t\tsmallScreenTitle={ postTitle || __( '(no title)' ) }\n\t\t\tscope=\"core/edit-post\"\n\t\t\ttoggleShortcut={ shortcut }\n\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
@@ -32,13 +32,11 @@ var _store = require("../../../store");
32
32
  */
33
33
  const PANEL_NAME = 'post-excerpt';
34
34
 
35
- function PostExcerpt(_ref) {
36
- let {
37
- isEnabled,
38
- isOpened,
39
- onTogglePanel
40
- } = _ref;
41
-
35
+ function PostExcerpt({
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/post-excerpt/index.js"],"names":["PANEL_NAME","PostExcerpt","isEnabled","isOpened","onTogglePanel","select","editPostStore","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,cAAnB;;AAEA,SAASC,WAAT,OAA+D;AAAA,MAAzC;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,QAAb;AAAuBC,IAAAA;AAAvB,GAAyC;;AAC9D,MAAK,CAAEF,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,wBAAD,QACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAG,cAAI,SAAJ,CADT;AAEC,IAAA,MAAM,EAAGC,QAFV;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKC,4BAAC,mBAAD,OALD,CADD,CADD;AAWA;;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,WAfU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPostExcerpt as PostExcerptForm,\n\tPostExcerptCheck,\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 = 'post-excerpt';\n\nfunction PostExcerpt( { isEnabled, isOpened, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Excerpt' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostExcerptForm />\n\t\t\t</PanelBody>\n\t\t</PostExcerptCheck>\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] )( PostExcerpt );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-excerpt/index.js"],"names":["PANEL_NAME","PostExcerpt","isEnabled","isOpened","onTogglePanel","select","editPostStore","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,cAAnB;;AAEA,SAASC,WAAT,CAAsB;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,QAAb;AAAuBC,EAAAA;AAAvB,CAAtB,EAA+D;AAC9D,MAAK,CAAEF,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,wBAAD,QACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAG,cAAI,SAAJ,CADT;AAEC,IAAA,MAAM,EAAGC,QAFV;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKC,4BAAC,mBAAD,OALD,CADD,CADD;AAWA;;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,WAfU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPostExcerpt as PostExcerptForm,\n\tPostExcerptCheck,\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 = 'post-excerpt';\n\nfunction PostExcerpt( { isEnabled, isOpened, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Excerpt' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostExcerptForm />\n\t\t\t</PanelBody>\n\t\t</PostExcerptCheck>\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] )( PostExcerpt );\n"]}
@@ -32,32 +32,25 @@ function PostSchedule() {
32
32
  popoverProps: popoverProps,
33
33
  contentClassName: "edit-post-post-schedule__dialog",
34
34
  focusOnMount: true,
35
- renderToggle: _ref => {
36
- let {
37
- isOpen,
38
- onToggle
39
- } = _ref;
40
- return (0, _element.createElement)(PostScheduleToggle, {
41
- isOpen: isOpen,
42
- onClick: onToggle
43
- });
44
- },
45
- renderContent: _ref2 => {
46
- let {
47
- onClose
48
- } = _ref2;
49
- return (0, _element.createElement)(_editor.PostSchedule, {
50
- onClose: onClose
51
- });
52
- }
35
+ renderToggle: ({
36
+ isOpen,
37
+ onToggle
38
+ }) => (0, _element.createElement)(PostScheduleToggle, {
39
+ isOpen: isOpen,
40
+ onClick: onToggle
41
+ }),
42
+ renderContent: ({
43
+ onClose
44
+ }) => (0, _element.createElement)(_editor.PostSchedule, {
45
+ onClose: onClose
46
+ })
53
47
  })));
54
48
  }
55
49
 
56
- function PostScheduleToggle(_ref3) {
57
- let {
58
- isOpen,
59
- onClick
60
- } = _ref3;
50
+ function PostScheduleToggle({
51
+ isOpen,
52
+ onClick
53
+ }) {
61
54
  const label = (0, _editor.usePostScheduleLabel)();
62
55
  const fullLabel = (0, _editor.usePostScheduleLabel)({
63
56
  full: true
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-schedule/index.js"],"names":["PostSchedule","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","isOpen","onToggle","onClose","PostScheduleToggle","onClick","label","fullLabel","full"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AANA;AACA;AACA;AAUe,SAASA,YAAT,GAAwB;AACtC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHsC,CAItC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AAAEC,IAAAA,MAAM,EAAEH,aAAV;AAAyBI,IAAAA,SAAS,EAAE;AAApC,GAAR,CADoB,EAEpB,CAAEJ,aAAF,CAFoB,CAArB;AAKA,SACC,4BAAC,yBAAD,QACC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,GAAG,EAAGC;AAFP,KAIC,0CAAQ,cAAI,SAAJ,CAAR,CAJD,EAKC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAGC,YADhB;AAEC,IAAA,gBAAgB,EAAC,iCAFlB;AAGC,IAAA,YAAY,MAHb;AAIC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEG,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd,4BAAC,kBAAD;AACC,QAAA,MAAM,EAAGD,MADV;AAEC,QAAA,OAAO,EAAGC;AAFX,QADc;AAAA,KAJhB;AAUC,IAAA,aAAa,EAAG;AAAA,UAAE;AAAEC,QAAAA;AAAF,OAAF;AAAA,aACf,4BAAC,oBAAD;AAAkB,QAAA,OAAO,EAAGA;AAA5B,QADe;AAAA;AAVjB,IALD,CADD,CADD;AAwBA;;AAED,SAASC,kBAAT,QAAmD;AAAA,MAAtB;AAAEH,IAAAA,MAAF;AAAUI,IAAAA;AAAV,GAAsB;AAClD,QAAMC,KAAK,GAAG,mCAAd;AACA,QAAMC,SAAS,GAAG,kCAAsB;AAAEC,IAAAA,IAAI,EAAE;AAAR,GAAtB,CAAlB;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,IAAA,KAAK,EAAGD,SAHT;AAIC,IAAA,WAAW,MAJZ;AAKC,qBAAgBN,MALjB,CAMC;AAND;AAOC,kBAAa,mBAAS,cAAI,iBAAJ,CAAT,EAAkCK,KAAlC,CAPd;AAQC,IAAA,OAAO,EAAGD;AARX,KAUGC,KAVH,CADD;AAcA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { useState, useMemo } from '@wordpress/element';\nimport {\n\tPostSchedule as PostScheduleForm,\n\tPostScheduleCheck,\n\tusePostScheduleLabel,\n} from '@wordpress/editor';\n\nexport default function PostSchedule() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostScheduleCheck>\n\t\t\t<PanelRow\n\t\t\t\tclassName=\"edit-post-post-schedule\"\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t>\n\t\t\t\t<span>{ __( 'Publish' ) }</span>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tcontentClassName=\"edit-post-post-schedule__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostScheduleToggle\n\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostScheduleForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t</PostScheduleCheck>\n\t);\n}\n\nfunction PostScheduleToggle( { isOpen, onClick } ) {\n\tconst label = usePostScheduleLabel();\n\tconst fullLabel = usePostScheduleLabel( { full: true } );\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-schedule__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\tlabel={ fullLabel }\n\t\t\tshowTooltip\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post date.\n\t\t\taria-label={ sprintf( __( 'Change date: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-schedule/index.js"],"names":["PostSchedule","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","isOpen","onToggle","onClose","PostScheduleToggle","onClick","label","fullLabel","full"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AANA;AACA;AACA;AAUe,SAASA,YAAT,GAAwB;AACtC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHsC,CAItC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AAAEC,IAAAA,MAAM,EAAEH,aAAV;AAAyBI,IAAAA,SAAS,EAAE;AAApC,GAAR,CADoB,EAEpB,CAAEJ,aAAF,CAFoB,CAArB;AAKA,SACC,4BAAC,yBAAD,QACC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,GAAG,EAAGC;AAFP,KAIC,0CAAQ,cAAI,SAAJ,CAAR,CAJD,EAKC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAGC,YADhB;AAEC,IAAA,gBAAgB,EAAC,iCAFlB;AAGC,IAAA,YAAY,MAHb;AAIC,IAAA,YAAY,EAAG,CAAE;AAAEG,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,4BAAC,kBAAD;AACC,MAAA,MAAM,EAAGD,MADV;AAEC,MAAA,OAAO,EAAGC;AAFX,MALF;AAUC,IAAA,aAAa,EAAG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACf,4BAAC,oBAAD;AAAkB,MAAA,OAAO,EAAGA;AAA5B;AAXF,IALD,CADD,CADD;AAwBA;;AAED,SAASC,kBAAT,CAA6B;AAAEH,EAAAA,MAAF;AAAUI,EAAAA;AAAV,CAA7B,EAAmD;AAClD,QAAMC,KAAK,GAAG,mCAAd;AACA,QAAMC,SAAS,GAAG,kCAAsB;AAAEC,IAAAA,IAAI,EAAE;AAAR,GAAtB,CAAlB;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,IAAA,KAAK,EAAGD,SAHT;AAIC,IAAA,WAAW,MAJZ;AAKC,qBAAgBN,MALjB,CAMC;AAND;AAOC,kBAAa,mBAAS,cAAI,iBAAJ,CAAT,EAAkCK,KAAlC,CAPd;AAQC,IAAA,OAAO,EAAGD;AARX,KAUGC,KAVH,CADD;AAcA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { useState, useMemo } from '@wordpress/element';\nimport {\n\tPostSchedule as PostScheduleForm,\n\tPostScheduleCheck,\n\tusePostScheduleLabel,\n} from '@wordpress/editor';\n\nexport default function PostSchedule() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostScheduleCheck>\n\t\t\t<PanelRow\n\t\t\t\tclassName=\"edit-post-post-schedule\"\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t>\n\t\t\t\t<span>{ __( 'Publish' ) }</span>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tcontentClassName=\"edit-post-post-schedule__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostScheduleToggle\n\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostScheduleForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t</PostScheduleCheck>\n\t);\n}\n\nfunction PostScheduleToggle( { isOpen, onClick } ) {\n\tconst label = usePostScheduleLabel();\n\tconst fullLabel = usePostScheduleLabel( { full: true } );\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-schedule__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\tlabel={ fullLabel }\n\t\t\tshowTooltip\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post date.\n\t\t\taria-label={ sprintf( __( 'Change date: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
@@ -56,11 +56,10 @@ var _postUrl = _interopRequireDefault(require("../post-url"));
56
56
  */
57
57
  const PANEL_NAME = 'post-status';
58
58
 
59
- function PostStatus(_ref) {
60
- let {
61
- isOpened,
62
- onTogglePanel
63
- } = _ref;
59
+ function PostStatus({
60
+ isOpened,
61
+ onTogglePanel
62
+ }) {
64
63
  return (0, _element.createElement)(_components.PanelBody, {
65
64
  className: "edit-post-post-status",
66
65
  title: (0, _i18n.__)('Summary'),
@@ -85,12 +84,9 @@ var _default = (0, _compose.compose)([(0, _data.withSelect)(select => {
85
84
  isRemoved: isEditorPanelRemoved(PANEL_NAME),
86
85
  isOpened: isEditorPanelOpened(PANEL_NAME)
87
86
  };
88
- }), (0, _compose.ifCondition)(_ref2 => {
89
- let {
90
- isRemoved
91
- } = _ref2;
92
- return !isRemoved;
93
- }), (0, _data.withDispatch)(dispatch => ({
87
+ }), (0, _compose.ifCondition)(({
88
+ isRemoved
89
+ }) => !isRemoved), (0, _data.withDispatch)(dispatch => ({
94
90
  onTogglePanel() {
95
91
  return dispatch(_store.store).toggleEditorPanelOpened(PANEL_NAME);
96
92
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"names":["PANEL_NAME","PostStatus","isOpened","onTogglePanel","fills","marginTop","select","isEditorPanelRemoved","isEditorPanelOpened","editPostStore","isRemoved","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAcA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,aAAnB;;AAEA,SAASC,UAAT,OAAmD;AAAA,MAA9B;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAA8B;AAClD,SACC,4BAAC,qBAAD;AACC,IAAA,SAAS,EAAC,uBADX;AAEC,IAAA,KAAK,EAAG,cAAI,SAAJ,CAFT;AAGC,IAAA,MAAM,EAAGD,QAHV;AAIC,IAAA,QAAQ,EAAGC;AAJZ,KAMC,4BAAC,6BAAD,CAAsB,IAAtB,QACKC,KAAF,IACD,qDACC,4BAAC,uBAAD,OADD,EAEC,4BAAC,qBAAD,OAFD,EAGC,4BAAC,qBAAD,OAHD,EAIC,4BAAC,gBAAD,OAJD,EAKC,4BAAC,mBAAD,OALD,EAMC,4BAAC,0BAAD,OAND,EAOC,4BAAC,mBAAD,OAPD,EAQC,4BAAC,iBAAD,OARD,EASC,4BAAC,mBAAD,OATD,EAUGA,KAVH,EAWC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAG;AACPC,MAAAA,SAAS,EAAE;AADJ,KADT;AAIC,IAAA,OAAO,EAAG;AAJX,KAMC,4BAAC,+BAAD,OAND,EAOC,4BAAC,kBAAD,OAPD,CAXD,CAFF,CAND,CADD;AAkCA;;eAEc,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AACzB;AACA;AACA,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MACLF,MAAM,CAAEG,YAAF,CADP;AAEA,SAAO;AACNC,IAAAA,SAAS,EAAEH,oBAAoB,CAAEP,UAAF,CADzB;AAENE,IAAAA,QAAQ,EAAEM,mBAAmB,CAAER,UAAF;AAFvB,GAAP;AAIA,CATD,CADuB,EAWvB,0BAAa;AAAA,MAAE;AAAEU,IAAAA;AAAF,GAAF;AAAA,SAAqB,CAAEA,SAAvB;AAAA,CAAb,CAXuB,EAYvB,wBAAgBC,QAAF,KAAkB;AAC/BR,EAAAA,aAAa,GAAG;AACf,WAAOQ,QAAQ,CAAEF,YAAF,CAAR,CAA0BG,uBAA1B,CACNZ,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAd,CAZuB,CAAT,EAmBVC,UAnBU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { PostSwitchToDraftButton } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostTrash from '../post-trash';\nimport PostSchedule from '../post-schedule';\nimport PostSticky from '../post-sticky';\nimport PostAuthor from '../post-author';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport PostPendingStatus from '../post-pending-status';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport { store as editPostStore } from '../../../store';\nimport PostTemplate from '../post-template';\nimport PostURL from '../post-url';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nfunction PostStatus( { isOpened, onTogglePanel } ) {\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ onTogglePanel }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t\t<PostTemplate />\n\t\t\t\t\t\t<PostURL />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostPendingStatus />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthor />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostSwitchToDraftButton />\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\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] )( PostStatus );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"names":["PANEL_NAME","PostStatus","isOpened","onTogglePanel","fills","marginTop","select","isEditorPanelRemoved","isEditorPanelOpened","editPostStore","isRemoved","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAC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gBC,QAAF,KAAkB;AAC/BR,EAAAA,aAAa,GAAG;AACf,WAAOQ,QAAQ,CAAEF,YAAF,CAAR,CAA0BG,uBAA1B,CACNZ,UADM,CAAP;AAGA;;AAL8B,CAAlB,CAAd,CAZuB,CAAT,EAmBVC,UAnBU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { PostSwitchToDraftButton } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostTrash from '../post-trash';\nimport PostSchedule from '../post-schedule';\nimport PostSticky from '../post-sticky';\nimport PostAuthor from '../post-author';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport PostPendingStatus from '../post-pending-status';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport { store as editPostStore } from '../../../store';\nimport PostTemplate from '../post-template';\nimport PostURL from '../post-url';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nfunction PostStatus( { isOpened, onTogglePanel } ) {\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ onTogglePanel }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t\t<PostTemplate />\n\t\t\t\t\t\t<PostURL />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostPendingStatus />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthor />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostSwitchToDraftButton />\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\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] )( PostStatus );\n"]}
@@ -22,22 +22,18 @@ var _store = require("../../../store");
22
22
  /**
23
23
  * Internal dependencies
24
24
  */
25
- function TaxonomyPanel(_ref) {
26
- var _taxonomy$labels;
27
-
28
- let {
29
- isEnabled,
30
- taxonomy,
31
- isOpened,
32
- onTogglePanel,
33
- children
34
- } = _ref;
35
-
25
+ function TaxonomyPanel({
26
+ isEnabled,
27
+ taxonomy,
28
+ isOpened,
29
+ onTogglePanel,
30
+ children
31
+ }) {
36
32
  if (!isEnabled) {
37
33
  return null;
38
34
  }
39
35
 
40
- const taxonomyMenuName = taxonomy === null || taxonomy === void 0 ? void 0 : (_taxonomy$labels = taxonomy.labels) === null || _taxonomy$labels === void 0 ? void 0 : _taxonomy$labels.menu_name;
36
+ const taxonomyMenuName = taxonomy?.labels?.menu_name;
41
37
 
42
38
  if (!taxonomyMenuName) {
43
39
  return null;
@@ -51,9 +47,7 @@ function TaxonomyPanel(_ref) {
51
47
  }
52
48
 
53
49
  var _default = (0, _compose.compose)((0, _data.withSelect)((select, ownProps) => {
54
- var _ownProps$taxonomy;
55
-
56
- const slug = (_ownProps$taxonomy = ownProps.taxonomy) === null || _ownProps$taxonomy === void 0 ? void 0 : _ownProps$taxonomy.slug;
50
+ const slug = ownProps.taxonomy?.slug;
57
51
  const panelName = slug ? `taxonomy-panel-${slug}` : '';
58
52
  return {
59
53
  panelName,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js"],"names":["TaxonomyPanel","isEnabled","taxonomy","isOpened","onTogglePanel","children","taxonomyMenuName","labels","menu_name","select","ownProps","slug","panelName","editPostStore","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,aAAT,OAMI;AAAA;;AAAA,MANoB;AACvBC,IAAAA,SADuB;AAEvBC,IAAAA,QAFuB;AAGvBC,IAAAA,QAHuB;AAIvBC,IAAAA,aAJuB;AAKvBC,IAAAA;AALuB,GAMpB;;AACH,MAAK,CAAEJ,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMK,gBAAgB,GAAGJ,QAAH,aAAGA,QAAH,2CAAGA,QAAQ,CAAEK,MAAb,qDAAG,iBAAkBC,SAA3C;;AACA,MAAK,CAAEF,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAGA,gBADT;AAEC,IAAA,MAAM,EAAGH,QAFV;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKGC,QALH,CADD;AASA;;eAEc,sBACd,sBAAY,CAAEI,MAAF,EAAUC,QAAV,KAAwB;AAAA;;AACnC,QAAMC,IAAI,yBAAGD,QAAQ,CAACR,QAAZ,uDAAG,mBAAmBS,IAAhC;AACA,QAAMC,SAAS,GAAGD,IAAI,GAAI,kBAAkBA,IAAM,EAA5B,GAAgC,EAAtD;AACA,SAAO;AACNC,IAAAA,SADM;AAENX,IAAAA,SAAS,EAAEU,IAAI,GACZF,MAAM,CAAEI,YAAF,CAAN,CAAwBC,oBAAxB,CAA8CF,SAA9C,CADY,GAEZ,KAJG;AAKNT,IAAAA,QAAQ,EAAEQ,IAAI,GACXF,MAAM,CAAEI,YAAF,CAAN,CAAwBE,mBAAxB,CAA6CH,SAA7C,CADW,GAEX;AAPG,GAAP;AASA,CAZD,CADc,EAcd,wBAAc,CAAEI,QAAF,EAAYN,QAAZ,MAA4B;AACzCN,EAAAA,aAAa,EAAE,MAAM;AACpBY,IAAAA,QAAQ,CAAEH,YAAF,CAAR,CAA0BI,uBAA1B,CACCP,QAAQ,CAACE,SADV;AAGA;AALwC,CAA5B,CAAd,CAdc,EAqBZZ,aArBY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { PanelBody } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TaxonomyPanel( {\n\tisEnabled,\n\ttaxonomy,\n\tisOpened,\n\tonTogglePanel,\n\tchildren,\n} ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst taxonomyMenuName = taxonomy?.labels?.menu_name;\n\tif ( ! taxonomyMenuName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ taxonomyMenuName }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ onTogglePanel }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select, ownProps ) => {\n\t\tconst slug = ownProps.taxonomy?.slug;\n\t\tconst panelName = slug ? `taxonomy-panel-${ slug }` : '';\n\t\treturn {\n\t\t\tpanelName,\n\t\t\tisEnabled: slug\n\t\t\t\t? select( editPostStore ).isEditorPanelEnabled( panelName )\n\t\t\t\t: false,\n\t\t\tisOpened: slug\n\t\t\t\t? select( editPostStore ).isEditorPanelOpened( panelName )\n\t\t\t\t: false,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tonTogglePanel: () => {\n\t\t\tdispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\townProps.panelName\n\t\t\t);\n\t\t},\n\t} ) )\n)( TaxonomyPanel );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js"],"names":["TaxonomyPanel","isEnabled","taxonomy","isOpened","onTogglePanel","children","taxonomyMenuName","labels","menu_name","select","ownProps","slug","panelName","editPostStore","isEditorPanelEnabled","isEditorPanelOpened","dispatch","toggleEditorPanelOpened"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,aAAT,CAAwB;AACvBC,EAAAA,SADuB;AAEvBC,EAAAA,QAFuB;AAGvBC,EAAAA,QAHuB;AAIvBC,EAAAA,aAJuB;AAKvBC,EAAAA;AALuB,CAAxB,EAMI;AACH,MAAK,CAAEJ,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMK,gBAAgB,GAAGJ,QAAQ,EAAEK,MAAV,EAAkBC,SAA3C;;AACA,MAAK,CAAEF,gBAAP,EAA0B;AACzB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD;AACC,IAAA,KAAK,EAAGA,gBADT;AAEC,IAAA,MAAM,EAAGH,QAFV;AAGC,IAAA,QAAQ,EAAGC;AAHZ,KAKGC,QALH,CADD;AASA;;eAEc,sBACd,sBAAY,CAAEI,MAAF,EAAUC,QAAV,KAAwB;AACnC,QAAMC,IAAI,GAAGD,QAAQ,CAACR,QAAT,EAAmBS,IAAhC;AACA,QAAMC,SAAS,GAAGD,IAAI,GAAI,kBAAkBA,IAAM,EAA5B,GAAgC,EAAtD;AACA,SAAO;AACNC,IAAAA,SADM;AAENX,IAAAA,SAAS,EAAEU,IAAI,GACZF,MAAM,CAAEI,YAAF,CAAN,CAAwBC,oBAAxB,CAA8CF,SAA9C,CADY,GAEZ,KAJG;AAKNT,IAAAA,QAAQ,EAAEQ,IAAI,GACXF,MAAM,CAAEI,YAAF,CAAN,CAAwBE,mBAAxB,CAA6CH,SAA7C,CADW,GAEX;AAPG,GAAP;AASA,CAZD,CADc,EAcd,wBAAc,CAAEI,QAAF,EAAYN,QAAZ,MAA4B;AACzCN,EAAAA,aAAa,EAAE,MAAM;AACpBY,IAAAA,QAAQ,CAAEH,YAAF,CAAR,CAA0BI,uBAA1B,CACCP,QAAQ,CAACE,SADV;AAGA;AALwC,CAA5B,CAAd,CAdc,EAqBZZ,aArBY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { PanelBody } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TaxonomyPanel( {\n\tisEnabled,\n\ttaxonomy,\n\tisOpened,\n\tonTogglePanel,\n\tchildren,\n} ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst taxonomyMenuName = taxonomy?.labels?.menu_name;\n\tif ( ! taxonomyMenuName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ taxonomyMenuName }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ onTogglePanel }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select, ownProps ) => {\n\t\tconst slug = ownProps.taxonomy?.slug;\n\t\tconst panelName = slug ? `taxonomy-panel-${ slug }` : '';\n\t\treturn {\n\t\t\tpanelName,\n\t\t\tisEnabled: slug\n\t\t\t\t? select( editPostStore ).isEditorPanelEnabled( panelName )\n\t\t\t\t: false,\n\t\t\tisOpened: slug\n\t\t\t\t? select( editPostStore ).isEditorPanelOpened( panelName )\n\t\t\t\t: false,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tonTogglePanel: () => {\n\t\t\tdispatch( editPostStore ).toggleEditorPanelOpened(\n\t\t\t\townProps.panelName\n\t\t\t);\n\t\t},\n\t} ) )\n)( TaxonomyPanel );\n"]}
@@ -30,10 +30,9 @@ var _store = require("../../../store");
30
30
  */
31
31
  const DEFAULT_TITLE = (0, _i18n.__)('Custom Template');
32
32
 
33
- function PostTemplateCreateModal(_ref) {
34
- let {
35
- onClose
36
- } = _ref;
33
+ function PostTemplateCreateModal({
34
+ onClose
35
+ }) {
37
36
  const defaultBlockTemplate = (0, _data.useSelect)(select => select(_editor.store).getEditorSettings().defaultBlockTemplate, []);
38
37
  const {
39
38
  __unstableCreateTemplate,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-template/create-modal.js"],"names":["DEFAULT_TITLE","PostTemplateCreateModal","onClose","defaultBlockTemplate","select","editorStore","getEditorSettings","__unstableCreateTemplate","__unstableSwitchToTemplateMode","editPostStore","title","setTitle","isBusy","setIsBusy","cancel","submit","event","preventDefault","newTemplateContent","tagName","layout","inherit","slug","content"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AAOA;;AACA;;AAKA;;AApBA;AACA;AACA;;AAeA;AACA;AACA;AAGA,MAAMA,aAAa,GAAG,cAAI,iBAAJ,CAAtB;;AAEe,SAASC,uBAAT,OAAgD;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AAC9D,QAAMC,oBAAoB,GAAG,qBAC1BC,MAAF,IACCA,MAAM,CAAEC,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V,aAAvB,CADyB;AAE/BuB,MAAAA,OAAO,EAAEL,kBAFsB;AAG/BR,MAAAA,KAAK,EAAEA,KAAK,IAAIV;AAHe,KAAF,CAA9B;AAMAa,IAAAA,SAAS,CAAE,KAAF,CAAT;AACAC,IAAAA,MAAM;;AAENN,IAAAA,8BAA8B,CAAE,IAAF,CAA9B;AACA,GAtDD;;AAwDA,SACC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,cAAI,wBAAJ,CADT;AAEC,IAAA,cAAc,EAAGM,MAFlB;AAGC,IAAA,SAAS,EAAC;AAHX,KAKC;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,QAAQ,EAAGC;AAFZ,KAIC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,uBAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EAAG,cAAI,MAAJ,CAFT;AAGC,IAAA,KAAK,EAAGL,KAHT;AAIC,IAAA,QAAQ,EAAGC,QAJZ;AAKC,IAAA,WAAW,EAAGX,aALf;AAMC,IAAA,QAAQ,EAAGY,MANZ;AAOC,IAAA,IAAI,EAAG,cACN,iHADM;AAPR,IADD,EAYC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,UAAhB;AAA2B,IAAA,OAAO,EAAGE;AAArC,KACG,cAAI,QAAJ,CADH,CADD,EAKC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,MAAM,EAAGF,MAHV;AAIC,qBAAgBA;AAJjB,KAMG,cAAI,QAAJ,CANH,CALD,CAZD,CAJD,CALD,CADD;AAwCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useState } from '@wordpress/element';\nimport { serialize, createBlock } from '@wordpress/blocks';\nimport {\n\tModal,\n\tTextControl,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { cleanForSlug } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst DEFAULT_TITLE = __( 'Custom Template' );\n\nexport default function PostTemplateCreateModal( { onClose } ) {\n\tconst defaultBlockTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().defaultBlockTemplate,\n\t\t[]\n\t);\n\n\tconst { __unstableCreateTemplate, __unstableSwitchToTemplateMode } =\n\t\tuseDispatch( editPostStore );\n\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\n\tconst cancel = () => {\n\t\tsetTitle( '' );\n\t\tonClose();\n\t};\n\n\tconst submit = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( isBusy ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsBusy( true );\n\n\t\tconst newTemplateContent =\n\t\t\tdefaultBlockTemplate ??\n\t\t\tserialize( [\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'header',\n\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/site-title' ),\n\t\t\t\t\t\tcreateBlock( 'core/site-tagline' ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\tcreateBlock( 'core/separator' ),\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'main',\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t[ createBlock( 'core/post-title' ) ]\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcreateBlock( 'core/post-content', {\n\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t] );\n\n\t\tawait __unstableCreateTemplate( {\n\t\t\tslug: cleanForSlug( title || DEFAULT_TITLE ),\n\t\t\tcontent: newTemplateContent,\n\t\t\ttitle: title || DEFAULT_TITLE,\n\t\t} );\n\n\t\tsetIsBusy( false );\n\t\tcancel();\n\n\t\t__unstableSwitchToTemplateMode( true );\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Create custom template' ) }\n\t\t\tonRequestClose={ cancel }\n\t\t\tclassName=\"edit-post-post-template__create-modal\"\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"edit-post-post-template__create-form\"\n\t\t\t\tonSubmit={ submit }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ DEFAULT_TITLE }\n\t\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Describe the template, e.g. \"Post with sidebar\". A custom template can be manually applied to any post or page.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button variant=\"tertiary\" onClick={ cancel }>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\t\taria-disabled={ isBusy }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-template/create-modal.js"],"names":["DEFAULT_TITLE","PostTemplateCreateModal","onClose","defaultBlockTemplate","select","editorStore","getEditorSettings","__unstableCreateTemplate","__unstableSwitchToTemplateMode","editPostStore","title","setTitle","isBusy","setIsBusy","cancel","submit","event","preventDefault","newTemplateContent","tagName","layout","inherit","slug","content"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AAOA;;AACA;;AAKA;;AApBA;AACA;AACA;;AAeA;AACA;AACA;AAGA,MAAMA,aAAa,GAAG,cAAI,iBAAJ,CAAtB;;AAEe,SAASC,uBAAT,CAAkC;AAAEC,EAAAA;AAAF,CAAlC,EAAgD;AAC9D,QAAMC,oBAAoB,GAAG,qBAC1BC,MAAF,IACCA,MAAM,CAAEC,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CH,oBAFf,EAG5B,EAH4B,CAA7B;AAMA,QAAM;AAAEI,IAAAA,wBAAF;AAA4BC,IAAAA;AAA5B,MACL,uBAAaC,YAAb,CADD;AAGA,QAAM,CAAEC,KAAF,EAASC,QAAT,IAAsB,uBAAU,EAAV,CAA5B;AAEA,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwB,uBAAU,KAAV,CAA9B;;AAEA,QAAMC,MAAM,GAAG,MAAM;AACpBH,IAAAA,QAAQ,CAAE,EAAF,CAAR;AACAT,IAAAA,OAAO;AACP,GAHD;;AAKA,QAAMa,MAAM,GAAG,MAAQC,KAAR,IAAmB;AACjCA,IAAAA,KAAK,CAACC,cAAN;;AAEA,QAAKL,MAAL,EAAc;AACb;AACA;;AAEDC,IAAAA,SAAS,CAAE,IAAF,CAAT;AAE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AAK,EAAG,cAAI,MAAJ,CAFT;AAGC,IAAA,KAAK,EAAGL,KAHT;AAIC,IAAA,QAAQ,EAAGC,QAJZ;AAKC,IAAA,WAAW,EAAGX,aALf;AAMC,IAAA,QAAQ,EAAGY,MANZ;AAOC,IAAA,IAAI,EAAG,cACN,iHADM;AAPR,IADD,EAYC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,UAAhB;AAA2B,IAAA,OAAO,EAAGE;AAArC,KACG,cAAI,QAAJ,CADH,CADD,EAKC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,MAAM,EAAGF,MAHV;AAIC,qBAAgBA;AAJjB,KAMG,cAAI,QAAJ,CANH,CALD,CAZD,CAJD,CALD,CADD;AAwCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useState } from '@wordpress/element';\nimport { serialize, createBlock } from '@wordpress/blocks';\nimport {\n\tModal,\n\tTextControl,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { cleanForSlug } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst DEFAULT_TITLE = __( 'Custom Template' );\n\nexport default function PostTemplateCreateModal( { onClose } ) {\n\tconst defaultBlockTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().defaultBlockTemplate,\n\t\t[]\n\t);\n\n\tconst { __unstableCreateTemplate, __unstableSwitchToTemplateMode } =\n\t\tuseDispatch( editPostStore );\n\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst [ isBusy, setIsBusy ] = useState( false );\n\n\tconst cancel = () => {\n\t\tsetTitle( '' );\n\t\tonClose();\n\t};\n\n\tconst submit = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( isBusy ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsBusy( true );\n\n\t\tconst newTemplateContent =\n\t\t\tdefaultBlockTemplate ??\n\t\t\tserialize( [\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'header',\n\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock( 'core/site-title' ),\n\t\t\t\t\t\tcreateBlock( 'core/site-tagline' ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t\tcreateBlock( 'core/separator' ),\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/group',\n\t\t\t\t\t{\n\t\t\t\t\t\ttagName: 'main',\n\t\t\t\t\t},\n\t\t\t\t\t[\n\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t[ createBlock( 'core/post-title' ) ]\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcreateBlock( 'core/post-content', {\n\t\t\t\t\t\t\tlayout: { inherit: true },\n\t\t\t\t\t\t} ),\n\t\t\t\t\t]\n\t\t\t\t),\n\t\t\t] );\n\n\t\tawait __unstableCreateTemplate( {\n\t\t\tslug: cleanForSlug( title || DEFAULT_TITLE ),\n\t\t\tcontent: newTemplateContent,\n\t\t\ttitle: title || DEFAULT_TITLE,\n\t\t} );\n\n\t\tsetIsBusy( false );\n\t\tcancel();\n\n\t\t__unstableSwitchToTemplateMode( true );\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Create custom template' ) }\n\t\t\tonRequestClose={ cancel }\n\t\t\tclassName=\"edit-post-post-template__create-modal\"\n\t\t>\n\t\t\t<form\n\t\t\t\tclassName=\"edit-post-post-template__create-form\"\n\t\t\t\tonSubmit={ submit }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ DEFAULT_TITLE }\n\t\t\t\t\t\tdisabled={ isBusy }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Describe the template, e.g. \"Post with sidebar\". A custom template can be manually applied to any post or page.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button variant=\"tertiary\" onClick={ cancel }>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tisBusy={ isBusy }\n\t\t\t\t\t\t\taria-disabled={ isBusy }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"]}
@@ -34,12 +34,11 @@ var _createModal = _interopRequireDefault(require("./create-modal"));
34
34
  /**
35
35
  * Internal dependencies
36
36
  */
37
- function PostTemplateForm(_ref) {
37
+ function PostTemplateForm({
38
+ onClose
39
+ }) {
38
40
  var _options$find, _selectedOption$value;
39
41
 
40
- let {
41
- onClose
42
- } = _ref;
43
42
  const {
44
43
  isPostsPage,
45
44
  availableTemplates,
@@ -56,7 +55,7 @@ function PostTemplateForm(_ref) {
56
55
  const editorSettings = select(_editor.store).getEditorSettings();
57
56
  const siteSettings = canUser('read', 'settings') ? getEntityRecord('root', 'site') : undefined;
58
57
 
59
- const _isPostsPage = select(_editor.store).getCurrentPostId() === (siteSettings === null || siteSettings === void 0 ? void 0 : siteSettings.page_for_posts);
58
+ const _isPostsPage = select(_editor.store).getCurrentPostId() === siteSettings?.page_for_posts;
60
59
 
61
60
  const canCreateTemplates = canUser('create', 'templates');
62
61
  return {
@@ -72,20 +71,14 @@ function PostTemplateForm(_ref) {
72
71
  };
73
72
  }, []);
74
73
  const options = (0, _element.useMemo)(() => Object.entries({ ...availableTemplates,
75
- ...Object.fromEntries((fetchedTemplates !== null && fetchedTemplates !== void 0 ? fetchedTemplates : []).map(_ref2 => {
76
- let {
77
- slug,
78
- title
79
- } = _ref2;
80
- return [slug, title.rendered];
81
- }))
82
- }).map(_ref3 => {
83
- let [slug, title] = _ref3;
84
- return {
85
- value: slug,
86
- label: title
87
- };
88
- }), [availableTemplates, fetchedTemplates]);
74
+ ...Object.fromEntries((fetchedTemplates !== null && fetchedTemplates !== void 0 ? fetchedTemplates : []).map(({
75
+ slug,
76
+ title
77
+ }) => [slug, title.rendered]))
78
+ }).map(([slug, title]) => ({
79
+ value: slug,
80
+ label: title
81
+ })), [availableTemplates, fetchedTemplates]);
89
82
  const selectedOption = (_options$find = options.find(option => option.value === selectedTemplateSlug)) !== null && _options$find !== void 0 ? _options$find : options.find(option => !option.value); // The default option has '' value.
90
83
 
91
84
  const {
@@ -114,7 +107,7 @@ function PostTemplateForm(_ref) {
114
107
  __nextHasNoMarginBottom: true,
115
108
  hideLabelFromVision: true,
116
109
  label: (0, _i18n.__)('Template'),
117
- value: (_selectedOption$value = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '',
110
+ value: (_selectedOption$value = selectedOption?.value) !== null && _selectedOption$value !== void 0 ? _selectedOption$value : '',
118
111
  options: options,
119
112
  onChange: slug => editPost({
120
113
  template: slug || ''
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-template/form.js"],"names":["PostTemplateForm","onClose","isPostsPage","availableTemplates","fetchedTemplates","selectedTemplateSlug","canCreate","canEdit","select","canUser","getEntityRecord","getEntityRecords","coreStore","editorSettings","editorStore","getEditorSettings","siteSettings","undefined","_isPostsPage","getCurrentPostId","page_for_posts","canCreateTemplates","post_type","getCurrentPostType","per_page","getEditedPostAttribute","supportsTemplateMode","editPostStore","getEditedPostTemplate","options","Object","entries","fromEntries","map","slug","title","rendered","value","label","selectedOption","find","option","editPost","__unstableSwitchToTemplateMode","isCreateModalOpen","setIsCreateModalOpen","icon","addTemplate","onClick","template"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,gBAAT,OAAyC;AAAA;;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AACvD,QAAM;AACLC,IAAAA,WADK;AAELC,IAAAA,kBAFK;AAGLC,IAAAA,gBAHK;AAILC,IAAAA,oBAJK;AAKLC,IAAAA,SALK;AAMLC,IAAAA;AANK,MAOF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,eAAX;AAA4BC,MAAAA;AAA5B,QACLH,MAAM,CAAEI,eAAF,CADP;AAEA,UAAMC,cAAc,GAAGL,MAAM,CAAEM,aAAF,CAAN,CAAsBC,iBAAtB,EAAvB;AACA,UAAMC,YAAY,GAAGP,OAAO,CAAE,MAAF,EAAU,UAAV,CAAP,GAClBC,eAAe,CAAE,MAAF,EAAU,MAAV,CADG,GAElBO,SAFH;;AAGA,UAAMC,YAAY,GACjBV,MAAM,CAAEM,aAAF,CAAN,CAAsBK,gBAAtB,QACAH,YADA,aACAA,YADA,uBACAA,YAAY,CAAEI,cADd,CADD;;AAGA,UAAMC,kBAAkB,GAAGZ,OAAO,CAAE,QAAF,EAAY,WAAZ,CAAlC;AAEA,WAAO;AACNP,MA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EO,MAAAA,QAAQ,EAAEf,IAAI,IAAI;AAApB,KAAF;AAPV,IA5BF,EAuCG3B,OAAO,IACR,uCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,MADT;AAEC,IAAA,OAAO,EAAG,MAAMoC,8BAA8B;AAF/C,KAIG,cAAI,eAAJ,CAJH,CADD,CAxCF,EAiDGC,iBAAiB,IAClB,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAMC,oBAAoB,CAAE,KAAF;AADrC,IAlDF,CADD;AAyDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { addTemplate } from '@wordpress/icons';\nimport { Notice, SelectControl, Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport PostTemplateCreateModal from './create-modal';\n\nexport default function PostTemplateForm( { onClose } ) {\n\tconst {\n\t\tisPostsPage,\n\t\tavailableTemplates,\n\t\tfetchedTemplates,\n\t\tselectedTemplateSlug,\n\t\tcanCreate,\n\t\tcanEdit,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst editorSettings = select( editorStore ).getEditorSettings();\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst _isPostsPage =\n\t\t\tselect( editorStore ).getCurrentPostId() ===\n\t\t\tsiteSettings?.page_for_posts;\n\t\tconst canCreateTemplates = canUser( 'create', 'templates' );\n\n\t\treturn {\n\t\t\tisPostsPage: _isPostsPage,\n\t\t\tavailableTemplates: editorSettings.availableTemplates,\n\t\t\tfetchedTemplates: canCreateTemplates\n\t\t\t\t? getEntityRecords( 'postType', 'wp_template', {\n\t\t\t\t\t\tpost_type: select( editorStore ).getCurrentPostType(),\n\t\t\t\t\t\tper_page: -1,\n\t\t\t\t } )\n\t\t\t\t: undefined,\n\t\t\tselectedTemplateSlug:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' ),\n\t\t\tcanCreate:\n\t\t\t\tcanCreateTemplates &&\n\t\t\t\t! _isPostsPage &&\n\t\t\t\teditorSettings.supportsTemplateMode,\n\t\t\tcanEdit:\n\t\t\t\tcanCreateTemplates &&\n\t\t\t\teditorSettings.supportsTemplateMode &&\n\t\t\t\t!! select( editPostStore ).getEditedPostTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst options = useMemo(\n\t\t() =>\n\t\t\tObject.entries( {\n\t\t\t\t...availableTemplates,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t( fetchedTemplates ?? [] ).map( ( { slug, title } ) => [\n\t\t\t\t\t\tslug,\n\t\t\t\t\t\ttitle.rendered,\n\t\t\t\t\t] )\n\t\t\t\t),\n\t\t\t} ).map( ( [ slug, title ] ) => ( { value: slug, label: title } ) ),\n\t\t[ availableTemplates, fetchedTemplates ]\n\t);\n\n\tconst selectedOption =\n\t\toptions.find( ( option ) => option.value === selectedTemplateSlug ) ??\n\t\toptions.find( ( option ) => ! option.value ); // The default option has '' value.\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { __unstableSwitchToTemplateMode } = useDispatch( editPostStore );\n\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\n\treturn (\n\t\t<div className=\"edit-post-post-template__form\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Template' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Templates define the way content is displayed when viewing your site.'\n\t\t\t\t) }\n\t\t\t\tactions={\n\t\t\t\t\tcanCreate\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ticon: addTemplate,\n\t\t\t\t\t\t\t\t\tlabel: __( 'Add template' ),\n\t\t\t\t\t\t\t\t\tonClick: () => setIsCreateModalOpen( true ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: []\n\t\t\t\t}\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t{ isPostsPage ? (\n\t\t\t\t<Notice\n\t\t\t\t\tclassName=\"edit-post-post-template__notice\"\n\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\tisDismissible={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'The posts page template cannot be changed.' ) }\n\t\t\t\t</Notice>\n\t\t\t) : (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tlabel={ __( 'Template' ) }\n\t\t\t\t\tvalue={ selectedOption?.value ?? '' }\n\t\t\t\t\toptions={ options }\n\t\t\t\t\tonChange={ ( slug ) =>\n\t\t\t\t\t\teditPost( { template: slug || '' } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ canEdit && (\n\t\t\t\t<p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => __unstableSwitchToTemplateMode() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<PostTemplateCreateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-template/form.js"],"names":["PostTemplateForm","onClose","isPostsPage","availableTemplates","fetchedTemplates","selectedTemplateSlug","canCreate","canEdit","select","canUser","getEntityRecord","getEntityRecords","coreStore","editorSettings","editorStore","getEditorSettings","siteSettings","undefined","_isPostsPage","getCurrentPostId","page_for_posts","canCreateTemplates","post_type","getCurrentPostType","per_page","getEditedPostAttribute","supportsTemplateMode","editPostStore","getEditedPostTemplate","options","Object","entries","fromEntries","map","slug","title","rendered","value","label","selectedOption","find","option","editPost","__unstableSwitchToTemplateMode","isCreateModalOpen","setIsCreateModalOpen","icon","addTemplate","onClick","template"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,gBAAT,CAA2B;AAAEC,EAAAA;AAAF,CAA3B,EAAyC;AAAA;;AACvD,QAAM;AACLC,IAAAA,WADK;AAELC,IAAAA,kBAFK;AAGLC,IAAAA,gBAHK;AAILC,IAAAA,oBAJK;AAKLC,IAAAA,SALK;AAMLC,IAAAA;AANK,MAOF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AAAEC,MAAAA,OAAF;AAAWC,MAAAA,eAAX;AAA4BC,MAAAA;AAA5B,QACLH,MAAM,CAAEI,eAAF,CADP;AAEA,UAAMC,cAAc,GAAGL,MAAM,CAAEM,aAAF,CAAN,CAAsBC,iBAAtB,EAAvB;AACA,UAAMC,YAAY,GAAGP,OAAO,CAAE,MAAF,EAAU,UAAV,CAAP,GAClBC,eAAe,CAAE,MAAF,EAAU,MAAV,CADG,GAElBO,SAFH;;AAGA,UAAMC,YAAY,GACjBV,MAAM,CAAEM,aAAF,CAAN,CAAsBK,gBAAtB,OACAH,YAAY,EAAEI,cAFf;;AAGA,UAAMC,kBAAkB,GAAGZ,OAAO,CAAE,QAAF,EAAY,WAAZ,CAAlC;AAEA,WAAO;AACNP,MAAAA,WAAW,EAAEgB,YADP;AAENf,MAAAA,kBAAkB,EAAEU,cAAc,CAACV,kBAF7B;AAGNC,MAAAA,gBAAgB,EAAEiB,kBAAkB,GACjCV,gBAAgB,CAAE,UAAF,EAAc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EAiDGC,iBAAiB,IAClB,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAMC,oBAAoB,CAAE,KAAF;AADrC,IAlDF,CADD;AAyDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { addTemplate } from '@wordpress/icons';\nimport { Notice, SelectControl, Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport PostTemplateCreateModal from './create-modal';\n\nexport default function PostTemplateForm( { onClose } ) {\n\tconst {\n\t\tisPostsPage,\n\t\tavailableTemplates,\n\t\tfetchedTemplates,\n\t\tselectedTemplateSlug,\n\t\tcanCreate,\n\t\tcanEdit,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst editorSettings = select( editorStore ).getEditorSettings();\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst _isPostsPage =\n\t\t\tselect( editorStore ).getCurrentPostId() ===\n\t\t\tsiteSettings?.page_for_posts;\n\t\tconst canCreateTemplates = canUser( 'create', 'templates' );\n\n\t\treturn {\n\t\t\tisPostsPage: _isPostsPage,\n\t\t\tavailableTemplates: editorSettings.availableTemplates,\n\t\t\tfetchedTemplates: canCreateTemplates\n\t\t\t\t? getEntityRecords( 'postType', 'wp_template', {\n\t\t\t\t\t\tpost_type: select( editorStore ).getCurrentPostType(),\n\t\t\t\t\t\tper_page: -1,\n\t\t\t\t } )\n\t\t\t\t: undefined,\n\t\t\tselectedTemplateSlug:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' ),\n\t\t\tcanCreate:\n\t\t\t\tcanCreateTemplates &&\n\t\t\t\t! _isPostsPage &&\n\t\t\t\teditorSettings.supportsTemplateMode,\n\t\t\tcanEdit:\n\t\t\t\tcanCreateTemplates &&\n\t\t\t\teditorSettings.supportsTemplateMode &&\n\t\t\t\t!! select( editPostStore ).getEditedPostTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst options = useMemo(\n\t\t() =>\n\t\t\tObject.entries( {\n\t\t\t\t...availableTemplates,\n\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t( fetchedTemplates ?? [] ).map( ( { slug, title } ) => [\n\t\t\t\t\t\tslug,\n\t\t\t\t\t\ttitle.rendered,\n\t\t\t\t\t] )\n\t\t\t\t),\n\t\t\t} ).map( ( [ slug, title ] ) => ( { value: slug, label: title } ) ),\n\t\t[ availableTemplates, fetchedTemplates ]\n\t);\n\n\tconst selectedOption =\n\t\toptions.find( ( option ) => option.value === selectedTemplateSlug ) ??\n\t\toptions.find( ( option ) => ! option.value ); // The default option has '' value.\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { __unstableSwitchToTemplateMode } = useDispatch( editPostStore );\n\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\n\treturn (\n\t\t<div className=\"edit-post-post-template__form\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Template' ) }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Templates define the way content is displayed when viewing your site.'\n\t\t\t\t) }\n\t\t\t\tactions={\n\t\t\t\t\tcanCreate\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ticon: addTemplate,\n\t\t\t\t\t\t\t\t\tlabel: __( 'Add template' ),\n\t\t\t\t\t\t\t\t\tonClick: () => setIsCreateModalOpen( true ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t ]\n\t\t\t\t\t\t: []\n\t\t\t\t}\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t{ isPostsPage ? (\n\t\t\t\t<Notice\n\t\t\t\t\tclassName=\"edit-post-post-template__notice\"\n\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\tisDismissible={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'The posts page template cannot be changed.' ) }\n\t\t\t\t</Notice>\n\t\t\t) : (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tlabel={ __( 'Template' ) }\n\t\t\t\t\tvalue={ selectedOption?.value ?? '' }\n\t\t\t\t\toptions={ options }\n\t\t\t\t\tonChange={ ( slug ) =>\n\t\t\t\t\t\teditPost( { template: slug || '' } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ canEdit && (\n\t\t\t\t<p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => __unstableSwitchToTemplateMode() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Edit template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<PostTemplateCreateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"]}