@wordpress/edit-post 7.24.0 → 7.25.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 (143) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/header/header-toolbar/index.js +8 -4
  3. package/build/components/header/header-toolbar/index.js.map +1 -1
  4. package/build/components/header/index.js +13 -11
  5. package/build/components/header/index.js.map +1 -1
  6. package/build/components/header/mode-switcher/index.js +1 -1
  7. package/build/components/header/mode-switcher/index.js.map +1 -1
  8. package/build/components/header/more-menu/index.js +2 -1
  9. package/build/components/header/more-menu/index.js.map +1 -1
  10. package/build/components/header/writing-menu/index.js +13 -12
  11. package/build/components/header/writing-menu/index.js.map +1 -1
  12. package/build/components/layout/index.js +12 -12
  13. package/build/components/layout/index.js.map +1 -1
  14. package/build/components/preferences-modal/index.js +65 -49
  15. package/build/components/preferences-modal/index.js.map +1 -1
  16. package/build/components/sidebar/post-status/index.js +1 -2
  17. package/build/components/sidebar/post-status/index.js.map +1 -1
  18. package/build/components/sidebar/settings-header/index.js +17 -43
  19. package/build/components/sidebar/settings-header/index.js.map +1 -1
  20. package/build/components/sidebar/settings-sidebar/index.js +80 -20
  21. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  22. package/build/components/start-page-options/index.js +3 -3
  23. package/build/components/start-page-options/index.js.map +1 -1
  24. package/build/components/visual-editor/index.js +20 -257
  25. package/build/components/visual-editor/index.js.map +1 -1
  26. package/build/components/welcome-guide/index.js +6 -3
  27. package/build/components/welcome-guide/index.js.map +1 -1
  28. package/build/editor.js +5 -6
  29. package/build/editor.js.map +1 -1
  30. package/build/editor.native.js +1 -2
  31. package/build/editor.native.js.map +1 -1
  32. package/build/index.js +5 -4
  33. package/build/index.js.map +1 -1
  34. package/build/plugins/welcome-guide-menu-item/index.js +2 -6
  35. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  36. package/build/store/actions.js +35 -39
  37. package/build/store/actions.js.map +1 -1
  38. package/build/store/reducer.js +1 -34
  39. package/build/store/reducer.js.map +1 -1
  40. package/build/store/selectors.js +22 -12
  41. package/build/store/selectors.js.map +1 -1
  42. package/build-module/components/header/header-toolbar/index.js +8 -4
  43. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  44. package/build-module/components/header/index.js +15 -13
  45. package/build-module/components/header/index.js.map +1 -1
  46. package/build-module/components/header/mode-switcher/index.js +1 -1
  47. package/build-module/components/header/mode-switcher/index.js.map +1 -1
  48. package/build-module/components/header/more-menu/index.js +2 -1
  49. package/build-module/components/header/more-menu/index.js.map +1 -1
  50. package/build-module/components/header/writing-menu/index.js +14 -13
  51. package/build-module/components/header/writing-menu/index.js.map +1 -1
  52. package/build-module/components/layout/index.js +13 -13
  53. package/build-module/components/layout/index.js.map +1 -1
  54. package/build-module/components/preferences-modal/index.js +65 -49
  55. package/build-module/components/preferences-modal/index.js.map +1 -1
  56. package/build-module/components/sidebar/post-status/index.js +2 -3
  57. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  58. package/build-module/components/sidebar/settings-header/index.js +20 -46
  59. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  60. package/build-module/components/sidebar/settings-sidebar/index.js +80 -21
  61. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  62. package/build-module/components/start-page-options/index.js +3 -3
  63. package/build-module/components/start-page-options/index.js.map +1 -1
  64. package/build-module/components/visual-editor/index.js +24 -261
  65. package/build-module/components/visual-editor/index.js.map +1 -1
  66. package/build-module/components/welcome-guide/index.js +6 -3
  67. package/build-module/components/welcome-guide/index.js.map +1 -1
  68. package/build-module/editor.js +5 -6
  69. package/build-module/editor.js.map +1 -1
  70. package/build-module/editor.native.js +1 -2
  71. package/build-module/editor.native.js.map +1 -1
  72. package/build-module/index.js +3 -2
  73. package/build-module/index.js.map +1 -1
  74. package/build-module/plugins/welcome-guide-menu-item/index.js +2 -6
  75. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  76. package/build-module/store/actions.js +31 -36
  77. package/build-module/store/actions.js.map +1 -1
  78. package/build-module/store/reducer.js +1 -33
  79. package/build-module/store/reducer.js.map +1 -1
  80. package/build-module/store/selectors.js +18 -9
  81. package/build-module/store/selectors.js.map +1 -1
  82. package/build-style/style-rtl.css +63 -200
  83. package/build-style/style.css +63 -200
  84. package/package.json +32 -32
  85. package/src/components/header/header-toolbar/index.js +4 -0
  86. package/src/components/header/header-toolbar/style.scss +15 -13
  87. package/src/components/header/index.js +28 -13
  88. package/src/components/header/mode-switcher/index.js +2 -1
  89. package/src/components/header/more-menu/index.js +1 -0
  90. package/src/components/header/style.scss +60 -34
  91. package/src/components/header/writing-menu/index.js +16 -18
  92. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +1 -1
  93. package/src/components/layout/index.js +13 -12
  94. package/src/components/preferences-modal/index.js +109 -96
  95. package/src/components/preferences-modal/test/index.js +1 -52
  96. package/src/components/sidebar/post-status/index.js +2 -2
  97. package/src/components/sidebar/settings-header/index.js +19 -71
  98. package/src/components/sidebar/settings-sidebar/index.js +117 -54
  99. package/src/components/sidebar/style.scss +4 -12
  100. package/src/components/start-page-options/index.js +3 -3
  101. package/src/components/visual-editor/index.js +26 -359
  102. package/src/components/visual-editor/style.scss +0 -15
  103. package/src/components/welcome-guide/index.js +4 -2
  104. package/src/editor.js +7 -7
  105. package/src/editor.native.js +3 -9
  106. package/src/index.js +3 -2
  107. package/src/plugins/welcome-guide-menu-item/index.js +3 -6
  108. package/src/store/actions.js +32 -46
  109. package/src/store/reducer.js +0 -33
  110. package/src/store/selectors.js +23 -9
  111. package/src/store/test/actions.js +0 -28
  112. package/src/style.scss +0 -3
  113. package/src/test/__snapshots__/editor.native.js.snap +21 -0
  114. package/src/test/editor.native.js +90 -56
  115. package/build/components/device-preview/index.js +0 -72
  116. package/build/components/device-preview/index.js.map +0 -1
  117. package/build/components/header/document-actions/index.js +0 -82
  118. package/build/components/header/document-actions/index.js.map +0 -1
  119. package/build/components/sidebar/post-template/create-modal.js +0 -99
  120. package/build/components/sidebar/post-template/create-modal.js.map +0 -1
  121. package/build/components/sidebar/post-template/form.js +0 -110
  122. package/build/components/sidebar/post-template/form.js.map +0 -1
  123. package/build/components/sidebar/post-template/index.js +0 -106
  124. package/build/components/sidebar/post-template/index.js.map +0 -1
  125. package/build-module/components/device-preview/index.js +0 -65
  126. package/build-module/components/device-preview/index.js.map +0 -1
  127. package/build-module/components/header/document-actions/index.js +0 -74
  128. package/build-module/components/header/document-actions/index.js.map +0 -1
  129. package/build-module/components/sidebar/post-template/create-modal.js +0 -92
  130. package/build-module/components/sidebar/post-template/create-modal.js.map +0 -1
  131. package/build-module/components/sidebar/post-template/form.js +0 -102
  132. package/build-module/components/sidebar/post-template/form.js.map +0 -1
  133. package/build-module/components/sidebar/post-template/index.js +0 -98
  134. package/build-module/components/sidebar/post-template/index.js.map +0 -1
  135. package/src/components/device-preview/index.js +0 -73
  136. package/src/components/header/document-actions/index.js +0 -82
  137. package/src/components/header/document-actions/style.scss +0 -64
  138. package/src/components/sidebar/post-template/create-modal.js +0 -140
  139. package/src/components/sidebar/post-template/form.js +0 -141
  140. package/src/components/sidebar/post-template/index.js +0 -120
  141. package/src/components/sidebar/post-template/style.scss +0 -22
  142. package/src/components/sidebar/settings-header/style.scss +0 -74
  143. package/src/components/sidebar/template/style.scss +0 -35
@@ -53,68 +53,30 @@ export default function EditPostPreferencesModal() {
53
53
  setIsListViewOpened(false);
54
54
  closeGeneralSidebar();
55
55
  };
56
+ const turnOffDistractionFree = () => {
57
+ setPreference('core/edit-post', 'distractionFree', false);
58
+ };
56
59
  const sections = useMemo(() => [{
57
60
  name: 'general',
58
61
  tabLabel: __('General'),
59
62
  content: createElement(Fragment, null, isLargeViewport && createElement(PreferencesModalSection, {
60
- title: __('Publishing'),
61
- description: __('Change options related to publishing.')
63
+ title: __('Publishing')
62
64
  }, createElement(EnablePublishSidebarOption, {
63
65
  help: __('Review settings, such as visibility and tags.'),
64
- label: __('Include pre-publish checklist')
66
+ label: __('Enable pre-publish flow')
65
67
  })), createElement(PreferencesModalSection, {
66
- title: __('Appearance'),
67
- description: __('Customize options related to the block editor interface and editing flow.')
68
+ title: __('Interface')
68
69
  }, 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, {
82
70
  featureName: "showListViewByDefault",
83
71
  help: __('Opens the block list view sidebar by default.'),
84
72
  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
73
  }), showBlockBreadcrumbsOption && createElement(EnableFeature, {
90
74
  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')
104
- }), createElement(EnableFeature, {
105
- featureName: "keepCaretInsideBlock",
106
- help: __('Aids screen readers by stopping text caret from leaving blocks.'),
107
- label: __('Contain text cursor inside block')
75
+ help: __('Display the block hierarchy trail at the bottom of the editor.'),
76
+ label: __('Show block breadcrumbs')
108
77
  })), 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
78
  title: __('Document settings'),
117
- description: __('Choose what displays in the panel.')
79
+ description: __('Select what settings are shown in the document panel.')
118
80
  }, createElement(EnablePluginDocumentSettingPanelOption.Slot, null), createElement(PostTaxonomies, {
119
81
  taxonomyWrapper: (content, taxonomy) => createElement(EnablePanelOption, {
120
82
  label: taxonomy.labels.menu_name,
@@ -135,9 +97,63 @@ export default function EditPostPreferencesModal() {
135
97
  label: __('Page attributes'),
136
98
  panelName: "page-attributes"
137
99
  }))), createElement(MetaBoxesSection, {
138
- title: __('Additional'),
139
- description: __('Add extra areas to the editor.')
100
+ title: __('Advanced')
101
+ }))
102
+ }, {
103
+ name: 'appearance',
104
+ tabLabel: __('Appearance'),
105
+ content: createElement(PreferencesModalSection, {
106
+ title: __('Appearance'),
107
+ description: __('Customize the editor interface to suit your needs.')
108
+ }, createElement(EnableFeature, {
109
+ featureName: "fixedToolbar",
110
+ onToggle: turnOffDistractionFree,
111
+ help: __('Access all block and document tools in a single place.'),
112
+ label: __('Top toolbar')
113
+ }), createElement(EnableFeature, {
114
+ featureName: "distractionFree",
115
+ onToggle: toggleDistractionFree,
116
+ help: __('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
117
+ label: __('Distraction free')
118
+ }), createElement(EnableFeature, {
119
+ featureName: "focusMode",
120
+ help: __('Highlights the current block and fades other content.'),
121
+ label: __('Spotlight mode')
122
+ }), createElement(EnableFeature, {
123
+ featureName: "themeStyles",
124
+ help: __('Make the editor look like your theme.'),
125
+ label: __('Use theme styles')
140
126
  }))
127
+ }, {
128
+ name: 'accessibility',
129
+ tabLabel: __('Accessibility'),
130
+ content: createElement(Fragment, null, createElement(PreferencesModalSection, {
131
+ title: __('Navigation'),
132
+ description: __('Optimize the editing experience for enhanced control.')
133
+ }, createElement(EnableFeature, {
134
+ featureName: "keepCaretInsideBlock",
135
+ help: __('Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'),
136
+ label: __('Contain text cursor inside block')
137
+ })), createElement(PreferencesModalSection, {
138
+ title: __('Interface')
139
+ }, createElement(EnableFeature, {
140
+ featureName: "showIconLabels",
141
+ label: __('Show button text labels'),
142
+ help: __('Show text instead of icons on buttons across the interface.')
143
+ })))
144
+ }, {
145
+ name: 'blocks',
146
+ tabLabel: __('Blocks'),
147
+ content: createElement(Fragment, null, createElement(PreferencesModalSection, {
148
+ title: __('Inserter')
149
+ }, createElement(EnableFeature, {
150
+ featureName: "mostUsedBlocks",
151
+ help: __('Adds a category with the most frequently used blocks in the inserter.'),
152
+ label: __('Show most used blocks')
153
+ })), createElement(PreferencesModalSection, {
154
+ title: __('Manage block visibility'),
155
+ description: __("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")
156
+ }, createElement(BlockManager, null)))
141
157
  }], [isLargeViewport, showBlockBreadcrumbsOption]);
142
158
  if (!isModalActive) {
143
159
  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,EACpB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,EAAGtD,EAAE,CAAE,YAAa,CAAG;MAC5B8D,SAAS,EAAC;IAAkB,CAC5B,CACoB,CAAC,EACvBb,aAAA,CAAC1C,mBAAmB,QACnB0C,aAAA,CAAC9B,iBAAiB;MACjBmC,KAAK,EAAGtD,EAAE,CAAE,iBAAkB,CAAG;MACjC8D,SAAS,EAAC;IAAiB,CAC3B,CACmB,CACG,CAAC,EAC1Bb,aAAA,CAAC5B,gBAAgB;MAChB8B,KAAK,EAAGnD,EAAE,CAAE,YAAa,CAAG;MAC5BoD,WAAW,EAAGpD,EAAE,CACf,gCACD;IAAG,CACH,CACA;EAEJ,CAAC,CACD,EACD,CAAE0B,eAAe,EAAEG,0BAA0B,CAC9C,CAAC;EAED,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACCqB,aAAA,CAACrC,gBAAgB;IAACe,UAAU,EAAGA;EAAY,GAC1CsB,aAAA,CAACpC,oBAAoB;IAACgC,QAAQ,EAAGA;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","isFeatureActive","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","turnOffDistractionFree","sections","name","tabLabel","content","createElement","Fragment","title","help","label","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, 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 turnOffDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', '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 flow' ) }\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\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\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</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\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\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\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\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\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\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 }>\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,CAAEa,aAAa,EAAEC,0BAA0B,CAAE,GAAG3B,SAAS,CAC5D4B,MAAM,IAAM;IACb,MAAM;MAAEC;IAAkB,CAAC,GAAGD,MAAM,CAAEnB,WAAY,CAAC;IACnD,MAAM;MAAEqB,aAAa;MAAEC;IAAgB,CAAC,GAAGH,MAAM,CAAER,aAAc,CAAC;IAClE,MAAMY,WAAW,GAAGJ,MAAM,CAAEf,cAAe,CAAC,CAACa,aA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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"}
@@ -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 } from '@wordpress/editor';
9
9
 
10
10
  /**
11
11
  * Internal dependencies
@@ -18,7 +18,6 @@ import PostFormat from '../post-format';
18
18
  import PostPendingStatus from '../post-pending-status';
19
19
  import PluginPostStatusInfo from '../plugin-post-status-info';
20
20
  import { store as editPostStore } from '../../../store';
21
- import PostTemplate from '../post-template';
22
21
 
23
22
  /**
24
23
  * Module Constants
@@ -51,7 +50,7 @@ export default function PostStatus() {
51
50
  title: __('Summary'),
52
51
  opened: isOpened,
53
52
  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, {
53
+ }, 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
54
  style: {
56
55
  marginTop: '16px'
57
56
  },
@@ -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</PanelBody>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EA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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","PostVisibility","PostTrash","PostSticky","PostSlug","PostFormat","PostPendingStatus","PluginPostStatusInfo","store","editPostStore","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} 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';\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<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,QACX,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;AAC7D,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;;AAEvD;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;MAAEC,oBAAoB;MAAEC;I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@@ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { Button } from '@wordpress/components';
6
- import { __, _x, sprintf } from '@wordpress/i18n';
7
- import { useDispatch, useSelect } from '@wordpress/data';
5
+ import { privateApis as componentsPrivateApis } from '@wordpress/components';
6
+ import { __, _x } from '@wordpress/i18n';
7
+ import { useSelect } from '@wordpress/data';
8
8
  import { store as editorStore } from '@wordpress/editor';
9
9
 
10
10
  /**
11
11
  * Internal dependencies
12
12
  */
13
- import { store as editPostStore } from '../../../store';
14
- const SettingsHeader = ({
15
- sidebarName
16
- }) => {
17
- const {
18
- openGeneralSidebar
19
- } = useDispatch(editPostStore);
20
- const openDocumentSettings = () => openGeneralSidebar('edit-post/document');
21
- const openBlockSettings = () => openGeneralSidebar('edit-post/block');
13
+ import { unlock } from '../../../lock-unlock';
14
+ import { sidebars } from '../settings-sidebar';
15
+ const {
16
+ Tabs
17
+ } = unlock(componentsPrivateApis);
18
+ const SettingsHeader = () => {
22
19
  const {
23
20
  documentLabel,
24
21
  isTemplateMode
25
22
  } = useSelect(select => {
26
- const postTypeLabel = select(editorStore).getPostTypeLabel();
23
+ const {
24
+ getPostTypeLabel,
25
+ getRenderingMode
26
+ } = select(editorStore);
27
27
  return {
28
28
  // translators: Default label for the Document sidebar tab, not selected.
29
- documentLabel: postTypeLabel || _x('Document', 'noun'),
30
- isTemplateMode: select(editPostStore).isEditingTemplate()
29
+ documentLabel: getPostTypeLabel() || _x('Document', 'noun'),
30
+ isTemplateMode: getRenderingMode() === 'template-only'
31
31
  };
32
32
  }, []);
33
- const [documentAriaLabel, documentActiveClass] = sidebarName === 'edit-post/document' ?
34
- // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.
35
- [sprintf(__('%s (selected)'), documentLabel), 'is-active'] : [documentLabel, ''];
36
- const [blockAriaLabel, blockActiveClass] = sidebarName === 'edit-post/block' ?
37
- // translators: ARIA label for the Block Settings Sidebar tab, selected.
38
- [__('Block (selected)'), 'is-active'] :
39
- // translators: ARIA label for the Block Settings Sidebar tab, not selected.
40
- [__('Block'), ''];
41
- const [templateAriaLabel, templateActiveClass] = sidebarName === 'edit-post/document' ? [__('Template (selected)'), 'is-active'] : [__('Template'), ''];
42
-
43
- /* Use a list so screen readers will announce how many tabs there are. */
44
- return createElement("ul", null, !isTemplateMode && createElement("li", null, createElement(Button, {
45
- onClick: openDocumentSettings,
46
- className: `edit-post-sidebar__panel-tab ${documentActiveClass}`,
47
- "aria-label": documentAriaLabel,
48
- "data-label": documentLabel
49
- }, documentLabel)), isTemplateMode && createElement("li", null, createElement(Button, {
50
- onClick: openDocumentSettings,
51
- className: `edit-post-sidebar__panel-tab ${templateActiveClass}`,
52
- "aria-label": templateAriaLabel,
53
- "data-label": __('Template')
54
- }, __('Template'))), createElement("li", null, createElement(Button, {
55
- onClick: openBlockSettings,
56
- className: `edit-post-sidebar__panel-tab ${blockActiveClass}`,
57
- "aria-label": blockAriaLabel
58
- // translators: Data label for the Block Settings Sidebar tab.
59
- ,
60
- "data-label": __('Block')
61
- },
62
- // translators: Text label for the Block Settings Sidebar tab.
63
- __('Block'))));
33
+ return createElement(Tabs.TabList, null, createElement(Tabs.Tab, {
34
+ tabId: sidebars.document
35
+ }, isTemplateMode ? __('Template') : documentLabel), createElement(Tabs.Tab, {
36
+ tabId: sidebars.block
37
+ }, __('Block')));
64
38
  };
65
39
  export default SettingsHeader;
66
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Button","__","_x","sprintf","useDispatch","useSelect","store","editorStore","editPostStore","SettingsHeader","sidebarName","openGeneralSidebar","openDocumentSettings","openBlockSettings","documentLabel","isTemplateMode","select","postTypeLabel","getPostTypeLabel","isEditingTemplate","documentAriaLabel","documentActiveClass","blockAriaLabel","blockActiveClass","templateAriaLabel","templateActiveClass","createElement","onClick","className"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\tconst openDocumentSettings = () =>\n\t\topenGeneralSidebar( 'edit-post/document' );\n\tconst openBlockSettings = () => openGeneralSidebar( 'edit-post/block' );\n\n\tconst { documentLabel, isTemplateMode } = useSelect( ( select ) => {\n\t\tconst postTypeLabel = select( editorStore ).getPostTypeLabel();\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst [ documentAriaLabel, documentActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.\n\t\t\t [ sprintf( __( '%s (selected)' ), documentLabel ), 'is-active' ]\n\t\t\t: [ documentLabel, '' ];\n\n\tconst [ blockAriaLabel, blockActiveClass ] =\n\t\tsidebarName === 'edit-post/block'\n\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t [ __( 'Block (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Block' ), '' ];\n\n\tconst [ templateAriaLabel, templateActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? [ __( 'Template (selected)' ), 'is-active' ]\n\t\t\t: [ __( 'Template' ), '' ];\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t{ ! isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ documentActiveClass }` }\n\t\t\t\t\t\taria-label={ documentAriaLabel }\n\t\t\t\t\t\tdata-label={ documentLabel }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ documentLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t{ isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ templateActiveClass }` }\n\t\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\t\tdata-label={ __( 'Template' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ blockActiveClass }` }\n\t\t\t\t\taria-label={ blockAriaLabel }\n\t\t\t\t\t// translators: Data label for the Block Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Block Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,gBAAgB;AAEvD,MAAMC,cAAc,GAAGA,CAAE;E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c,IACjBW,aAAA,aACCA,aAAA,CAAC1B,MAAM;IACN2B,OAAO,EAAGf,oBAAsB;IAChCgB,SAAS,EAAI,gCAAgCP,mBAAqB,EAAG;IACrE,cAAaD,iBAAmB;IAChC,cAAaN;EAAe,GAE1BA,aACK,CACL,CACJ,EACCC,cAAc,IACfW,aAAA,aACCA,aAAA,CAAC1B,MAAM;IACN2B,OAAO,EAAGf,oBAAsB;IAChCgB,SAAS,EAAI,gCAAgCH,mBAAqB,EAAG;IACrE,cAAaD,iBAAmB;IAChC,cAAavB,EAAE,CAAE,UAAW;EAAG,GAE7BA,EAAE,CAAE,UAAW,CACV,CACL,CACJ,EACDyB,aAAA,aACCA,aAAA,CAAC1B,MAAM;IACN2B,OAAO,EAAGd,iBAAmB;IAC7Be,SAAS,EAAI,gCAAgCL,gBAAkB,EAAG;IAClE,cAAaD;IACb;IAAA;IACA,cAAarB,EAAE,CAAE,OAAQ;EAAG;EAG3B;EACAA,EAAE,CAAE,OAAQ,CAEN,CACL,CACD,CAAC;AAEP,CAAC;AAED,eAAeQ,cAAc"}
1
+ {"version":3,"names":["privateApis","componentsPrivateApis","__","_x","useSelect","store","editorStore","unlock","sidebars","Tabs","SettingsHeader","documentLabel","isTemplateMode","select","getPostTypeLabel","getRenderingMode","createElement","TabList","Tab","tabId","document","block"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport { sidebars } from '../settings-sidebar';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SettingsHeader = () => {\n\tconst { documentLabel, isTemplateMode } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel, getRenderingMode } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t\tisTemplateMode: getRenderingMode() === 'template-only',\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList>\n\t\t\t<Tabs.Tab tabId={ sidebars.document }>\n\t\t\t\t{ isTemplateMode ? __( 'Template' ) : documentLabel }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab tabId={ sidebars.block }>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n};\n\nexport default SettingsHeader;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,QAAQ,QAAQ,qBAAqB;AAE9C,MAAM;EAAEC;AAAK,CAAC,GAAGF,MAAM,CAAEN,qBAAsB,CAAC;AAEhD,MAAMS,cAAc,GAAGA,CAAA,KAAM;EAC5B,MAAM;IAAEC,aAAa;IAAEC;EAAe,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAClE,MAAM;MAAEC,gBAAgB;MAAEC;IAAiB,CAAC,GAAGF,MAAM,CAAEP,WAAY,CAAC;IAEpE,OAAO;MACN;MACAK,aAAa,EAAEG,gBAAgB,CAAC,CAAC,IAAIX,EAAE,CAAE,UAAU,EAAE,MAAO,CAAC;MAC7DS,cAAc,EAAEG,gBAAgB,CAAC,CAAC,KAAK;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA,CAACP,IAAI,CAACQ,OAAO,QACZD,aAAA,CAACP,IAAI,CAACS,GAAG;IAACC,KAAK,EAAGX,QAAQ,CAACY;EAAU,GAClCR,cAAc,GAAGV,EAAE,CAAE,UAAW,CAAC,GAAGS,aAC7B,CAAC,EACXK,aAAA,CAACP,IAAI,CAACS,GAAG;IAACC,KAAK,EAAGX,QAAQ,CAACa;EAAO,GAE/BnB,EAAE,CAAE,OAAQ,CACL,CACG,CAAC;AAEjB,CAAC;AAED,eAAeQ,cAAc"}
@@ -3,12 +3,13 @@ import { createElement, Fragment } from "react";
3
3
  * WordPress dependencies
4
4
  */
5
5
  import { BlockInspector, store as blockEditorStore } from '@wordpress/block-editor';
6
- import { useSelect } from '@wordpress/data';
7
- import { Platform } from '@wordpress/element';
6
+ import { useSelect, useDispatch } from '@wordpress/data';
7
+ import { Platform, useCallback, useContext } from '@wordpress/element';
8
8
  import { isRTL, __ } from '@wordpress/i18n';
9
9
  import { drawerLeft, drawerRight } from '@wordpress/icons';
10
10
  import { store as interfaceStore } from '@wordpress/interface';
11
11
  import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
12
+ import { store as editorStore } from '@wordpress/editor';
12
13
 
13
14
  /**
14
15
  * Internal dependencies
@@ -26,13 +27,61 @@ import PluginDocumentSettingPanel from '../plugin-document-setting-panel';
26
27
  import PluginSidebarEditPost from '../plugin-sidebar';
27
28
  import TemplateSummary from '../template-summary';
28
29
  import { store as editPostStore } from '../../../store';
30
+ import { privateApis as componentsPrivateApis } from '@wordpress/components';
31
+ import { unlock } from '../../../lock-unlock';
32
+ const {
33
+ Tabs
34
+ } = unlock(componentsPrivateApis);
29
35
  const SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select({
30
36
  web: true,
31
37
  native: false
32
38
  });
39
+ export const sidebars = {
40
+ document: 'edit-post/document',
41
+ block: 'edit-post/block'
42
+ };
43
+ const SidebarContent = ({
44
+ sidebarName,
45
+ keyboardShortcut,
46
+ isTemplateMode
47
+ }) => {
48
+ // Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we
49
+ // need to forward the `Tabs` context so it can be passed through the
50
+ // underlying slot/fill.
51
+ const tabsContextValue = useContext(Tabs.Context);
52
+ return createElement(PluginSidebarEditPost, {
53
+ identifier: sidebarName,
54
+ header: createElement(Tabs.Context.Provider, {
55
+ value: tabsContextValue
56
+ }, createElement(SettingsHeader, null)),
57
+ closeLabel: __('Close Settings')
58
+ // This classname is added so we can apply a corrective negative
59
+ // margin to the panel.
60
+ // see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
61
+ ,
62
+ className: "edit-post-sidebar__panel",
63
+ headerClassName: "edit-post-sidebar__panel-tabs"
64
+ /* translators: button label text should, if possible, be under 16 characters. */,
65
+ title: __('Settings'),
66
+ toggleShortcut: keyboardShortcut,
67
+ icon: isRTL() ? drawerLeft : drawerRight,
68
+ isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
69
+ }, createElement(Tabs.Context.Provider, {
70
+ value: tabsContextValue
71
+ }, createElement(Tabs.TabPanel, {
72
+ tabId: sidebars.document,
73
+ focusable: false
74
+ }, !isTemplateMode && createElement(Fragment, null, createElement(PostStatus, null), createElement(PluginDocumentSettingPanel.Slot, null), createElement(LastRevision, null), createElement(PostTaxonomies, null), createElement(FeaturedImage, null), createElement(PostExcerpt, null), createElement(DiscussionPanel, null), createElement(PageAttributes, null), createElement(MetaBoxes, {
75
+ location: "side"
76
+ })), isTemplateMode && createElement(TemplateSummary, null)), createElement(Tabs.TabPanel, {
77
+ tabId: sidebars.block,
78
+ focusable: false
79
+ }, createElement(BlockInspector, null))));
80
+ };
33
81
  const SettingsSidebar = () => {
34
82
  const {
35
83
  sidebarName,
84
+ isSettingsSidebarActive,
36
85
  keyboardShortcut,
37
86
  isTemplateMode
38
87
  } = useSelect(select => {
@@ -44,34 +93,44 @@ const SettingsSidebar = () => {
44
93
  // should contain the sidebar that will be active when the toggle button is pressed. If a block
45
94
  // is selected, that should be edit-post/block otherwise it's edit-post/document.
46
95
  let sidebar = select(interfaceStore).getActiveComplementaryArea(editPostStore.name);
47
- if (!['edit-post/document', 'edit-post/block'].includes(sidebar)) {
96
+ let isSettingsSidebar = true;
97
+ if (![sidebars.document, sidebars.block].includes(sidebar)) {
98
+ isSettingsSidebar = false;
48
99
  if (select(blockEditorStore).getBlockSelectionStart()) {
49
- sidebar = 'edit-post/block';
100
+ sidebar = sidebars.block;
50
101
  }
51
- sidebar = 'edit-post/document';
102
+ sidebar = sidebars.document;
52
103
  }
53
104
  const shortcut = select(keyboardShortcutsStore).getShortcutRepresentation('core/edit-post/toggle-sidebar');
54
105
  return {
55
106
  sidebarName: sidebar,
107
+ isSettingsSidebarActive: isSettingsSidebar,
56
108
  keyboardShortcut: shortcut,
57
- isTemplateMode: select(editPostStore).isEditingTemplate()
109
+ isTemplateMode: select(editorStore).getRenderingMode() === 'template-only'
58
110
  };
59
111
  }, []);
60
- return createElement(PluginSidebarEditPost, {
61
- identifier: sidebarName,
62
- header: createElement(SettingsHeader, {
63
- sidebarName: sidebarName
64
- }),
65
- closeLabel: __('Close Settings'),
66
- headerClassName: "edit-post-sidebar__panel-tabs"
67
- /* translators: button label text should, if possible, be under 16 characters. */,
68
- title: __('Settings'),
69
- toggleShortcut: keyboardShortcut,
70
- icon: isRTL() ? drawerLeft : drawerRight,
71
- isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
72
- }, !isTemplateMode && sidebarName === 'edit-post/document' && createElement(Fragment, null, createElement(PostStatus, null), createElement(PluginDocumentSettingPanel.Slot, null), createElement(LastRevision, null), createElement(PostTaxonomies, null), createElement(FeaturedImage, null), createElement(PostExcerpt, null), createElement(DiscussionPanel, null), createElement(PageAttributes, null), createElement(MetaBoxes, {
73
- location: "side"
74
- })), isTemplateMode && sidebarName === 'edit-post/document' && createElement(TemplateSummary, null), sidebarName === 'edit-post/block' && createElement(BlockInspector, null));
112
+ const {
113
+ openGeneralSidebar
114
+ } = useDispatch(editPostStore);
115
+ const onTabSelect = useCallback(newSelectedTabId => {
116
+ if (!!newSelectedTabId) {
117
+ openGeneralSidebar(newSelectedTabId);
118
+ }
119
+ }, [openGeneralSidebar]);
120
+ return createElement(Tabs
121
+ // Due to how this component is controlled (via a value from the
122
+ // `interfaceStore`), when the sidebar closes the currently selected
123
+ // tab can't be found. This causes the component to continuously reset
124
+ // the selection to `null` in an infinite loop.Proactively setting
125
+ // the selected tab to `null` avoids that.
126
+ , {
127
+ selectedTabId: isSettingsSidebarActive ? sidebarName : null,
128
+ onSelect: onTabSelect
129
+ }, createElement(SidebarContent, {
130
+ sidebarName: sidebarName,
131
+ keyboardShortcut: keyboardShortcut,
132
+ isTemplateMode: isTemplateMode
133
+ }));
75
134
  };
76
135
  export default SettingsSidebar;
77
136
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","Platform","isRTL","__","drawerLeft","drawerRight","interfaceStore","keyboardShortcutsStore","SettingsHeader","PostStatus","LastRevision","PostTaxonomies","FeaturedImage","PostExcerpt","DiscussionPanel","PageAttributes","MetaBoxes","PluginDocumentSettingPanel","PluginSidebarEditPost","TemplateSummary","editPostStore","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","SettingsSidebar","sidebarName","keyboardShortcut","isTemplateMode","sidebar","getActiveComplementaryArea","name","includes","getBlockSelectionStart","shortcut","getShortcutRepresentation","isEditingTemplate","createElement","identifier","header","closeLabel","headerClassName","title","toggleShortcut","icon","isActiveByDefault","Fragment","Slot","location"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { Platform } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport LastRevision from '../last-revision';\nimport PostTaxonomies from '../post-taxonomies';\nimport FeaturedImage from '../featured-image';\nimport PostExcerpt from '../post-excerpt';\nimport DiscussionPanel from '../discussion-panel';\nimport PageAttributes from '../page-attributes';\nimport MetaBoxes from '../../meta-boxes';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebarEditPost from '../plugin-sidebar';\nimport TemplateSummary from '../template-summary';\nimport { store as editPostStore } from '../../../store';\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst SettingsSidebar = () => {\n\tconst { sidebarName, keyboardShortcut, isTemplateMode } = useSelect(\n\t\t( select ) => {\n\t\t\t// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.\n\t\t\t// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.\n\t\t\t// If one of the two sidebars is active the component will contain the content of that sidebar.\n\t\t\t// When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost\n\t\t\t// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName\n\t\t\t// should contain the sidebar that will be active when the toggle button is pressed. If a block\n\t\t\t// is selected, that should be edit-post/block otherwise it's edit-post/document.\n\t\t\tlet sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditPostStore.name\n\t\t\t);\n\t\t\tif (\n\t\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\t\tsidebar\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif ( select( blockEditorStore ).getBlockSelectionStart() ) {\n\t\t\t\t\tsidebar = 'edit-post/block';\n\t\t\t\t}\n\t\t\t\tsidebar = 'edit-post/document';\n\t\t\t}\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' );\n\t\t\treturn {\n\t\t\t\tsidebarName: sidebar,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PluginSidebarEditPost\n\t\t\tidentifier={ sidebarName }\n\t\t\theader={ <SettingsHeader sidebarName={ sidebarName } /> }\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t{ ! isTemplateMode && sidebarName === 'edit-post/document' && (\n\t\t\t\t<>\n\t\t\t\t\t<PostStatus />\n\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t<LastRevision />\n\t\t\t\t\t<PostTaxonomies />\n\t\t\t\t\t<FeaturedImage />\n\t\t\t\t\t<PostExcerpt />\n\t\t\t\t\t<DiscussionPanel />\n\t\t\t\t\t<PageAttributes />\n\t\t\t\t\t<MetaBoxes location=\"side\" />\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ isTemplateMode && sidebarName === 'edit-post/document' && (\n\t\t\t\t<TemplateSummary />\n\t\t\t) }\n\t\t\t{ sidebarName === 'edit-post/block' && <BlockInspector /> }\n\t\t</PluginSidebarEditPost>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,KAAK,EAAEC,EAA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,eAAe,MAAE,CAClB,EACCO,WAAW,KAAK,iBAAiB,IAAIW,aAAA,CAACxC,cAAc,MAAE,CAClC,CAAC;AAE1B,CAAC;AAED,eAAe4B,eAAe"}
1
+ {"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","useDispatch","Platform","useCallback","useContext","isRTL","__","drawerLeft","drawerRight","interfaceStore","keyboardShortcutsStore","editorStore","SettingsHeader","PostStatus","LastRevision","PostTaxonomies","FeaturedImage","PostExcerpt","DiscussionPanel","PageAttributes","MetaBoxes","PluginDocumentSettingPanel","PluginSidebarEditPost","TemplateSummary","editPostStore","privateApis","componentsPrivateApis","unlock","Tabs","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","sidebars","document","block","SidebarContent","sidebarName","keyboardShortcut","isTemplateMode","tabsContextValue","Context","createElement","identifier","header","Provider","value","closeLabel","className","headerClassName","title","toggleShortcut","icon","isActiveByDefault","TabPanel","tabId","focusable","Fragment","Slot","location","SettingsSidebar","isSettingsSidebarActive","sidebar","getActiveComplementaryArea","name","isSettingsSidebar","includes","getBlockSelectionStart","shortcut","getShortcutRepresentation","getRenderingMode","openGeneralSidebar","onTabSelect","newSelectedTabId","selectedTabId","onSelect"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Platform, useCallback, useContext } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport LastRevision from '../last-revision';\nimport PostTaxonomies from '../post-taxonomies';\nimport FeaturedImage from '../featured-image';\nimport PostExcerpt from '../post-excerpt';\nimport DiscussionPanel from '../discussion-panel';\nimport PageAttributes from '../page-attributes';\nimport MetaBoxes from '../../meta-boxes';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebarEditPost from '../plugin-sidebar';\nimport TemplateSummary from '../template-summary';\nimport { store as editPostStore } from '../../../store';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { unlock } from '../../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\nexport const sidebars = {\n\tdocument: 'edit-post/document',\n\tblock: 'edit-post/block',\n};\n\nconst SidebarContent = ( {\n\tsidebarName,\n\tkeyboardShortcut,\n\tisTemplateMode,\n} ) => {\n\t// Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\treturn (\n\t\t<PluginSidebarEditPost\n\t\t\tidentifier={ sidebarName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SettingsHeader />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"edit-post-sidebar__panel\"\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t{ ! isTemplateMode && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostStatus />\n\t\t\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t\t\t<LastRevision />\n\t\t\t\t\t\t\t<PostTaxonomies />\n\t\t\t\t\t\t\t<FeaturedImage />\n\t\t\t\t\t\t\t<PostExcerpt />\n\t\t\t\t\t\t\t<DiscussionPanel />\n\t\t\t\t\t\t\t<PageAttributes />\n\t\t\t\t\t\t\t<MetaBoxes location=\"side\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isTemplateMode && <TemplateSummary /> }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebarEditPost>\n\t);\n};\n\nconst SettingsSidebar = () => {\n\tconst {\n\t\tsidebarName,\n\t\tisSettingsSidebarActive,\n\t\tkeyboardShortcut,\n\t\tisTemplateMode,\n\t} = useSelect( ( select ) => {\n\t\t// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.\n\t\t// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.\n\t\t// If one of the two sidebars is active the component will contain the content of that sidebar.\n\t\t// When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost\n\t\t// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName\n\t\t// should contain the sidebar that will be active when the toggle button is pressed. If a block\n\t\t// is selected, that should be edit-post/block otherwise it's edit-post/document.\n\t\tlet sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\teditPostStore.name\n\t\t);\n\t\tlet isSettingsSidebar = true;\n\t\tif ( ! [ sidebars.document, sidebars.block ].includes( sidebar ) ) {\n\t\t\tisSettingsSidebar = false;\n\t\t\tif ( select( blockEditorStore ).getBlockSelectionStart() ) {\n\t\t\t\tsidebar = sidebars.block;\n\t\t\t}\n\t\t\tsidebar = sidebars.document;\n\t\t}\n\t\tconst shortcut = select(\n\t\t\tkeyboardShortcutsStore\n\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' );\n\t\treturn {\n\t\t\tsidebarName: sidebar,\n\t\t\tisSettingsSidebarActive: isSettingsSidebar,\n\t\t\tkeyboardShortcut: shortcut,\n\t\t\tisTemplateMode:\n\t\t\t\tselect( editorStore ).getRenderingMode() === 'template-only',\n\t\t};\n\t}, [] );\n\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\topenGeneralSidebar( newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ openGeneralSidebar ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\t// Due to how this component is controlled (via a value from the\n\t\t\t// `interfaceStore`), when the sidebar closes the currently selected\n\t\t\t// tab can't be found. This causes the component to continuously reset\n\t\t\t// the selection to `null` in an infinite loop.Proactively setting\n\t\t\t// the selected tab to `null` avoids that.\n\t\t\tselectedTabId={ isSettingsSidebarActive ? sidebarName : null }\n\t\t\tonSelect={ onTabSelect }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\tsidebarName={ sidebarName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tisTemplateMode={ isTemplateMode }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,QAAQ,EAAEC,WAAW,EAA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AAGrE,WAAW,CAC5BsE,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BF,kBAAkB,CAAEE,gBAAiB,CAAC;IACvC;EACD,CAAC,EACD,CAAEF,kBAAkB,CACrB,CAAC;EAED,OACC7B,aAAA,CAACd;EACA;EACA;EACA;EACA;EACA;EAAA;IACA8C,aAAa,EAAGb,uBAAuB,GAAGxB,WAAW,GAAG,IAAM;IAC9DsC,QAAQ,EAAGH;EAAa,GAExB9B,aAAA,CAACN,cAAc;IACdC,WAAW,EAAGA,WAAa;IAC3BC,gBAAgB,EAAGA,gBAAkB;IACrCC,cAAc,EAAGA;EAAgB,CACjC,CACI,CAAC;AAET,CAAC;AAED,eAAeqB,eAAe"}
@@ -82,13 +82,13 @@ export default function StartPageOptions() {
82
82
  const [isClosed, setIsClosed] = useState(false);
83
83
  const shouldEnableModal = useSelect(select => {
84
84
  const {
85
- isCleanNewPost
85
+ isCleanNewPost,
86
+ getRenderingMode
86
87
  } = select(editorStore);
87
88
  const {
88
- isEditingTemplate,
89
89
  isFeatureActive
90
90
  } = select(editPostStore);
91
- return !isEditingTemplate() && !isFeatureActive('welcomeGuide') && isCleanNewPost();
91
+ return getRenderingMode() === 'post-only' && !isFeatureActive('welcomeGuide') && isCleanNewPost();
92
92
  }, []);
93
93
  if (!shouldEnableModal || isClosed) {
94
94
  return null;