@wordpress/edit-post 7.31.0 → 7.33.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 (294) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +9 -323
  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 +5 -5
  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 +7 -6
  16. package/build/components/header/more-menu/index.js.map +1 -1
  17. package/build/components/header/post-publish-button-or-toggle.js +11 -13
  18. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  19. package/build/components/header/preferences-menu-item/index.js +12 -4
  20. package/build/components/header/preferences-menu-item/index.js.map +1 -1
  21. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  22. package/build/components/header/writing-menu/index.js.map +1 -1
  23. package/build/components/init-pattern-modal/index.js.map +1 -1
  24. package/build/components/keyboard-shortcuts/index.js +1 -36
  25. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  26. package/build/components/layout/actions-panel.js +4 -7
  27. package/build/components/layout/actions-panel.js.map +1 -1
  28. package/build/components/layout/index.js +16 -21
  29. package/build/components/layout/index.js.map +1 -1
  30. package/build/components/layout/index.native.js.map +1 -1
  31. package/build/components/meta-boxes/index.js.map +1 -1
  32. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  33. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  34. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  35. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  36. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  37. package/build/components/preferences-modal/index.js +1 -21
  38. package/build/components/preferences-modal/index.js.map +1 -1
  39. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  40. package/build/components/sidebar/plugin-post-publish-panel/index.js +16 -64
  41. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  42. package/build/components/sidebar/plugin-pre-publish-panel/index.js +16 -63
  43. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  44. package/build/components/sidebar/post-format/index.js.map +1 -1
  45. package/build/components/sidebar/post-pending-status/index.js.map +1 -1
  46. package/build/components/sidebar/post-slug/index.js.map +1 -1
  47. package/build/components/sidebar/post-status/index.js +9 -9
  48. package/build/components/sidebar/post-status/index.js.map +1 -1
  49. package/build/components/sidebar/post-sticky/index.js.map +1 -1
  50. package/build/components/sidebar/post-trash/index.js.map +1 -1
  51. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  52. package/build/components/sidebar/settings-header/index.js.map +1 -1
  53. package/build/components/sidebar/settings-sidebar/index.js +42 -40
  54. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  55. package/build/components/text-editor/index.js.map +1 -1
  56. package/build/components/visual-editor/block-inspector-button.js +1 -1
  57. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  58. package/build/components/visual-editor/header.native.js.map +1 -1
  59. package/build/components/visual-editor/index.js +4 -1
  60. package/build/components/visual-editor/index.js.map +1 -1
  61. package/build/components/visual-editor/index.native.js.map +1 -1
  62. package/build/components/visual-editor/use-padding-appender.js +62 -0
  63. package/build/components/visual-editor/use-padding-appender.js.map +1 -0
  64. package/build/components/welcome-guide/default.js.map +1 -1
  65. package/build/components/welcome-guide/image.js.map +1 -1
  66. package/build/components/welcome-guide/index.js.map +1 -1
  67. package/build/components/welcome-guide/template.js.map +1 -1
  68. package/build/editor.js +9 -4
  69. package/build/editor.js.map +1 -1
  70. package/build/editor.native.js.map +1 -1
  71. package/build/hooks/commands/use-common-commands.js +7 -24
  72. package/build/hooks/commands/use-common-commands.js.map +1 -1
  73. package/build/hooks/components/index.js.map +1 -1
  74. package/build/hooks/index.js.map +1 -1
  75. package/build/hooks/use-navigate-to-entity-record.js +36 -19
  76. package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
  77. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  78. package/build/index.js +7 -12
  79. package/build/index.js.map +1 -1
  80. package/build/index.native.js +2 -4
  81. package/build/index.native.js.map +1 -1
  82. package/build/lock-unlock.js.map +1 -1
  83. package/build/plugins/copy-content-menu-item/index.js.map +1 -1
  84. package/build/plugins/index.js.map +1 -1
  85. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
  86. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  87. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  88. package/build/store/actions.js +46 -31
  89. package/build/store/actions.js.map +1 -1
  90. package/build/store/constants.js.map +1 -1
  91. package/build/store/index.js +1 -1
  92. package/build/store/index.js.map +1 -1
  93. package/build/store/reducer.js +1 -15
  94. package/build/store/reducer.js.map +1 -1
  95. package/build/store/selectors.js +44 -24
  96. package/build/store/selectors.js.map +1 -1
  97. package/build/utils/meta-boxes.js.map +1 -1
  98. package/build-module/components/browser-url/index.js.map +1 -1
  99. package/build-module/components/editor-initialization/index.js +1 -2
  100. package/build-module/components/editor-initialization/index.js.map +1 -1
  101. package/build-module/components/editor-initialization/listener-hooks.js +2 -38
  102. package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
  103. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  104. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  105. package/build-module/components/header/index.js +4 -4
  106. package/build-module/components/header/index.js.map +1 -1
  107. package/build-module/components/header/index.native.js +1 -1
  108. package/build-module/components/header/index.native.js.map +1 -1
  109. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  110. package/build-module/components/header/more-menu/index.js +5 -4
  111. package/build-module/components/header/more-menu/index.js.map +1 -1
  112. package/build-module/components/header/post-publish-button-or-toggle.js +11 -13
  113. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  114. package/build-module/components/header/preferences-menu-item/index.js +11 -3
  115. package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
  116. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  117. package/build-module/components/header/writing-menu/index.js.map +1 -1
  118. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  119. package/build-module/components/keyboard-shortcuts/index.js +1 -36
  120. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  121. package/build-module/components/layout/actions-panel.js +4 -5
  122. package/build-module/components/layout/actions-panel.js.map +1 -1
  123. package/build-module/components/layout/index.js +15 -20
  124. package/build-module/components/layout/index.js.map +1 -1
  125. package/build-module/components/layout/index.native.js.map +1 -1
  126. package/build-module/components/meta-boxes/index.js.map +1 -1
  127. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  128. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  129. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  130. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  131. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  132. package/build-module/components/preferences-modal/index.js +1 -20
  133. package/build-module/components/preferences-modal/index.js.map +1 -1
  134. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  135. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +14 -62
  136. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  137. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +14 -61
  138. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  139. package/build-module/components/sidebar/post-format/index.js.map +1 -1
  140. package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
  141. package/build-module/components/sidebar/post-slug/index.js.map +1 -1
  142. package/build-module/components/sidebar/post-status/index.js +9 -10
  143. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  144. package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
  145. package/build-module/components/sidebar/post-trash/index.js.map +1 -1
  146. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  147. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  148. package/build-module/components/sidebar/settings-sidebar/index.js +43 -41
  149. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  150. package/build-module/components/text-editor/index.js.map +1 -1
  151. package/build-module/components/visual-editor/block-inspector-button.js +1 -1
  152. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  153. package/build-module/components/visual-editor/header.native.js.map +1 -1
  154. package/build-module/components/visual-editor/index.js +4 -1
  155. package/build-module/components/visual-editor/index.js.map +1 -1
  156. package/build-module/components/visual-editor/index.native.js.map +1 -1
  157. package/build-module/components/visual-editor/use-padding-appender.js +55 -0
  158. package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
  159. package/build-module/components/welcome-guide/default.js.map +1 -1
  160. package/build-module/components/welcome-guide/image.js.map +1 -1
  161. package/build-module/components/welcome-guide/index.js.map +1 -1
  162. package/build-module/components/welcome-guide/template.js.map +1 -1
  163. package/build-module/editor.js +9 -4
  164. package/build-module/editor.js.map +1 -1
  165. package/build-module/editor.native.js.map +1 -1
  166. package/build-module/hooks/commands/use-common-commands.js +9 -26
  167. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  168. package/build-module/hooks/components/index.js.map +1 -1
  169. package/build-module/hooks/index.js.map +1 -1
  170. package/build-module/hooks/use-navigate-to-entity-record.js +37 -20
  171. package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
  172. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  173. package/build-module/index.js +8 -8
  174. package/build-module/index.js.map +1 -1
  175. package/build-module/index.native.js +2 -4
  176. package/build-module/index.native.js.map +1 -1
  177. package/build-module/lock-unlock.js.map +1 -1
  178. package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
  179. package/build-module/plugins/index.js.map +1 -1
  180. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
  181. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  182. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  183. package/build-module/store/actions.js +38 -22
  184. package/build-module/store/actions.js.map +1 -1
  185. package/build-module/store/constants.js.map +1 -1
  186. package/build-module/store/index.js.map +1 -1
  187. package/build-module/store/reducer.js +1 -13
  188. package/build-module/store/reducer.js.map +1 -1
  189. package/build-module/store/selectors.js +42 -21
  190. package/build-module/store/selectors.js.map +1 -1
  191. package/build-module/utils/meta-boxes.js.map +1 -1
  192. package/build-style/classic-rtl.css +2 -2
  193. package/build-style/classic.css +2 -2
  194. package/build-style/style-rtl.css +12 -454
  195. package/build-style/style.css +12 -454
  196. package/package.json +32 -34
  197. package/src/classic.scss +2 -1
  198. package/src/components/editor-initialization/index.js +1 -5
  199. package/src/components/editor-initialization/listener-hooks.js +1 -40
  200. package/src/components/editor-initialization/test/listener-hooks.js +1 -96
  201. package/src/components/header/index.js +3 -4
  202. package/src/components/header/index.native.js +1 -1
  203. package/src/components/header/more-menu/index.js +3 -4
  204. package/src/components/header/post-publish-button-or-toggle.js +10 -11
  205. package/src/components/header/preferences-menu-item/index.js +9 -3
  206. package/src/components/header/style.scss +5 -3
  207. package/src/components/header/test/index.js +13 -1
  208. package/src/components/keyboard-shortcuts/index.js +3 -44
  209. package/src/components/layout/actions-panel.js +5 -4
  210. package/src/components/layout/index.js +20 -42
  211. package/src/components/meta-boxes/meta-boxes-area/style.scss +1 -1
  212. package/src/components/preferences-modal/index.js +1 -24
  213. package/src/components/sidebar/plugin-post-publish-panel/index.js +12 -67
  214. package/src/components/sidebar/plugin-pre-publish-panel/index.js +12 -66
  215. package/src/components/sidebar/post-status/index.js +6 -9
  216. package/src/components/sidebar/settings-sidebar/index.js +64 -56
  217. package/src/components/visual-editor/block-inspector-button.js +1 -1
  218. package/src/components/visual-editor/index.js +4 -0
  219. package/src/components/visual-editor/use-padding-appender.js +66 -0
  220. package/src/editor.js +14 -4
  221. package/src/hooks/commands/use-common-commands.js +13 -28
  222. package/src/hooks/use-navigate-to-entity-record.js +37 -24
  223. package/src/index.js +11 -6
  224. package/src/index.native.js +1 -4
  225. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
  226. package/src/store/actions.js +37 -24
  227. package/src/store/reducer.js +0 -13
  228. package/src/store/selectors.js +52 -36
  229. package/src/store/test/actions.js +11 -10
  230. package/src/style.scss +1 -20
  231. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -107
  232. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
  233. package/build/components/header/plugin-more-menu-item/index.js +0 -78
  234. package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
  235. package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
  236. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  237. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  238. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  239. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
  240. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  241. package/build/components/keyboard-shortcut-help-modal/index.js +0 -129
  242. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  243. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
  244. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  245. package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
  246. package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  247. package/build/components/sidebar/plugin-sidebar/index.js +0 -104
  248. package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
  249. package/build/components/sidebar/template-summary/index.js +0 -36
  250. package/build/components/sidebar/template-summary/index.js.map +0 -1
  251. package/build/components/start-page-options/index.js +0 -107
  252. package/build/components/start-page-options/index.js.map +0 -1
  253. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -100
  254. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +0 -1
  255. package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
  256. package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
  257. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
  258. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  259. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  260. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  261. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  262. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  263. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -119
  264. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  265. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
  266. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  267. package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
  268. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  269. package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
  270. package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
  271. package/build-module/components/sidebar/template-summary/index.js +0 -29
  272. package/build-module/components/sidebar/template-summary/index.js.map +0 -1
  273. package/build-module/components/start-page-options/index.js +0 -100
  274. package/build-module/components/start-page-options/index.js.map +0 -1
  275. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -108
  276. package/src/components/header/plugin-more-menu-item/index.js +0 -73
  277. package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
  278. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  279. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
  280. package/src/components/keyboard-shortcut-help-modal/index.js +0 -159
  281. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
  282. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  283. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
  284. package/src/components/sidebar/plugin-post-publish-panel/test/__snapshots__/index.js.snap +0 -39
  285. package/src/components/sidebar/plugin-post-publish-panel/test/index.js +0 -33
  286. package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
  287. package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
  288. package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
  289. package/src/components/sidebar/plugin-pre-publish-panel/test/index.js +0 -33
  290. package/src/components/sidebar/plugin-sidebar/index.js +0 -94
  291. package/src/components/sidebar/template-summary/index.js +0 -37
  292. package/src/components/sidebar/template-summary/style.scss +0 -5
  293. package/src/components/start-page-options/index.js +0 -108
  294. package/src/components/start-page-options/style.scss +0 -26
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _element = require("@wordpress/element");
9
- var _keycodes = require("@wordpress/keycodes");
10
- /**
11
- * WordPress dependencies
12
- */
13
-
14
- function KeyCombination({
15
- keyCombination,
16
- forceAriaLabel
17
- }) {
18
- const shortcut = keyCombination.modifier ? _keycodes.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
19
- const ariaLabel = keyCombination.modifier ? _keycodes.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
20
- return (0, _react.createElement)("kbd", {
21
- className: "edit-post-keyboard-shortcut-help-modal__shortcut-key-combination",
22
- "aria-label": forceAriaLabel || ariaLabel
23
- }, (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => {
24
- if (character === '+') {
25
- return (0, _react.createElement)(_element.Fragment, {
26
- key: index
27
- }, character);
28
- }
29
- return (0, _react.createElement)("kbd", {
30
- key: index,
31
- className: "edit-post-keyboard-shortcut-help-modal__shortcut-key"
32
- }, character);
33
- }));
34
- }
35
- function Shortcut({
36
- description,
37
- keyCombination,
38
- aliases = [],
39
- ariaLabel
40
- }) {
41
- return (0, _react.createElement)(_element.Fragment, null, (0, _react.createElement)("div", {
42
- className: "edit-post-keyboard-shortcut-help-modal__shortcut-description"
43
- }, description), (0, _react.createElement)("div", {
44
- className: "edit-post-keyboard-shortcut-help-modal__shortcut-term"
45
- }, (0, _react.createElement)(KeyCombination, {
46
- keyCombination: keyCombination,
47
- forceAriaLabel: ariaLabel
48
- }), aliases.map((alias, index) => (0, _react.createElement)(KeyCombination, {
49
- keyCombination: alias,
50
- forceAriaLabel: ariaLabel,
51
- key: index
52
- }))));
53
- }
54
- var _default = exports.default = Shortcut;
55
- //# sourceMappingURL=shortcut.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_element","require","_keycodes","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","displayShortcutList","character","ariaLabel","shortcutAriaLabel","_react","createElement","className","Array","isArray","map","index","Fragment","key","Shortcut","description","aliases","alias","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-post-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-post-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,SAASE,cAAcA,CAAE;EAAEC,cAAc;EAAEC;AAAe,CAAC,EAAG;EAC7D,MAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAQ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,CAAEO,KAAK,EAAEN,KAAK,KAC5B,IAAAN,MAAA,CAAAC,aAAA,EAACV,cAAc;IACdC,cAAc,EAAGoB,KAAO;IACxBnB,cAAc,EAAGK,SAAW;IAC5BU,GAAG,EAAGF;EAAO,CACb,CACA,CACE,CACJ,CAAC;AAEL;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcN,QAAQ"}
@@ -1,73 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _components = require("@wordpress/components");
9
- /**
10
- * Defines as extensibility slot for the Summary panel.
11
- */
12
-
13
- /**
14
- * WordPress dependencies
15
- */
16
-
17
- const {
18
- Fill,
19
- Slot
20
- } = (0, _components.createSlotFill)('PluginPostStatusInfo');
21
-
22
- /**
23
- * Renders a row in the Summary panel of the Document sidebar.
24
- * It should be noted that this is named and implemented around the function it serves
25
- * and not its location, which may change in future iterations.
26
- *
27
- * @param {Object} props Component properties.
28
- * @param {string} [props.className] An optional class name added to the row.
29
- * @param {Element} props.children Children to be rendered.
30
- *
31
- * @example
32
- * ```js
33
- * // Using ES5 syntax
34
- * var __ = wp.i18n.__;
35
- * var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;
36
- *
37
- * function MyPluginPostStatusInfo() {
38
- * return React.createElement(
39
- * PluginPostStatusInfo,
40
- * {
41
- * className: 'my-plugin-post-status-info',
42
- * },
43
- * __( 'My post status info' )
44
- * )
45
- * }
46
- * ```
47
- *
48
- * @example
49
- * ```jsx
50
- * // Using ESNext syntax
51
- * import { __ } from '@wordpress/i18n';
52
- * import { PluginPostStatusInfo } from '@wordpress/edit-post';
53
- *
54
- * const MyPluginPostStatusInfo = () => (
55
- * <PluginPostStatusInfo
56
- * className="my-plugin-post-status-info"
57
- * >
58
- * { __( 'My post status info' ) }
59
- * </PluginPostStatusInfo>
60
- * );
61
- * ```
62
- *
63
- * @return {Component} The component to be rendered.
64
- */
65
- const PluginPostStatusInfo = ({
66
- children,
67
- className
68
- }) => (0, _react.createElement)(Fill, null, (0, _react.createElement)(_components.PanelRow, {
69
- className: className
70
- }, children));
71
- PluginPostStatusInfo.Slot = Slot;
72
- var _default = exports.default = PluginPostStatusInfo;
73
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","Fill","Slot","createSlotFill","PluginPostStatusInfo","children","className","_react","createElement","PanelRow","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-status-info/index.js"],"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 {Element} 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 React.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 {Component} 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"],"mappings":";;;;;;;AAOA,IAAAA,WAAA,GAAAC,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;AAGA,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,sBAAuB,CAAC;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KACrD,IAAAC,MAAA,CAAAC,aAAA,EAACP,IAAI,QACJ,IAAAM,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,QAAQ;EAACH,SAAS,EAAGA;AAAW,GAAGD,QAAoB,CACnD,CACN;AAEDD,oBAAoB,CAACF,IAAI,GAAGA,IAAI;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAElBR,oBAAoB"}
@@ -1,104 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = PluginSidebarEditPost;
7
- var _react = require("react");
8
- var _interface = require("@wordpress/interface");
9
- var _data = require("@wordpress/data");
10
- var _i18n = require("@wordpress/i18n");
11
- var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
12
- var _editor = require("@wordpress/editor");
13
- /**
14
- * WordPress dependencies
15
- */
16
-
17
- /**
18
- * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
19
- * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
20
- * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
21
- *
22
- * ```js
23
- * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );
24
- * ```
25
- *
26
- * @see PluginSidebarMoreMenuItem
27
- *
28
- * @param {Object} props Element props.
29
- * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
30
- * @param {string} [props.className] An optional class name added to the sidebar body.
31
- * @param {string} props.title Title displayed at the top of the sidebar.
32
- * @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.
33
- * @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.
34
- *
35
- * @example
36
- * ```js
37
- * // Using ES5 syntax
38
- * var __ = wp.i18n.__;
39
- * var el = React.createElement;
40
- * var PanelBody = wp.components.PanelBody;
41
- * var PluginSidebar = wp.editPost.PluginSidebar;
42
- * var moreIcon = React.createElement( 'svg' ); //... svg element.
43
- *
44
- * function MyPluginSidebar() {
45
- * return el(
46
- * PluginSidebar,
47
- * {
48
- * name: 'my-sidebar',
49
- * title: 'My sidebar title',
50
- * icon: moreIcon,
51
- * },
52
- * el(
53
- * PanelBody,
54
- * {},
55
- * __( 'My sidebar content' )
56
- * )
57
- * );
58
- * }
59
- * ```
60
- *
61
- * @example
62
- * ```jsx
63
- * // Using ESNext syntax
64
- * import { __ } from '@wordpress/i18n';
65
- * import { PanelBody } from '@wordpress/components';
66
- * import { PluginSidebar } from '@wordpress/edit-post';
67
- * import { more } from '@wordpress/icons';
68
- *
69
- * const MyPluginSidebar = () => (
70
- * <PluginSidebar
71
- * name="my-sidebar"
72
- * title="My sidebar title"
73
- * icon={ more }
74
- * >
75
- * <PanelBody>
76
- * { __( 'My sidebar content' ) }
77
- * </PanelBody>
78
- * </PluginSidebar>
79
- * );
80
- * ```
81
- */
82
- function PluginSidebarEditPost({
83
- className,
84
- ...props
85
- }) {
86
- const {
87
- postTitle,
88
- shortcut
89
- } = (0, _data.useSelect)(select => {
90
- return {
91
- postTitle: select(_editor.store).getEditedPostAttribute('title'),
92
- shortcut: select(_keyboardShortcuts.store).getShortcutRepresentation('core/edit-post/toggle-sidebar')
93
- };
94
- }, []);
95
- return (0, _react.createElement)(_interface.ComplementaryArea, {
96
- panelClassName: className,
97
- className: "edit-post-sidebar",
98
- smallScreenTitle: postTitle || (0, _i18n.__)('(no title)'),
99
- scope: "core/edit-post",
100
- toggleShortcut: shortcut,
101
- ...props
102
- });
103
- }
104
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_interface","require","_data","_i18n","_keyboardShortcuts","_editor","PluginSidebarEditPost","className","props","postTitle","shortcut","useSelect","select","editorStore","getEditedPostAttribute","keyboardShortcutsStore","getShortcutRepresentation","_react","createElement","ComplementaryArea","panelClassName","smallScreenTitle","__","scope","toggleShortcut"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-sidebar/index.js"],"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 * 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 = React.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editPost.PluginSidebar;\n * var moreIcon = React.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 } = 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};\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\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,SAASK,qBAAqBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACxE,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxD,OAAO;MACNH,SAAS,EAAEG,MAAM,CAAEC,aAAY,CAAC,CAACC,sBAAsB,CAAE,OAAQ,CAAC;MAClEJ,QAAQ,EAAEE,MAAM,CACfG,wBACD,CAAC,CAACC,yBAAyB,CAAE,+BAAgC;IAC9D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAClB,UAAA,CAAAmB,iBAAiB;IACjBC,cAAc,EAAGb,SAAW;IAC5BA,SAAS,EAAC,mBAAmB;IAC7Bc,gBAAgB,EAAGZ,SAAS,IAAI,IAAAa,QAAE,EAAE,YAAa,CAAG;IACpDC,KAAK,EAAC,gBAAgB;IACtBC,cAAc,EAAGd,QAAU;IAAA,GACtBF;EAAK,CACV,CAAC;AAEJ"}
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _icons = require("@wordpress/icons");
9
- var _data = require("@wordpress/data");
10
- var _components = require("@wordpress/components");
11
- var _editor = require("@wordpress/editor");
12
- /**
13
- * WordPress dependencies
14
- */
15
-
16
- function TemplateSummary() {
17
- const template = (0, _data.useSelect)(select => {
18
- const {
19
- getCurrentPost
20
- } = select(_editor.store);
21
- return getCurrentPost();
22
- }, []);
23
- if (!template) {
24
- return null;
25
- }
26
- return (0, _react.createElement)(_components.PanelBody, null, (0, _react.createElement)(_components.Flex, {
27
- align: "flex-start",
28
- gap: "3"
29
- }, (0, _react.createElement)(_components.FlexItem, null, (0, _react.createElement)(_icons.Icon, {
30
- icon: _icons.layout
31
- })), (0, _react.createElement)(_components.FlexBlock, null, (0, _react.createElement)("h2", {
32
- className: "edit-post-template-summary__title"
33
- }, template?.title || template?.slug), (0, _react.createElement)("p", null, template?.description))));
34
- }
35
- var _default = exports.default = TemplateSummary;
36
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_icons","require","_data","_components","_editor","TemplateSummary","template","useSelect","select","getCurrentPost","editorStore","_react","createElement","PanelBody","Flex","align","gap","FlexItem","Icon","icon","layout","FlexBlock","className","title","slug","description","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/template-summary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, layout } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { Flex, FlexItem, FlexBlock, PanelBody } from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\n\nfunction TemplateSummary() {\n\tconst template = useSelect( ( select ) => {\n\t\tconst { getCurrentPost } = select( editorStore );\n\t\treturn getCurrentPost();\n\t}, [] );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody>\n\t\t\t<Flex align=\"flex-start\" gap=\"3\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Icon icon={ layout } />\n\t\t\t\t</FlexItem>\n\n\t\t\t\t<FlexBlock>\n\t\t\t\t\t<h2 className=\"edit-post-template-summary__title\">\n\t\t\t\t\t\t{ template?.title || template?.slug }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p>{ template?.description }</p>\n\t\t\t\t</FlexBlock>\n\t\t\t</Flex>\n\t\t</PanelBody>\n\t);\n}\n\nexport default TemplateSummary;\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA,SAASI,eAAeA,CAAA,EAAG;EAC1B,MAAMC,QAAQ,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzC,MAAM;MAAEC;IAAe,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IAChD,OAAOD,cAAc,CAAC,CAAC;EACxB,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEH,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAK,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,SAAS,QACT,IAAAF,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAW,IAAI;IAACC,KAAK,EAAC,YAAY;IAACC,GAAG,EAAC;EAAG,GAC/B,IAAAL,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAc,QAAQ,QACR,IAAAN,MAAA,CAAAC,aAAA,EAACZ,MAAA,CAAAkB,IAAI;IAACC,IAAI,EAAGC;EAAQ,CAAE,CACd,CAAC,EAEX,IAAAT,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAkB,SAAS,QACT,IAAAV,MAAA,CAAAC,aAAA;IAAIU,SAAS,EAAC;EAAmC,GAC9ChB,QAAQ,EAAEiB,KAAK,IAAIjB,QAAQ,EAAEkB,IAC5B,CAAC,EACL,IAAAb,MAAA,CAAAC,aAAA,aAAKN,QAAQ,EAAEmB,WAAgB,CACrB,CACN,CACI,CAAC;AAEd;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcvB,eAAe"}
@@ -1,107 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = StartPageOptions;
7
- var _react = require("react");
8
- var _components = require("@wordpress/components");
9
- var _i18n = require("@wordpress/i18n");
10
- var _element = require("@wordpress/element");
11
- var _blockEditor = require("@wordpress/block-editor");
12
- var _data = require("@wordpress/data");
13
- var _compose = require("@wordpress/compose");
14
- var _editor = require("@wordpress/editor");
15
- var _store = require("../../store");
16
- /**
17
- * WordPress dependencies
18
- */
19
-
20
- /**
21
- * Internal dependencies
22
- */
23
-
24
- function useStartPatterns() {
25
- // A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,
26
- // and it has no postTypes declared and the current post type is page or if
27
- // the current post type is part of the postTypes declared.
28
- const {
29
- blockPatternsWithPostContentBlockType,
30
- postType
31
- } = (0, _data.useSelect)(select => {
32
- const {
33
- getPatternsByBlockTypes
34
- } = select(_blockEditor.store);
35
- const {
36
- getCurrentPostType
37
- } = select(_editor.store);
38
- return {
39
- blockPatternsWithPostContentBlockType: getPatternsByBlockTypes('core/post-content'),
40
- postType: getCurrentPostType()
41
- };
42
- }, []);
43
- return (0, _element.useMemo)(() => {
44
- // filter patterns without postTypes declared if the current postType is page
45
- // or patterns that declare the current postType in its post type array.
46
- return blockPatternsWithPostContentBlockType.filter(pattern => {
47
- return postType === 'page' && !pattern.postTypes || Array.isArray(pattern.postTypes) && pattern.postTypes.includes(postType);
48
- });
49
- }, [postType, blockPatternsWithPostContentBlockType]);
50
- }
51
- function PatternSelection({
52
- blockPatterns,
53
- onChoosePattern
54
- }) {
55
- const shownBlockPatterns = (0, _compose.useAsyncList)(blockPatterns);
56
- const {
57
- resetEditorBlocks
58
- } = (0, _data.useDispatch)(_editor.store);
59
- return (0, _react.createElement)(_blockEditor.__experimentalBlockPatternsList, {
60
- blockPatterns: blockPatterns,
61
- shownPatterns: shownBlockPatterns,
62
- onClickPattern: (_pattern, blocks) => {
63
- resetEditorBlocks(blocks);
64
- onChoosePattern();
65
- }
66
- });
67
- }
68
- function StartPageOptionsModal({
69
- onClose
70
- }) {
71
- const startPatterns = useStartPatterns();
72
- const hasStartPattern = startPatterns.length > 0;
73
- if (!hasStartPattern) {
74
- return null;
75
- }
76
- return (0, _react.createElement)(_components.Modal, {
77
- className: "edit-post-start-page-options__modal",
78
- title: (0, _i18n.__)('Choose a pattern'),
79
- isFullScreen: true,
80
- onRequestClose: onClose
81
- }, (0, _react.createElement)("div", {
82
- className: "edit-post-start-page-options__modal-content"
83
- }, (0, _react.createElement)(PatternSelection, {
84
- blockPatterns: startPatterns,
85
- onChoosePattern: onClose
86
- })));
87
- }
88
- function StartPageOptions() {
89
- const [isClosed, setIsClosed] = (0, _element.useState)(false);
90
- const shouldEnableModal = (0, _data.useSelect)(select => {
91
- const {
92
- isCleanNewPost,
93
- getRenderingMode
94
- } = select(_editor.store);
95
- const {
96
- isFeatureActive
97
- } = select(_store.store);
98
- return getRenderingMode() === 'post-only' && !isFeatureActive('welcomeGuide') && isCleanNewPost();
99
- }, []);
100
- if (!shouldEnableModal || isClosed) {
101
- return null;
102
- }
103
- return (0, _react.createElement)(StartPageOptionsModal, {
104
- onClose: () => setIsClosed(true)
105
- });
106
- }
107
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_i18n","_element","_blockEditor","_data","_compose","_editor","_store","useStartPatterns","blockPatternsWithPostContentBlockType","postType","useSelect","select","getPatternsByBlockTypes","blockEditorStore","getCurrentPostType","editorStore","useMemo","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","blockPatterns","onChoosePattern","shownBlockPatterns","useAsyncList","resetEditorBlocks","useDispatch","_react","createElement","__experimentalBlockPatternsList","shownPatterns","onClickPattern","_pattern","blocks","StartPageOptionsModal","onClose","startPatterns","hasStartPattern","length","Modal","className","title","__","isFullScreen","onRequestClose","StartPageOptions","isClosed","setIsClosed","useState","shouldEnableModal","isCleanNewPost","getRenderingMode","isFeatureActive","editPostStore"],"sources":["@wordpress/edit-post/src/components/start-page-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declared and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes } = select( blockEditorStore );\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType:\n\t\t\t\t\tgetPatternsByBlockTypes( 'core/post-content' ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { blockPatterns, onChoosePattern } ) {\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { resetEditorBlocks } = useDispatch( editorStore );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartPageOptionsModal( { onClose } ) {\n\tconst startPatterns = useStartPatterns();\n\tconst hasStartPattern = startPatterns.length > 0;\n\n\tif ( ! hasStartPattern ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen\n\t\t\tonRequestClose={ onClose }\n\t\t>\n\t\t\t<div className=\"edit-post-start-page-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tblockPatterns={ startPatterns }\n\t\t\t\t\tonChoosePattern={ onClose }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n\nexport default function StartPageOptions() {\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst shouldEnableModal = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost, getRenderingMode } = select( editorStore );\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn (\n\t\t\tgetRenderingMode() === 'post-only' &&\n\t\t\t! isFeatureActive( 'welcomeGuide' ) &&\n\t\t\tisCleanNewPost()\n\t\t);\n\t}, [] );\n\n\tif ( ! shouldEnableModal || isClosed ) {\n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AAY,CAAC;IAClE,MAAM;MAAEwC;IAAgB,CAAC,GAAG5C,MAAM,CAAE6C,YAAc,CAAC;IAEnD,OACCF,gBAAgB,CAAC,CAAC,KAAK,WAAW,IAClC,CAAEC,eAAe,CAAE,cAAe,CAAC,IACnCF,cAAc,CAAC,CAAC;EAElB,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAED,iBAAiB,IAAIH,QAAQ,EAAG;IACtC,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAnB,MAAA,CAAAC,aAAA,EAACM,qBAAqB;IAACC,OAAO,EAAGA,CAAA,KAAMY,WAAW,CAAE,IAAK;EAAG,CAAE,CAAC;AACvE"}
@@ -1,100 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { BlockSettingsMenuControls } from '@wordpress/block-editor';
6
- import { MenuItem } from '@wordpress/components';
7
- import { compose } from '@wordpress/compose';
8
- const isEverySelectedBlockAllowed = (selected, allowed) => selected.filter(id => !allowed.includes(id)).length === 0;
9
-
10
- /**
11
- * Plugins may want to add an item to the menu either for every block
12
- * or only for the specific ones provided in the `allowedBlocks` component property.
13
- *
14
- * If there are multiple blocks selected the item will be rendered if every block
15
- * is of one allowed type (not necessarily the same).
16
- *
17
- * @param {string[]} selectedBlocks Array containing the names of the blocks selected
18
- * @param {string[]} allowedBlocks Array containing the names of the blocks allowed
19
- * @return {boolean} Whether the item will be rendered or not.
20
- */
21
- const shouldRenderItem = (selectedBlocks, allowedBlocks) => !Array.isArray(allowedBlocks) || isEverySelectedBlockAllowed(selectedBlocks, allowedBlocks);
22
-
23
- /**
24
- * Renders a new item in the block settings menu.
25
- *
26
- * @param {Object} props Component props.
27
- * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.
28
- * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.
29
- * @param {string} props.label The menu item text.
30
- * @param {Function} props.onClick Callback function to be executed when the user click the menu item.
31
- * @param {boolean} [props.small] Whether to render the label or not.
32
- * @param {string} [props.role] The ARIA role for the menu item.
33
- *
34
- * @example
35
- * ```js
36
- * // Using ES5 syntax
37
- * var __ = wp.i18n.__;
38
- * var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem;
39
- *
40
- * function doOnClick(){
41
- * // To be called when the user clicks the menu item.
42
- * }
43
- *
44
- * function MyPluginBlockSettingsMenuItem() {
45
- * return React.createElement(
46
- * PluginBlockSettingsMenuItem,
47
- * {
48
- * allowedBlocks: [ 'core/paragraph' ],
49
- * icon: 'dashicon-name',
50
- * label: __( 'Menu item text' ),
51
- * onClick: doOnClick,
52
- * }
53
- * );
54
- * }
55
- * ```
56
- *
57
- * @example
58
- * ```jsx
59
- * // Using ESNext syntax
60
- * import { __ } from '@wordpress/i18n';
61
- * import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';
62
- *
63
- * const doOnClick = ( ) => {
64
- * // To be called when the user clicks the menu item.
65
- * };
66
- *
67
- * const MyPluginBlockSettingsMenuItem = () => (
68
- * <PluginBlockSettingsMenuItem
69
- * allowedBlocks={ [ 'core/paragraph' ] }
70
- * icon='dashicon-name'
71
- * label={ __( 'Menu item text' ) }
72
- * onClick={ doOnClick } />
73
- * );
74
- * ```
75
- *
76
- * @return {Component} The component to be rendered.
77
- */
78
- const PluginBlockSettingsMenuItem = ({
79
- allowedBlocks,
80
- icon,
81
- label,
82
- onClick,
83
- small,
84
- role
85
- }) => createElement(BlockSettingsMenuControls, null, ({
86
- selectedBlocks,
87
- onClose
88
- }) => {
89
- if (!shouldRenderItem(selectedBlocks, allowedBlocks)) {
90
- return null;
91
- }
92
- return createElement(MenuItem, {
93
- onClick: compose(onClick, onClose),
94
- icon: icon,
95
- label: small ? label : undefined,
96
- role: role
97
- }, !small && label);
98
- });
99
- export default PluginBlockSettingsMenuItem;
100
- //# sourceMappingURL=plugin-block-settings-menu-item.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["BlockSettingsMenuControls","MenuItem","compose","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","createElement","onClose","undefined"],"sources":["@wordpress/edit-post/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editPost.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/edit-post';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,yBAAyB,QAAQ,yBAAyB;AACnE,SA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AAC;AAEb,CAC0B,CAC3B;AAED,eAAeF,2BAA2B"}
@@ -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"}