@wordpress/edit-post 7.24.1 → 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 (267) hide show
  1. package/CHANGELOG.md +8 -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 +35 -33
  6. package/build/components/header/index.js.map +1 -1
  7. package/build/components/header/mode-switcher/index.js +1 -1
  8. package/build/components/header/mode-switcher/index.js.map +1 -1
  9. package/build/components/header/more-menu/index.js +2 -1
  10. package/build/components/header/more-menu/index.js.map +1 -1
  11. package/build/components/header/writing-menu/index.js +22 -18
  12. package/build/components/header/writing-menu/index.js.map +1 -1
  13. package/build/components/keyboard-shortcuts/index.js +1 -20
  14. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  15. package/build/components/layout/index.js +45 -38
  16. package/build/components/layout/index.js.map +1 -1
  17. package/build/components/layout/index.native.js +3 -1
  18. package/build/components/layout/index.native.js.map +1 -1
  19. package/build/components/meta-boxes/meta-box-visibility.js +2 -6
  20. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  21. package/build/components/preferences-modal/index.js +87 -54
  22. package/build/components/preferences-modal/index.js.map +1 -1
  23. package/build/components/preferences-modal/options/enable-feature.js +23 -23
  24. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  25. package/build/components/preferences-modal/options/enable-panel.js +3 -6
  26. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  27. package/build/components/sidebar/plugin-document-setting-panel/index.js +3 -3
  28. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  29. package/build/components/sidebar/plugin-sidebar/index.js +2 -10
  30. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  31. package/build/components/sidebar/post-status/index.js +3 -5
  32. package/build/components/sidebar/post-status/index.js.map +1 -1
  33. package/build/components/sidebar/settings-header/index.js +17 -43
  34. package/build/components/sidebar/settings-header/index.js.map +1 -1
  35. package/build/components/sidebar/settings-sidebar/index.js +80 -26
  36. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  37. package/build/components/start-page-options/index.js +3 -3
  38. package/build/components/start-page-options/index.js.map +1 -1
  39. package/build/components/visual-editor/index.js +20 -257
  40. package/build/components/visual-editor/index.js.map +1 -1
  41. package/build/components/welcome-guide/index.js +6 -3
  42. package/build/components/welcome-guide/index.js.map +1 -1
  43. package/build/editor.js +20 -30
  44. package/build/editor.js.map +1 -1
  45. package/build/editor.native.js +3 -11
  46. package/build/editor.native.js.map +1 -1
  47. package/build/hooks/commands/use-common-commands.js +16 -12
  48. package/build/hooks/commands/use-common-commands.js.map +1 -1
  49. package/build/hooks/use-post-history.js +79 -0
  50. package/build/hooks/use-post-history.js.map +1 -0
  51. package/build/index.js +24 -20
  52. package/build/index.js.map +1 -1
  53. package/build/index.native.js +7 -1
  54. package/build/index.native.js.map +1 -1
  55. package/build/plugins/welcome-guide-menu-item/index.js +2 -6
  56. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  57. package/build/store/actions.js +94 -112
  58. package/build/store/actions.js.map +1 -1
  59. package/build/store/reducer.js +1 -95
  60. package/build/store/reducer.js.map +1 -1
  61. package/build/store/selectors.js +86 -48
  62. package/build/store/selectors.js.map +1 -1
  63. package/build-module/components/browser-url/index.js +3 -2
  64. package/build-module/components/browser-url/index.js.map +1 -1
  65. package/build-module/components/header/index.js +37 -35
  66. package/build-module/components/header/index.js.map +1 -1
  67. package/build-module/components/header/mode-switcher/index.js +1 -1
  68. package/build-module/components/header/mode-switcher/index.js.map +1 -1
  69. package/build-module/components/header/more-menu/index.js +2 -1
  70. package/build-module/components/header/more-menu/index.js.map +1 -1
  71. package/build-module/components/header/writing-menu/index.js +23 -19
  72. package/build-module/components/header/writing-menu/index.js.map +1 -1
  73. package/build-module/components/keyboard-shortcuts/index.js +1 -20
  74. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  75. package/build-module/components/layout/index.js +46 -38
  76. package/build-module/components/layout/index.js.map +1 -1
  77. package/build-module/components/layout/index.native.js +4 -2
  78. package/build-module/components/layout/index.native.js.map +1 -1
  79. package/build-module/components/meta-boxes/meta-box-visibility.js +2 -6
  80. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  81. package/build-module/components/preferences-modal/index.js +87 -54
  82. package/build-module/components/preferences-modal/index.js.map +1 -1
  83. package/build-module/components/preferences-modal/options/enable-feature.js +22 -23
  84. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  85. package/build-module/components/preferences-modal/options/enable-panel.js +3 -7
  86. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  87. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +3 -3
  88. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  89. package/build-module/components/sidebar/plugin-sidebar/index.js +2 -10
  90. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  91. package/build-module/components/sidebar/post-status/index.js +4 -6
  92. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  93. package/build-module/components/sidebar/settings-header/index.js +20 -46
  94. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  95. package/build-module/components/sidebar/settings-sidebar/index.js +80 -27
  96. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  97. package/build-module/components/start-page-options/index.js +3 -3
  98. package/build-module/components/start-page-options/index.js.map +1 -1
  99. package/build-module/components/visual-editor/index.js +24 -261
  100. package/build-module/components/visual-editor/index.js.map +1 -1
  101. package/build-module/components/welcome-guide/index.js +6 -3
  102. package/build-module/components/welcome-guide/index.js.map +1 -1
  103. package/build-module/editor.js +20 -30
  104. package/build-module/editor.js.map +1 -1
  105. package/build-module/editor.native.js +3 -11
  106. package/build-module/editor.native.js.map +1 -1
  107. package/build-module/hooks/commands/use-common-commands.js +16 -12
  108. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  109. package/build-module/hooks/use-post-history.js +73 -0
  110. package/build-module/hooks/use-post-history.js.map +1 -0
  111. package/build-module/index.js +19 -12
  112. package/build-module/index.js.map +1 -1
  113. package/build-module/index.native.js +7 -1
  114. package/build-module/index.native.js.map +1 -1
  115. package/build-module/plugins/welcome-guide-menu-item/index.js +2 -6
  116. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  117. package/build-module/store/actions.js +86 -105
  118. package/build-module/store/actions.js.map +1 -1
  119. package/build-module/store/reducer.js +1 -92
  120. package/build-module/store/reducer.js.map +1 -1
  121. package/build-module/store/selectors.js +76 -38
  122. package/build-module/store/selectors.js.map +1 -1
  123. package/build-style/style-rtl.css +65 -473
  124. package/build-style/style.css +65 -473
  125. package/package.json +32 -32
  126. package/src/components/browser-url/index.js +4 -2
  127. package/src/components/header/index.js +45 -46
  128. package/src/components/header/mode-switcher/index.js +2 -1
  129. package/src/components/header/more-menu/index.js +1 -0
  130. package/src/components/header/style.scss +63 -37
  131. package/src/components/header/writing-menu/index.js +24 -24
  132. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -15
  133. package/src/components/keyboard-shortcuts/index.js +1 -23
  134. package/src/components/layout/index.js +31 -39
  135. package/src/components/layout/index.native.js +9 -1
  136. package/src/components/meta-boxes/meta-box-visibility.js +2 -8
  137. package/src/components/preferences-modal/index.js +128 -97
  138. package/src/components/preferences-modal/options/enable-feature.js +26 -21
  139. package/src/components/preferences-modal/options/enable-panel.js +3 -7
  140. package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +187 -175
  141. package/src/components/preferences-modal/test/index.js +1 -52
  142. package/src/components/sidebar/plugin-document-setting-panel/index.js +3 -3
  143. package/src/components/sidebar/plugin-sidebar/index.js +1 -9
  144. package/src/components/sidebar/post-status/index.js +5 -5
  145. package/src/components/sidebar/settings-header/index.js +19 -71
  146. package/src/components/sidebar/settings-sidebar/index.js +125 -60
  147. package/src/components/sidebar/style.scss +4 -12
  148. package/src/components/start-page-options/index.js +3 -3
  149. package/src/components/text-editor/style.scss +0 -6
  150. package/src/components/visual-editor/index.js +26 -359
  151. package/src/components/visual-editor/style.scss +0 -15
  152. package/src/components/welcome-guide/index.js +4 -2
  153. package/src/editor.js +36 -35
  154. package/src/editor.native.js +2 -23
  155. package/src/hooks/commands/use-common-commands.js +14 -16
  156. package/src/hooks/use-post-history.js +73 -0
  157. package/src/index.js +24 -13
  158. package/src/index.native.js +8 -1
  159. package/src/plugins/welcome-guide-menu-item/index.js +3 -6
  160. package/src/store/actions.js +80 -131
  161. package/src/store/reducer.js +0 -93
  162. package/src/store/selectors.js +97 -55
  163. package/src/store/test/actions.js +10 -131
  164. package/src/store/test/reducer.js +1 -108
  165. package/src/store/test/selectors.js +0 -50
  166. package/src/style.scss +1 -8
  167. package/src/test/__snapshots__/editor.native.js.snap +21 -0
  168. package/src/test/editor.native.js +107 -56
  169. package/build/components/device-preview/index.js +0 -72
  170. package/build/components/device-preview/index.js.map +0 -1
  171. package/build/components/header/document-actions/index.js +0 -82
  172. package/build/components/header/document-actions/index.js.map +0 -1
  173. package/build/components/header/header-toolbar/index.js +0 -156
  174. package/build/components/header/header-toolbar/index.js.map +0 -1
  175. package/build/components/secondary-sidebar/inserter-sidebar.js +0 -73
  176. package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  177. package/build/components/secondary-sidebar/list-view-outline.js +0 -112
  178. package/build/components/secondary-sidebar/list-view-outline.js.map +0 -1
  179. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -148
  180. package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  181. package/build/components/sidebar/discussion-panel/index.js +0 -59
  182. package/build/components/sidebar/discussion-panel/index.js.map +0 -1
  183. package/build/components/sidebar/featured-image/index.js +0 -70
  184. package/build/components/sidebar/featured-image/index.js.map +0 -1
  185. package/build/components/sidebar/last-revision/index.js +0 -21
  186. package/build/components/sidebar/last-revision/index.js.map +0 -1
  187. package/build/components/sidebar/page-attributes/index.js +0 -65
  188. package/build/components/sidebar/page-attributes/index.js.map +0 -1
  189. package/build/components/sidebar/plugin-post-excerpt/index.js +0 -72
  190. package/build/components/sidebar/plugin-post-excerpt/index.js.map +0 -1
  191. package/build/components/sidebar/post-excerpt/index.js +0 -54
  192. package/build/components/sidebar/post-excerpt/index.js.map +0 -1
  193. package/build/components/sidebar/post-taxonomies/index.js +0 -30
  194. package/build/components/sidebar/post-taxonomies/index.js.map +0 -1
  195. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -56
  196. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +0 -1
  197. package/build/components/sidebar/post-template/create-modal.js +0 -99
  198. package/build/components/sidebar/post-template/create-modal.js.map +0 -1
  199. package/build/components/sidebar/post-template/form.js +0 -110
  200. package/build/components/sidebar/post-template/form.js.map +0 -1
  201. package/build/components/sidebar/post-template/index.js +0 -106
  202. package/build/components/sidebar/post-template/index.js.map +0 -1
  203. package/build/components/view-link/index.js +0 -53
  204. package/build/components/view-link/index.js.map +0 -1
  205. package/build-module/components/device-preview/index.js +0 -65
  206. package/build-module/components/device-preview/index.js.map +0 -1
  207. package/build-module/components/header/document-actions/index.js +0 -74
  208. package/build-module/components/header/document-actions/index.js.map +0 -1
  209. package/build-module/components/header/header-toolbar/index.js +0 -148
  210. package/build-module/components/header/header-toolbar/index.js.map +0 -1
  211. package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -66
  212. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
  213. package/build-module/components/secondary-sidebar/list-view-outline.js +0 -105
  214. package/build-module/components/secondary-sidebar/list-view-outline.js.map +0 -1
  215. package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -140
  216. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
  217. package/build-module/components/sidebar/discussion-panel/index.js +0 -52
  218. package/build-module/components/sidebar/discussion-panel/index.js.map +0 -1
  219. package/build-module/components/sidebar/featured-image/index.js +0 -63
  220. package/build-module/components/sidebar/featured-image/index.js.map +0 -1
  221. package/build-module/components/sidebar/last-revision/index.js +0 -13
  222. package/build-module/components/sidebar/last-revision/index.js.map +0 -1
  223. package/build-module/components/sidebar/page-attributes/index.js +0 -57
  224. package/build-module/components/sidebar/page-attributes/index.js.map +0 -1
  225. package/build-module/components/sidebar/plugin-post-excerpt/index.js +0 -64
  226. package/build-module/components/sidebar/plugin-post-excerpt/index.js.map +0 -1
  227. package/build-module/components/sidebar/post-excerpt/index.js +0 -47
  228. package/build-module/components/sidebar/post-excerpt/index.js.map +0 -1
  229. package/build-module/components/sidebar/post-taxonomies/index.js +0 -21
  230. package/build-module/components/sidebar/post-taxonomies/index.js.map +0 -1
  231. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -48
  232. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +0 -1
  233. package/build-module/components/sidebar/post-template/create-modal.js +0 -92
  234. package/build-module/components/sidebar/post-template/create-modal.js.map +0 -1
  235. package/build-module/components/sidebar/post-template/form.js +0 -102
  236. package/build-module/components/sidebar/post-template/form.js.map +0 -1
  237. package/build-module/components/sidebar/post-template/index.js +0 -98
  238. package/build-module/components/sidebar/post-template/index.js.map +0 -1
  239. package/build-module/components/view-link/index.js +0 -46
  240. package/build-module/components/view-link/index.js.map +0 -1
  241. package/src/components/device-preview/index.js +0 -73
  242. package/src/components/header/document-actions/index.js +0 -82
  243. package/src/components/header/document-actions/style.scss +0 -64
  244. package/src/components/header/header-toolbar/index.js +0 -182
  245. package/src/components/header/header-toolbar/style.scss +0 -114
  246. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +0 -929
  247. package/src/components/secondary-sidebar/inserter-sidebar.js +0 -71
  248. package/src/components/secondary-sidebar/list-view-outline.js +0 -98
  249. package/src/components/secondary-sidebar/list-view-sidebar.js +0 -170
  250. package/src/components/secondary-sidebar/style.scss +0 -120
  251. package/src/components/sidebar/discussion-panel/index.js +0 -62
  252. package/src/components/sidebar/featured-image/index.js +0 -67
  253. package/src/components/sidebar/last-revision/index.js +0 -17
  254. package/src/components/sidebar/last-revision/style.scss +0 -10
  255. package/src/components/sidebar/page-attributes/index.js +0 -65
  256. package/src/components/sidebar/plugin-post-excerpt/index.js +0 -61
  257. package/src/components/sidebar/plugin-post-excerpt/test/index.js +0 -36
  258. package/src/components/sidebar/post-excerpt/index.js +0 -59
  259. package/src/components/sidebar/post-taxonomies/index.js +0 -30
  260. package/src/components/sidebar/post-taxonomies/taxonomy-panel.js +0 -48
  261. package/src/components/sidebar/post-template/create-modal.js +0 -140
  262. package/src/components/sidebar/post-template/form.js +0 -141
  263. package/src/components/sidebar/post-template/index.js +0 -120
  264. package/src/components/sidebar/post-template/style.scss +0 -22
  265. package/src/components/sidebar/settings-header/style.scss +0 -74
  266. package/src/components/sidebar/template/style.scss +0 -35
  267. package/src/components/view-link/index.js +0 -48
@@ -1,105 +0,0 @@
1
- import { createElement, Fragment } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { useSelect } from '@wordpress/data';
6
- import { DocumentOutline, WordCount, TimeToRead, CharacterCount } from '@wordpress/editor';
7
- import { store as blockEditorStore } from '@wordpress/block-editor';
8
- import { __experimentalText as Text, Path, SVG, Line, Rect } from '@wordpress/components';
9
- import { __ } from '@wordpress/i18n';
10
- function EmptyOutlineIllustration() {
11
- return createElement(SVG, {
12
- width: "138",
13
- height: "148",
14
- viewBox: "0 0 138 148",
15
- fill: "none",
16
- xmlns: "http://www.w3.org/2000/svg"
17
- }, createElement(Rect, {
18
- width: "138",
19
- height: "148",
20
- rx: "4",
21
- fill: "#F0F6FC"
22
- }), createElement(Line, {
23
- x1: "44",
24
- y1: "28",
25
- x2: "24",
26
- y2: "28",
27
- stroke: "#DDDDDD"
28
- }), createElement(Rect, {
29
- x: "48",
30
- y: "16",
31
- width: "27",
32
- height: "23",
33
- rx: "4",
34
- fill: "#DDDDDD"
35
- }), createElement(Path, {
36
- d: "M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",
37
- fill: "black"
38
- }), createElement(Line, {
39
- x1: "55",
40
- y1: "59",
41
- x2: "24",
42
- y2: "59",
43
- stroke: "#DDDDDD"
44
- }), createElement(Rect, {
45
- x: "59",
46
- y: "47",
47
- width: "29",
48
- height: "23",
49
- rx: "4",
50
- fill: "#DDDDDD"
51
- }), createElement(Path, {
52
- d: "M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",
53
- fill: "black"
54
- }), createElement(Line, {
55
- x1: "80",
56
- y1: "90",
57
- x2: "24",
58
- y2: "90",
59
- stroke: "#DDDDDD"
60
- }), createElement(Rect, {
61
- x: "84",
62
- y: "78",
63
- width: "30",
64
- height: "23",
65
- rx: "4",
66
- fill: "#F0B849"
67
- }), createElement(Path, {
68
- d: "M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",
69
- fill: "black"
70
- }), createElement(Line, {
71
- x1: "66",
72
- y1: "121",
73
- x2: "24",
74
- y2: "121",
75
- stroke: "#DDDDDD"
76
- }), createElement(Rect, {
77
- x: "70",
78
- y: "109",
79
- width: "29",
80
- height: "23",
81
- rx: "4",
82
- fill: "#DDDDDD"
83
- }), createElement(Path, {
84
- d: "M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",
85
- fill: "black"
86
- }));
87
- }
88
- export default function ListViewOutline() {
89
- const {
90
- headingCount
91
- } = useSelect(select => {
92
- const {
93
- getGlobalBlockCount
94
- } = select(blockEditorStore);
95
- return {
96
- headingCount: getGlobalBlockCount('core/heading')
97
- };
98
- }, []);
99
- return createElement(Fragment, null, createElement("div", {
100
- className: "edit-post-editor__list-view-overview"
101
- }, createElement("div", null, createElement(Text, null, __('Characters:')), createElement(Text, null, createElement(CharacterCount, null))), createElement("div", null, createElement(Text, null, __('Words:')), createElement(WordCount, null)), createElement("div", null, createElement(Text, null, __('Time to read:')), createElement(TimeToRead, null))), headingCount > 0 ? createElement(DocumentOutline, null) : createElement("div", {
102
- className: "edit-post-editor__list-view-empty-headings"
103
- }, createElement(EmptyOutlineIllustration, null), createElement("p", null, __('Navigate the structure of your document and address issues like empty or incorrect heading levels.'))));
104
- }
105
- //# sourceMappingURL=list-view-outline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useSelect","DocumentOutline","WordCount","TimeToRead","CharacterCount","store","blockEditorStore","__experimentalText","Text","Path","SVG","Line","Rect","__","EmptyOutlineIllustration","createElement","width","height","viewBox","fill","xmlns","rx","x1","y1","x2","y2","stroke","x","y","d","ListViewOutline","headingCount","select","getGlobalBlockCount","Fragment","className"],"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-outline.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tDocumentOutline,\n\tWordCount,\n\tTimeToRead,\n\tCharacterCount,\n} from '@wordpress/editor';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport {\n\t__experimentalText as Text,\n\tPath,\n\tSVG,\n\tLine,\n\tRect,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\nexport default function ListViewOutline() {\n\tconst { headingCount } = useSelect( ( select ) => {\n\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\t\treturn {\n\t\t\theadingCount: getGlobalBlockCount( 'core/heading' ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-post-editor__list-view-overview\">\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Characters:' ) }</Text>\n\t\t\t\t\t<Text>\n\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t</Text>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Words:' ) }</Text>\n\t\t\t\t\t<WordCount />\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Time to read:' ) }</Text>\n\t\t\t\t\t<TimeToRead />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{ headingCount > 0 ? (\n\t\t\t\t<DocumentOutline />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-post-editor__list-view-empty-headings\">\n\t\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,eAAe,EACfC,SAAS,EACTC,UAAU,EACVC,cAAc,QACR,mBAAmB;AAC1B,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SACCC,kBAAkB,IAAIC,IAAI,EAC1BC,IAAI,EACJC,GAAG,EACHC,IAAI,EACJC,IAAI,QACE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ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GK,EAAE,CAAE,aAAc,CAAS,CAAC,EACpCE,aAAA,CAACP,IAAI,QACJO,aAAA,CAACX,cAAc,MAAE,CACZ,CACF,CAAC,EACNW,aAAA,cACCA,aAAA,CAACP,IAAI,QAAGK,EAAE,CAAE,QAAS,CAAS,CAAC,EAC/BE,aAAA,CAACb,SAAS,MAAE,CACR,CAAC,EACNa,aAAA,cACCA,aAAA,CAACP,IAAI,QAAGK,EAAE,CAAE,eAAgB,CAAS,CAAC,EACtCE,aAAA,CAACZ,UAAU,MAAE,CACT,CACD,CAAC,EACJ4B,YAAY,GAAG,CAAC,GACjBhB,aAAA,CAACd,eAAe,MAAE,CAAC,GAEnBc,aAAA;IAAKoB,SAAS,EAAC;EAA4C,GAC1DpB,aAAA,CAACD,wBAAwB,MAAE,CAAC,EAC5BC,aAAA,YACGF,EAAE,CACH,oGACD,CACE,CACC,CAEL,CAAC;AAEL"}
@@ -1,140 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { __experimentalListView as ListView } from '@wordpress/block-editor';
6
- import { Button, TabPanel } from '@wordpress/components';
7
- import { useFocusOnMount, useMergeRefs } from '@wordpress/compose';
8
- import { useDispatch } from '@wordpress/data';
9
- import { focus } from '@wordpress/dom';
10
- import { useCallback, useRef, useState } from '@wordpress/element';
11
- import { __, _x } from '@wordpress/i18n';
12
- import { closeSmall } from '@wordpress/icons';
13
- import { useShortcut } from '@wordpress/keyboard-shortcuts';
14
- import { ESCAPE } from '@wordpress/keycodes';
15
-
16
- /**
17
- * Internal dependencies
18
- */
19
- import { store as editPostStore } from '../../store';
20
- import ListViewOutline from './list-view-outline';
21
- export default function ListViewSidebar({
22
- listViewToggleElement
23
- }) {
24
- const {
25
- setIsListViewOpened
26
- } = useDispatch(editPostStore);
27
-
28
- // This hook handles focus when the sidebar first renders.
29
- const focusOnMountRef = useFocusOnMount('firstElement');
30
-
31
- // When closing the list view, focus should return to the toggle button.
32
- const closeListView = useCallback(() => {
33
- setIsListViewOpened(false);
34
- listViewToggleElement?.focus();
35
- }, [listViewToggleElement, setIsListViewOpened]);
36
- const closeOnEscape = useCallback(event => {
37
- if (event.keyCode === ESCAPE && !event.defaultPrevented) {
38
- event.preventDefault();
39
- closeListView();
40
- }
41
- }, [closeListView]);
42
-
43
- // Use internal state instead of a ref to make sure that the component
44
- // re-renders when the dropZoneElement updates.
45
- const [dropZoneElement, setDropZoneElement] = useState(null);
46
- // Tracks our current tab.
47
- const [tab, setTab] = useState('list-view');
48
-
49
- // This ref refers to the sidebar as a whole.
50
- const sidebarRef = useRef();
51
- // This ref refers to the tab panel.
52
- const tabPanelRef = useRef();
53
- // This ref refers to the list view application area.
54
- const listViewRef = useRef();
55
-
56
- // Must merge the refs together so focus can be handled properly in the next function.
57
- const listViewContainerRef = useMergeRefs([focusOnMountRef, listViewRef, setDropZoneElement]);
58
-
59
- /*
60
- * Callback function to handle list view or outline focus.
61
- *
62
- * @param {string} currentTab The current tab. Either list view or outline.
63
- *
64
- * @return void
65
- */
66
- function handleSidebarFocus(currentTab) {
67
- // Tab panel focus.
68
- const tabPanelFocus = focus.tabbable.find(tabPanelRef.current)[0];
69
- // List view tab is selected.
70
- if (currentTab === 'list-view') {
71
- // Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.
72
- const listViewApplicationFocus = focus.tabbable.find(listViewRef.current)[0];
73
- const listViewFocusArea = sidebarRef.current.contains(listViewApplicationFocus) ? listViewApplicationFocus : tabPanelFocus;
74
- listViewFocusArea.focus();
75
- // Outline tab is selected.
76
- } else {
77
- tabPanelFocus.focus();
78
- }
79
- }
80
- const handleToggleListViewShortcut = useCallback(() => {
81
- // If the sidebar has focus, it is safe to close.
82
- if (sidebarRef.current.contains(sidebarRef.current.ownerDocument.activeElement)) {
83
- closeListView();
84
- } else {
85
- // If the list view or outline does not have focus, focus should be moved to it.
86
- handleSidebarFocus(tab);
87
- }
88
- }, [closeListView, tab]);
89
-
90
- // This only fires when the sidebar is open because of the conditional rendering.
91
- // It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
92
- useShortcut('core/edit-post/toggle-list-view', handleToggleListViewShortcut);
93
-
94
- /**
95
- * Render tab content for a given tab name.
96
- *
97
- * @param {string} tabName The name of the tab to render.
98
- */
99
- function renderTabContent(tabName) {
100
- if (tabName === 'list-view') {
101
- return createElement("div", {
102
- className: "edit-post-editor__list-view-panel-content"
103
- }, createElement(ListView, {
104
- dropZoneElement: dropZoneElement
105
- }));
106
- }
107
- return createElement(ListViewOutline, null);
108
- }
109
- return (
110
- // eslint-disable-next-line jsx-a11y/no-static-element-interactions
111
- createElement("div", {
112
- className: "edit-post-editor__document-overview-panel",
113
- onKeyDown: closeOnEscape,
114
- ref: sidebarRef
115
- }, createElement(Button, {
116
- className: "edit-post-editor__document-overview-panel__close-button",
117
- icon: closeSmall,
118
- label: __('Close'),
119
- onClick: closeListView
120
- }), createElement(TabPanel, {
121
- className: "edit-post-editor__document-overview-panel__tab-panel",
122
- ref: tabPanelRef,
123
- onSelect: tabName => setTab(tabName),
124
- selectOnMove: false,
125
- tabs: [{
126
- name: 'list-view',
127
- title: _x('List View', 'Post overview'),
128
- className: 'edit-post-sidebar__panel-tab'
129
- }, {
130
- name: 'outline',
131
- title: _x('Outline', 'Post overview'),
132
- className: 'edit-post-sidebar__panel-tab'
133
- }]
134
- }, currentTab => createElement("div", {
135
- className: "edit-post-editor__list-view-container",
136
- ref: listViewContainerRef
137
- }, renderTabContent(currentTab.name))))
138
- );
139
- }
140
- //# sourceMappingURL=list-view-sidebar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__experimentalListView","ListView","Button","TabPanel","useFocusOnMount","useMergeRefs","useDispatch","focus","useCallback","useRef","useState","__","_x","closeSmall","useShortcut","ESCAPE","store","editPostStore","ListViewOutline","ListViewSidebar","listViewToggleElement","setIsListViewOpened","focusOnMountRef","closeListView","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","tab","setTab","sidebarRef","tabPanelRef","listViewRef","listViewContainerRef","handleSidebarFocus","currentTab","tabPanelFocus","tabbable","find","current","listViewApplicationFocus","listViewFocusArea","contains","handleToggleListViewShortcut","ownerDocument","activeElement","renderTabContent","tabName","createElement","className","onKeyDown","ref","icon","label","onClick","onSelect","selectOnMove","tabs","name","title"],"sources":["@wordpress/edit-post/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useCallback, useRef, useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport ListViewOutline from './list-view-outline';\n\nexport default function ListViewSidebar( { listViewToggleElement } ) {\n\tconst { setIsListViewOpened } = useDispatch( editPostStore );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tlistViewToggleElement?.focus();\n\t}, [ listViewToggleElement, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabPanelRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabPanelRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\tconst handleToggleListViewShortcut = useCallback( () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tcloseListView();\n\t\t} else {\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t}, [ closeListView, tab ] );\n\n\t// This only fires when the sidebar is open because of the conditional rendering.\n\t// It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut(\n\t\t'core/edit-post/toggle-list-view',\n\t\thandleToggleListViewShortcut\n\t);\n\n\t/**\n\t * Render tab content for a given tab name.\n\t *\n\t * @param {string} tabName The name of the tab to render.\n\t */\n\tfunction renderTabContent( tabName ) {\n\t\tif ( tabName === 'list-view' ) {\n\t\t\treturn (\n\t\t\t\t<div className=\"edit-post-editor__list-view-panel-content\">\n\t\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn <ListViewOutline />;\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-post-editor__document-overview-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__close-button\"\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\tonClick={ closeListView }\n\t\t\t/>\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"edit-post-editor__document-overview-panel__tab-panel\"\n\t\t\t\tref={ tabPanelRef }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tselectOnMove={ false }\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: _x( 'List View', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: _x( 'Outline', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'edit-post-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ ( currentTab ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-post-editor__list-view-container\"\n\t\t\t\t\t\tref={ list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,aAAA;MACCC,SAAS,EAAC,uCAAuC;MACjDE,GAAG,EAAGlB;IAAsB,GAE1Ba,gBAAgB,CAAEX,UAAU,CAACuB,IAAK,CAChC,CAEG,CACN;EAAC;AAER"}
@@ -1,52 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { __ } from '@wordpress/i18n';
6
- import { PanelBody, PanelRow } from '@wordpress/components';
7
- import { PostComments, PostPingbacks, PostTypeSupportCheck } from '@wordpress/editor';
8
- import { useDispatch, useSelect } from '@wordpress/data';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import { store as editPostStore } from '../../../store';
14
-
15
- /**
16
- * Module Constants
17
- */
18
- const PANEL_NAME = 'discussion-panel';
19
- function DiscussionPanel() {
20
- const {
21
- isEnabled,
22
- isOpened
23
- } = useSelect(select => {
24
- const {
25
- isEditorPanelEnabled,
26
- isEditorPanelOpened
27
- } = select(editPostStore);
28
- return {
29
- isEnabled: isEditorPanelEnabled(PANEL_NAME),
30
- isOpened: isEditorPanelOpened(PANEL_NAME)
31
- };
32
- }, []);
33
- const {
34
- toggleEditorPanelOpened
35
- } = useDispatch(editPostStore);
36
- if (!isEnabled) {
37
- return null;
38
- }
39
- return createElement(PostTypeSupportCheck, {
40
- supportKeys: ['comments', 'trackbacks']
41
- }, createElement(PanelBody, {
42
- title: __('Discussion'),
43
- opened: isOpened,
44
- onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
45
- }, createElement(PostTypeSupportCheck, {
46
- supportKeys: "comments"
47
- }, createElement(PanelRow, null, createElement(PostComments, null))), createElement(PostTypeSupportCheck, {
48
- supportKeys: "trackbacks"
49
- }, createElement(PanelRow, null, createElement(PostPingbacks, null)))));
50
- }
51
- export default DiscussionPanel;
52
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__","PanelBody","PanelRow","PostComments","PostPingbacks","PostTypeSupportCheck","useDispatch","useSelect","store","editPostStore","PANEL_NAME","DiscussionPanel","isEnabled","isOpened","select","isEditorPanelEnabled","isEditorPanelOpened","toggleEditorPanelOpened","createElement","supportKeys","title","opened","onToggle"],"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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B;IAACc,WAAW,EAAC;EAAY,GAC7CD,aAAA,CAAChB,QAAQ,QACRgB,aAAA,CAACd,aAAa,MAAE,CACP,CACW,CACZ,CACU,CAAC;AAEzB;AAEA,eAAeO,eAAe"}
@@ -1,63 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { __ } from '@wordpress/i18n';
6
- import { PanelBody } from '@wordpress/components';
7
- import { PostFeaturedImage, PostFeaturedImageCheck, store as editorStore } from '@wordpress/editor';
8
- import { compose } from '@wordpress/compose';
9
- import { withSelect, withDispatch } from '@wordpress/data';
10
- import { store as coreStore } from '@wordpress/core-data';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import { store as editPostStore } from '../../../store';
16
-
17
- /**
18
- * Module Constants
19
- */
20
- const PANEL_NAME = 'featured-image';
21
- function FeaturedImage({
22
- isEnabled,
23
- isOpened,
24
- postType,
25
- onTogglePanel
26
- }) {
27
- var _postType$labels$feat;
28
- if (!isEnabled) {
29
- return null;
30
- }
31
- return createElement(PostFeaturedImageCheck, null, createElement(PanelBody, {
32
- title: (_postType$labels$feat = postType?.labels?.featured_image) !== null && _postType$labels$feat !== void 0 ? _postType$labels$feat : __('Featured image'),
33
- opened: isOpened,
34
- onToggle: onTogglePanel
35
- }, createElement(PostFeaturedImage, null)));
36
- }
37
- const applyWithSelect = withSelect(select => {
38
- const {
39
- getEditedPostAttribute
40
- } = select(editorStore);
41
- const {
42
- getPostType
43
- } = select(coreStore);
44
- const {
45
- isEditorPanelEnabled,
46
- isEditorPanelOpened
47
- } = select(editPostStore);
48
- return {
49
- postType: getPostType(getEditedPostAttribute('type')),
50
- isEnabled: isEditorPanelEnabled(PANEL_NAME),
51
- isOpened: isEditorPanelOpened(PANEL_NAME)
52
- };
53
- });
54
- const applyWithDispatch = withDispatch(dispatch => {
55
- const {
56
- toggleEditorPanelOpened
57
- } = dispatch(editPostStore);
58
- return {
59
- onTogglePanel: (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args)
60
- };
61
- });
62
- export default compose(applyWithSelect, applyWithDispatch)(FeaturedImage);
63
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__","PanelBody","PostFeaturedImage","PostFeaturedImageCheck","store","editorStore","compose","withSelect","withDispatch","coreStore","editPostStore","PANEL_NAME","FeaturedImage","isEnabled","isOpened","postType","onTogglePanel","_postType$labels$feat","createElement","title","labels","featured_image","opened","onToggle","applyWithSelect","select","getEditedPostAttribute","getPostType","isEditorPanelEnabled","isEditorPanelOpened","applyWithDispatch","dispatch","toggleEditorPanelOpened","args"],"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":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SACCC,iBAAiB,EACjBC,sBAAsB,EACtBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASJ,KAAK,IAAIK,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASL,KAAK,IAAIM,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,MAAMC,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,OACCK,aAAA,CAACf,sBAAsB,QACtBe,aAAA,CAACjB,SAAS;IACTkB,KAAK,GAAAF,qBAAA,GACJF,QAAQ,EAAEK,MAAM,EAAEC,cAAc,cAAAJ,qBAAA,cAAAA,qBAAA,GAAIjB,EAAE,CAAE,gBAAiB,CACzD;IACDsB,MAAM,EAAGR,QAAU;IACnBS,QAAQ,EAAGP;EAAe,GAE1BE,aAAA,CAAChB,iBAAiB,MAAE,CACV,CACY,CAAC;AAE3B;AAEA,MAAMsB,eAAe,GAAGjB,UAAU,CAAIkB,MAAM,IAAM;EACjD,MAAM;IAAEC;EAAuB,CAAC,GAAGD,MAAM,CAAEpB,WAAY,CAAC;EACxD,MAAM;IAAEsB;EAAY,CAAC,GAAGF,MAAM,CAAEhB,SAAU,CAAC;EAC3C,MAAM;IAAEmB,oBAAoB;IAAEC;EAAoB,CAAC,GAClDJ,MAAM,CAAEf,aAAc,CAAC;EAExB,OAAO;IACNK,QAAQ,EAAEY,WAAW,CAAED,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDb,SAAS,EAAEe,oBAAoB,CAAEjB,UAAW,CAAC;IAC7CG,QAAQ,EAAEe,mBAAmB,CAAElB,UAAW;EAC3C,CAAC;AACF,CAAE,CAAC;AAEH,MAAMmB,iBAAiB,GAAGtB,YAAY,CAAIuB,QAAQ,IAAM;EACvD,MAAM;IAAEC;EAAwB,CAAC,GAAGD,QAAQ,CAAErB,aAAc,CAAC;EAE7D,OAAO;IACNM,aAAa,EAAEA,CAAE,GAAGiB,IAAI,KACvBD,uBAAuB,CAAErB,UAAU,EAAE,GAAGsB,IAAK;EAC/C,CAAC;AACF,CAAE,CAAC;AAEH,eAAe3B,OAAO,CAAEkB,eAAe,EAAEM,iBAAkB,CAAC,CAAElB,aAAc,CAAC"}
@@ -1,13 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { PanelBody } from '@wordpress/components';
6
- import { PostLastRevision, PostLastRevisionCheck } from '@wordpress/editor';
7
- function LastRevision() {
8
- return createElement(PostLastRevisionCheck, null, createElement(PanelBody, {
9
- className: "edit-post-last-revision__panel"
10
- }, createElement(PostLastRevision, null)));
11
- }
12
- export default LastRevision;
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["PanelBody","PostLastRevision","PostLastRevisionCheck","LastRevision","createElement","className"],"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":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;AACjD,SAASC,gBAAgB,EAAEC,qBAAqB,QAAQ,mBAAmB;AAE3E,SAASC,YAAYA,CAAA,EAAG;EACvB,OACCC,aAAA,CAACF,qBAAqB,QACrBE,aAAA,CAACJ,SAAS;IAACK,SAAS,EAAC;EAAgC,GACpDD,aAAA,CAACH,gBAAgB,MAAE,CACT,CACW,CAAC;AAE1B;AAEA,eAAeE,YAAY"}
@@ -1,57 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { __ } from '@wordpress/i18n';
6
- import { PanelBody, PanelRow } from '@wordpress/components';
7
- import { store as editorStore, PageAttributesCheck, PageAttributesOrder, PageAttributesParent } from '@wordpress/editor';
8
- import { useSelect, useDispatch } from '@wordpress/data';
9
- import { store as coreStore } from '@wordpress/core-data';
10
-
11
- /**
12
- * Internal dependencies
13
- */
14
- import { store as editPostStore } from '../../../store';
15
-
16
- /**
17
- * Module Constants
18
- */
19
- const PANEL_NAME = 'page-attributes';
20
- export function PageAttributes() {
21
- var _postType$labels$attr;
22
- const {
23
- isEnabled,
24
- isOpened,
25
- postType
26
- } = useSelect(select => {
27
- const {
28
- getEditedPostAttribute
29
- } = select(editorStore);
30
- const {
31
- isEditorPanelEnabled,
32
- isEditorPanelOpened
33
- } = select(editPostStore);
34
- const {
35
- getPostType
36
- } = select(coreStore);
37
- return {
38
- isEnabled: isEditorPanelEnabled(PANEL_NAME),
39
- isOpened: isEditorPanelOpened(PANEL_NAME),
40
- postType: getPostType(getEditedPostAttribute('type'))
41
- };
42
- }, []);
43
- const {
44
- toggleEditorPanelOpened
45
- } = useDispatch(editPostStore);
46
- if (!isEnabled || !postType) {
47
- return null;
48
- }
49
- const onTogglePanel = (...args) => toggleEditorPanelOpened(PANEL_NAME, ...args);
50
- return createElement(PageAttributesCheck, null, createElement(PanelBody, {
51
- title: (_postType$labels$attr = postType?.labels?.attributes) !== null && _postType$labels$attr !== void 0 ? _postType$labels$attr : __('Page attributes'),
52
- opened: isOpened,
53
- onToggle: onTogglePanel
54
- }, createElement(PageAttributesParent, null), createElement(PanelRow, null, createElement(PageAttributesOrder, null))));
55
- }
56
- export default PageAttributes;
57
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__","PanelBody","PanelRow","store","editorStore","PageAttributesCheck","PageAttributesOrder","PageAttributesParent","useSelect","useDispatch","coreStore","editPostStore","PANEL_NAME","PageAttributes","_postType$labels$attr","isEnabled","isOpened","postType","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","getPostType","toggleEditorPanelOpened","onTogglePanel","args","createElement","title","labels","attributes","opened","onToggle"],"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":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,uBAAuB;AAC3D,SACCC,KAAK,IAAIC,WAAW,EACpBC,mBAAmB,EACnBC,mBAAmB,EACnBC,oBAAoB,QACd,mBAAmB;AAC1B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASN,KAAK,IAAIO,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,MAAMC,UAAU,GAAG,iBAAiB;AAEpC,OAAO,SAASC,cAAcA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EAChC,MAAM;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IAClE,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEd,WAAY,CAAC;IACxD,MAAM;MAAEgB,oBAAoB;MAAEC;IAAoB,CAAC,GAClDH,MAAM,CAAEP,aAAc,CAAC;IACxB,MAAM;MAAEW;IAAY,CAAC,GAAGJ,MAAM,CAAER,SAAU,CAAC;IAC3C,OAAO;MACNK,SAAS,EAAEK,oBAAoB,CAAER,UAAW,CAAC;MAC7CI,QAAQ,EAAEK,mBAAmB,CAAET,UAAW,CAAC;MAC3CK,QAAQ,EAAEK,WAAW,CAAEH,sBAAsB,CAAE,MAAO,CAAE;IACzD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEI;EAAwB,CAAC,GAAGd,WAAW,CAAEE,aAAc,CAAC;EAEhE,IAAK,CAAEI,SAAS,IAAI,CAAEE,QAAQ,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,MAAMO,aAAa,GAAGA,CAAE,GAAGC,IAAI,KAC9BF,uBAAuB,CAAEX,UAAU,EAAE,GAAGa,IAAK,CAAC;EAE/C,OACCC,aAAA,CAACrB,mBAAmB,QACnBqB,aAAA,CAACzB,SAAS;IACT0B,KAAK,GAAAb,qBAAA,GACJG,QAAQ,EAAEW,MAAM,EAAEC,UAAU,cAAAf,qBAAA,cAAAA,qBAAA,GAAId,EAAE,CAAE,iBAAkB,CACtD;IACD8B,MAAM,EAAGd,QAAU;IACnBe,QAAQ,EAAGP;EAAe,GAE1BE,aAAA,CAACnB,oBAAoB,MAAE,CAAC,EACxBmB,aAAA,CAACxB,QAAQ,QACRwB,aAAA,CAACpB,mBAAmB,MAAE,CACb,CACA,CACS,CAAC;AAExB;AAEA,eAAeO,cAAc"}
@@ -1,64 +0,0 @@
1
- import { createElement } from "react";
2
- /**
3
- * Defines as extensibility slot for the Excerpt panel.
4
- */
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
- import { createSlotFill, PanelRow } from '@wordpress/components';
10
- const {
11
- Fill,
12
- Slot
13
- } = createSlotFill('PluginPostExcerpt');
14
-
15
- /**
16
- * Renders a post excerpt panel in the post sidebar.
17
- *
18
- * @param {Object} props Component properties.
19
- * @param {string} [props.className] An optional class name added to the row.
20
- * @param {Element} props.children Children to be rendered.
21
- *
22
- * @example
23
- * ```js
24
- * // Using ES5 syntax
25
- * var __ = wp.i18n.__;
26
- * var PluginPostExcerpt = wp.editPost.PluginPostExcerpt;
27
- *
28
- * function MyPluginPostExcerpt() {
29
- * return React.createElement(
30
- * PluginPostExcerpt,
31
- * {
32
- * className: 'my-plugin-post-excerpt',
33
- * },
34
- * __( 'Post excerpt custom content' )
35
- * )
36
- * }
37
- * ```
38
- *
39
- * @example
40
- * ```jsx
41
- * // Using ESNext syntax
42
- * import { __ } from '@wordpress/i18n';
43
- * import { PluginPostExcerpt } from '@wordpress/edit-post';
44
- *
45
- * const MyPluginPostExcerpt = () => (
46
- * <PluginPostExcerpt className="my-plugin-post-excerpt">
47
- * { __( 'Post excerpt custom content' ) }
48
- * </PluginPostExcerpt>
49
- * );
50
- * ```
51
- *
52
- * @return {Component} The component to be rendered.
53
- */
54
- const PluginPostExcerpt = ({
55
- children,
56
- className
57
- }) => {
58
- return createElement(Fill, null, createElement(PanelRow, {
59
- className: className
60
- }, children));
61
- };
62
- PluginPostExcerpt.Slot = Slot;
63
- export default PluginPostExcerpt;
64
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createSlotFill","PanelRow","Fill","Slot","PluginPostExcerpt","children","className","createElement"],"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":";AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,QAAQ,QAAQ,uBAAuB;AAEhE,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGH,cAAc,CAAE,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,MAAMI,iBAAiB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KAAM;EACxD,OACCC,aAAA,CAACL,IAAI,QACJK,aAAA,CAACN,QAAQ;IAACK,SAAS,EAAGA;EAAW,GAAGD,QAAoB,CACnD,CAAC;AAET,CAAC;AAEDD,iBAAiB,CAACD,IAAI,GAAGA,IAAI;AAE7B,eAAeC,iBAAiB"}
@@ -1,47 +0,0 @@
1
- import { createElement, Fragment } from "react";
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { __ } from '@wordpress/i18n';
6
- import { PanelBody } from '@wordpress/components';
7
- import { PostExcerpt as PostExcerptForm, PostExcerptCheck } from '@wordpress/editor';
8
- import { useDispatch, useSelect } from '@wordpress/data';
9
-
10
- /**
11
- * Internal dependencies
12
- */
13
- import { store as editPostStore } from '../../../store';
14
- import PluginPostExcerpt from '../plugin-post-excerpt';
15
-
16
- /**
17
- * Module Constants
18
- */
19
- const PANEL_NAME = 'post-excerpt';
20
- export default function PostExcerpt() {
21
- const {
22
- isOpened,
23
- isEnabled
24
- } = useSelect(select => {
25
- const {
26
- isEditorPanelOpened,
27
- isEditorPanelEnabled
28
- } = select(editPostStore);
29
- return {
30
- isOpened: isEditorPanelOpened(PANEL_NAME),
31
- isEnabled: isEditorPanelEnabled(PANEL_NAME)
32
- };
33
- }, []);
34
- const {
35
- toggleEditorPanelOpened
36
- } = useDispatch(editPostStore);
37
- const toggleExcerptPanel = () => toggleEditorPanelOpened(PANEL_NAME);
38
- if (!isEnabled) {
39
- return null;
40
- }
41
- return createElement(PostExcerptCheck, null, createElement(PanelBody, {
42
- title: __('Excerpt'),
43
- opened: isOpened,
44
- onToggle: toggleExcerptPanel
45
- }, createElement(PluginPostExcerpt.Slot, null, fills => createElement(Fragment, null, createElement(PostExcerptForm, null), fills))));
46
- }
47
- //# sourceMappingURL=index.js.map