@wordpress/edit-post 7.26.1-next.79a6196f.0 → 7.27.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 (124) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/build/components/header/index.js +2 -2
  3. package/build/components/header/index.js.map +1 -1
  4. package/build/components/meta-boxes/index.js +3 -2
  5. package/build/components/meta-boxes/index.js.map +1 -1
  6. package/build/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
  7. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -0
  8. package/build/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +11 -2
  9. package/build/components/preferences-modal/enable-panel.js.map +1 -0
  10. package/build/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +11 -2
  11. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  12. package/build/components/preferences-modal/index.js +31 -149
  13. package/build/components/preferences-modal/index.js.map +1 -1
  14. package/build/components/preferences-modal/meta-boxes-section.js +11 -5
  15. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  16. package/build/components/sidebar/plugin-document-setting-panel/index.js +5 -2
  17. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  18. package/build/editor.js +3 -26
  19. package/build/editor.js.map +1 -1
  20. package/build/editor.native.js +4 -28
  21. package/build/editor.native.js.map +1 -1
  22. package/build/hooks/commands/use-common-commands.js +48 -8
  23. package/build/hooks/commands/use-common-commands.js.map +1 -1
  24. package/build/index.js +2 -2
  25. package/build/index.js.map +1 -1
  26. package/build/index.native.js +1 -1
  27. package/build/index.native.js.map +1 -1
  28. package/build/store/actions.js +11 -10
  29. package/build/store/actions.js.map +1 -1
  30. package/build/store/selectors.js +24 -6
  31. package/build/store/selectors.js.map +1 -1
  32. package/build-module/components/header/index.js +2 -2
  33. package/build-module/components/header/index.js.map +1 -1
  34. package/build-module/components/meta-boxes/index.js +3 -2
  35. package/build-module/components/meta-boxes/index.js.map +1 -1
  36. package/build-module/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
  37. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -0
  38. package/build-module/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +10 -2
  39. package/build-module/components/preferences-modal/enable-panel.js.map +1 -0
  40. package/build-module/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +10 -2
  41. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
  42. package/build-module/components/preferences-modal/index.js +31 -150
  43. package/build-module/components/preferences-modal/index.js.map +1 -1
  44. package/build-module/components/preferences-modal/meta-boxes-section.js +7 -2
  45. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  46. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +5 -2
  47. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  48. package/build-module/editor.js +3 -26
  49. package/build-module/editor.js.map +1 -1
  50. package/build-module/editor.native.js +5 -29
  51. package/build-module/editor.native.js.map +1 -1
  52. package/build-module/hooks/commands/use-common-commands.js +49 -9
  53. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  54. package/build-module/index.js +2 -2
  55. package/build-module/index.js.map +1 -1
  56. package/build-module/index.native.js +1 -1
  57. package/build-module/index.native.js.map +1 -1
  58. package/build-module/store/actions.js +11 -10
  59. package/build-module/store/actions.js.map +1 -1
  60. package/build-module/store/selectors.js +24 -6
  61. package/build-module/store/selectors.js.map +1 -1
  62. package/build-style/classic-rtl.css +1 -1
  63. package/build-style/classic.css +1 -1
  64. package/build-style/style-rtl.css +16 -182
  65. package/build-style/style.css +16 -182
  66. package/package.json +32 -32
  67. package/src/components/header/index.js +2 -4
  68. package/src/components/header/style.scss +13 -4
  69. package/src/components/meta-boxes/index.js +4 -2
  70. package/src/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -3
  71. package/src/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +9 -2
  72. package/src/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +9 -2
  73. package/src/components/preferences-modal/index.js +44 -267
  74. package/src/components/preferences-modal/meta-boxes-section.js +6 -2
  75. package/src/components/preferences-modal/{options/test → test}/__snapshots__/enable-custom-fields.js.snap +4 -4
  76. package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +18 -18
  77. package/src/components/sidebar/plugin-document-setting-panel/index.js +6 -2
  78. package/src/editor.js +55 -85
  79. package/src/editor.native.js +4 -33
  80. package/src/hooks/commands/use-common-commands.js +77 -7
  81. package/src/index.js +2 -2
  82. package/src/index.native.js +1 -1
  83. package/src/store/actions.js +14 -33
  84. package/src/store/selectors.js +52 -26
  85. package/src/store/test/actions.js +9 -9
  86. package/src/style.scss +0 -1
  87. package/build/components/block-manager/category.js +0 -105
  88. package/build/components/block-manager/category.js.map +0 -1
  89. package/build/components/block-manager/checklist.js +0 -35
  90. package/build/components/block-manager/checklist.js.map +0 -1
  91. package/build/components/block-manager/index.js +0 -127
  92. package/build/components/block-manager/index.js.map +0 -1
  93. package/build/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
  94. package/build/components/preferences-modal/options/enable-feature.js +0 -36
  95. package/build/components/preferences-modal/options/enable-feature.js.map +0 -1
  96. package/build/components/preferences-modal/options/enable-panel.js.map +0 -1
  97. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -32
  98. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
  99. package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
  100. package/build/components/preferences-modal/options/index.js +0 -42
  101. package/build/components/preferences-modal/options/index.js.map +0 -1
  102. package/build-module/components/block-manager/category.js +0 -96
  103. package/build-module/components/block-manager/category.js.map +0 -1
  104. package/build-module/components/block-manager/checklist.js +0 -27
  105. package/build-module/components/block-manager/checklist.js.map +0 -1
  106. package/build-module/components/block-manager/index.js +0 -118
  107. package/build-module/components/block-manager/index.js.map +0 -1
  108. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
  109. package/build-module/components/preferences-modal/options/enable-feature.js +0 -29
  110. package/build-module/components/preferences-modal/options/enable-feature.js.map +0 -1
  111. package/build-module/components/preferences-modal/options/enable-panel.js.map +0 -1
  112. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -24
  113. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
  114. package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
  115. package/build-module/components/preferences-modal/options/index.js +0 -6
  116. package/build-module/components/preferences-modal/options/index.js.map +0 -1
  117. package/src/components/block-manager/category.js +0 -94
  118. package/src/components/block-manager/checklist.js +0 -30
  119. package/src/components/block-manager/index.js +0 -158
  120. package/src/components/block-manager/style.scss +0 -82
  121. package/src/components/preferences-modal/options/enable-feature.js +0 -31
  122. package/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -23
  123. package/src/components/preferences-modal/options/index.js +0 -5
  124. /package/src/components/preferences-modal/{options/test → test}/enable-custom-fields.js +0 -0
@@ -69,7 +69,7 @@
69
69
  margin-left: $grid-unit;
70
70
  }
71
71
 
72
- // Modified group borders
72
+ // Modified group borders.
73
73
  .components-toolbar-group,
74
74
  .components-toolbar {
75
75
  border-right: none;
@@ -194,18 +194,27 @@
194
194
  }
195
195
 
196
196
  .show-icon-labels {
197
-
198
197
  .edit-post-header__toolbar .block-editor-block-mover {
198
+ // Modified group borders.
199
199
  border-left: none;
200
200
 
201
201
  &::before {
202
202
  content: "";
203
203
  width: $border-width;
204
- margin-top: $grid-unit + $grid-unit-05;
205
- margin-bottom: $grid-unit + $grid-unit-05;
204
+ margin-top: $grid-unit-15;
205
+ margin-bottom: $grid-unit-15;
206
206
  background-color: $gray-300;
207
207
  margin-left: $grid-unit;
208
208
  }
209
+
210
+ // Modified block movers horizontal separator.
211
+ .block-editor-block-mover__move-button-container {
212
+ &::before {
213
+ width: calc(100% - #{$grid-unit-30});
214
+ background: $gray-300;
215
+ left: calc(50% + 1px);
216
+ }
217
+ }
209
218
  }
210
219
  }
211
220
 
@@ -30,14 +30,16 @@ export default function MetaBoxes( { location } ) {
30
30
  [ location ]
31
31
  );
32
32
 
33
+ const hasMetaBoxes = !! metaBoxes?.length;
34
+
33
35
  // When editor is ready, initialize postboxes (wp core script) and metabox
34
36
  // saving. This initializes all meta box locations, not just this specific
35
37
  // one.
36
38
  useEffect( () => {
37
- if ( isEditorReady && ! areMetaBoxesInitialized ) {
39
+ if ( isEditorReady && hasMetaBoxes && ! areMetaBoxesInitialized ) {
38
40
  registry.dispatch( editPostStore ).initializeMetaBoxes();
39
41
  }
40
- }, [ isEditorReady, areMetaBoxesInitialized ] );
42
+ }, [ isEditorReady, hasMetaBoxes, areMetaBoxesInitialized ] );
41
43
 
42
44
  if ( ! areMetaBoxesInitialized ) {
43
45
  return null;
@@ -6,9 +6,16 @@ import { __ } from '@wordpress/i18n';
6
6
  import { Button } from '@wordpress/components';
7
7
  import { withSelect } from '@wordpress/data';
8
8
  import { store as editorStore } from '@wordpress/editor';
9
- import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';
9
+ import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
10
10
  import { getPathAndQueryString } from '@wordpress/url';
11
11
 
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import { unlock } from '../../lock-unlock';
16
+
17
+ const { PreferenceBaseOption } = unlock( preferencesPrivateApis );
18
+
12
19
  function submitCustomFieldsForm() {
13
20
  const customFieldsForm = document.getElementById(
14
21
  'toggle-custom-fields-form'
@@ -53,7 +60,7 @@ export function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {
53
60
  const [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );
54
61
 
55
62
  return (
56
- <BaseOption
63
+ <PreferenceBaseOption
57
64
  label={ label }
58
65
  isChecked={ isChecked }
59
66
  onChange={ setIsChecked }
@@ -61,7 +68,7 @@ export function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {
61
68
  { isChecked !== areCustomFieldsEnabled && (
62
69
  <CustomFieldsConfirmation willEnable={ isChecked } />
63
70
  ) }
64
- </BaseOption>
71
+ </PreferenceBaseOption>
65
72
  );
66
73
  }
67
74
 
@@ -3,8 +3,15 @@
3
3
  */
4
4
  import { compose, ifCondition } from '@wordpress/compose';
5
5
  import { withSelect, withDispatch } from '@wordpress/data';
6
- import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';
7
6
  import { store as editorStore } from '@wordpress/editor';
7
+ import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import { unlock } from '../../lock-unlock';
13
+
14
+ const { PreferenceBaseOption } = unlock( preferencesPrivateApis );
8
15
 
9
16
  export default compose(
10
17
  withSelect( ( select, { panelName } ) => {
@@ -20,4 +27,4 @@ export default compose(
20
27
  onChange: () =>
21
28
  dispatch( editorStore ).toggleEditorPanelEnabled( panelName ),
22
29
  } ) )
23
- )( BaseOption );
30
+ )( PreferenceBaseOption );
@@ -5,7 +5,14 @@ import { compose } from '@wordpress/compose';
5
5
  import { withSelect, withDispatch } from '@wordpress/data';
6
6
  import { ifViewportMatches } from '@wordpress/viewport';
7
7
  import { store as editorStore } from '@wordpress/editor';
8
- import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';
8
+ import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import { unlock } from '../../lock-unlock';
14
+
15
+ const { PreferenceBaseOption } = unlock( preferencesPrivateApis );
9
16
 
10
17
  export default compose(
11
18
  withSelect( ( select ) => ( {
@@ -22,4 +29,4 @@ export default compose(
22
29
  // In < medium viewports we override this option and always show the publish sidebar.
23
30
  // See the edit-post's header component for the specific logic.
24
31
  ifViewportMatches( 'medium' )
25
- )( BaseOption );
32
+ )( PreferenceBaseOption );
@@ -5,294 +5,71 @@
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { useViewportMatch } from '@wordpress/compose';
7
7
  import { useSelect, useDispatch } from '@wordpress/data';
8
- import { useMemo } from '@wordpress/element';
9
- import {
10
- PostTaxonomies,
11
- PostExcerptCheck,
12
- PageAttributesCheck,
13
- PostFeaturedImageCheck,
14
- PostTypeSupportCheck,
15
- store as editorStore,
16
- } from '@wordpress/editor';
17
- import {
18
- PreferencesModal,
19
- PreferencesModalTabs,
20
- PreferencesModalSection,
21
- store as interfaceStore,
22
- } from '@wordpress/interface';
23
- import { store as preferencesStore } from '@wordpress/preferences';
8
+ import { store as interfaceStore } from '@wordpress/interface';
9
+ import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
10
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
24
11
 
25
12
  /**
26
13
  * Internal dependencies
27
14
  */
28
-
29
- import {
30
- EnablePluginDocumentSettingPanelOption,
31
- EnablePublishSidebarOption,
32
- EnablePanelOption,
33
- EnableFeature,
34
- } from './options';
15
+ import { unlock } from '../../lock-unlock';
35
16
  import MetaBoxesSection from './meta-boxes-section';
36
- import { store as editPostStore } from '../../store';
37
- import BlockManager from '../block-manager';
17
+ import EnablePublishSidebarOption from './enable-publish-sidebar';
18
+
19
+ const { PreferencesModalSection, PreferenceToggleControl } = unlock(
20
+ preferencesPrivateApis
21
+ );
22
+ const { PreferencesModal } = unlock( editorPrivateApis );
38
23
 
39
24
  export const PREFERENCES_MODAL_NAME = 'edit-post/preferences';
40
25
 
41
26
  export default function EditPostPreferencesModal() {
42
27
  const isLargeViewport = useViewportMatch( 'medium' );
43
28
  const { closeModal } = useDispatch( interfaceStore );
44
- const [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(
45
- ( select ) => {
46
- const { getEditorSettings } = select( editorStore );
47
- const { getEditorMode } = select( editPostStore );
48
- const { get } = select( preferencesStore );
49
- const modalActive = select( interfaceStore ).isModalActive(
50
- PREFERENCES_MODAL_NAME
51
- );
52
- const mode = getEditorMode();
53
- const isRichEditingEnabled = getEditorSettings().richEditingEnabled;
54
- const isDistractionFreeEnabled = get( 'core', 'distractionFree' );
55
- return [
56
- modalActive,
57
- ! isDistractionFreeEnabled &&
58
- isLargeViewport &&
59
- isRichEditingEnabled &&
60
- mode === 'visual',
61
- isDistractionFreeEnabled,
62
- ];
63
- },
64
- [ isLargeViewport ]
65
- );
66
-
67
- const { closeGeneralSidebar } = useDispatch( editPostStore );
68
- const { setIsListViewOpened, setIsInserterOpened } =
69
- useDispatch( editorStore );
70
- const { set: setPreference } = useDispatch( preferencesStore );
71
-
72
- const toggleDistractionFree = () => {
73
- setPreference( 'core', 'fixedToolbar', true );
74
- setIsInserterOpened( false );
75
- setIsListViewOpened( false );
76
- closeGeneralSidebar();
77
- };
29
+ const { isModalActive } = useSelect( ( select ) => {
30
+ const modalActive = select( interfaceStore ).isModalActive(
31
+ PREFERENCES_MODAL_NAME
32
+ );
33
+ return {
34
+ isModalActive: modalActive,
35
+ };
36
+ }, [] );
78
37
 
79
- const turnOffDistractionFree = () => {
80
- setPreference( 'core', 'distractionFree', false );
81
- };
82
-
83
- const sections = useMemo(
84
- () => [
85
- {
86
- name: 'general',
87
- tabLabel: __( 'General' ),
88
- content: (
89
- <>
90
- { isLargeViewport && (
91
- <PreferencesModalSection
92
- title={ __( 'Publishing' ) }
93
- >
94
- <EnablePublishSidebarOption
95
- help={ __(
96
- 'Review settings, such as visibility and tags.'
97
- ) }
98
- label={ __( 'Enable pre-publish checks' ) }
99
- />
100
- </PreferencesModalSection>
101
- ) }
102
- <PreferencesModalSection title={ __( 'Interface' ) }>
103
- <EnableFeature
104
- scope="core"
105
- featureName="showListViewByDefault"
106
- help={ __(
107
- 'Opens the block list view sidebar by default.'
108
- ) }
109
- label={ __( 'Always open list view' ) }
110
- />
111
- { showBlockBreadcrumbsOption && (
112
- <EnableFeature
113
- scope="core"
114
- featureName="showBlockBreadcrumbs"
115
- help={ __(
116
- 'Display the block hierarchy trail at the bottom of the editor.'
117
- ) }
118
- label={ __( 'Show block breadcrumbs' ) }
119
- />
120
- ) }
121
- <EnableFeature
122
- scope="core"
123
- featureName="allowRightClickOverrides"
124
- help={ __(
125
- 'Allows contextual list view menus via right-click, overriding browser defaults.'
126
- ) }
127
- label={ __(
128
- 'Allow right-click contextual menus'
129
- ) }
130
- />
131
- </PreferencesModalSection>
132
- <PreferencesModalSection
133
- title={ __( 'Document settings' ) }
134
- description={ __(
135
- 'Select what settings are shown in the document panel.'
136
- ) }
137
- >
138
- <EnablePluginDocumentSettingPanelOption.Slot />
139
- <PostTaxonomies
140
- taxonomyWrapper={ ( content, taxonomy ) => (
141
- <EnablePanelOption
142
- label={ taxonomy.labels.menu_name }
143
- panelName={ `taxonomy-panel-${ taxonomy.slug }` }
144
- />
145
- ) }
146
- />
147
- <PostFeaturedImageCheck>
148
- <EnablePanelOption
149
- label={ __( 'Featured image' ) }
150
- panelName="featured-image"
151
- />
152
- </PostFeaturedImageCheck>
153
- <PostExcerptCheck>
154
- <EnablePanelOption
155
- label={ __( 'Excerpt' ) }
156
- panelName="post-excerpt"
157
- />
158
- </PostExcerptCheck>
159
- <PostTypeSupportCheck
160
- supportKeys={ [ 'comments', 'trackbacks' ] }
161
- >
162
- <EnablePanelOption
163
- label={ __( 'Discussion' ) }
164
- panelName="discussion-panel"
165
- />
166
- </PostTypeSupportCheck>
167
- <PageAttributesCheck>
168
- <EnablePanelOption
169
- label={ __( 'Page attributes' ) }
170
- panelName="page-attributes"
171
- />
172
- </PageAttributesCheck>
173
- </PreferencesModalSection>
174
- <MetaBoxesSection title={ __( 'Advanced' ) } />
175
- </>
176
- ),
177
- },
178
- {
179
- name: 'appearance',
180
- tabLabel: __( 'Appearance' ),
181
- content: (
182
- <PreferencesModalSection
183
- title={ __( 'Appearance' ) }
184
- description={ __(
185
- 'Customize the editor interface to suit your needs.'
186
- ) }
187
- >
188
- <EnableFeature
189
- scope="core"
190
- featureName="fixedToolbar"
191
- onToggle={ turnOffDistractionFree }
38
+ const extraSections = {
39
+ general: (
40
+ <>
41
+ { isLargeViewport && (
42
+ <PreferencesModalSection title={ __( 'Publishing' ) }>
43
+ <EnablePublishSidebarOption
192
44
  help={ __(
193
- 'Access all block and document tools in a single place.'
45
+ 'Review settings, such as visibility and tags.'
194
46
  ) }
195
- label={ __( 'Top toolbar' ) }
196
- />
197
- <EnableFeature
198
- scope="core"
199
- featureName="distractionFree"
200
- onToggle={ toggleDistractionFree }
201
- help={ __(
202
- 'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'
203
- ) }
204
- label={ __( 'Distraction free' ) }
205
- />
206
- <EnableFeature
207
- scope="core"
208
- featureName="focusMode"
209
- help={ __(
210
- 'Highlights the current block and fades other content.'
211
- ) }
212
- label={ __( 'Spotlight mode' ) }
213
- />
214
- <EnableFeature
215
- featureName="themeStyles"
216
- help={ __(
217
- 'Make the editor look like your theme.'
218
- ) }
219
- label={ __( 'Use theme styles' ) }
47
+ label={ __( 'Enable pre-publish checks' ) }
220
48
  />
221
49
  </PreferencesModalSection>
222
- ),
223
- },
224
- {
225
- name: 'accessibility',
226
- tabLabel: __( 'Accessibility' ),
227
- content: (
228
- <>
229
- <PreferencesModalSection
230
- title={ __( 'Navigation' ) }
231
- description={ __(
232
- 'Optimize the editing experience for enhanced control.'
233
- ) }
234
- >
235
- <EnableFeature
236
- scope="core"
237
- featureName="keepCaretInsideBlock"
238
- help={ __(
239
- 'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'
240
- ) }
241
- label={ __(
242
- 'Contain text cursor inside block'
243
- ) }
244
- />
245
- </PreferencesModalSection>
246
- <PreferencesModalSection title={ __( 'Interface' ) }>
247
- <EnableFeature
248
- scope="core"
249
- featureName="showIconLabels"
250
- label={ __( 'Show button text labels' ) }
251
- help={ __(
252
- 'Show text instead of icons on buttons across the interface.'
253
- ) }
254
- />
255
- </PreferencesModalSection>
256
- </>
257
- ),
258
- },
259
- {
260
- name: 'blocks',
261
- tabLabel: __( 'Blocks' ),
262
- content: (
263
- <>
264
- <PreferencesModalSection title={ __( 'Inserter' ) }>
265
- <EnableFeature
266
- scope="core"
267
- featureName="mostUsedBlocks"
268
- help={ __(
269
- 'Adds a category with the most frequently used blocks in the inserter.'
270
- ) }
271
- label={ __( 'Show most used blocks' ) }
272
- />
273
- </PreferencesModalSection>
274
- <PreferencesModalSection
275
- title={ __( 'Manage block visibility' ) }
276
- description={ __(
277
- "Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."
278
- ) }
279
- >
280
- <BlockManager />
281
- </PreferencesModalSection>
282
- </>
283
- ),
284
- },
285
- ],
286
- [ isLargeViewport, showBlockBreadcrumbsOption ]
287
- );
50
+ ) }
51
+ <MetaBoxesSection title={ __( 'Advanced' ) } />
52
+ </>
53
+ ),
54
+ appearance: (
55
+ <PreferenceToggleControl
56
+ scope="core/edit-post"
57
+ featureName="themeStyles"
58
+ help={ __( 'Make the editor look like your theme.' ) }
59
+ label={ __( 'Use theme styles' ) }
60
+ />
61
+ ),
62
+ };
288
63
 
289
64
  if ( ! isModalActive ) {
290
65
  return null;
291
66
  }
292
67
 
293
68
  return (
294
- <PreferencesModal closeModal={ closeModal }>
295
- <PreferencesModalTabs sections={ sections } />
296
- </PreferencesModal>
69
+ <PreferencesModal
70
+ extraSections={ extraSections }
71
+ isActive={ isModalActive }
72
+ onClose={ closeModal }
73
+ />
297
74
  );
298
75
  }
@@ -4,13 +4,17 @@
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { withSelect } from '@wordpress/data';
6
6
  import { store as editorStore } from '@wordpress/editor';
7
- import { PreferencesModalSection } from '@wordpress/interface';
7
+ import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
8
8
 
9
9
  /**
10
10
  * Internal dependencies
11
11
  */
12
- import { EnableCustomFieldsOption, EnablePanelOption } from './options';
12
+ import EnableCustomFieldsOption from './enable-custom-fields';
13
+ import EnablePanelOption from './enable-panel';
13
14
  import { store as editPostStore } from '../../store';
15
+ import { unlock } from '../../lock-unlock';
16
+
17
+ const { PreferencesModalSection } = unlock( preferencesPrivateApis );
14
18
 
15
19
  export function MetaBoxesSection( {
16
20
  areCustomFieldsRegistered,
@@ -54,7 +54,7 @@ exports[`EnableCustomFieldsOption renders a checked checkbox and a confirmation
54
54
 
55
55
  <div>
56
56
  <div
57
- class="interface-preferences-modal__option"
57
+ class="preference-base-option"
58
58
  >
59
59
  <div
60
60
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -160,7 +160,7 @@ exports[`EnableCustomFieldsOption renders a checked checkbox when custom fields
160
160
 
161
161
  <div>
162
162
  <div
163
- class="interface-preferences-modal__option"
163
+ class="preference-base-option"
164
164
  >
165
165
  <div
166
166
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -256,7 +256,7 @@ exports[`EnableCustomFieldsOption renders an unchecked checkbox and a confirmati
256
256
 
257
257
  <div>
258
258
  <div
259
- class="interface-preferences-modal__option"
259
+ class="preference-base-option"
260
260
  >
261
261
  <div
262
262
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -363,7 +363,7 @@ exports[`EnableCustomFieldsOption renders an unchecked checkbox when custom fiel
363
363
 
364
364
  <div>
365
365
  <div
366
- class="interface-preferences-modal__option"
366
+ class="preference-base-option"
367
367
  >
368
368
  <div
369
369
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -53,22 +53,22 @@ exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
53
53
  }
54
54
 
55
55
  <fieldset
56
- class="interface-preferences-modal__section"
56
+ class="preferences-modal__section"
57
57
  >
58
58
  <legend
59
- class="interface-preferences-modal__section-legend"
59
+ class="preferences-modal__section-legend"
60
60
  >
61
61
  <h2
62
- class="interface-preferences-modal__section-title"
62
+ class="preferences-modal__section-title"
63
63
  >
64
64
  Advanced panels
65
65
  </h2>
66
66
  </legend>
67
67
  <div
68
- class="interface-preferences-modal__section-content"
68
+ class="preferences-modal__section-content"
69
69
  >
70
70
  <div
71
- class="interface-preferences-modal__option"
71
+ class="preference-base-option"
72
72
  >
73
73
  <div
74
74
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -165,22 +165,22 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
165
165
  }
166
166
 
167
167
  <fieldset
168
- class="interface-preferences-modal__section"
168
+ class="preferences-modal__section"
169
169
  >
170
170
  <legend
171
- class="interface-preferences-modal__section-legend"
171
+ class="preferences-modal__section-legend"
172
172
  >
173
173
  <h2
174
- class="interface-preferences-modal__section-title"
174
+ class="preferences-modal__section-title"
175
175
  >
176
176
  Advanced panels
177
177
  </h2>
178
178
  </legend>
179
179
  <div
180
- class="interface-preferences-modal__section-content"
180
+ class="preferences-modal__section-content"
181
181
  >
182
182
  <div
183
- class="interface-preferences-modal__option"
183
+ class="preference-base-option"
184
184
  >
185
185
  <div
186
186
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -221,7 +221,7 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
221
221
  </div>
222
222
  </div>
223
223
  <div
224
- class="interface-preferences-modal__option"
224
+ class="preference-base-option"
225
225
  >
226
226
  <div
227
227
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -263,7 +263,7 @@ exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`
263
263
  </div>
264
264
  </div>
265
265
  <div
266
- class="interface-preferences-modal__option"
266
+ class="preference-base-option"
267
267
  >
268
268
  <div
269
269
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -361,22 +361,22 @@ exports[`MetaBoxesSection renders meta box options 1`] = `
361
361
  }
362
362
 
363
363
  <fieldset
364
- class="interface-preferences-modal__section"
364
+ class="preferences-modal__section"
365
365
  >
366
366
  <legend
367
- class="interface-preferences-modal__section-legend"
367
+ class="preferences-modal__section-legend"
368
368
  >
369
369
  <h2
370
- class="interface-preferences-modal__section-title"
370
+ class="preferences-modal__section-title"
371
371
  >
372
372
  Advanced panels
373
373
  </h2>
374
374
  </legend>
375
375
  <div
376
- class="interface-preferences-modal__section-content"
376
+ class="preferences-modal__section-content"
377
377
  >
378
378
  <div
379
- class="interface-preferences-modal__option"
379
+ class="preference-base-option"
380
380
  >
381
381
  <div
382
382
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -418,7 +418,7 @@ exports[`MetaBoxesSection renders meta box options 1`] = `
418
418
  </div>
419
419
  </div>
420
420
  <div
421
- class="interface-preferences-modal__option"
421
+ class="preference-base-option"
422
422
  >
423
423
  <div
424
424
  class="components-base-control components-toggle-control emotion-0 emotion-1"
@@ -5,14 +5,18 @@ import { createSlotFill, PanelBody } from '@wordpress/components';
5
5
  import { usePluginContext } from '@wordpress/plugins';
6
6
  import { useDispatch, useSelect } from '@wordpress/data';
7
7
  import warning from '@wordpress/warning';
8
- import { store as editorStore } from '@wordpress/editor';
8
+ import {
9
+ store as editorStore,
10
+ privateApis as editorPrivateApis,
11
+ } from '@wordpress/editor';
9
12
 
10
13
  /**
11
14
  * Internal dependencies
12
15
  */
13
- import { EnablePluginDocumentSettingPanelOption } from '../../preferences-modal/options';
16
+ import { unlock } from '../../../lock-unlock';
14
17
 
15
18
  const { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );
19
+ const { EnablePluginDocumentSettingPanelOption } = unlock( editorPrivateApis );
16
20
 
17
21
  /**
18
22
  * Renders items below the Status & Availability panel in the Document Sidebar.