@wordpress/edit-post 7.25.0 → 7.26.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 (199) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/browser-url/index.js +3 -2
  4. package/build/components/browser-url/index.js.map +1 -1
  5. package/build/components/header/index.js +25 -25
  6. package/build/components/header/index.js.map +1 -1
  7. package/build/components/header/writing-menu/index.js +11 -8
  8. package/build/components/header/writing-menu/index.js.map +1 -1
  9. package/build/components/keyboard-shortcuts/index.js +1 -20
  10. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  11. package/build/components/layout/index.js +33 -26
  12. package/build/components/layout/index.js.map +1 -1
  13. package/build/components/layout/index.native.js +3 -1
  14. package/build/components/layout/index.native.js.map +1 -1
  15. package/build/components/meta-boxes/meta-box-visibility.js +2 -6
  16. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  17. package/build/components/preferences-modal/index.js +25 -8
  18. package/build/components/preferences-modal/index.js.map +1 -1
  19. package/build/components/preferences-modal/options/enable-feature.js +23 -23
  20. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  21. package/build/components/preferences-modal/options/enable-panel.js +3 -6
  22. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  23. package/build/components/sidebar/plugin-document-setting-panel/index.js +3 -3
  24. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  25. package/build/components/sidebar/plugin-sidebar/index.js +2 -10
  26. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  27. package/build/components/sidebar/post-status/index.js +2 -3
  28. package/build/components/sidebar/post-status/index.js.map +1 -1
  29. package/build/components/sidebar/settings-sidebar/index.js +1 -7
  30. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  31. package/build/editor.js +19 -28
  32. package/build/editor.js.map +1 -1
  33. package/build/editor.native.js +3 -10
  34. package/build/editor.native.js.map +1 -1
  35. package/build/hooks/commands/use-common-commands.js +16 -12
  36. package/build/hooks/commands/use-common-commands.js.map +1 -1
  37. package/build/hooks/use-post-history.js +79 -0
  38. package/build/hooks/use-post-history.js.map +1 -0
  39. package/build/index.js +19 -16
  40. package/build/index.js.map +1 -1
  41. package/build/index.native.js +7 -1
  42. package/build/index.native.js.map +1 -1
  43. package/build/store/actions.js +59 -73
  44. package/build/store/actions.js.map +1 -1
  45. package/build/store/reducer.js +1 -62
  46. package/build/store/reducer.js.map +1 -1
  47. package/build/store/selectors.js +66 -38
  48. package/build/store/selectors.js.map +1 -1
  49. package/build-module/components/browser-url/index.js +3 -2
  50. package/build-module/components/browser-url/index.js.map +1 -1
  51. package/build-module/components/header/index.js +25 -25
  52. package/build-module/components/header/index.js.map +1 -1
  53. package/build-module/components/header/writing-menu/index.js +11 -8
  54. package/build-module/components/header/writing-menu/index.js.map +1 -1
  55. package/build-module/components/keyboard-shortcuts/index.js +1 -20
  56. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  57. package/build-module/components/layout/index.js +33 -25
  58. package/build-module/components/layout/index.js.map +1 -1
  59. package/build-module/components/layout/index.native.js +4 -2
  60. package/build-module/components/layout/index.native.js.map +1 -1
  61. package/build-module/components/meta-boxes/meta-box-visibility.js +2 -6
  62. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  63. package/build-module/components/preferences-modal/index.js +25 -8
  64. package/build-module/components/preferences-modal/index.js.map +1 -1
  65. package/build-module/components/preferences-modal/options/enable-feature.js +22 -23
  66. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  67. package/build-module/components/preferences-modal/options/enable-panel.js +3 -7
  68. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  69. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +3 -3
  70. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  71. package/build-module/components/sidebar/plugin-sidebar/index.js +2 -10
  72. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  73. package/build-module/components/sidebar/post-status/index.js +3 -4
  74. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  75. package/build-module/components/sidebar/settings-sidebar/index.js +2 -8
  76. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  77. package/build-module/editor.js +19 -28
  78. package/build-module/editor.js.map +1 -1
  79. package/build-module/editor.native.js +3 -10
  80. package/build-module/editor.native.js.map +1 -1
  81. package/build-module/hooks/commands/use-common-commands.js +16 -12
  82. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  83. package/build-module/hooks/use-post-history.js +73 -0
  84. package/build-module/hooks/use-post-history.js.map +1 -0
  85. package/build-module/index.js +17 -11
  86. package/build-module/index.js.map +1 -1
  87. package/build-module/index.native.js +7 -1
  88. package/build-module/index.native.js.map +1 -1
  89. package/build-module/store/actions.js +55 -69
  90. package/build-module/store/actions.js.map +1 -1
  91. package/build-module/store/reducer.js +1 -60
  92. package/build-module/store/reducer.js.map +1 -1
  93. package/build-module/store/selectors.js +58 -29
  94. package/build-module/store/selectors.js.map +1 -1
  95. package/build-style/style-rtl.css +13 -284
  96. package/build-style/style.css +13 -284
  97. package/package.json +32 -32
  98. package/src/components/browser-url/index.js +4 -2
  99. package/src/components/header/index.js +24 -40
  100. package/src/components/header/style.scss +3 -3
  101. package/src/components/header/writing-menu/index.js +10 -8
  102. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -15
  103. package/src/components/keyboard-shortcuts/index.js +1 -23
  104. package/src/components/layout/index.js +18 -27
  105. package/src/components/layout/index.native.js +9 -1
  106. package/src/components/meta-boxes/meta-box-visibility.js +2 -8
  107. package/src/components/preferences-modal/index.js +27 -9
  108. package/src/components/preferences-modal/options/enable-feature.js +26 -21
  109. package/src/components/preferences-modal/options/enable-panel.js +3 -7
  110. package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +187 -175
  111. package/src/components/sidebar/plugin-document-setting-panel/index.js +3 -3
  112. package/src/components/sidebar/plugin-sidebar/index.js +1 -9
  113. package/src/components/sidebar/post-status/index.js +3 -3
  114. package/src/components/sidebar/settings-sidebar/index.js +15 -13
  115. package/src/components/text-editor/style.scss +0 -6
  116. package/src/editor.js +34 -33
  117. package/src/editor.native.js +2 -17
  118. package/src/hooks/commands/use-common-commands.js +14 -16
  119. package/src/hooks/use-post-history.js +73 -0
  120. package/src/index.js +22 -12
  121. package/src/index.native.js +8 -1
  122. package/src/store/actions.js +48 -85
  123. package/src/store/reducer.js +0 -60
  124. package/src/store/selectors.js +74 -46
  125. package/src/store/test/actions.js +10 -103
  126. package/src/store/test/reducer.js +1 -108
  127. package/src/store/test/selectors.js +0 -50
  128. package/src/style.scss +1 -5
  129. package/src/test/editor.native.js +17 -0
  130. package/build/components/header/header-toolbar/index.js +0 -160
  131. package/build/components/header/header-toolbar/index.js.map +0 -1
  132. package/build/components/secondary-sidebar/inserter-sidebar.js +0 -73
  133. package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  134. package/build/components/secondary-sidebar/list-view-outline.js +0 -112
  135. package/build/components/secondary-sidebar/list-view-outline.js.map +0 -1
  136. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -148
  137. package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  138. package/build/components/sidebar/discussion-panel/index.js +0 -59
  139. package/build/components/sidebar/discussion-panel/index.js.map +0 -1
  140. package/build/components/sidebar/featured-image/index.js +0 -70
  141. package/build/components/sidebar/featured-image/index.js.map +0 -1
  142. package/build/components/sidebar/last-revision/index.js +0 -21
  143. package/build/components/sidebar/last-revision/index.js.map +0 -1
  144. package/build/components/sidebar/page-attributes/index.js +0 -65
  145. package/build/components/sidebar/page-attributes/index.js.map +0 -1
  146. package/build/components/sidebar/plugin-post-excerpt/index.js +0 -72
  147. package/build/components/sidebar/plugin-post-excerpt/index.js.map +0 -1
  148. package/build/components/sidebar/post-excerpt/index.js +0 -54
  149. package/build/components/sidebar/post-excerpt/index.js.map +0 -1
  150. package/build/components/sidebar/post-taxonomies/index.js +0 -30
  151. package/build/components/sidebar/post-taxonomies/index.js.map +0 -1
  152. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -56
  153. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +0 -1
  154. package/build/components/view-link/index.js +0 -53
  155. package/build/components/view-link/index.js.map +0 -1
  156. package/build-module/components/header/header-toolbar/index.js +0 -152
  157. package/build-module/components/header/header-toolbar/index.js.map +0 -1
  158. package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -66
  159. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  160. package/build-module/components/secondary-sidebar/list-view-outline.js +0 -105
  161. package/build-module/components/secondary-sidebar/list-view-outline.js.map +0 -1
  162. package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -140
  163. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  164. package/build-module/components/sidebar/discussion-panel/index.js +0 -52
  165. package/build-module/components/sidebar/discussion-panel/index.js.map +0 -1
  166. package/build-module/components/sidebar/featured-image/index.js +0 -63
  167. package/build-module/components/sidebar/featured-image/index.js.map +0 -1
  168. package/build-module/components/sidebar/last-revision/index.js +0 -13
  169. package/build-module/components/sidebar/last-revision/index.js.map +0 -1
  170. package/build-module/components/sidebar/page-attributes/index.js +0 -57
  171. package/build-module/components/sidebar/page-attributes/index.js.map +0 -1
  172. package/build-module/components/sidebar/plugin-post-excerpt/index.js +0 -64
  173. package/build-module/components/sidebar/plugin-post-excerpt/index.js.map +0 -1
  174. package/build-module/components/sidebar/post-excerpt/index.js +0 -47
  175. package/build-module/components/sidebar/post-excerpt/index.js.map +0 -1
  176. package/build-module/components/sidebar/post-taxonomies/index.js +0 -21
  177. package/build-module/components/sidebar/post-taxonomies/index.js.map +0 -1
  178. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -48
  179. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +0 -1
  180. package/build-module/components/view-link/index.js +0 -46
  181. package/build-module/components/view-link/index.js.map +0 -1
  182. package/src/components/header/header-toolbar/index.js +0 -186
  183. package/src/components/header/header-toolbar/style.scss +0 -116
  184. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +0 -929
  185. package/src/components/secondary-sidebar/inserter-sidebar.js +0 -71
  186. package/src/components/secondary-sidebar/list-view-outline.js +0 -98
  187. package/src/components/secondary-sidebar/list-view-sidebar.js +0 -170
  188. package/src/components/secondary-sidebar/style.scss +0 -120
  189. package/src/components/sidebar/discussion-panel/index.js +0 -62
  190. package/src/components/sidebar/featured-image/index.js +0 -67
  191. package/src/components/sidebar/last-revision/index.js +0 -17
  192. package/src/components/sidebar/last-revision/style.scss +0 -10
  193. package/src/components/sidebar/page-attributes/index.js +0 -65
  194. package/src/components/sidebar/plugin-post-excerpt/index.js +0 -61
  195. package/src/components/sidebar/plugin-post-excerpt/test/index.js +0 -36
  196. package/src/components/sidebar/post-excerpt/index.js +0 -59
  197. package/src/components/sidebar/post-taxonomies/index.js +0 -30
  198. package/src/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -48
  199. package/src/components/view-link/index.js +0 -48
@@ -1 +0,0 @@
1
- {"version":3,"names":["_i18n","require","_components","_editor","_data","_store","PANEL_NAME","DiscussionPanel","isEnabled","isOpened","useSelect","select","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","toggleEditorPanelOpened","useDispatch","_react","createElement","PostTypeSupportCheck","supportKeys","PanelBody","title","__","opened","onToggle","PanelRow","PostComments","PostPingbacks","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/discussion-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPostComments,\n\tPostPingbacks,\n\tPostTypeSupportCheck,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'discussion-panel';\n\nfunction DiscussionPanel() {\n\tconst { isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</PanelBody>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default DiscussionPanel;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMK,UAAU,GAAG,kBAAkB;AAErC,SAASC,eAAeA,CAAA,EAAG;EAC1B,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxD,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEG,YAAc,CAAC;IACxB,OAAO;MACNN,SAAS,EAAEI,oBAAoB,CAAEN,UAAW,CAAC;MAC7CG,QAAQ,EAAEI,mBAAmB,CAAEP,UAAW;IAC3C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAES;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,YAAc,CAAC;EAEhE,IAAK,CAAEN,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAgB,oBAAoB;IAACC,WAAW,EAAG,CAAE,UAAU,EAAE,YAAY;EAAI,GACjE,IAAAH,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAmB,SAAS;IACTC,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa,CAAG;IAC5BC,MAAM,EAAGf,QAAU;IACnBgB,QAAQ,EAAGA,CAAA,KAAMV,uBAAuB,CAAET,UAAW;EAAG,GAExD,IAAAW,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAgB,oBAAoB;IAACC,WAAW,EAAC;EAAU,GAC3C,IAAAH,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAwB,QAAQ,QACR,IAAAT,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAwB,YAAY,MAAE,CACN,CACW,CAAC,EAEvB,IAAAV,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAgB,oBAAoB;IAACC,WAAW,EAAC;EAAY,GAC7C,IAAAH,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAwB,QAAQ,QACR,IAAAT,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAyB,aAAa,MAAE,CACP,CACW,CACZ,CACU,CAAC;AAEzB;AAAC,IAAAC,QAAA,GAEctB,eAAe;AAAAuB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -1,70 +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 _i18n = require("@wordpress/i18n");
9
- var _components = require("@wordpress/components");
10
- var _editor = require("@wordpress/editor");
11
- var _compose = require("@wordpress/compose");
12
- var _data = require("@wordpress/data");
13
- var _coreData = require("@wordpress/core-data");
14
- var _store = require("../../../store");
15
- /**
16
- * WordPress dependencies
17
- */
18
-
19
- /**
20
- * Internal dependencies
21
- */
22
-
23
- /**
24
- * Module Constants
25
- */
26
- const PANEL_NAME = 'featured-image';
27
- function FeaturedImage({
28
- isEnabled,
29
- isOpened,
30
- postType,
31
- onTogglePanel
32
- }) {
33
- var _postType$labels$feat;
34
- if (!isEnabled) {
35
- return null;
36
- }
37
- return (0, _react.createElement)(_editor.PostFeaturedImageCheck, null, (0, _react.createElement)(_components.PanelBody, {
38
- title: (_postType$labels$feat = postType?.labels?.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : (0, _i18n.__)('Featured image'),
39
- opened: isOpened,
40
- onToggle: onTogglePanel
41
- }, (0, _react.createElement)(_editor.PostFeaturedImage, null)));
42
- }
43
- const applyWithSelect = (0, _data.withSelect)(select => {
44
- const {
45
- getEditedPostAttribute
46
- } = select(_editor.store);
47
- const {
48
- getPostType
49
- } = select(_coreData.store);
50
- const {
51
- isEditorPanelEnabled,
52
- isEditorPanelOpened
53
- } = select(_store.store);
54
- return {
55
- postType: getPostType(getEditedPostAttribute('type')),
56
- isEnabled: isEditorPanelEnabled(PANEL_NAME),
57
- isOpened: isEditorPanelOpened(PANEL_NAME)
58
- };
59
- });
60
- const applyWithDispatch = (0, _data.withDispatch)(dispatch => {
61
- const {
62
- toggleEditorPanelOpened
63
- } = dispatch(_store.store);
64
- return {
65
- onTogglePanel: (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args)
66
- };
67
- });
68
- var _default = (0, _compose.compose)(applyWithSelect, applyWithDispatch)(FeaturedImage);
69
- exports.default = _default;
70
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_i18n","require","_components","_editor","_compose","_data","_coreData","_store","PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","_postType$labels$feat","_react","createElement","PostFeaturedImageCheck","PanelBody","title","labels","featured_image","__","opened","onToggle","PostFeaturedImage","applyWithSelect","withSelect","select","getEditedPostAttribute","editorStore","getPostType","coreStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","applyWithDispatch","withDispatch","dispatch","toggleEditorPanelOpened","args","_default","compose","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/featured-image/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPostFeaturedImage,\n\tPostFeaturedImageCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'featured-image';\n\nfunction FeaturedImage( { isEnabled, isOpened, postType, onTogglePanel } ) {\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getEditedPostAttribute } = select( editorStore );\n\tconst { getPostType } = select( coreStore );\n\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\tselect( editPostStore );\n\n\treturn {\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t};\n} );\n\nconst applyWithDispatch = withDispatch( ( dispatch ) => {\n\tconst { toggleEditorPanelOpened } = dispatch( editPostStore );\n\n\treturn {\n\t\tonTogglePanel: ( ...args ) =>\n\t\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args ),\n\t};\n} );\n\nexport default compose( applyWithSelect, applyWithDispatch )( FeaturedImage );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMO,UAAU,GAAG,gBAAgB;AAEnC,SAASC,aAAaA,CAAE;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC;AAAc,CAAC,EAAG;EAAA,IAAAC,qBAAA;EAC1E,IAAK,CAAEJ,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAK,MAAA,CAAAC,aAAA,EAACb,OAAA,CAAAc,sBAAsB,QACtB,IAAAF,MAAA,CAAAC,aAAA,EAACd,WAAA,CAAAgB,SAAS;IACTC,KAAK,GAAAL,qBAAA,GACJF,QAAQ,EAAEQ,MAAM,EAAEC,cAAc,cAAAP,qBAAA,cAAAA,qBAAA,GAAI,IAAAQ,QAAE,EAAE,gBAAiB,CACzD;IACDC,MAAM,EAAGZ,QAAU;IACnBa,QAAQ,EAAGX;EAAe,GAE1B,IAAAE,MAAA,CAAAC,aAAA,EAACb,OAAA,CAAAsB,iBAAiB,MAAE,CACV,CACY,CAAC;AAE3B;AAEA,MAAMC,eAAe,GAAG,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACjD,MAAM;IAAEC;EAAuB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;EACxD,MAAM;IAAEC;EAAY,CAAC,GAAGH,MAAM,CAAEI,eAAU,CAAC;EAC3C,MAAM;IAAEC,oBAAoB;IAAEC;EAAoB,CAAC,GAClDN,MAAM,CAAEO,YAAc,CAAC;EAExB,OAAO;IACNvB,QAAQ,EAAEmB,WAAW,CAAEF,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDnB,SAAS,EAAEuB,oBAAoB,CAAEzB,UAAW,CAAC;IAC7CG,QAAQ,EAAEuB,mBAAmB,CAAE1B,UAAW;EAC3C,CAAC;AACF,CAAE,CAAC;AAEH,MAAM4B,iBAAiB,GAAG,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EACvD,MAAM;IAAEC;EAAwB,CAAC,GAAGD,QAAQ,CAAEH,YAAc,CAAC;EAE7D,OAAO;IACNtB,aAAa,EAAEA,CAAE,GAAG2B,IAAI,KACvBD,uBAAuB,CAAE/B,UAAU,EAAE,GAAGgC,IAAK;EAC/C,CAAC;AACF,CAAE,CAAC;AAAC,IAAAC,QAAA,GAEW,IAAAC,gBAAO,EAAEhB,eAAe,EAAEU,iBAAkB,CAAC,CAAE3B,aAAc,CAAC;AAAAkC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
@@ -1,21 +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
- var _editor = require("@wordpress/editor");
10
- /**
11
- * WordPress dependencies
12
- */
13
-
14
- function LastRevision() {
15
- return (0, _react.createElement)(_editor.PostLastRevisionCheck, null, (0, _react.createElement)(_components.PanelBody, {
16
- className: "edit-post-last-revision__panel"
17
- }, (0, _react.createElement)(_editor.PostLastRevision, null)));
18
- }
19
- var _default = LastRevision;
20
- exports.default = _default;
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_editor","LastRevision","_react","createElement","PostLastRevisionCheck","PanelBody","className","PostLastRevision","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/last-revision/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { PostLastRevision, PostLastRevisionCheck } from '@wordpress/editor';\n\nfunction LastRevision() {\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<PanelBody className=\"edit-post-last-revision__panel\">\n\t\t\t\t<PostLastRevision />\n\t\t\t</PanelBody>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default LastRevision;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,SAASE,YAAYA,CAAA,EAAG;EACvB,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACH,OAAA,CAAAI,qBAAqB,QACrB,IAAAF,MAAA,CAAAC,aAAA,EAACL,WAAA,CAAAO,SAAS;IAACC,SAAS,EAAC;EAAgC,GACpD,IAAAJ,MAAA,CAAAC,aAAA,EAACH,OAAA,CAAAO,gBAAgB,MAAE,CACT,CACW,CAAC;AAE1B;AAAC,IAAAC,QAAA,GAEcP,YAAY;AAAAQ,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PageAttributes = PageAttributes;
7
- exports.default = void 0;
8
- var _react = require("react");
9
- var _i18n = require("@wordpress/i18n");
10
- var _components = require("@wordpress/components");
11
- var _editor = require("@wordpress/editor");
12
- var _data = require("@wordpress/data");
13
- var _coreData = require("@wordpress/core-data");
14
- var _store = require("../../../store");
15
- /**
16
- * WordPress dependencies
17
- */
18
-
19
- /**
20
- * Internal dependencies
21
- */
22
-
23
- /**
24
- * Module Constants
25
- */
26
- const PANEL_NAME = 'page-attributes';
27
- function PageAttributes() {
28
- var _postType$labels$attr;
29
- const {
30
- isEnabled,
31
- isOpened,
32
- postType
33
- } = (0, _data.useSelect)(select => {
34
- const {
35
- getEditedPostAttribute
36
- } = select(_editor.store);
37
- const {
38
- isEditorPanelEnabled,
39
- isEditorPanelOpened
40
- } = select(_store.store);
41
- const {
42
- getPostType
43
- } = select(_coreData.store);
44
- return {
45
- isEnabled: isEditorPanelEnabled(PANEL_NAME),
46
- isOpened: isEditorPanelOpened(PANEL_NAME),
47
- postType: getPostType(getEditedPostAttribute('type'))
48
- };
49
- }, []);
50
- const {
51
- toggleEditorPanelOpened
52
- } = (0, _data.useDispatch)(_store.store);
53
- if (!isEnabled || !postType) {
54
- return null;
55
- }
56
- const onTogglePanel = (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args);
57
- return (0, _react.createElement)(_editor.PageAttributesCheck, null, (0, _react.createElement)(_components.PanelBody, {
58
- title: (_postType$labels$attr = postType?.labels?.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : (0, _i18n.__)('Page attributes'),
59
- opened: isOpened,
60
- onToggle: onTogglePanel
61
- }, (0, _react.createElement)(_editor.PageAttributesParent, null), (0, _react.createElement)(_components.PanelRow, null, (0, _react.createElement)(_editor.PageAttributesOrder, null))));
62
- }
63
- var _default = PageAttributes;
64
- exports.default = _default;
65
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_i18n","require","_components","_editor","_data","_coreData","_store","PANEL_NAME","PageAttributes","_postType$labels$attr","isEnabled","isOpened","postType","useSelect","select","getEditedPostAttribute","editorStore","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","getPostType","coreStore","toggleEditorPanelOpened","useDispatch","onTogglePanel","args","_react","createElement","PageAttributesCheck","PanelBody","title","labels","attributes","__","opened","onToggle","PageAttributesParent","PanelRow","PageAttributesOrder","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/page-attributes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tstore as editorStore,\n\tPageAttributesCheck,\n\tPageAttributesOrder,\n\tPageAttributesParent,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'page-attributes';\n\nexport function PageAttributes() {\n\tconst { isEnabled, isOpened, postType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled || ! postType ) {\n\t\treturn null;\n\t}\n\n\tconst onTogglePanel = ( ...args ) =>\n\t\ttoggleEditorPanelOpened( PANEL_NAME, ...args );\n\n\treturn (\n\t\t<PageAttributesCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.attributes ?? __( 'Page attributes' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ onTogglePanel }\n\t\t\t>\n\t\t\t\t<PageAttributesParent />\n\t\t\t\t<PanelRow>\n\t\t\t\t\t<PageAttributesOrder />\n\t\t\t\t</PanelRow>\n\t\t\t</PanelBody>\n\t\t</PageAttributesCheck>\n\t);\n}\n\nexport default PageAttributes;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;AACA,MAAMM,UAAU,GAAG,iBAAiB;AAE7B,SAASC,cAAcA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EAChC,MAAM;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAClE,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IACxD,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDJ,MAAM,CAAEK,YAAc,CAAC;IACxB,MAAM;MAAEC;IAAY,CAAC,GAAGN,MAAM,CAAEO,eAAU,CAAC;IAC3C,OAAO;MACNX,SAAS,EAAEO,oBAAoB,CAAEV,UAAW,CAAC;MAC7CI,QAAQ,EAAEO,mBAAmB,CAAEX,UAAW,CAAC;MAC3CK,QAAQ,EAAEQ,WAAW,CAAEL,sBAAsB,CAAE,MAAO,CAAE;IACzD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEO;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEJ,YAAc,CAAC;EAEhE,IAAK,CAAET,SAAS,IAAI,CAAEE,QAAQ,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,MAAMY,aAAa,GAAGA,CAAE,GAAGC,IAAI,KAC9BH,uBAAuB,CAAEf,UAAU,EAAE,GAAGkB,IAAK,CAAC;EAE/C,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACxB,OAAA,CAAAyB,mBAAmB,QACnB,IAAAF,MAAA,CAAAC,aAAA,EAACzB,WAAA,CAAA2B,SAAS;IACTC,KAAK,GAAArB,qBAAA,GACJG,QAAQ,EAAEmB,MAAM,EAAEC,UAAU,cAAAvB,qBAAA,cAAAA,qBAAA,GAAI,IAAAwB,QAAE,EAAE,iBAAkB,CACtD;IACDC,MAAM,EAAGvB,QAAU;IACnBwB,QAAQ,EAAGX;EAAe,GAE1B,IAAAE,MAAA,CAAAC,aAAA,EAACxB,OAAA,CAAAiC,oBAAoB,MAAE,CAAC,EACxB,IAAAV,MAAA,CAAAC,aAAA,EAACzB,WAAA,CAAAmC,QAAQ,QACR,IAAAX,MAAA,CAAAC,aAAA,EAACxB,OAAA,CAAAmC,mBAAmB,MAAE,CACb,CACA,CACS,CAAC;AAExB;AAAC,IAAAC,QAAA,GAEc/B,cAAc;AAAAgC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -1,72 +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 Excerpt panel.
11
- */
12
-
13
- /**
14
- * WordPress dependencies
15
- */
16
-
17
- const {
18
- Fill,
19
- Slot
20
- } = (0, _components.createSlotFill)('PluginPostExcerpt');
21
-
22
- /**
23
- * Renders a post excerpt panel in the post sidebar.
24
- *
25
- * @param {Object} props Component properties.
26
- * @param {string} [props.className] An optional class name added to the row.
27
- * @param {Element} props.children Children to be rendered.
28
- *
29
- * @example
30
- * ```js
31
- * // Using ES5 syntax
32
- * var __ = wp.i18n.__;
33
- * var PluginPostExcerpt = wp.editPost.PluginPostExcerpt;
34
- *
35
- * function MyPluginPostExcerpt() {
36
- * return React.createElement(
37
- * PluginPostExcerpt,
38
- * {
39
- * className: 'my-plugin-post-excerpt',
40
- * },
41
- * __( 'Post excerpt custom content' )
42
- * )
43
- * }
44
- * ```
45
- *
46
- * @example
47
- * ```jsx
48
- * // Using ESNext syntax
49
- * import { __ } from '@wordpress/i18n';
50
- * import { PluginPostExcerpt } from '@wordpress/edit-post';
51
- *
52
- * const MyPluginPostExcerpt = () => (
53
- * <PluginPostExcerpt className="my-plugin-post-excerpt">
54
- * { __( 'Post excerpt custom content' ) }
55
- * </PluginPostExcerpt>
56
- * );
57
- * ```
58
- *
59
- * @return {Component} The component to be rendered.
60
- */
61
- const PluginPostExcerpt = ({
62
- children,
63
- className
64
- }) => {
65
- return (0, _react.createElement)(Fill, null, (0, _react.createElement)(_components.PanelRow, {
66
- className: className
67
- }, children));
68
- };
69
- PluginPostExcerpt.Slot = Slot;
70
- var _default = PluginPostExcerpt;
71
- exports.default = _default;
72
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","Fill","Slot","createSlotFill","PluginPostExcerpt","children","className","_react","createElement","PanelRow","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-post-excerpt/index.js"],"sourcesContent":["/**\n * Defines as extensibility slot for the Excerpt panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );\n\n/**\n * Renders a post excerpt panel in the post sidebar.\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 PluginPostExcerpt = wp.editPost.PluginPostExcerpt;\n *\n * function MyPluginPostExcerpt() {\n * \treturn React.createElement(\n * \t\tPluginPostExcerpt,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-excerpt',\n * \t\t},\n * \t\t__( 'Post excerpt custom content' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPostExcerpt } from '@wordpress/edit-post';\n *\n * const MyPluginPostExcerpt = () => (\n * \t<PluginPostExcerpt className=\"my-plugin-post-excerpt\">\n * \t\t{ __( 'Post excerpt custom content' ) }\n * \t</PluginPostExcerpt>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginPostExcerpt = ( { children, className } ) => {\n\treturn (\n\t\t<Fill>\n\t\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t\t</Fill>\n\t);\n};\n\nPluginPostExcerpt.Slot = Slot;\n\nexport default PluginPostExcerpt;\n"],"mappings":";;;;;;;AAOA,IAAAA,WAAA,GAAAC,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;AAGA,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,0BAAc,EAAE,mBAAoB,CAAC;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,iBAAiB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KAAM;EACxD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACP,IAAI,QACJ,IAAAM,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAU,QAAQ;IAACH,SAAS,EAAGA;EAAW,GAAGD,QAAoB,CACnD,CAAC;AAET,CAAC;AAEDD,iBAAiB,CAACF,IAAI,GAAGA,IAAI;AAAC,IAAAQ,QAAA,GAEfN,iBAAiB;AAAAO,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = PostExcerpt;
8
- var _react = require("react");
9
- var _i18n = require("@wordpress/i18n");
10
- var _components = require("@wordpress/components");
11
- var _editor = require("@wordpress/editor");
12
- var _data = require("@wordpress/data");
13
- var _store = require("../../../store");
14
- var _pluginPostExcerpt = _interopRequireDefault(require("../plugin-post-excerpt"));
15
- /**
16
- * WordPress dependencies
17
- */
18
-
19
- /**
20
- * Internal dependencies
21
- */
22
-
23
- /**
24
- * Module Constants
25
- */
26
- const PANEL_NAME = 'post-excerpt';
27
- function PostExcerpt() {
28
- const {
29
- isOpened,
30
- isEnabled
31
- } = (0, _data.useSelect)(select => {
32
- const {
33
- isEditorPanelOpened,
34
- isEditorPanelEnabled
35
- } = select(_store.store);
36
- return {
37
- isOpened: isEditorPanelOpened(PANEL_NAME),
38
- isEnabled: isEditorPanelEnabled(PANEL_NAME)
39
- };
40
- }, []);
41
- const {
42
- toggleEditorPanelOpened
43
- } = (0, _data.useDispatch)(_store.store);
44
- const toggleExcerptPanel = () => toggleEditorPanelOpened(PANEL_NAME);
45
- if (!isEnabled) {
46
- return null;
47
- }
48
- return (0, _react.createElement)(_editor.PostExcerptCheck, null, (0, _react.createElement)(_components.PanelBody, {
49
- title: (0, _i18n.__)('Excerpt'),
50
- opened: isOpened,
51
- onToggle: toggleExcerptPanel
52
- }, (0, _react.createElement)(_pluginPostExcerpt.default.Slot, null, fills => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_editor.PostExcerpt, null), fills))));
53
- }
54
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_i18n","require","_components","_editor","_data","_store","_pluginPostExcerpt","_interopRequireDefault","PANEL_NAME","PostExcerpt","isOpened","isEnabled","useSelect","select","isEditorPanelOpened","isEditorPanelEnabled","editPostStore","toggleEditorPanelOpened","useDispatch","toggleExcerptPanel","_react","createElement","PostExcerptCheck","PanelBody","title","__","opened","onToggle","default","Slot","fills","Fragment"],"sources":["@wordpress/edit-post/src/components/sidebar/post-excerpt/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPostExcerpt as PostExcerptForm,\n\tPostExcerptCheck,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport PluginPostExcerpt from '../plugin-post-excerpt';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-excerpt';\n\nexport default function PostExcerpt() {\n\tconst { isOpened, isEnabled } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\tselect( editPostStore );\n\n\t\treturn {\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\tconst toggleExcerptPanel = () => toggleEditorPanelOpened( PANEL_NAME );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Excerpt' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ toggleExcerptPanel }\n\t\t\t>\n\t\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostExcerptForm />\n\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</PluginPostExcerpt.Slot>\n\t\t\t</PanelBody>\n\t\t</PostExcerptCheck>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAC,sBAAA,CAAAN,OAAA;AAfA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAMO,UAAU,GAAG,cAAc;AAElB,SAASC,WAAWA,CAAA,EAAG;EACrC,MAAM;IAAEC,QAAQ;IAAEC;EAAU,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxD,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEG,YAAc,CAAC;IAExB,OAAO;MACNN,QAAQ,EAAEI,mBAAmB,CAAEN,UAAW,CAAC;MAC3CG,SAAS,EAAEI,oBAAoB,CAAEP,UAAW;IAC7C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAES;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,YAAc,CAAC;EAChE,MAAMG,kBAAkB,GAAGA,CAAA,KAAMF,uBAAuB,CAAET,UAAW,CAAC;EAEtE,IAAK,CAAEG,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAS,MAAA,CAAAC,aAAA,EAAClB,OAAA,CAAAmB,gBAAgB,QAChB,IAAAF,MAAA,CAAAC,aAAA,EAACnB,WAAA,CAAAqB,SAAS;IACTC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IACzBC,MAAM,EAAGhB,QAAU;IACnBiB,QAAQ,EAAGR;EAAoB,GAE/B,IAAAC,MAAA,CAAAC,aAAA,EAACf,kBAAA,CAAAsB,OAAiB,CAACC,IAAI,QAClBC,KAAK,IACR,IAAAV,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAW,QAAA,QACC,IAAAX,MAAA,CAAAC,aAAA,EAAClB,OAAA,CAAAM,WAAe,MAAE,CAAC,EACjBqB,KACD,CAEoB,CACd,CACM,CAAC;AAErB"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = require("react");
9
- var _editor = require("@wordpress/editor");
10
- var _taxonomyPanel = _interopRequireDefault(require("./taxonomy-panel"));
11
- /**
12
- * WordPress dependencies
13
- */
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
-
19
- function PostTaxonomies() {
20
- return (0, _react.createElement)(_editor.PostTaxonomiesCheck, null, (0, _react.createElement)(_editor.PostTaxonomies, {
21
- taxonomyWrapper: (content, taxonomy) => {
22
- return (0, _react.createElement)(_taxonomyPanel.default, {
23
- taxonomy: taxonomy
24
- }, content);
25
- }
26
- }));
27
- }
28
- var _default = PostTaxonomies;
29
- exports.default = _default;
30
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_editor","require","_taxonomyPanel","_interopRequireDefault","PostTaxonomies","_react","createElement","PostTaxonomiesCheck","taxonomyWrapper","content","taxonomy","default","_default","exports"],"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostTaxonomies as PostTaxonomiesForm,\n\tPostTaxonomiesCheck,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport TaxonomyPanel from './taxonomy-panel';\n\nfunction PostTaxonomies() {\n\treturn (\n\t\t<PostTaxonomiesCheck>\n\t\t\t<PostTaxonomiesForm\n\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<TaxonomyPanel taxonomy={ taxonomy }>\n\t\t\t\t\t\t\t{ content }\n\t\t\t\t\t\t</TaxonomyPanel>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PostTaxonomiesCheck>\n\t);\n}\n\nexport default PostTaxonomies;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAQA,IAAAC,cAAA,GAAAC,sBAAA,CAAAF,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,SAASG,cAAcA,CAAA,EAAG;EACzB,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,OAAA,CAAAO,mBAAmB,QACnB,IAAAF,MAAA,CAAAC,aAAA,EAACN,OAAA,CAAAI,cAAkB;IAClBI,eAAe,EAAGA,CAAEC,OAAO,EAAEC,QAAQ,KAAM;MAC1C,OACC,IAAAL,MAAA,CAAAC,aAAA,EAACJ,cAAA,CAAAS,OAAa;QAACD,QAAQ,EAAGA;MAAU,GACjCD,OACY,CAAC;IAElB;EAAG,CACH,CACmB,CAAC;AAExB;AAAC,IAAAG,QAAA,GAEcR,cAAc;AAAAS,OAAA,CAAAF,OAAA,GAAAC,QAAA"}
@@ -1,56 +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
- var _data = require("@wordpress/data");
10
- var _store = require("../../../store");
11
- /**
12
- * WordPress dependencies
13
- */
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
-
19
- function TaxonomyPanel({
20
- taxonomy,
21
- children
22
- }) {
23
- const slug = taxonomy?.slug;
24
- const panelName = slug ? `taxonomy-panel-${slug}` : '';
25
- const {
26
- isEnabled,
27
- isOpened
28
- } = (0, _data.useSelect)(select => {
29
- const {
30
- isEditorPanelEnabled,
31
- isEditorPanelOpened
32
- } = select(_store.store);
33
- return {
34
- isEnabled: slug ? isEditorPanelEnabled(panelName) : false,
35
- isOpened: slug ? isEditorPanelOpened(panelName) : false
36
- };
37
- }, [panelName, slug]);
38
- const {
39
- toggleEditorPanelOpened
40
- } = (0, _data.useDispatch)(_store.store);
41
- if (!isEnabled) {
42
- return null;
43
- }
44
- const taxonomyMenuName = taxonomy?.labels?.menu_name;
45
- if (!taxonomyMenuName) {
46
- return null;
47
- }
48
- return (0, _react.createElement)(_components.PanelBody, {
49
- title: taxonomyMenuName,
50
- opened: isOpened,
51
- onToggle: () => toggleEditorPanelOpened(panelName)
52
- }, children);
53
- }
54
- var _default = TaxonomyPanel;
55
- exports.default = _default;
56
- //# sourceMappingURL=taxonomy-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_components","require","_data","_store","TaxonomyPanel","taxonomy","children","slug","panelName","isEnabled","isOpened","useSelect","select","isEditorPanelEnabled","isEditorPanelOpened","editPostStore","toggleEditorPanelOpened","useDispatch","taxonomyMenuName","labels","menu_name","_react","createElement","PanelBody","title","opened","onToggle","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-taxonomies/taxonomy-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TaxonomyPanel( { taxonomy, children } ) {\n\tconst slug = taxonomy?.slug;\n\tconst panelName = slug ? `taxonomy-panel-${ slug }` : '';\n\tconst { isEnabled, isOpened } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\t\tselect( editPostStore );\n\t\t\treturn {\n\t\t\t\tisEnabled: slug ? isEditorPanelEnabled( panelName ) : false,\n\t\t\t\tisOpened: slug ? isEditorPanelOpened( panelName ) : false,\n\t\t\t};\n\t\t},\n\t\t[ panelName, slug ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst taxonomyMenuName = taxonomy?.labels?.menu_name;\n\tif ( ! taxonomyMenuName ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ taxonomyMenuName }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t>\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n}\n\nexport default TaxonomyPanel;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASG,aAAaA,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,EAAG;EAChD,MAAMC,IAAI,GAAGF,QAAQ,EAAEE,IAAI;EAC3B,MAAMC,SAAS,GAAGD,IAAI,GAAI,kBAAkBA,IAAM,EAAC,GAAG,EAAE;EACxD,MAAM;IAAEE,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EACtCC,MAAM,IAAM;IACb,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEG,YAAc,CAAC;IACxB,OAAO;MACNN,SAAS,EAAEF,IAAI,GAAGM,oBAAoB,CAAEL,SAAU,CAAC,GAAG,KAAK;MAC3DE,QAAQ,EAAEH,IAAI,GAAGO,mBAAmB,CAAEN,SAAU,CAAC,GAAG;IACrD,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,EAAED,IAAI,CAClB,CAAC;EACD,MAAM;IAAES;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,YAAc,CAAC;EAEhE,IAAK,CAAEN,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMS,gBAAgB,GAAGb,QAAQ,EAAEc,MAAM,EAAEC,SAAS;EACpD,IAAK,CAAEF,gBAAgB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAG,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,SAAS;IACTC,KAAK,EAAGN,gBAAkB;IAC1BO,MAAM,EAAGf,QAAU;IACnBgB,QAAQ,EAAGA,CAAA,KAAMV,uBAAuB,CAAER,SAAU;EAAG,GAErDF,QACQ,CAAC;AAEd;AAAC,IAAAqB,QAAA,GAEcvB,aAAa;AAAAwB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = ViewLink;
7
- var _react = require("react");
8
- var _i18n = require("@wordpress/i18n");
9
- var _components = require("@wordpress/components");
10
- var _icons = require("@wordpress/icons");
11
- var _editor = require("@wordpress/editor");
12
- var _coreData = require("@wordpress/core-data");
13
- var _data = require("@wordpress/data");
14
- var _store = require("../../store");
15
- /**
16
- * WordPress dependencies
17
- */
18
-
19
- /**
20
- * Internal dependencies
21
- */
22
-
23
- function ViewLink() {
24
- const {
25
- permalink,
26
- isPublished,
27
- label,
28
- showIconLabels
29
- } = (0, _data.useSelect)(select => {
30
- // Grab post type to retrieve the view_item label.
31
- const postTypeSlug = select(_editor.store).getCurrentPostType();
32
- const postType = select(_coreData.store).getPostType(postTypeSlug);
33
- return {
34
- permalink: select(_editor.store).getPermalink(),
35
- isPublished: select(_editor.store).isCurrentPostPublished(),
36
- label: postType?.labels.view_item,
37
- showIconLabels: select(_store.store).isFeatureActive('showIconLabels')
38
- };
39
- }, []);
40
-
41
- // Only render the view button if the post is published and has a permalink.
42
- if (!isPublished || !permalink) {
43
- return null;
44
- }
45
- return (0, _react.createElement)(_components.Button, {
46
- icon: _icons.external,
47
- label: label || (0, _i18n.__)('View post'),
48
- href: permalink,
49
- target: "_blank",
50
- showTooltip: !showIconLabels
51
- });
52
- }
53
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_i18n","require","_components","_icons","_editor","_coreData","_data","_store","ViewLink","permalink","isPublished","label","showIconLabels","useSelect","select","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","getPermalink","isCurrentPostPublished","labels","view_item","editPostStore","isFeatureActive","_react","createElement","Button","icon","external","__","href","target","showTooltip"],"sources":["@wordpress/edit-post/src/components/view-link/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function ViewLink() {\n\tconst { permalink, isPublished, label, showIconLabels } = useSelect(\n\t\t( select ) => {\n\t\t\t// Grab post type to retrieve the view_item label.\n\t\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\n\t\t\treturn {\n\t\t\t\tpermalink: select( editorStore ).getPermalink(),\n\t\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\t\tlabel: postType?.labels.view_item,\n\t\t\t\tshowIconLabels:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\t// Only render the view button if the post is published and has a permalink.\n\tif ( ! isPublished || ! permalink ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\ticon={ external }\n\t\t\tlabel={ label || __( 'View post' ) }\n\t\t\thref={ permalink }\n\t\t\ttarget=\"_blank\"\n\t\t\tshowTooltip={ ! showIconLabels }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAQA;AACA;AACA;;AAGe,SAASO,QAAQA,CAAA,EAAG;EAClC,MAAM;IAAEC,SAAS;IAAEC,WAAW;IAAEC,KAAK;IAAEC;EAAe,CAAC,GAAG,IAAAC,eAAS,EAChEC,MAAM,IAAM;IACb;IACA,MAAMC,YAAY,GAAGD,MAAM,CAAEE,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC;IAC/D,MAAMC,QAAQ,GAAGJ,MAAM,CAAEK,eAAU,CAAC,CAACC,WAAW,CAAEL,YAAa,CAAC;IAEhE,OAAO;MACNN,SAAS,EAAEK,MAAM,CAAEE,aAAY,CAAC,CAACK,YAAY,CAAC,CAAC;MAC/CX,WAAW,EAAEI,MAAM,CAAEE,aAAY,CAAC,CAACM,sBAAsB,CAAC,CAAC;MAC3DX,KAAK,EAAEO,QAAQ,EAAEK,MAAM,CAACC,SAAS;MACjCZ,cAAc,EACbE,MAAM,CAAEW,YAAc,CAAC,CAACC,eAAe,CAAE,gBAAiB;IAC5D,CAAC;EACF,CAAC,EACD,EACD,CAAC;;EAED;EACA,IAAK,CAAEhB,WAAW,IAAI,CAAED,SAAS,EAAG;IACnC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAkB,MAAA,CAAAC,aAAA,EAAC1B,WAAA,CAAA2B,MAAM;IACNC,IAAI,EAAGC,eAAU;IACjBpB,KAAK,EAAGA,KAAK,IAAI,IAAAqB,QAAE,EAAE,WAAY,CAAG;IACpCC,IAAI,EAAGxB,SAAW;IAClByB,MAAM,EAAC,QAAQ;IACfC,WAAW,EAAG,CAAEvB;EAAgB,CAChC,CAAC;AAEJ"}
@@ -1,152 +0,0 @@
1
- import { createElement, Fragment } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { useViewportMatch } from '@wordpress/compose';
6
- import { useSelect, useDispatch } from '@wordpress/data';
7
- import { __, _x } from '@wordpress/i18n';
8
- import { NavigableToolbar, ToolSelector, store as blockEditorStore, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
9
- import { EditorHistoryRedo, EditorHistoryUndo, store as editorStore } from '@wordpress/editor';
10
- import { Button, ToolbarItem } from '@wordpress/components';
11
- import { listView, plus } from '@wordpress/icons';
12
- import { useRef, useCallback } from '@wordpress/element';
13
- import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
- import { store as editPostStore } from '../../../store';
19
- import { unlock } from '../../../lock-unlock';
20
- const {
21
- useShouldContextualToolbarShow
22
- } = unlock(blockEditorPrivateApis);
23
- const preventDefault = event => {
24
- event.preventDefault();
25
- };
26
- function HeaderToolbar({
27
- hasFixedToolbar,
28
- setListViewToggleElement
29
- }) {
30
- const inserterButton = useRef();
31
- const {
32
- setIsInserterOpened,
33
- setIsListViewOpened
34
- } = useDispatch(editPostStore);
35
- const {
36
- isInserterEnabled,
37
- isInserterOpened,
38
- isTextModeEnabled,
39
- showIconLabels,
40
- isListViewOpen,
41
- listViewShortcut
42
- } = useSelect(select => {
43
- const {
44
- hasInserterItems,
45
- getBlockRootClientId,
46
- getBlockSelectionEnd
47
- } = select(blockEditorStore);
48
- const {
49
- getEditorSettings
50
- } = select(editorStore);
51
- const {
52
- getEditorMode,
53
- isFeatureActive,
54
- isListViewOpened
55
- } = select(editPostStore);
56
- const {
57
- getShortcutRepresentation
58
- } = select(keyboardShortcutsStore);
59
- return {
60
- // This setting (richEditingEnabled) should not live in the block editor's setting.
61
- isInserterEnabled: getEditorMode() === 'visual' && getEditorSettings().richEditingEnabled && hasInserterItems(getBlockRootClientId(getBlockSelectionEnd())),
62
- isInserterOpened: select(editPostStore).isInserterOpened(),
63
- isTextModeEnabled: getEditorMode() === 'text',
64
- showIconLabels: isFeatureActive('showIconLabels'),
65
- isListViewOpen: isListViewOpened(),
66
- listViewShortcut: getShortcutRepresentation('core/edit-post/toggle-list-view')
67
- };
68
- }, []);
69
- const isLargeViewport = useViewportMatch('medium');
70
- const isWideViewport = useViewportMatch('wide');
71
- const {
72
- shouldShowContextualToolbar,
73
- canFocusHiddenToolbar,
74
- fixedToolbarCanBeFocused
75
- } = useShouldContextualToolbarShow();
76
- // If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.
77
- // There's a fixed block toolbar when the fixed toolbar option is enabled or when the browser width is less than the large viewport.
78
- const blockToolbarCanBeFocused = shouldShowContextualToolbar || canFocusHiddenToolbar || fixedToolbarCanBeFocused;
79
- /* translators: accessibility text for the editor toolbar */
80
- const toolbarAriaLabel = __('Document tools');
81
- const toggleListView = useCallback(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]);
82
- const overflowItems = createElement(Fragment, null, createElement(ToolbarItem, {
83
- as: Button,
84
- className: "edit-post-header-toolbar__document-overview-toggle",
85
- icon: listView,
86
- disabled: isTextModeEnabled,
87
- isPressed: isListViewOpen
88
- /* translators: button label text should, if possible, be under 16 characters. */,
89
- label: __('Document Overview'),
90
- onClick: toggleListView,
91
- shortcut: listViewShortcut,
92
- showTooltip: !showIconLabels,
93
- variant: showIconLabels ? 'tertiary' : undefined,
94
- "aria-expanded": isListViewOpen,
95
- ref: setListViewToggleElement,
96
- size: "compact"
97
- }));
98
- const toggleInserter = useCallback(() => {
99
- if (isInserterOpened) {
100
- // Focusing the inserter button should close the inserter popover.
101
- // However, there are some cases it won't close when the focus is lost.
102
- // See https://github.com/WordPress/gutenberg/issues/43090 for more details.
103
- inserterButton.current.focus();
104
- setIsInserterOpened(false);
105
- } else {
106
- setIsInserterOpened(true);
107
- }
108
- }, [isInserterOpened, setIsInserterOpened]);
109
-
110
- /* translators: button label text should, if possible, be under 16 characters. */
111
- const longLabel = _x('Toggle block inserter', 'Generic label for block inserter button');
112
- const shortLabel = !isInserterOpened ? __('Add') : __('Close');
113
- return createElement(NavigableToolbar, {
114
- className: "edit-post-header-toolbar",
115
- "aria-label": toolbarAriaLabel,
116
- shouldUseKeyboardFocusShortcut: !blockToolbarCanBeFocused,
117
- variant: "unstyled"
118
- }, createElement("div", {
119
- className: "edit-post-header-toolbar__left"
120
- }, createElement(ToolbarItem, {
121
- ref: inserterButton,
122
- as: Button,
123
- className: "edit-post-header-toolbar__inserter-toggle",
124
- variant: "primary",
125
- isPressed: isInserterOpened,
126
- onMouseDown: preventDefault,
127
- onClick: toggleInserter,
128
- disabled: !isInserterEnabled,
129
- icon: plus,
130
- label: showIconLabels ? shortLabel : longLabel,
131
- showTooltip: !showIconLabels,
132
- "aria-expanded": isInserterOpened
133
- }), (isWideViewport || !showIconLabels) && createElement(Fragment, null, isLargeViewport && !hasFixedToolbar && createElement(ToolbarItem, {
134
- as: ToolSelector,
135
- showTooltip: !showIconLabels,
136
- variant: showIconLabels ? 'tertiary' : undefined,
137
- disabled: isTextModeEnabled,
138
- size: "compact"
139
- }), createElement(ToolbarItem, {
140
- as: EditorHistoryUndo,
141
- showTooltip: !showIconLabels,
142
- variant: showIconLabels ? 'tertiary' : undefined,
143
- size: "compact"
144
- }), createElement(ToolbarItem, {
145
- as: EditorHistoryRedo,
146
- showTooltip: !showIconLabels,
147
- variant: showIconLabels ? 'tertiary' : undefined,
148
- size: "compact"
149
- }), overflowItems)));
150
- }
151
- export default HeaderToolbar;
152
- //# sourceMappingURL=index.js.map