@wordpress/edit-post 7.32.0 → 7.34.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 (302) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +17 -223
  3. package/build/components/browser-url/index.js.map +1 -1
  4. package/build/components/editor-initialization/index.js +0 -1
  5. package/build/components/editor-initialization/index.js.map +1 -1
  6. package/build/components/editor-initialization/listener-hooks.js +1 -38
  7. package/build/components/editor-initialization/listener-hooks.js.map +1 -1
  8. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  9. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  10. package/build/components/header/index.js +20 -51
  11. package/build/components/header/index.js.map +1 -1
  12. package/build/components/header/index.native.js +1 -1
  13. package/build/components/header/index.native.js.map +1 -1
  14. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  15. package/build/components/header/more-menu/index.js +17 -42
  16. package/build/components/header/more-menu/index.js.map +1 -1
  17. package/build/components/header/more-menu/manage-patterns-menu-item.js +40 -0
  18. package/build/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
  19. package/build/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
  20. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  21. package/build/components/init-pattern-modal/index.js.map +1 -1
  22. package/build/components/keyboard-shortcuts/index.js +0 -123
  23. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  24. package/build/components/layout/index.js +28 -29
  25. package/build/components/layout/index.js.map +1 -1
  26. package/build/components/layout/index.native.js.map +1 -1
  27. package/build/components/meta-boxes/index.js.map +1 -1
  28. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  29. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  30. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  31. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  32. package/build/components/preferences-modal/index.js +3 -32
  33. package/build/components/preferences-modal/index.js.map +1 -1
  34. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  35. package/build/components/sidebar/post-format/index.js.map +1 -1
  36. package/build/components/sidebar/post-pending-status/index.js.map +1 -1
  37. package/build/components/sidebar/post-slug/index.js.map +1 -1
  38. package/build/components/sidebar/post-status/index.js +35 -12
  39. package/build/components/sidebar/post-status/index.js.map +1 -1
  40. package/build/components/sidebar/post-sticky/index.js.map +1 -1
  41. package/build/components/sidebar/post-trash/index.js.map +1 -1
  42. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  43. package/build/components/sidebar/settings-header/index.js.map +1 -1
  44. package/build/components/sidebar/settings-sidebar/index.js +68 -41
  45. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  46. package/build/components/text-editor/index.js.map +1 -1
  47. package/build/components/visual-editor/block-inspector-button.js +1 -1
  48. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  49. package/build/components/visual-editor/header.native.js.map +1 -1
  50. package/build/components/visual-editor/index.js +4 -1
  51. package/build/components/visual-editor/index.js.map +1 -1
  52. package/build/components/visual-editor/index.native.js.map +1 -1
  53. package/build/components/visual-editor/use-padding-appender.js +62 -0
  54. package/build/components/visual-editor/use-padding-appender.js.map +1 -0
  55. package/build/components/welcome-guide/default.js.map +1 -1
  56. package/build/components/welcome-guide/image.js.map +1 -1
  57. package/build/components/welcome-guide/index.js.map +1 -1
  58. package/build/components/welcome-guide/template.js.map +1 -1
  59. package/build/deprecated.js +132 -0
  60. package/build/deprecated.js.map +1 -0
  61. package/build/editor.js +2 -2
  62. package/build/editor.js.map +1 -1
  63. package/build/editor.native.js.map +1 -1
  64. package/build/hooks/commands/use-common-commands.js +5 -22
  65. package/build/hooks/commands/use-common-commands.js.map +1 -1
  66. package/build/hooks/components/index.js.map +1 -1
  67. package/build/hooks/index.js.map +1 -1
  68. package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
  69. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  70. package/build/index.js +19 -62
  71. package/build/index.js.map +1 -1
  72. package/build/index.native.js.map +1 -1
  73. package/build/lock-unlock.js.map +1 -1
  74. package/build/store/actions.js +10 -8
  75. package/build/store/actions.js.map +1 -1
  76. package/build/store/constants.js.map +1 -1
  77. package/build/store/index.js +1 -1
  78. package/build/store/index.js.map +1 -1
  79. package/build/store/reducer.js.map +1 -1
  80. package/build/store/selectors.js +34 -19
  81. package/build/store/selectors.js.map +1 -1
  82. package/build/utils/meta-boxes.js.map +1 -1
  83. package/build-module/components/browser-url/index.js.map +1 -1
  84. package/build-module/components/editor-initialization/index.js +1 -2
  85. package/build-module/components/editor-initialization/index.js.map +1 -1
  86. package/build-module/components/editor-initialization/listener-hooks.js +2 -38
  87. package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
  88. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  89. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  90. package/build-module/components/header/index.js +22 -53
  91. package/build-module/components/header/index.js.map +1 -1
  92. package/build-module/components/header/index.native.js +1 -1
  93. package/build-module/components/header/index.native.js.map +1 -1
  94. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  95. package/build-module/components/header/more-menu/index.js +17 -42
  96. package/build-module/components/header/more-menu/index.js.map +1 -1
  97. package/build-module/components/header/more-menu/manage-patterns-menu-item.js +33 -0
  98. package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +1 -0
  99. package/build-module/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +1 -1
  100. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
  101. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  102. package/build-module/components/keyboard-shortcuts/index.js +1 -124
  103. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  104. package/build-module/components/layout/index.js +28 -29
  105. package/build-module/components/layout/index.js.map +1 -1
  106. package/build-module/components/layout/index.native.js.map +1 -1
  107. package/build-module/components/meta-boxes/index.js.map +1 -1
  108. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  109. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  110. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  111. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  112. package/build-module/components/preferences-modal/index.js +4 -32
  113. package/build-module/components/preferences-modal/index.js.map +1 -1
  114. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  115. package/build-module/components/sidebar/post-format/index.js.map +1 -1
  116. package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
  117. package/build-module/components/sidebar/post-slug/index.js.map +1 -1
  118. package/build-module/components/sidebar/post-status/index.js +36 -14
  119. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  120. package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
  121. package/build-module/components/sidebar/post-trash/index.js.map +1 -1
  122. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  123. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  124. package/build-module/components/sidebar/settings-sidebar/index.js +71 -44
  125. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  126. package/build-module/components/text-editor/index.js.map +1 -1
  127. package/build-module/components/visual-editor/block-inspector-button.js +1 -1
  128. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  129. package/build-module/components/visual-editor/header.native.js.map +1 -1
  130. package/build-module/components/visual-editor/index.js +4 -1
  131. package/build-module/components/visual-editor/index.js.map +1 -1
  132. package/build-module/components/visual-editor/index.native.js.map +1 -1
  133. package/build-module/components/visual-editor/use-padding-appender.js +55 -0
  134. package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
  135. package/build-module/components/welcome-guide/default.js.map +1 -1
  136. package/build-module/components/welcome-guide/image.js.map +1 -1
  137. package/build-module/components/welcome-guide/index.js.map +1 -1
  138. package/build-module/components/welcome-guide/template.js.map +1 -1
  139. package/build-module/deprecated.js +116 -0
  140. package/build-module/deprecated.js.map +1 -0
  141. package/build-module/editor.js +2 -2
  142. package/build-module/editor.js.map +1 -1
  143. package/build-module/editor.native.js.map +1 -1
  144. package/build-module/hooks/commands/use-common-commands.js +7 -24
  145. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  146. package/build-module/hooks/components/index.js.map +1 -1
  147. package/build-module/hooks/index.js.map +1 -1
  148. package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
  149. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  150. package/build-module/index.js +2 -15
  151. package/build-module/index.js.map +1 -1
  152. package/build-module/index.native.js.map +1 -1
  153. package/build-module/lock-unlock.js.map +1 -1
  154. package/build-module/store/actions.js +8 -7
  155. package/build-module/store/actions.js.map +1 -1
  156. package/build-module/store/constants.js.map +1 -1
  157. package/build-module/store/index.js.map +1 -1
  158. package/build-module/store/reducer.js.map +1 -1
  159. package/build-module/store/selectors.js +33 -18
  160. package/build-module/store/selectors.js.map +1 -1
  161. package/build-module/utils/meta-boxes.js.map +1 -1
  162. package/build-style/classic-rtl.css +2 -2
  163. package/build-style/classic.css +2 -2
  164. package/build-style/style-rtl.css +18 -589
  165. package/build-style/style.css +18 -589
  166. package/package.json +32 -34
  167. package/src/classic.scss +1 -1
  168. package/src/components/editor-initialization/index.js +1 -5
  169. package/src/components/editor-initialization/listener-hooks.js +1 -40
  170. package/src/components/editor-initialization/test/listener-hooks.js +1 -96
  171. package/src/components/header/index.js +25 -71
  172. package/src/components/header/index.native.js +1 -1
  173. package/src/components/header/more-menu/index.js +27 -43
  174. package/src/components/header/more-menu/manage-patterns-menu-item.js +33 -0
  175. package/src/components/header/style.scss +5 -82
  176. package/src/components/keyboard-shortcuts/index.js +2 -148
  177. package/src/components/layout/index.js +26 -47
  178. package/src/components/layout/style.scss +7 -80
  179. package/src/components/preferences-modal/index.js +3 -46
  180. package/src/components/sidebar/post-status/index.js +61 -24
  181. package/src/components/sidebar/settings-sidebar/index.js +113 -73
  182. package/src/components/visual-editor/block-inspector-button.js +1 -1
  183. package/src/components/visual-editor/index.js +4 -0
  184. package/src/components/visual-editor/use-padding-appender.js +66 -0
  185. package/src/deprecated.js +107 -0
  186. package/src/editor.js +2 -2
  187. package/src/hooks/commands/use-common-commands.js +11 -26
  188. package/src/index.js +3 -20
  189. package/src/store/actions.js +10 -12
  190. package/src/store/selectors.js +41 -33
  191. package/src/store/test/actions.js +11 -10
  192. package/src/style.scss +1 -19
  193. package/build/components/header/plugin-more-menu-item/index.js +0 -78
  194. package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
  195. package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
  196. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  197. package/build/components/header/post-publish-button-or-toggle.js +0 -91
  198. package/build/components/header/post-publish-button-or-toggle.js.map +0 -1
  199. package/build/components/header/preferences-menu-item/index.js +0 -31
  200. package/build/components/header/preferences-menu-item/index.js.map +0 -1
  201. package/build/components/header/tools-more-menu-group/index.js +0 -26
  202. package/build/components/header/tools-more-menu-group/index.js.map +0 -1
  203. package/build/components/header/writing-menu/index.js +0 -71
  204. package/build/components/header/writing-menu/index.js.map +0 -1
  205. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  206. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  207. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
  208. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  209. package/build/components/keyboard-shortcut-help-modal/index.js +0 -132
  210. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  211. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
  212. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  213. package/build/components/layout/actions-panel.js +0 -86
  214. package/build/components/layout/actions-panel.js.map +0 -1
  215. package/build/components/preferences-modal/enable-publish-sidebar.js +0 -38
  216. package/build/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
  217. package/build/components/sidebar/plugin-post-publish-panel/index.js +0 -39
  218. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
  219. package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
  220. package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  221. package/build/components/sidebar/plugin-pre-publish-panel/index.js +0 -43
  222. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
  223. package/build/components/sidebar/plugin-sidebar/index.js +0 -104
  224. package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
  225. package/build/components/start-page-options/index.js +0 -107
  226. package/build/components/start-page-options/index.js.map +0 -1
  227. package/build/plugins/copy-content-menu-item/index.js +0 -39
  228. package/build/plugins/copy-content-menu-item/index.js.map +0 -1
  229. package/build/plugins/index.js +0 -69
  230. package/build/plugins/index.js.map +0 -1
  231. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -41
  232. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
  233. package/build/plugins/welcome-guide-menu-item/index.js.map +0 -1
  234. package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
  235. package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
  236. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
  237. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  238. package/build-module/components/header/post-publish-button-or-toggle.js +0 -83
  239. package/build-module/components/header/post-publish-button-or-toggle.js.map +0 -1
  240. package/build-module/components/header/preferences-menu-item/index.js +0 -24
  241. package/build-module/components/header/preferences-menu-item/index.js.map +0 -1
  242. package/build-module/components/header/tools-more-menu-group/index.js +0 -19
  243. package/build-module/components/header/tools-more-menu-group/index.js.map +0 -1
  244. package/build-module/components/header/writing-menu/index.js +0 -64
  245. package/build-module/components/header/writing-menu/index.js.map +0 -1
  246. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  247. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  248. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  249. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  250. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -122
  251. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  252. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
  253. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  254. package/build-module/components/layout/actions-panel.js +0 -78
  255. package/build-module/components/layout/actions-panel.js.map +0 -1
  256. package/build-module/components/preferences-modal/enable-publish-sidebar.js +0 -31
  257. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +0 -1
  258. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +0 -32
  259. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +0 -1
  260. package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
  261. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  262. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +0 -36
  263. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +0 -1
  264. package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
  265. package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
  266. package/build-module/components/start-page-options/index.js +0 -100
  267. package/build-module/components/start-page-options/index.js.map +0 -1
  268. package/build-module/plugins/copy-content-menu-item/index.js +0 -32
  269. package/build-module/plugins/copy-content-menu-item/index.js.map +0 -1
  270. package/build-module/plugins/index.js +0 -65
  271. package/build-module/plugins/index.js.map +0 -1
  272. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -33
  273. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +0 -1
  274. package/build-module/plugins/welcome-guide-menu-item/index.js.map +0 -1
  275. package/src/components/header/plugin-more-menu-item/index.js +0 -73
  276. package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
  277. package/src/components/header/post-publish-button-or-toggle.js +0 -92
  278. package/src/components/header/preferences-menu-item/index.js +0 -25
  279. package/src/components/header/test/index.js +0 -51
  280. package/src/components/header/tools-more-menu-group/index.js +0 -20
  281. package/src/components/header/writing-menu/index.js +0 -73
  282. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  283. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
  284. package/src/components/keyboard-shortcut-help-modal/index.js +0 -163
  285. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
  286. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  287. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
  288. package/src/components/layout/actions-panel.js +0 -103
  289. package/src/components/preferences-modal/enable-publish-sidebar.js +0 -32
  290. package/src/components/preferences-modal/test/index.js +0 -28
  291. package/src/components/sidebar/plugin-post-publish-panel/index.js +0 -28
  292. package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
  293. package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
  294. package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
  295. package/src/components/sidebar/plugin-pre-publish-panel/index.js +0 -32
  296. package/src/components/sidebar/plugin-sidebar/index.js +0 -94
  297. package/src/components/start-page-options/index.js +0 -108
  298. package/src/components/start-page-options/style.scss +0 -26
  299. package/src/plugins/copy-content-menu-item/index.js +0 -29
  300. package/src/plugins/index.js +0 -85
  301. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +0 -34
  302. /package/src/{plugins/welcome-guide-menu-item/index.js → components/header/more-menu/welcome-guide-menu-item.js} +0 -0
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _react = require("react");
5
- var _components = require("@wordpress/components");
6
- var _coreData = require("@wordpress/core-data");
7
- var _editor = require("@wordpress/editor");
8
- var _data = require("@wordpress/data");
9
- var _icons = require("@wordpress/icons");
10
- var _i18n = require("@wordpress/i18n");
11
- var _plugins = require("@wordpress/plugins");
12
- var _url = require("@wordpress/url");
13
- var _copyContentMenuItem = _interopRequireDefault(require("./copy-content-menu-item"));
14
- var _keyboardShortcutsHelpMenuItem = _interopRequireDefault(require("./keyboard-shortcuts-help-menu-item"));
15
- var _toolsMoreMenuGroup = _interopRequireDefault(require("../components/header/tools-more-menu-group"));
16
- var _welcomeGuideMenuItem = _interopRequireDefault(require("./welcome-guide-menu-item"));
17
- /**
18
- * WordPress dependencies
19
- */
20
-
21
- /**
22
- * Internal dependencies
23
- */
24
-
25
- function ManagePatternsMenuItem() {
26
- const url = (0, _data.useSelect)(select => {
27
- const {
28
- canUser
29
- } = select(_coreData.store);
30
- const {
31
- getEditorSettings
32
- } = select(_editor.store);
33
- const isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;
34
- const defaultUrl = (0, _url.addQueryArgs)('edit.php', {
35
- post_type: 'wp_block'
36
- });
37
- const patternsUrl = (0, _url.addQueryArgs)('site-editor.php', {
38
- path: '/patterns'
39
- });
40
-
41
- // The site editor and templates both check whether the user has
42
- // edit_theme_options capabilities. We can leverage that here and not
43
- // display the manage patterns link if the user can't access it.
44
- return canUser('read', 'templates') && isBlockTheme ? patternsUrl : defaultUrl;
45
- }, []);
46
- return (0, _react.createElement)(_components.MenuItem, {
47
- role: "menuitem",
48
- href: url
49
- }, (0, _i18n.__)('Manage patterns'));
50
- }
51
- (0, _plugins.registerPlugin)('edit-post', {
52
- render() {
53
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_toolsMoreMenuGroup.default, null, ({
54
- onClose
55
- }) => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(ManagePatternsMenuItem, null), (0, _react.createElement)(_keyboardShortcutsHelpMenuItem.default, {
56
- onSelect: onClose
57
- }), (0, _react.createElement)(_welcomeGuideMenuItem.default, null), (0, _react.createElement)(_copyContentMenuItem.default, null), (0, _react.createElement)(_components.MenuItem, {
58
- role: "menuitem",
59
- icon: _icons.external,
60
- href: (0, _i18n.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'),
61
- target: "_blank",
62
- rel: "noopener noreferrer"
63
- }, (0, _i18n.__)('Help'), (0, _react.createElement)(_components.VisuallyHidden, {
64
- as: "span"
65
- }, /* translators: accessibility text */
66
- (0, _i18n.__)('(opens in a new tab)'))))));
67
- }
68
- });
69
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_coreData","_editor","_data","_icons","_i18n","_plugins","_url","_copyContentMenuItem","_interopRequireDefault","_keyboardShortcutsHelpMenuItem","_toolsMoreMenuGroup","_welcomeGuideMenuItem","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","getEditorSettings","editorStore","isBlockTheme","__unstableIsBlockBasedTheme","defaultUrl","addQueryArgs","post_type","patternsUrl","path","_react","createElement","MenuItem","role","href","__","registerPlugin","render","Fragment","default","onClose","onSelect","icon","external","target","rel","VisuallyHidden","as"],"sources":["@wordpress/edit-post/src/plugins/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\n\t\tconst isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) && isBlockTheme\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"],"mappings":";;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAKA,IAAAQ,oBAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,8BAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,mBAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,qBAAA,GAAAH,sBAAA,CAAAT,OAAA;AAlBA;AACA;AACA;;AAUA;AACA;AACA;;AAMA,SAASa,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IACvC,MAAM;MAAEC;IAAkB,CAAC,GAAGH,MAAM,CAAEI,aAAY,CAAC;IAEnD,MAAMC,YAAY,GAAGF,iBAAiB,CAAC,CAAC,CAACG,2BAA2B;IACpE,MAAMC,UAAU,GAAG,IAAAC,iBAAY,EAAE,UAAU,EAAE;MAC5CC,SAAS,EAAE;IACZ,CAAE,CAAC;IACH,MAAMC,WAAW,GAAG,IAAAF,iBAAY,EAAE,iBAAiB,EAAE;MACpDG,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;IACA;IACA,OAAOV,OAAO,CAAE,MAAM,EAAE,WAAY,CAAC,IAAII,YAAY,GAClDK,WAAW,GACXH,UAAU;EACd,CAAC,EAAE,EAAG,CAAC;EAEP,OACC,IAAAK,MAAA,CAAAC,aAAA,EAAC9B,WAAA,CAAA+B,QAAQ;IAACC,IAAI,EAAC,UAAU;IAACC,IAAI,EAAGlB;EAAK,GACnC,IAAAmB,QAAE,EAAE,iBAAkB,CACf,CAAC;AAEb;AAEA,IAAAC,uBAAc,EAAE,WAAW,EAAE;EAC5BC,MAAMA,CAAA,EAAG;IACR,OACC,IAAAP,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAQ,QAAA,QACC,IAAAR,MAAA,CAAAC,aAAA,EAAClB,mBAAA,CAAA0B,OAAkB,QAChB,CAAE;MAAEC;IAAQ,CAAC,KACd,IAAAV,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAQ,QAAA,QACC,IAAAR,MAAA,CAAAC,aAAA,EAAChB,sBAAsB,MAAE,CAAC,EAC1B,IAAAe,MAAA,CAAAC,aAAA,EAACnB,8BAAA,CAAA2B,OAA6B;MAC7BE,QAAQ,EAAGD;IAAS,CACpB,CAAC,EACF,IAAAV,MAAA,CAAAC,aAAA,EAACjB,qBAAA,CAAAyB,OAAoB,MAAE,CAAC,EACxB,IAAAT,MAAA,CAAAC,aAAA,EAACrB,oBAAA,CAAA6B,OAAmB,MAAE,CAAC,EACvB,IAAAT,MAAA,CAAAC,aAAA,EAAC9B,WAAA,CAAA+B,QAAQ;MACRC,IAAI,EAAC,UAAU;MACfS,IAAI,EAAGC,eAAU;MACjBT,IAAI,EAAG,IAAAC,QAAE,EACR,qEACD,CAAG;MACHS,MAAM,EAAC,QAAQ;MACfC,GAAG,EAAC;IAAqB,GAEvB,IAAAV,QAAE,EAAE,MAAO,CAAC,EACd,IAAAL,MAAA,CAAAC,aAAA,EAAC9B,WAAA,CAAA6C,cAAc;MAACC,EAAE,EAAC;IAAM,GAEvB;IACA,IAAAZ,QAAE,EAAE,sBAAuB,CAEb,CACP,CACT,CAEgB,CACnB,CAAC;EAEL;AACD,CAAE,CAAC"}
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.KeyboardShortcutsHelpMenuItem = KeyboardShortcutsHelpMenuItem;
7
- exports.default = void 0;
8
- var _react = require("react");
9
- var _components = require("@wordpress/components");
10
- var _data = require("@wordpress/data");
11
- var _i18n = require("@wordpress/i18n");
12
- var _keycodes = require("@wordpress/keycodes");
13
- var _interface = require("@wordpress/interface");
14
- var _keyboardShortcutHelpModal = require("../../components/keyboard-shortcut-help-modal");
15
- /**
16
- * WordPress dependencies
17
- */
18
-
19
- /**
20
- * Internal dependencies
21
- */
22
-
23
- function KeyboardShortcutsHelpMenuItem({
24
- openModal
25
- }) {
26
- return (0, _react.createElement)(_components.MenuItem, {
27
- onClick: () => {
28
- openModal(_keyboardShortcutHelpModal.KEYBOARD_SHORTCUT_HELP_MODAL_NAME);
29
- },
30
- shortcut: _keycodes.displayShortcut.access('h')
31
- }, (0, _i18n.__)('Keyboard shortcuts'));
32
- }
33
- var _default = exports.default = (0, _data.withDispatch)(dispatch => {
34
- const {
35
- openModal
36
- } = dispatch(_interface.store);
37
- return {
38
- openModal
39
- };
40
- })(KeyboardShortcutsHelpMenuItem);
41
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_data","_i18n","_keycodes","_interface","_keyboardShortcutHelpModal","KeyboardShortcutsHelpMenuItem","openModal","_react","createElement","MenuItem","onClick","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","shortcut","displayShortcut","access","__","_default","exports","default","withDispatch","dispatch","interfaceStore"],"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { withDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\n\nexport function KeyboardShortcutsHelpMenuItem( { openModal } ) {\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t\t} }\n\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t>\n\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default withDispatch( ( dispatch ) => {\n\tconst { openModal } = dispatch( interfaceStore );\n\n\treturn {\n\t\topenModal,\n\t};\n} )( KeyboardShortcutsHelpMenuItem );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAKA,IAAAK,0BAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGO,SAASM,6BAA6BA,CAAE;EAAEC;AAAU,CAAC,EAAG;EAC9D,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAW,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfJ,SAAS,CAAEK,4DAAkC,CAAC;IAC/C,CAAG;IACHC,QAAQ,EAAGC,yBAAe,CAACC,MAAM,CAAE,GAAI;EAAG,GAExC,IAAAC,QAAE,EAAE,oBAAqB,CAClB,CAAC;AAEb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC5C,MAAM;IAAEd;EAAU,CAAC,GAAGc,QAAQ,CAAEC,gBAAe,CAAC;EAEhD,OAAO;IACNf;EACD,CAAC;AACF,CAAE,CAAC,CAAED,6BAA8B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_data","require","_preferences","_i18n","_editor","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","_react","createElement","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/plugins/welcome-guide-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMe,SAASI,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGT,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEU,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ"}
@@ -1,73 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { ActionItem } from '@wordpress/interface';
5
- import { compose } from '@wordpress/compose';
6
- import { MenuItem } from '@wordpress/components';
7
- import { withPluginContext } from '@wordpress/plugins';
8
-
9
- /**
10
- * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.
11
- * The text within the component appears as the menu item label.
12
- *
13
- * @param {Object} props Component properties.
14
- * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
15
- * @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 to the left of the menu item label.
16
- * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.
17
- * @param {...*} [props.other] Any additional props are passed through to the underlying [MenuItem](https://github.com/WordPress/gutenberg/tree/HEAD/packages/components/src/menu-item/README.md) component.
18
- *
19
- * @example
20
- * ```js
21
- * // Using ES5 syntax
22
- * var __ = wp.i18n.__;
23
- * var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;
24
- * var moreIcon = React.createElement( 'svg' ); //... svg element.
25
- *
26
- * function onButtonClick() {
27
- * alert( 'Button clicked.' );
28
- * }
29
- *
30
- * function MyButtonMoreMenuItem() {
31
- * return React.createElement(
32
- * PluginMoreMenuItem,
33
- * {
34
- * icon: moreIcon,
35
- * onClick: onButtonClick,
36
- * },
37
- * __( 'My button title' )
38
- * );
39
- * }
40
- * ```
41
- *
42
- * @example
43
- * ```jsx
44
- * // Using ESNext syntax
45
- * import { __ } from '@wordpress/i18n';
46
- * import { PluginMoreMenuItem } from '@wordpress/edit-post';
47
- * import { more } from '@wordpress/icons';
48
- *
49
- * function onButtonClick() {
50
- * alert( 'Button clicked.' );
51
- * }
52
- *
53
- * const MyButtonMoreMenuItem = () => (
54
- * <PluginMoreMenuItem
55
- * icon={ more }
56
- * onClick={ onButtonClick }
57
- * >
58
- * { __( 'My button title' ) }
59
- * </PluginMoreMenuItem>
60
- * );
61
- * ```
62
- *
63
- * @return {Component} The component to be rendered.
64
- */
65
- export default compose(withPluginContext((context, ownProps) => {
66
- var _ownProps$as;
67
- return {
68
- as: (_ownProps$as = ownProps.as) !== null && _ownProps$as !== void 0 ? _ownProps$as : MenuItem,
69
- icon: ownProps.icon || context.icon,
70
- name: 'core/edit-post/plugin-more-menu'
71
- };
72
- }))(ActionItem);
73
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ActionItem","compose","MenuItem","withPluginContext","context","ownProps","_ownProps$as","as","icon","name"],"sources":["@wordpress/edit-post/src/components/header/plugin-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ActionItem } from '@wordpress/interface';\nimport { compose } from '@wordpress/compose';\nimport { MenuItem } from '@wordpress/components';\nimport { withPluginContext } from '@wordpress/plugins';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.href] When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.\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 to the left of the menu item label.\n * @param {Function} [props.onClick=noop] The callback function to be executed when the user clicks the menu item.\n * @param {...*} [props.other] Any additional props are passed through to the underlying [MenuItem](https://github.com/WordPress/gutenberg/tree/HEAD/packages/components/src/menu-item/README.md) component.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * function MyButtonMoreMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginMoreMenuItem,\n * \t\t{\n * \t\t\ticon: moreIcon,\n * \t\t\tonClick: onButtonClick,\n * \t\t},\n * \t\t__( 'My button title' )\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginMoreMenuItem } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * function onButtonClick() {\n * \talert( 'Button clicked.' );\n * }\n *\n * const MyButtonMoreMenuItem = () => (\n * \t<PluginMoreMenuItem\n * \t\ticon={ more }\n * \t\tonClick={ onButtonClick }\n * \t>\n * \t\t{ __( 'My button title' ) }\n * \t</PluginMoreMenuItem>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nexport default compose(\n\twithPluginContext( ( context, ownProps ) => {\n\t\treturn {\n\t\t\tas: ownProps.as ?? MenuItem,\n\t\t\ticon: ownProps.icon || context.icon,\n\t\t\tname: 'core/edit-post/plugin-more-menu',\n\t\t};\n\t} )\n)( ActionItem );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,sBAAsB;AACjD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,iBAAiB,QAAQ,oBAAoB;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeF,OAAO,CACrBE,iBAAiB,CAAE,CAAEC,OAAO,EAAEC,QAAQ,KAAM;EAAA,IAAAC,YAAA;EAC3C,OAAO;IACNC,EAAE,GAAAD,YAAA,GAAED,QAAQ,CAACE,EAAE,cAAAD,YAAA,cAAAA,YAAA,GAAIJ,QAAQ;IAC3BM,IAAI,EAAEH,QAAQ,CAACG,IAAI,IAAIJ,OAAO,CAACI,IAAI;IACnCC,IAAI,EAAE;EACP,CAAC;AACF,CAAE,CACH,CAAC,CAAET,UAAW,CAAC"}
@@ -1,65 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';
6
-
7
- /**
8
- * Renders a menu item in `Plugins` group in `More Menu` drop down,
9
- * and can be used to activate the corresponding `PluginSidebar` component.
10
- * The text within the component appears as the menu item label.
11
- *
12
- * @param {Object} props Component props.
13
- * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
14
- * @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 to the left of the menu item label.
15
- *
16
- * @example
17
- * ```js
18
- * // Using ES5 syntax
19
- * var __ = wp.i18n.__;
20
- * var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;
21
- * var moreIcon = React.createElement( 'svg' ); //... svg element.
22
- *
23
- * function MySidebarMoreMenuItem() {
24
- * return React.createElement(
25
- * PluginSidebarMoreMenuItem,
26
- * {
27
- * target: 'my-sidebar',
28
- * icon: moreIcon,
29
- * },
30
- * __( 'My sidebar title' )
31
- * )
32
- * }
33
- * ```
34
- *
35
- * @example
36
- * ```jsx
37
- * // Using ESNext syntax
38
- * import { __ } from '@wordpress/i18n';
39
- * import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post';
40
- * import { more } from '@wordpress/icons';
41
- *
42
- * const MySidebarMoreMenuItem = () => (
43
- * <PluginSidebarMoreMenuItem
44
- * target="my-sidebar"
45
- * icon={ more }
46
- * >
47
- * { __( 'My sidebar title' ) }
48
- * </PluginSidebarMoreMenuItem>
49
- * );
50
- * ```
51
- *
52
- * @return {Component} The component to be rendered.
53
- */
54
-
55
- export default function PluginSidebarMoreMenuItem(props) {
56
- return createElement(ComplementaryAreaMoreMenuItem
57
- // Menu item is marked with unstable prop for backward compatibility.
58
- // @see https://github.com/WordPress/gutenberg/issues/14457
59
- , {
60
- __unstableExplicitMenuItem: true,
61
- scope: "core/edit-post",
62
- ...props
63
- });
64
- }
65
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ComplementaryAreaMoreMenuItem","PluginSidebarMoreMenuItem","props","createElement","__unstableExplicitMenuItem","scope"],"sources":["@wordpress/edit-post/src/components/header/plugin-sidebar-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryAreaMoreMenuItem } from '@wordpress/interface';\n\n/**\n * Renders a menu item in `Plugins` group in `More Menu` drop down,\n * and can be used to activate the corresponding `PluginSidebar` component.\n * The text within the component appears as the menu item label.\n *\n * @param {Object} props Component props.\n * @param {string} props.target A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.\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 to the left of the menu item label.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginSidebarMoreMenuItem = wp.editPost.PluginSidebarMoreMenuItem;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function MySidebarMoreMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginSidebarMoreMenuItem,\n * \t\t{\n * \t\t\ttarget: 'my-sidebar',\n * \t\t\ticon: moreIcon,\n * \t\t},\n * \t\t__( 'My sidebar title' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginSidebarMoreMenuItem } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * const MySidebarMoreMenuItem = () => (\n * \t<PluginSidebarMoreMenuItem\n * \t\ttarget=\"my-sidebar\"\n * \t\ticon={ more }\n * \t>\n * \t\t{ __( 'My sidebar title' ) }\n * \t</PluginSidebarMoreMenuItem>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\n\nexport default function PluginSidebarMoreMenuItem( props ) {\n\treturn (\n\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t// Menu item is marked with unstable prop for backward compatibility.\n\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t__unstableExplicitMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,6BAA6B,QAAQ,sBAAsB;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,eAAe,SAASC,yBAAyBA,CAAEC,KAAK,EAAG;EAC1D,OACCC,aAAA,CAACH;EACA;EACA;EAAA;IACAI,0BAA0B;IAC1BC,KAAK,EAAC,gBAAgB;IAAA,GACjBH;EAAK,CACV,CAAC;AAEJ"}
@@ -1,83 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { useViewportMatch, compose } from '@wordpress/compose';
6
- import { withDispatch, withSelect } from '@wordpress/data';
7
- import { PostPublishButton, store as editorStore } from '@wordpress/editor';
8
- export function PostPublishButtonOrToggle({
9
- forceIsDirty,
10
- hasPublishAction,
11
- isBeingScheduled,
12
- isPending,
13
- isPublished,
14
- isPublishSidebarEnabled,
15
- isPublishSidebarOpened,
16
- isScheduled,
17
- togglePublishSidebar,
18
- setEntitiesSavedStatesCallback
19
- }) {
20
- const IS_TOGGLE = 'toggle';
21
- const IS_BUTTON = 'button';
22
- const isSmallerThanMediumViewport = useViewportMatch('medium', '<');
23
- let component;
24
-
25
- /**
26
- * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):
27
- *
28
- * 1) We want to show a BUTTON when the post status is at the _final stage_
29
- * for a particular role (see https://wordpress.org/documentation/article/post-status/):
30
- *
31
- * - is published
32
- * - is scheduled to be published
33
- * - is pending and can't be published (but only for viewports >= medium).
34
- * Originally, we considered showing a button for pending posts that couldn't be published
35
- * (for example, for an author with the contributor role). Some languages can have
36
- * long translations for "Submit for review", so given the lack of UI real estate available
37
- * we decided to take into account the viewport in that case.
38
- * See: https://github.com/WordPress/gutenberg/issues/10475
39
- *
40
- * 2) Then, in small viewports, we'll show a TOGGLE.
41
- *
42
- * 3) Finally, we'll use the publish sidebar status to decide:
43
- *
44
- * - if it is enabled, we show a TOGGLE
45
- * - if it is disabled, we show a BUTTON
46
- */
47
- if (isPublished || isScheduled && isBeingScheduled || isPending && !hasPublishAction && !isSmallerThanMediumViewport) {
48
- component = IS_BUTTON;
49
- } else if (isSmallerThanMediumViewport) {
50
- component = IS_TOGGLE;
51
- } else if (isPublishSidebarEnabled) {
52
- component = IS_TOGGLE;
53
- } else {
54
- component = IS_BUTTON;
55
- }
56
- return createElement(PostPublishButton, {
57
- forceIsDirty: forceIsDirty,
58
- isOpen: isPublishSidebarOpened,
59
- isToggle: component === IS_TOGGLE,
60
- onToggle: togglePublishSidebar,
61
- setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
62
- });
63
- }
64
- export default compose(withSelect(select => {
65
- var _select$getCurrentPos;
66
- return {
67
- hasPublishAction: (_select$getCurrentPos = select(editorStore).getCurrentPost()?._links?.['wp:action-publish']) !== null && _select$getCurrentPos !== void 0 ? _select$getCurrentPos : false,
68
- isBeingScheduled: select(editorStore).isEditedPostBeingScheduled(),
69
- isPending: select(editorStore).isCurrentPostPending(),
70
- isPublished: select(editorStore).isCurrentPostPublished(),
71
- isPublishSidebarEnabled: select(editorStore).isPublishSidebarEnabled(),
72
- isPublishSidebarOpened: select(editorStore).isPublishSidebarOpened(),
73
- isScheduled: select(editorStore).isCurrentPostScheduled()
74
- };
75
- }), withDispatch(dispatch => {
76
- const {
77
- togglePublishSidebar
78
- } = dispatch(editorStore);
79
- return {
80
- togglePublishSidebar
81
- };
82
- }))(PostPublishButtonOrToggle);
83
- //# sourceMappingURL=post-publish-button-or-toggle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useViewportMatch","compose","withDispatch","withSelect","PostPublishButton","store","editorStore","PostPublishButtonOrToggle","forceIsDirty","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","createElement","isOpen","isToggle","onToggle","select","_select$getCurrentPos","getCurrentPost","_links","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","isCurrentPostScheduled","dispatch"],"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { PostPublishButton, store as editorStore } from '@wordpress/editor';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/documentation/article/post-status/):\n\t *\n\t * - is published\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else if ( isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction:\n\t\t\tselect( editorStore ).getCurrentPost()?._links?.[\n\t\t\t\t'wp:action-publish'\n\t\t\t] ?? false,\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened: select( editorStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editorStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,OAAO,QAAQ,oBAAoB;AAC9D,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,iBAAiB,EAAEC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAE3E,OAAO,SAASC,yBAAyBA,CAAE;EAC1CC,YAAY;EACZC,gBAAgB;EAChBC,gBAAgB;EAChBC,SAAS;EACTC,WAAW;EACXC,uBAAuB;EACvBC,sBAAsB;EACtBC,WAAW;EACXC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,SAAS,GAAG,QAAQ;EAC1B,MAAMC,2BAA2B,GAAGpB,gBAAgB,CAAE,QAAQ,EAAE,GAAI,CAAC;EACrE,IAAIqB,SAAS;;EAEb;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,IACCT,WAAW,IACTG,WAAW,IAAIL,gBAAkB,IACjCC,SAAS,IAAI,CAAEF,gBAAgB,IAAI,CAAEW,2BAA6B,EACnE;IACDC,SAAS,GAAGF,SAAS;EACtB,CAAC,MAAM,IAAKC,2BAA2B,EAAG;IACzCC,SAAS,GAAGH,SAAS;EACtB,CAAC,MAAM,IAAKL,uBAAuB,EAAG;IACrCQ,SAAS,GAAGH,SAAS;EACtB,CAAC,MAAM;IACNG,SAAS,GAAGF,SAAS;EACtB;EAEA,OACCG,aAAA,CAAClB,iBAAiB;IACjBI,YAAY,EAAGA,YAAc;IAC7Be,MAAM,EAAGT,sBAAwB;IACjCU,QAAQ,EAAGH,SAAS,KAAKH,SAAW;IACpCO,QAAQ,EAAGT,oBAAsB;IACjCC,8BAA8B,EAAGA;EAAgC,CACjE,CAAC;AAEJ;AAEA,eAAehB,OAAO,CACrBE,UAAU,CAAIuB,MAAM;EAAA,IAAAC,qBAAA;EAAA,OAAQ;IAC3BlB,gBAAgB,GAAAkB,qBAAA,GACfD,MAAM,CAAEpB,WAAY,CAAC,CAACsB,cAAc,CAAC,CAAC,EAAEC,MAAM,GAC7C,mBAAmB,CACnB,cAAAF,qBAAA,cAAAA,qBAAA,GAAI,KAAK;IACXjB,gBAAgB,EAAEgB,MAAM,CAAEpB,WAAY,CAAC,CAACwB,0BAA0B,CAAC,CAAC;IACpEnB,SAAS,EAAEe,MAAM,CAAEpB,WAAY,CAAC,CAACyB,oBAAoB,CAAC,CAAC;IACvDnB,WAAW,EAAEc,MAAM,CAAEpB,WAAY,CAAC,CAAC0B,sBAAsB,CAAC,CAAC;IAC3DnB,uBAAuB,EACtBa,MAAM,CAAEpB,WAAY,CAAC,CAACO,uBAAuB,CAAC,CAAC;IAChDC,sBAAsB,EAAEY,MAAM,CAAEpB,WAAY,CAAC,CAACQ,sBAAsB,CAAC,CAAC;IACtEC,WAAW,EAAEW,MAAM,CAAEpB,WAAY,CAAC,CAAC2B,sBAAsB,CAAC;EAC3D,CAAC;AAAA,CAAG,CAAC,EACL/B,YAAY,CAAIgC,QAAQ,IAAM;EAC7B,MAAM;IAAElB;EAAqB,CAAC,GAAGkB,QAAQ,CAAE5B,WAAY,CAAC;EACxD,OAAO;IACNU;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAET,yBAA0B,CAAC"}
@@ -1,24 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { useDispatch } from '@wordpress/data';
6
- import { __ } from '@wordpress/i18n';
7
- import { MenuItem } from '@wordpress/components';
8
- import { store as interfaceStore } from '@wordpress/interface';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import { PREFERENCES_MODAL_NAME } from '../../../components/preferences-modal';
14
- export default function PreferencesMenuItem() {
15
- const {
16
- openModal
17
- } = useDispatch(interfaceStore);
18
- return createElement(MenuItem, {
19
- onClick: () => {
20
- openModal(PREFERENCES_MODAL_NAME);
21
- }
22
- }, __('Preferences'));
23
- }
24
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useDispatch","__","MenuItem","store","interfaceStore","PREFERENCES_MODAL_NAME","PreferencesMenuItem","openModal","createElement","onClick"],"sources":["@wordpress/edit-post/src/components/header/preferences-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_MODAL_NAME } from '../../../components/preferences-modal';\n\nexport default function PreferencesMenuItem() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Preferences' ) }\n\t\t</MenuItem>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,KAAK,IAAIC,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,uCAAuC;AAE9E,eAAe,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAU,CAAC,GAAGP,WAAW,CAAEI,cAAe,CAAC;EACnD,OACCI,aAAA,CAACN,QAAQ;IACRO,OAAO,EAAGA,CAAA,KAAM;MACfF,SAAS,CAAEF,sBAAuB,CAAC;IACpC;EAAG,GAEDJ,EAAE,CAAE,aAAc,CACX,CAAC;AAEb"}
@@ -1,19 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { createSlotFill, MenuGroup } from '@wordpress/components';
6
- import { __ } from '@wordpress/i18n';
7
- const {
8
- Fill: ToolsMoreMenuGroup,
9
- Slot
10
- } = createSlotFill('ToolsMoreMenuGroup');
11
- ToolsMoreMenuGroup.Slot = ({
12
- fillProps
13
- }) => createElement(Slot, {
14
- fillProps: fillProps
15
- }, fills => fills.length > 0 && createElement(MenuGroup, {
16
- label: __('Tools')
17
- }, fills));
18
- export default ToolsMoreMenuGroup;
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createSlotFill","MenuGroup","__","Fill","ToolsMoreMenuGroup","Slot","fillProps","createElement","fills","length","label"],"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } =\n\tcreateSlotFill( 'ToolsMoreMenuGroup' );\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\tfills.length > 0 && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,MAAM;EAAEC,IAAI,EAAEC,kBAAkB;EAAEC;AAAK,CAAC,GACvCL,cAAc,CAAE,oBAAqB,CAAC;AAEvCI,kBAAkB,CAACC,IAAI,GAAG,CAAE;EAAEC;AAAU,CAAC,KACxCC,aAAA,CAACF,IAAI;EAACC,SAAS,EAAGA;AAAW,GACxBE,KAAK,IACRA,KAAK,CAACC,MAAM,GAAG,CAAC,IACfF,aAAA,CAACN,SAAS;EAACS,KAAK,EAAGR,EAAE,CAAE,OAAQ;AAAG,GAAGM,KAAkB,CAGpD,CACN;AAED,eAAeJ,kBAAkB"}
@@ -1,64 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { useDispatch } from '@wordpress/data';
6
- import { MenuGroup } from '@wordpress/components';
7
- import { __, _x } from '@wordpress/i18n';
8
- import { useViewportMatch } from '@wordpress/compose';
9
- import { displayShortcut } from '@wordpress/keycodes';
10
- import { PreferenceToggleMenuItem, store as preferencesStore } from '@wordpress/preferences';
11
- import { store as editorStore } from '@wordpress/editor';
12
- function WritingMenu() {
13
- const {
14
- set: setPreference
15
- } = useDispatch(preferencesStore);
16
- const {
17
- toggleDistractionFree
18
- } = useDispatch(editorStore);
19
- const turnOffDistractionFree = () => {
20
- setPreference('core', 'distractionFree', false);
21
- };
22
- const isLargeViewport = useViewportMatch('medium');
23
- if (!isLargeViewport) {
24
- return null;
25
- }
26
- return createElement(MenuGroup, {
27
- label: _x('View', 'noun')
28
- }, createElement(PreferenceToggleMenuItem, {
29
- scope: "core",
30
- name: "fixedToolbar",
31
- onToggle: turnOffDistractionFree,
32
- label: __('Top toolbar'),
33
- info: __('Access all block and document tools in a single place'),
34
- messageActivated: __('Top toolbar activated'),
35
- messageDeactivated: __('Top toolbar deactivated')
36
- }), createElement(PreferenceToggleMenuItem, {
37
- scope: "core",
38
- name: "distractionFree",
39
- handleToggling: false,
40
- onToggle: toggleDistractionFree,
41
- label: __('Distraction free'),
42
- info: __('Write with calmness'),
43
- messageActivated: __('Distraction free mode activated'),
44
- messageDeactivated: __('Distraction free mode deactivated'),
45
- shortcut: displayShortcut.primaryShift('\\')
46
- }), createElement(PreferenceToggleMenuItem, {
47
- scope: "core",
48
- name: "focusMode",
49
- label: __('Spotlight mode'),
50
- info: __('Focus on one block at a time'),
51
- messageActivated: __('Spotlight mode activated'),
52
- messageDeactivated: __('Spotlight mode deactivated')
53
- }), createElement(PreferenceToggleMenuItem, {
54
- scope: "core/edit-post",
55
- name: "fullscreenMode",
56
- label: __('Fullscreen mode'),
57
- info: __('Show and hide the admin user interface'),
58
- messageActivated: __('Fullscreen mode activated'),
59
- messageDeactivated: __('Fullscreen mode deactivated'),
60
- shortcut: displayShortcut.secondary('f')
61
- }));
62
- }
63
- export default WritingMenu;
64
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useDispatch","MenuGroup","__","_x","useViewportMatch","displayShortcut","PreferenceToggleMenuItem","store","preferencesStore","editorStore","WritingMenu","set","setPreference","toggleDistractionFree","turnOffDistractionFree","isLargeViewport","createElement","label","scope","name","onToggle","info","messageActivated","messageDeactivated","handleToggling","shortcut","primaryShift","secondary"],"sources":["@wordpress/edit-post/src/components/header/writing-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { MenuGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\nfunction WritingMenu() {\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tif ( ! isLargeViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\tinfo={ __(\n\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t) }\n\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"distractionFree\"\n\t\t\t\thandleToggling={ false }\n\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\tmessageActivated={ __( 'Distraction free mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Distraction free mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.primaryShift( '\\\\' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tname=\"focusMode\"\n\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Spotlight mode deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Fullscreen mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default WritingMenu;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SACCC,wBAAwB,EACxBC,KAAK,IAAIC,gBAAgB,QACnB,wBAAwB;AAC/B,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AAExD,SAASC,WAAWA,CAAA,EAAG;EACtB,MAAM;IAAEC,GAAG,EAAEC;EAAc,CAAC,GAAGZ,WAAW,CAAEQ,gBAAiB,CAAC;EAC9D,MAAM;IAAEK;EAAsB,CAAC,GAAGb,WAAW,CAAES,WAAY,CAAC;EAE5D,MAAMK,sBAAsB,GAAGA,CAAA,KAAM;IACpCF,aAAa,CAAE,MAAM,EAAE,iBAAiB,EAAE,KAAM,CAAC;EAClD,CAAC;EAED,MAAMG,eAAe,GAAGX,gBAAgB,CAAE,QAAS,CAAC;EACpD,IAAK,CAAEW,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAACf,SAAS;IAACgB,KAAK,EAAGd,EAAE,CAAE,MAAM,EAAE,MAAO;EAAG,GACxCa,aAAA,CAACV,wBAAwB;IACxBY,KAAK,EAAC,MAAM;IACZC,IAAI,EAAC,cAAc;IACnBC,QAAQ,EAAGN,sBAAwB;IACnCG,KAAK,EAAGf,EAAE,CAAE,aAAc,CAAG;IAC7BmB,IAAI,EAAGnB,EAAE,CACR,uDACD,CAAG;IACHoB,gBAAgB,EAAGpB,EAAE,CAAE,uBAAwB,CAAG;IAClDqB,kBAAkB,EAAGrB,EAAE,CAAE,yBAA0B;EAAG,CACtD,CAAC,EACFc,aAAA,CAACV,wBAAwB;IACxBY,KAAK,EAAC,MAAM;IACZC,IAAI,EAAC,iBAAiB;IACtBK,cAAc,EAAG,KAAO;IACxBJ,QAAQ,EAAGP,qBAAuB;IAClCI,KAAK,EAAGf,EAAE,CAAE,kBAAmB,CAAG;IAClCmB,IAAI,EAAGnB,EAAE,CAAE,qBAAsB,CAAG;IACpCoB,gBAAgB,EAAGpB,EAAE,CAAE,iCAAkC,CAAG;IAC5DqB,kBAAkB,EAAGrB,EAAE,CAAE,mCAAoC,CAAG;IAChEuB,QAAQ,EAAGpB,eAAe,CAACqB,YAAY,CAAE,IAAK;EAAG,CACjD,CAAC,EACFV,aAAA,CAACV,wBAAwB;IACxBY,KAAK,EAAC,MAAM;IACZC,IAAI,EAAC,WAAW;IAChBF,KAAK,EAAGf,EAAE,CAAE,gBAAiB,CAAG;IAChCmB,IAAI,EAAGnB,EAAE,CAAE,8BAA+B,CAAG;IAC7CoB,gBAAgB,EAAGpB,EAAE,CAAE,0BAA2B,CAAG;IACrDqB,kBAAkB,EAAGrB,EAAE,CAAE,4BAA6B;EAAG,CACzD,CAAC,EACFc,aAAA,CAACV,wBAAwB;IACxBY,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAC,gBAAgB;IACrBF,KAAK,EAAGf,EAAE,CAAE,iBAAkB,CAAG;IACjCmB,IAAI,EAAGnB,EAAE,CAAE,wCAAyC,CAAG;IACvDoB,gBAAgB,EAAGpB,EAAE,CAAE,2BAA4B,CAAG;IACtDqB,kBAAkB,EAAGrB,EAAE,CAAE,6BAA8B,CAAG;IAC1DuB,QAAQ,EAAGpB,eAAe,CAACsB,SAAS,CAAE,GAAI;EAAG,CAC7C,CACS,CAAC;AAEd;AAEA,eAAejB,WAAW"}
@@ -1,71 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __ } from '@wordpress/i18n';
5
- export const textFormattingShortcuts = [{
6
- keyCombination: {
7
- modifier: 'primary',
8
- character: 'b'
9
- },
10
- description: __('Make the selected text bold.')
11
- }, {
12
- keyCombination: {
13
- modifier: 'primary',
14
- character: 'i'
15
- },
16
- description: __('Make the selected text italic.')
17
- }, {
18
- keyCombination: {
19
- modifier: 'primary',
20
- character: 'k'
21
- },
22
- description: __('Convert the selected text into a link.')
23
- }, {
24
- keyCombination: {
25
- modifier: 'primaryShift',
26
- character: 'k'
27
- },
28
- description: __('Remove a link.')
29
- }, {
30
- keyCombination: {
31
- character: '[['
32
- },
33
- description: __('Insert a link to a post or page.')
34
- }, {
35
- keyCombination: {
36
- modifier: 'primary',
37
- character: 'u'
38
- },
39
- description: __('Underline the selected text.')
40
- }, {
41
- keyCombination: {
42
- modifier: 'access',
43
- character: 'd'
44
- },
45
- description: __('Strikethrough the selected text.')
46
- }, {
47
- keyCombination: {
48
- modifier: 'access',
49
- character: 'x'
50
- },
51
- description: __('Make the selected text inline code.')
52
- }, {
53
- keyCombination: {
54
- modifier: 'access',
55
- character: '0'
56
- },
57
- description: __('Convert the current heading to a paragraph.')
58
- }, {
59
- keyCombination: {
60
- modifier: 'access',
61
- character: '1-6'
62
- },
63
- description: __('Convert the current paragraph or heading to a heading of level 1 to 6.')
64
- }, {
65
- keyCombination: {
66
- modifier: 'primaryShift',
67
- character: '\u00a0'
68
- },
69
- description: __('Add non breaking space.')
70
- }];
71
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__","textFormattingShortcuts","keyCombination","modifier","character","description"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/config.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'd' },\n\t\tdescription: __( 'Strikethrough the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'x' },\n\t\tdescription: __( 'Make the selected text inline code.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: '0' },\n\t\tdescription: __( 'Convert the current heading to a paragraph.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: '1-6' },\n\t\tdescription: __(\n\t\t\t'Convert the current paragraph or heading to a heading of level 1 to 6.'\n\t\t),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: '\\u00a0' },\n\t\tdescription: __( 'Add non breaking space.' ),\n\t},\n];\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,uBAAuB,GAAG,CACtC;EACCC,cAAc,EAAE;IAAEC,QAAQ,EAAE,SAAS;IAAEC,SAAS,EAAE;EAAI,CAAC;EACvDC,WAAW,EAAEL,EAAE,CAAE,8BAA+B;AACjD,CAAC,EACD;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,SAAS;IAAEC,SAAS,EAAE;EAAI,CAAC;EACvDC,WAAW,EAAEL,EAAE,CAAE,gCAAiC;AACnD,CAAC,EACD;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,SAAS;IAAEC,SAAS,EAAE;EAAI,CAAC;EACvDC,WAAW,EAAEL,EAAE,CAAE,wCAAyC;AAC3D,CAAC,EACD;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,cAAc;IAAEC,SAAS,EAAE;EAAI,CAAC;EAC5DC,WAAW,EAAEL,EAAE,CAAE,gBAAiB;AACnC,CAAC,EACD;EACCE,cAAc,EAAE;IAAEE,SAAS,EAAE;EAAK,CAAC;EACnCC,WAAW,EAAEL,EAAE,CAAE,kCAAmC;AACrD,CAAC,EACD;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,SAAS;IAAEC,SAAS,EAAE;EAAI,CAAC;EACvDC,WAAW,EAAEL,EAAE,CAAE,8BAA+B;AACjD,CAAC,EACD;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,QAAQ;IAAEC,SAAS,EAAE;EAAI,CAAC;EACtDC,WAAW,EAAEL,EAAE,CAAE,kCAAmC;AACrD,CAAC,EACD;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,QAAQ;IAAEC,SAAS,EAAE;EAAI,CAAC;EACtDC,WAAW,EAAEL,EAAE,CAAE,qCAAsC;AACxD,CAAC,EACD;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,QAAQ;IAAEC,SAAS,EAAE;EAAI,CAAC;EACtDC,WAAW,EAAEL,EAAE,CAAE,6CAA8C;AAChE,CAAC,EACD;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,QAAQ;IAAEC,SAAS,EAAE;EAAM,CAAC;EACxDC,WAAW,EAAEL,EAAE,CACd,wEACD;AACD,CAAC,EACD;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,cAAc;IAAEC,SAAS,EAAE;EAAS,CAAC;EACjEC,WAAW,EAAEL,EAAE,CAAE,yBAA0B;AAC5C,CAAC,CACD"}