@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
@@ -30,91 +30,64 @@ export default function EditPostPreferencesModal() {
30
30
  getEditorSettings
31
31
  } = select(editorStore);
32
32
  const {
33
- getEditorMode,
34
- isFeatureActive
33
+ getEditorMode
35
34
  } = select(editPostStore);
35
+ const {
36
+ get
37
+ } = select(preferencesStore);
36
38
  const modalActive = select(interfaceStore).isModalActive(PREFERENCES_MODAL_NAME);
37
39
  const mode = getEditorMode();
38
40
  const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
39
- const isDistractionFreeEnabled = isFeatureActive('distractionFree');
41
+ const isDistractionFreeEnabled = get('core', 'distractionFree');
40
42
  return [modalActive, !isDistractionFreeEnabled && isLargeViewport && isRichEditingEnabled && mode === 'visual', isDistractionFreeEnabled];
41
43
  }, [isLargeViewport]);
42
44
  const {
43
- closeGeneralSidebar,
45
+ closeGeneralSidebar
46
+ } = useDispatch(editPostStore);
47
+ const {
44
48
  setIsListViewOpened,
45
49
  setIsInserterOpened
46
- } = useDispatch(editPostStore);
50
+ } = useDispatch(editorStore);
47
51
  const {
48
52
  set: setPreference
49
53
  } = useDispatch(preferencesStore);
50
54
  const toggleDistractionFree = () => {
51
- setPreference('core/edit-post', 'fixedToolbar', true);
55
+ setPreference('core', 'fixedToolbar', true);
52
56
  setIsInserterOpened(false);
53
57
  setIsListViewOpened(false);
54
58
  closeGeneralSidebar();
55
59
  };
60
+ const turnOffDistractionFree = () => {
61
+ setPreference('core', 'distractionFree', false);
62
+ };
56
63
  const sections = useMemo(() => [{
57
64
  name: 'general',
58
65
  tabLabel: __('General'),
59
66
  content: createElement(Fragment, null, isLargeViewport && createElement(PreferencesModalSection, {
60
- title: __('Publishing'),
61
- description: __('Change options related to publishing.')
67
+ title: __('Publishing')
62
68
  }, createElement(EnablePublishSidebarOption, {
63
69
  help: __('Review settings, such as visibility and tags.'),
64
- label: __('Include pre-publish checklist')
70
+ label: __('Enable pre-publish checks')
65
71
  })), createElement(PreferencesModalSection, {
66
- title: __('Appearance'),
67
- description: __('Customize options related to the block editor interface and editing flow.')
72
+ title: __('Interface')
68
73
  }, createElement(EnableFeature, {
69
- featureName: "distractionFree",
70
- onToggle: toggleDistractionFree,
71
- help: __('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
72
- label: __('Distraction free')
73
- }), createElement(EnableFeature, {
74
- featureName: "focusMode",
75
- help: __('Highlights the current block and fades other content.'),
76
- label: __('Spotlight mode')
77
- }), createElement(EnableFeature, {
78
- featureName: "showIconLabels",
79
- label: __('Show button text labels'),
80
- help: __('Show text instead of icons on buttons.')
81
- }), createElement(EnableFeature, {
74
+ scope: "core",
82
75
  featureName: "showListViewByDefault",
83
76
  help: __('Opens the block list view sidebar by default.'),
84
77
  label: __('Always open list view')
85
- }), createElement(EnableFeature, {
86
- featureName: "themeStyles",
87
- help: __('Make the editor look like your theme.'),
88
- label: __('Use theme styles')
89
78
  }), showBlockBreadcrumbsOption && createElement(EnableFeature, {
79
+ scope: "core",
90
80
  featureName: "showBlockBreadcrumbs",
91
- help: __('Shows block breadcrumbs at the bottom of the editor.'),
92
- label: __('Display block breadcrumbs')
93
- })))
94
- }, {
95
- name: 'blocks',
96
- tabLabel: __('Blocks'),
97
- content: createElement(Fragment, null, createElement(PreferencesModalSection, {
98
- title: __('Block interactions'),
99
- description: __('Customize how you interact with blocks in the block library and editing canvas.')
100
- }, createElement(EnableFeature, {
101
- featureName: "mostUsedBlocks",
102
- help: __('Places the most frequent blocks in the block library.'),
103
- label: __('Show most used blocks')
81
+ help: __('Display the block hierarchy trail at the bottom of the editor.'),
82
+ label: __('Show block breadcrumbs')
104
83
  }), createElement(EnableFeature, {
105
- featureName: "keepCaretInsideBlock",
106
- help: __('Aids screen readers by stopping text caret from leaving blocks.'),
107
- label: __('Contain text cursor inside block')
84
+ scope: "core",
85
+ featureName: "allowRightClickOverrides",
86
+ help: __('Allows contextual list view menus via right-click, overriding browser defaults.'),
87
+ label: __('Allow right-click contextual menus')
108
88
  })), createElement(PreferencesModalSection, {
109
- title: __('Visible blocks'),
110
- description: __("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")
111
- }, createElement(BlockManager, null)))
112
- }, {
113
- name: 'panels',
114
- tabLabel: __('Panels'),
115
- content: createElement(Fragment, null, createElement(PreferencesModalSection, {
116
89
  title: __('Document settings'),
117
- description: __('Choose what displays in the panel.')
90
+ description: __('Select what settings are shown in the document panel.')
118
91
  }, createElement(EnablePluginDocumentSettingPanelOption.Slot, null), createElement(PostTaxonomies, {
119
92
  taxonomyWrapper: (content, taxonomy) => createElement(EnablePanelOption, {
120
93
  label: taxonomy.labels.menu_name,
@@ -135,9 +108,69 @@ export default function EditPostPreferencesModal() {
135
108
  label: __('Page attributes'),
136
109
  panelName: "page-attributes"
137
110
  }))), createElement(MetaBoxesSection, {
138
- title: __('Additional'),
139
- description: __('Add extra areas to the editor.')
111
+ title: __('Advanced')
140
112
  }))
113
+ }, {
114
+ name: 'appearance',
115
+ tabLabel: __('Appearance'),
116
+ content: createElement(PreferencesModalSection, {
117
+ title: __('Appearance'),
118
+ description: __('Customize the editor interface to suit your needs.')
119
+ }, createElement(EnableFeature, {
120
+ scope: "core",
121
+ featureName: "fixedToolbar",
122
+ onToggle: turnOffDistractionFree,
123
+ help: __('Access all block and document tools in a single place.'),
124
+ label: __('Top toolbar')
125
+ }), createElement(EnableFeature, {
126
+ scope: "core",
127
+ featureName: "distractionFree",
128
+ onToggle: toggleDistractionFree,
129
+ help: __('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
130
+ label: __('Distraction free')
131
+ }), createElement(EnableFeature, {
132
+ scope: "core",
133
+ featureName: "focusMode",
134
+ help: __('Highlights the current block and fades other content.'),
135
+ label: __('Spotlight mode')
136
+ }), createElement(EnableFeature, {
137
+ featureName: "themeStyles",
138
+ help: __('Make the editor look like your theme.'),
139
+ label: __('Use theme styles')
140
+ }))
141
+ }, {
142
+ name: 'accessibility',
143
+ tabLabel: __('Accessibility'),
144
+ content: createElement(Fragment, null, createElement(PreferencesModalSection, {
145
+ title: __('Navigation'),
146
+ description: __('Optimize the editing experience for enhanced control.')
147
+ }, createElement(EnableFeature, {
148
+ scope: "core",
149
+ featureName: "keepCaretInsideBlock",
150
+ help: __('Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'),
151
+ label: __('Contain text cursor inside block')
152
+ })), createElement(PreferencesModalSection, {
153
+ title: __('Interface')
154
+ }, createElement(EnableFeature, {
155
+ scope: "core",
156
+ featureName: "showIconLabels",
157
+ label: __('Show button text labels'),
158
+ help: __('Show text instead of icons on buttons across the interface.')
159
+ })))
160
+ }, {
161
+ name: 'blocks',
162
+ tabLabel: __('Blocks'),
163
+ content: createElement(Fragment, null, createElement(PreferencesModalSection, {
164
+ title: __('Inserter')
165
+ }, createElement(EnableFeature, {
166
+ scope: "core",
167
+ featureName: "mostUsedBlocks",
168
+ help: __('Adds a category with the most frequently used blocks in the inserter.'),
169
+ label: __('Show most used blocks')
170
+ })), createElement(PreferencesModalSection, {
171
+ title: __('Manage block visibility'),
172
+ description: __("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")
173
+ }, createElement(BlockManager, null)))
141
174
  }], [isLargeViewport, showBlockBreadcrumbsOption]);
142
175
  if (!isModalActive) {
143
176
  return null;
@@ -1 +1 @@
1
- {"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","PostTaxonomies","PostExcerptCheck","PageAttributesCheck","PostFeaturedImageCheck","PostTypeSupportCheck","store","editorStore","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","interfaceStore","preferencesStore","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","EnablePanelOption","EnableFeature","MetaBoxesSection","editPostStore","BlockManager","PREFERENCES_MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","isModalActive","showBlockBreadcrumbsOption","select","getEditorSettings","getEditorMode","isFeatureActive","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","sections","name","tabLabel","content","createElement","Fragment","title","description","help","label","featureName","onToggle","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', true );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,cAAc,EACdC,gBAAgB,EAChBC,mBAAmB,EACnBC,sBAAsB,EACtBC,oBAAoB,EACpBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SACCC,gBAAgB,EAChBC,oBAAoB,EACpBC,uBAAuB,EACvBJ,KAAK,IAAIK,cAAc,QACjB,sBAAsB;AAC7B,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;;AAEA,SACCC,sCAAsC,EACtCC,0BAA0B,EAC1BC,iBAAiB,EACjBC,aAAa,QACP,WAAW;AAClB,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,SAASX,KAAK,IAAIY,aAAa,QAAQ,aAAa;AACpD,OAAOC,YAAY,MAAM,kBAAkB;AAE3C,OAAO,MAAMC,sBAAsB,GAAG,uBAAuB;AAE7D,eAAe,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,eAAe,GAAGzB,gBAAgB,CAAE,QAAS,CAAC;EACpD,MAAM;IAAE0B;EAAW,CAAC,GAAGxB,WAAW,CAAEY,cAAe,CAAC;EACpD,MAAM,C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AGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
1
+ {"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","PostTaxonomies","PostExcerptCheck","PageAttributesCheck","PostFeaturedImageCheck","PostTypeSupportCheck","store","editorStore","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","interfaceStore","preferencesStore","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","EnablePanelOption","EnableFeature","MetaBoxesSection","editPostStore","BlockManager","PREFERENCES_MODAL_NAME","EditPostPreferencesModal","isLargeViewport","closeModal","isModalActive","showBlockBreadcrumbsOption","select","getEditorSettings","getEditorMode","get","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","turnOffDistractionFree","sections","name","tabLabel","content","createElement","Fragment","title","help","label","scope","featureName","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","onToggle"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode } = select( editPostStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar } = useDispatch( editPostStore );\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Enable pre-publish checks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection title={ __( 'Advanced' ) } />\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'appearance',\n\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'accessibility',\n\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>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;IACdC,QAAQ,EAAEhD,EAAE,CAAE,QAAS,CAAC;IACxBiD,OAAO,EACNC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACpC,uBAAuB;MAACsC,KAAK,EAAGpD,EAAE,CAAE,UAAW;IAAG,GAClDkD,aAAA,CAAC9B,aAAa;MACbmC,KAAK,EAAC,MAAM;MACZC,WAAW,EAAC,gBAAgB;MAC5BH,IAAI,EAAGrD,EAAE,CACR,uEACD,CAAG;MACHsD,KAAK,EAAGtD,EAAE,CAAE,uBAAwB;IAAG,CACvC,CACuB,CAAC,EAC1BkD,aAAA,CAACpC,uBAAuB;MACvBsC,KAAK,EAAGpD,EAAE,CAAE,yBAA0B,CAAG;MACzCyD,WAAW,EAAGzD,EAAE,CACf,yGACD;IAAG,GAEHkD,aAAA,CAAC3B,YAAY,MAAE,CACS,CACxB;EAEJ,CAAC,CACD,EACD,CAAEG,eAAe,EAAEG,0BAA0B,CAC9C,CAAC;EAED,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACCsB,aAAA,CAACtC,gBAAgB;IAACe,UAAU,EAAGA;EAAY,GAC1CuB,aAAA,CAACrC,oBAAoB;IAACiC,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
@@ -1,30 +1,29 @@
1
+ import { createElement } from "react";
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
4
- import { compose } from '@wordpress/compose';
5
- import { withSelect, withDispatch } from '@wordpress/data';
5
+ import { useSelect, useDispatch } from '@wordpress/data';
6
6
  import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
- import { store as editPostStore } from '../../../store';
12
- export default compose(withSelect((select, {
13
- featureName
14
- }) => {
7
+ import { store as preferencesStore } from '@wordpress/preferences';
8
+ export default function EnableFeature(props) {
15
9
  const {
16
- isFeatureActive
17
- } = select(editPostStore);
18
- return {
19
- isChecked: isFeatureActive(featureName)
20
- };
21
- }), withDispatch((dispatch, {
22
- featureName,
23
- onToggle = () => {}
24
- }) => ({
25
- onChange: () => {
10
+ scope = 'core/edit-post',
11
+ featureName,
12
+ onToggle = () => {},
13
+ ...remainingProps
14
+ } = props;
15
+ const isChecked = useSelect(select => !!select(preferencesStore).get(scope, featureName), [scope, featureName]);
16
+ const {
17
+ toggle
18
+ } = useDispatch(preferencesStore);
19
+ const onChange = () => {
26
20
  onToggle();
27
- dispatch(editPostStore).toggleFeature(featureName);
28
- }
29
- })))(BaseOption);
21
+ toggle(scope, featureName);
22
+ };
23
+ return createElement(BaseOption, {
24
+ onChange: onChange,
25
+ isChecked: isChecked,
26
+ ...remainingProps
27
+ });
28
+ }
30
29
  //# sourceMappingURL=enable-feature.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["compose","withSelect","withDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","editPostStore","select","featureName","isFeatureActive","isChecked","dispatch","onToggle","onChange","toggleFeature"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-feature.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nexport default compose(\n\twithSelect( ( select, { featureName } ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\treturn {\n\t\t\tisChecked: isFeatureActive( featureName ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { featureName, onToggle = () => {} } ) => ( {\n\t\tonChange: () => {\n\t\t\tonToggle();\n\t\t\tdispatch( editPostStore ).toggleFeature( featureName );\n\t\t},\n\t} ) )\n)( BaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;;AAE1F;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;AAEvD,eAAeN,OAAO,CACrBC,UAAU,CAAE,CAAEM,MAAM,EAAE;EAAEC;AAAY,CAAC,KAAM;EAC1C,MAAM;IAAEC;EAAgB,CAAC,GAAGF,MAAM,CAAED,aAAc,CAAC;EACnD,OAAO;IACNI,SAAS,EAAED,eAAe,CAAED,WAAY;EACzC,CAAC;AACF,CAAE,CAAC,EACHN,YAAY,CAAE,CAAES,QAAQ,EAAE;EAAEH,WAAW;EAAEI,QAAQ,GAAGA,CAAA,KAAM,CAAC;AAAE,CAAC,MAAQ;EACrEC,QAAQ,EAAEA,CAAA,KAAM;IACfD,QAAQ,CAAC,CAAC;IACVD,QAAQ,CAAEL,aAAc,CAAC,CAACQ,aAAa,CAAEN,WAAY,CAAC;EACvD;AACD,CAAC,CAAG,CACL,CAAC,CAAEJ,UAAW,CAAC"}
1
+ {"version":3,"names":["useSelect","useDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","preferencesStore","EnableFeature","props","scope","featureName","onToggle","remainingProps","isChecked","select","get","toggle","onChange","createElement"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-feature.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function EnableFeature( props ) {\n\tconst {\n\t\tscope = 'core/edit-post',\n\t\tfeatureName,\n\t\tonToggle = () => {},\n\t\t...remainingProps\n\t} = props;\n\tconst isChecked = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, featureName ),\n\t\t[ scope, featureName ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst onChange = () => {\n\t\tonToggle();\n\t\ttoggle( scope, featureName );\n\t};\n\treturn (\n\t\t<BaseOption\n\t\t\tonChange={ onChange }\n\t\t\tisChecked={ isChecked }\n\t\t\t{ ...remainingProps }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;AAC1F,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAElE,eAAe,SAASC,aAAaA,CAAEC,KAAK,EAAG;EAC9C,MAAM;IACLC,KAAK,GAAG,gBAAgB;IACxBC,WAAW;IACXC,QAAQ,GAAGA,CAAA,KAAM,CAAC,CAAC;IACnB,GAAGC;EACJ,CAAC,GAAGJ,KAAK;EACT,MAAMK,SAAS,GAAGZ,SAAS,CACxBa,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAER,gBAAiB,CAAC,CAACS,GAAG,CAAEN,KAAK,EAAEC,WAAY,CAAC,EACrE,CAAED,KAAK,EAAEC,WAAW,CACrB,CAAC;EACD,MAAM;IAAEM;EAAO,CAAC,GAAGd,WAAW,CAAEI,gBAAiB,CAAC;EAClD,MAAMW,QAAQ,GAAGA,CAAA,KAAM;IACtBN,QAAQ,CAAC,CAAC;IACVK,MAAM,CAAEP,KAAK,EAAEC,WAAY,CAAC;EAC7B,CAAC;EACD,OACCQ,aAAA,CAACd,UAAU;IACVa,QAAQ,EAAGA,QAAU;IACrBJ,SAAS,EAAGA,SAAW;IAAA,GAClBD;EAAc,CACnB,CAAC;AAEJ"}
@@ -4,18 +4,14 @@
4
4
  import { compose, ifCondition } from '@wordpress/compose';
5
5
  import { withSelect, withDispatch } from '@wordpress/data';
6
6
  import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
- import { store as editPostStore } from '../../../store';
7
+ import { store as editorStore } from '@wordpress/editor';
12
8
  export default compose(withSelect((select, {
13
9
  panelName
14
10
  }) => {
15
11
  const {
16
12
  isEditorPanelEnabled,
17
13
  isEditorPanelRemoved
18
- } = select(editPostStore);
14
+ } = select(editorStore);
19
15
  return {
20
16
  isRemoved: isEditorPanelRemoved(panelName),
21
17
  isChecked: isEditorPanelEnabled(panelName)
@@ -25,6 +21,6 @@ export default compose(withSelect((select, {
25
21
  }) => !isRemoved), withDispatch((dispatch, {
26
22
  panelName
27
23
  }) => ({
28
- onChange: () => dispatch(editPostStore).toggleEditorPanelEnabled(panelName)
24
+ onChange: () => dispatch(editorStore).toggleEditorPanelEnabled(panelName)
29
25
  })))(BaseOption);
30
26
  //# sourceMappingURL=enable-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["compose","ifCondition","withSelect","withDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","editPostStore","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editPostStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( BaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;;AAE1F;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;AAEvD,eAAeP,OAAO,CACrBE,UAAU,CAAE,CAAEM,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAED,aAAc,CAAC;EACxB,OAAO;IACNK,SAAS,EAAED,oBAAoB,CAAEF,SAAU,CAAC;IAC5CI,SAAS,EAAEH,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACHR,WAAW,CAAE,CAAE;EAAEW;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/CT,YAAY,CAAE,CAAEW,QAAQ,EAAE;EAAEL;AAAU,CAAC,MAAQ;EAC9CM,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAEP,aAAc,CAAC,CAACS,wBAAwB,CAAEP,SAAU;AAChE,CAAC,CAAG,CACL,CAAC,CAAEJ,UAAW,CAAC"}
1
+ {"version":3,"names":["compose","ifCondition","withSelect","withDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","editorStore","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( BaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;AAC1F,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAExD,eAAeP,OAAO,CACrBE,UAAU,CAAE,CAAEM,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAED,WAAY,CAAC;EACtB,OAAO;IACNK,SAAS,EAAED,oBAAoB,CAAEF,SAAU,CAAC;IAC5CI,SAAS,EAAEH,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACHR,WAAW,CAAE,CAAE;EAAEW;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/CT,YAAY,CAAE,CAAEW,QAAQ,EAAE;EAAEL;AAAU,CAAC,MAAQ;EAC9CM,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAEP,WAAY,CAAC,CAACS,wBAAwB,CAAEP,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAEJ,UAAW,CAAC"}
@@ -6,12 +6,12 @@ import { createSlotFill, PanelBody } from '@wordpress/components';
6
6
  import { usePluginContext } from '@wordpress/plugins';
7
7
  import { useDispatch, useSelect } from '@wordpress/data';
8
8
  import warning from '@wordpress/warning';
9
+ import { store as editorStore } from '@wordpress/editor';
9
10
 
10
11
  /**
11
12
  * Internal dependencies
12
13
  */
13
14
  import { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';
14
- import { store as editPostStore } from '../../../store';
15
15
  const {
16
16
  Fill,
17
17
  Slot
@@ -87,7 +87,7 @@ const PluginDocumentSettingPanel = ({
87
87
  const {
88
88
  isEditorPanelOpened,
89
89
  isEditorPanelEnabled
90
- } = select(editPostStore);
90
+ } = select(editorStore);
91
91
  return {
92
92
  opened: isEditorPanelOpened(panelName),
93
93
  isEnabled: isEditorPanelEnabled(panelName)
@@ -95,7 +95,7 @@ const PluginDocumentSettingPanel = ({
95
95
  }, [panelName]);
96
96
  const {
97
97
  toggleEditorPanelOpened
98
- } = useDispatch(editPostStore);
98
+ } = useDispatch(editorStore);
99
99
  if (undefined === name) {
100
100
  typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? warning('PluginDocumentSettingPanel requires a name property.') : void 0;
101
101
  }
@@ -1 +1 @@
1
- {"version":3,"names":["createSlotFill","PanelBody","usePluginContext","useDispatch","useSelect","warning","EnablePluginDocumentSettingPanelOption","store","editPostStore","Fill","Slot","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","panelName","opened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","undefined","SCRIPT_DEBUG","createElement","Fragment","label","onToggle"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';\nimport { store as editPostStore } from '../../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = React.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editPostStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,SAASC,sCAAsC,QAAQ,iCAAiC;AACxF,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;AAEvD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGV,cAAc,CAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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","PanelBody","usePluginContext","useDispatch","useSelect","warning","store","editorStore","EnablePluginDocumentSettingPanelOption","Fill","Slot","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","panelName","opened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","undefined","SCRIPT_DEBUG","createElement","Fragment","label","onToggle"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = React.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/edit-post';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,OAAOC,OAAO,MAAM,oBAAoB;AACxC,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASC,sCAAsC,QAAQ,iCAAiC;AAExF,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGV,cAAc,CAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMW,0BAA0B,GAAGA,CAAE;EACpCC,IAAI;EACJC,SAAS;EACTC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KAAM;EACN,MAAM;IAAEJ,IAAI,EAAEK;EAAW,CAAC,GAAGf,gBAAgB,CAAC,CAAC;EAC/C,MAAMgB,SAAS,GAAI,GAAGD,UAAY,IAAIL,IAAM,EAAC;EAC7C,MAAM;IAAEO,MAAM;IAAEC;EAAU,CAAC,GAAGhB,SAAS,CACpCiB,MAAM,IAAM;IACb,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEd,WAAY,CAAC;IAEtB,OAAO;MACNY,MAAM,EAAEG,mBAAmB,CAAEJ,SAAU,CAAC;MACxCE,SAAS,EAAEG,oBAAoB,CAAEL,SAAU;IAC5C,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,CACZ,CAAC;EACD,MAAM;IAAEM;EAAwB,CAAC,GAAGrB,WAAW,CAAEI,WAAY,CAAC;EAE9D,IAAKkB,SAAS,KAAKb,IAAI,EAAG;IACzB,OAAAc,YAAA,oBAAAA,YAAA,YAAArB,OAAO,CAAE,sDAAuD,CAAC;EAClE;EAEA,OACCsB,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACnB,sCAAsC;IACtCqB,KAAK,EAAGf,KAAO;IACfI,SAAS,EAAGA;EAAW,CACvB,CAAC,EACFS,aAAA,CAAClB,IAAI,QACFW,SAAS,IACVO,aAAA,CAAC1B,SAAS;IACTY,SAAS,EAAGA,SAAW;IACvBC,KAAK,EAAGA,KAAO;IACfC,IAAI,EAAGA,IAAM;IACbI,MAAM,EAAGA,MAAQ;IACjBW,QAAQ,EAAGA,CAAA,KAAMN,uBAAuB,CAAEN,SAAU;EAAG,GAErDF,QACQ,CAEP,CACL,CAAC;AAEL,CAAC;AAEDL,0BAA0B,CAACD,IAAI,GAAGA,IAAI;AAEtC,eAAeC,0BAA0B"}
@@ -8,11 +8,6 @@ import { __ } from '@wordpress/i18n';
8
8
  import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
9
9
  import { store as editorStore } from '@wordpress/editor';
10
10
 
11
- /**
12
- * Internal dependencies
13
- */
14
- import { store as editPostStore } from '../../../store';
15
-
16
11
  /**
17
12
  * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.
18
13
  * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.
@@ -84,13 +79,11 @@ export default function PluginSidebarEditPost({
84
79
  }) {
85
80
  const {
86
81
  postTitle,
87
- shortcut,
88
- showIconLabels
82
+ shortcut
89
83
  } = useSelect(select => {
90
84
  return {
91
85
  postTitle: select(editorStore).getEditedPostAttribute('title'),
92
- shortcut: select(keyboardShortcutsStore).getShortcutRepresentation('core/edit-post/toggle-sidebar'),
93
- showIconLabels: select(editPostStore).isFeatureActive('showIconLabels')
86
+ shortcut: select(keyboardShortcutsStore).getShortcutRepresentation('core/edit-post/toggle-sidebar')
94
87
  };
95
88
  }, []);
96
89
  return createElement(ComplementaryArea, {
@@ -99,7 +92,6 @@ export default function PluginSidebarEditPost({
99
92
  smallScreenTitle: postTitle || __('(no title)'),
100
93
  scope: "core/edit-post",
101
94
  toggleShortcut: shortcut,
102
- showIconLabels: showIconLabels,
103
95
  ...props
104
96
  });
105
97
  }
@@ -1 +1 @@
1
- {"version":3,"names":["ComplementaryArea","useSelect","__","store","keyboardShortcutsStore","editorStore","editPostStore","PluginSidebarEditPost","className","props","postTitle","shortcut","showIconLabels","select","getEditedPostAttribute","getShortcutRepresentation","isFeatureActive","createElement","panelClassName","smallScreenTitle","scope","toggleShortcut"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = React.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editPost.PluginSidebar;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditPost( { className, ...props } ) {\n\tconst { postTitle, shortcut, showIconLabels } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostTitle: select( editorStore ).getEditedPostAttribute( 'title' ),\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-post-sidebar\"\n\t\t\tsmallScreenTitle={ postTitle || __( '(no title)' ) }\n\t\t\tscope=\"core/edit-post\"\n\t\t\ttoggleShortcut={ shortcut }\n\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASF,KAAK,IAAIG,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACxE,MAAM;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAe,CAAC,GAAGX,SAAS,CAAIY,MAAM,IAAM;IACxE,OAAO;MACNH,SAAS,EAAEG,MAAM,CAAER,WAAY,CAAC,CAACS,sBAAsB,CAAE,OAAQ,CAAC;MAClEH,QAAQ,EAAEE,MAAM,CACfT,sBACD,CAAC,CAACW,yBAAyB,CAAE,+BAAgC,CAAC;MAC9DH,cAAc,EACbC,MAAM,CAAEP,aAAc,CAAC,CAACU,eAAe,CAAE,gBAAiB;IAC5D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACCC,aAAA,CAACjB,iBAAiB;IACjBkB,cAAc,EAAGV,SAAW;IAC5BA,SAAS,EAAC,mBAAmB;IAC7BW,gBAAgB,EAAGT,SAAS,IAAIR,EAAE,CAAE,YAAa,CAAG;IACpDkB,KAAK,EAAC,gBAAgB;IACtBC,cAAc,EAAGV,QAAU;IAC3BC,cAAc,EAAGA,cAAgB;IAAA,GAC5BH;EAAK,CACV,CAAC;AAEJ"}
1
+ {"version":3,"names":["ComplementaryArea","useSelect","__","store","keyboardShortcutsStore","editorStore","PluginSidebarEditPost","className","props","postTitle","shortcut","select","getEditedPostAttribute","getShortcutRepresentation","createElement","panelClassName","smallScreenTitle","scope","toggleShortcut"],"sources":["@wordpress/edit-post/src/components/sidebar/plugin-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = React.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editPost.PluginSidebar;\n * var moreIcon = React.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-post';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditPost( { className, ...props } ) {\n\tconst { postTitle, shortcut } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostTitle: select( editorStore ).getEditedPostAttribute( 'title' ),\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-post-sidebar\"\n\t\t\tsmallScreenTitle={ postTitle || __( '(no title)' ) }\n\t\t\tscope=\"core/edit-post\"\n\t\t\ttoggleShortcut={ shortcut }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACxE,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACxD,OAAO;MACNF,SAAS,EAAEE,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,OAAQ,CAAC;MAClEF,QAAQ,EAAEC,MAAM,CACfP,sBACD,CAAC,CAACS,yBAAyB,CAAE,+BAAgC;IAC9D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OACCC,aAAA,CAACd,iBAAiB;IACjBe,cAAc,EAAGR,SAAW;IAC5BA,SAAS,EAAC,mBAAmB;IAC7BS,gBAAgB,EAAGP,SAAS,IAAIP,EAAE,CAAE,YAAa,CAAG;IACpDe,KAAK,EAAC,gBAAgB;IACtBC,cAAc,EAAGR,QAAU;IAAA,GACtBF;EAAK,CACV,CAAC;AAEJ"}
@@ -5,7 +5,7 @@ import { createElement, Fragment } from "react";
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { __experimentalHStack as HStack, PanelBody } from '@wordpress/components';
7
7
  import { useDispatch, useSelect } from '@wordpress/data';
8
- import { PostAuthorPanel, PostSchedulePanel, PostSwitchToDraftButton, PostSyncStatus, PostURLPanel } from '@wordpress/editor';
8
+ import { PostAuthorPanel, PostSchedulePanel, PostSwitchToDraftButton, PostSyncStatus, PostURLPanel, PostTemplatePanel, store as editorStore } from '@wordpress/editor';
9
9
 
10
10
  /**
11
11
  * Internal dependencies
@@ -17,8 +17,6 @@ import PostSlug from '../post-slug';
17
17
  import PostFormat from '../post-format';
18
18
  import PostPendingStatus from '../post-pending-status';
19
19
  import PluginPostStatusInfo from '../plugin-post-status-info';
20
- import { store as editPostStore } from '../../../store';
21
- import PostTemplate from '../post-template';
22
20
 
23
21
  /**
24
22
  * Module Constants
@@ -34,7 +32,7 @@ export default function PostStatus() {
34
32
  const {
35
33
  isEditorPanelRemoved,
36
34
  isEditorPanelOpened
37
- } = select(editPostStore);
35
+ } = select(editorStore);
38
36
  return {
39
37
  isRemoved: isEditorPanelRemoved(PANEL_NAME),
40
38
  isOpened: isEditorPanelOpened(PANEL_NAME)
@@ -42,7 +40,7 @@ export default function PostStatus() {
42
40
  }, []);
43
41
  const {
44
42
  toggleEditorPanelOpened
45
- } = useDispatch(editPostStore);
43
+ } = useDispatch(editorStore);
46
44
  if (isRemoved) {
47
45
  return null;
48
46
  }
@@ -51,7 +49,7 @@ export default function PostStatus() {
51
49
  title: __('Summary'),
52
50
  opened: isOpened,
53
51
  onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
54
- }, createElement(PluginPostStatusInfo.Slot, null, fills => createElement(Fragment, null, createElement(PostVisibility, null), createElement(PostSchedulePanel, null), createElement(PostTemplate, null), createElement(PostURLPanel, null), createElement(PostSyncStatus, null), createElement(PostSticky, null), createElement(PostPendingStatus, null), createElement(PostFormat, null), createElement(PostSlug, null), createElement(PostAuthorPanel, null), fills, createElement(HStack, {
52
+ }, createElement(PluginPostStatusInfo.Slot, null, fills => createElement(Fragment, null, createElement(PostVisibility, null), createElement(PostSchedulePanel, null), createElement(PostTemplatePanel, null), createElement(PostURLPanel, null), createElement(PostSyncStatus, null), createElement(PostSticky, null), createElement(PostPendingStatus, null), createElement(PostFormat, null), createElement(PostSlug, null), createElement(PostAuthorPanel, null), fills, createElement(HStack, {
55
53
  style: {
56
54
  marginTop: '16px'
57
55
  },
@@ -1 +1 @@
1
- {"version":3,"names":["__","__experimentalHStack","HStack","PanelBody","useDispatch","useSelect","PostAuthorPanel","PostSchedulePanel","PostSwitchToDraftButton","PostSyncStatus","PostURLPanel","PostVisibility","PostTrash","PostSticky","PostSlug","PostFormat","PostPendingStatus","PluginPostStatusInfo","store","editPostStore","PostTemplate","PANEL_NAME","PostStatus","isOpened","isRemoved","select","isEditorPanelRemoved","isEditorPanelOpened","toggleEditorPanelOpened","createElement","className","title","opened","onToggle","Slot","fills","Fragment","style","marginTop","spacing","wrap"],"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tPostAuthorPanel,\n\tPostSchedulePanel,\n\tPostSwitchToDraftButton,\n\tPostSyncStatus,\n\tPostURLPanel,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostTrash from '../post-trash';\nimport PostSticky from '../post-sticky';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport PostPendingStatus from '../post-pending-status';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport { store as editPostStore } from '../../../store';\nimport PostTemplate from '../post-template';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostStatus() {\n\tconst { isOpened, isRemoved } = useSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t<PostTemplate />\n\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostPendingStatus />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t\twrap\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostSwitchToDraftButton />\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</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G;IACzBgC,MAAM,EAAGT,QAAU;IACnBU,QAAQ,EAAGA,CAAA,KAAML,uBAAuB,CAAEP,UAAW;EAAG,GAExDQ,aAAA,CAACZ,oBAAoB,CAACiB,IAAI,QACrBC,KAAK,IACRN,aAAA,CAAAO,QAAA,QACCP,aAAA,CAAClB,cAAc,MAAE,CAAC,EAClBkB,aAAA,CAACtB,iBAAiB,MAAE,CAAC,EACrBsB,aAAA,CAACT,YAAY,MAAE,CAAC,EAChBS,aAAA,CAACnB,YAAY,MAAE,CAAC,EAChBmB,aAAA,CAACpB,cAAc,MAAE,CAAC,EAClBoB,aAAA,CAAChB,UAAU,MAAE,CAAC,EACdgB,aAAA,CAACb,iBAAiB,MAAE,CAAC,EACrBa,aAAA,CAACd,UAAU,MAAE,CAAC,EACdc,aAAA,CAACf,QAAQ,MAAE,CAAC,EACZe,aAAA,CAACvB,eAAe,MAAE,CAAC,EACjB6B,KAAK,EACPN,aAAA,CAAC3B,MAAM;IACNmC,KAAK,EAAG;MACPC,SAAS,EAAE;IACZ,CAAG;IACHC,OAAO,EAAG,CAAG;IACbC,IAAI;EAAA,GAEJX,aAAA,CAACrB,uBAAuB,MAAE,CAAC,EAC3BqB,aAAA,CAACjB,SAAS,MAAE,CACL,CACP,CAEuB,CACjB,CAAC;AAEd"}
1
+ {"version":3,"names":["__","__experimentalHStack","HStack","PanelBody","useDispatch","useSelect","PostAuthorPanel","PostSchedulePanel","PostSwitchToDraftButton","PostSyncStatus","PostURLPanel","PostTemplatePanel","store","editorStore","PostVisibility","PostTrash","PostSticky","PostSlug","PostFormat","PostPendingStatus","PluginPostStatusInfo","PANEL_NAME","PostStatus","isOpened","isRemoved","select","isEditorPanelRemoved","isEditorPanelOpened","toggleEditorPanelOpened","createElement","className","title","opened","onToggle","Slot","fills","Fragment","style","marginTop","spacing","wrap"],"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tPostAuthorPanel,\n\tPostSchedulePanel,\n\tPostSwitchToDraftButton,\n\tPostSyncStatus,\n\tPostURLPanel,\n\tPostTemplatePanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostTrash from '../post-trash';\nimport PostSticky from '../post-sticky';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport PostPendingStatus from '../post-pending-status';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostStatus() {\n\tconst { isOpened, isRemoved } = useSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t<PostTemplatePanel />\n\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostPendingStatus />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t\twrap\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostSwitchToDraftButton />\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,SAAS,QACH,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,eAAe,EACfC,iBAAiB,EACjBC,uBAAuB,EACvBC,cAAc,EACdC,YAAY,EACZC,iBAAiB,EACjBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,QAAQ,MAAM,cAAc;AACnC,OAAOC,UAAU,MAAM,gBAAgB;AACvC,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,oBAAoB,MAAM,4BAA4B;;AAE7D;AACA;AACA;AACA,MAAMC,UAAU,GAAG,aAAa;AAEhC,eAAe,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAM;IAAEC,QAAQ;IAAEC;EAAU,CAAC,GAAGnB,SAAS,CAAIoB,MAAM,IAAM;IACxD;IACA;IACA,MAAM;M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