@wordpress/edit-post 7.26.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.
- package/CHANGELOG.md +2 -0
- package/build/components/header/index.js +2 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/layout/index.native.js +1 -3
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +3 -2
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -0
- package/build/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +11 -2
- package/build/components/preferences-modal/enable-panel.js.map +1 -0
- package/build/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +11 -2
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build/components/preferences-modal/index.js +31 -149
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +11 -5
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +5 -2
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/editor.js +3 -26
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +4 -28
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +48 -8
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/index.native.js +1 -1
- package/build/index.native.js.map +1 -1
- package/build/store/actions.js +11 -10
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +24 -6
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/index.js +2 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +1 -3
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +3 -2
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -0
- package/build-module/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +10 -2
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -0
- package/build-module/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +10 -2
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +31 -150
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +7 -2
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +5 -2
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/editor.js +3 -26
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +5 -29
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +49 -9
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +2 -2
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/actions.js +11 -10
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +24 -6
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/classic-rtl.css +1 -1
- package/build-style/classic.css +1 -1
- package/build-style/style-rtl.css +16 -182
- package/build-style/style.css +16 -182
- package/package.json +32 -32
- package/src/components/header/index.js +2 -4
- package/src/components/header/style.scss +13 -4
- package/src/components/layout/index.native.js +1 -4
- package/src/components/meta-boxes/index.js +4 -2
- package/src/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -3
- package/src/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +9 -2
- package/src/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +9 -2
- package/src/components/preferences-modal/index.js +44 -267
- package/src/components/preferences-modal/meta-boxes-section.js +6 -2
- package/src/components/preferences-modal/{options/test → test}/__snapshots__/enable-custom-fields.js.snap +4 -4
- package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +18 -18
- package/src/components/sidebar/plugin-document-setting-panel/index.js +6 -2
- package/src/editor.js +55 -85
- package/src/editor.native.js +4 -33
- package/src/hooks/commands/use-common-commands.js +77 -7
- package/src/index.js +2 -2
- package/src/index.native.js +1 -1
- package/src/store/actions.js +14 -33
- package/src/store/selectors.js +52 -26
- package/src/store/test/actions.js +9 -9
- package/src/style.scss +0 -1
- package/build/components/block-manager/category.js +0 -105
- package/build/components/block-manager/category.js.map +0 -1
- package/build/components/block-manager/checklist.js +0 -35
- package/build/components/block-manager/checklist.js.map +0 -1
- package/build/components/block-manager/index.js +0 -127
- package/build/components/block-manager/index.js.map +0 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
- package/build/components/preferences-modal/options/enable-feature.js +0 -36
- package/build/components/preferences-modal/options/enable-feature.js.map +0 -1
- package/build/components/preferences-modal/options/enable-panel.js.map +0 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -32
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
- package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
- package/build/components/preferences-modal/options/index.js +0 -42
- package/build/components/preferences-modal/options/index.js.map +0 -1
- package/build-module/components/block-manager/category.js +0 -96
- package/build-module/components/block-manager/category.js.map +0 -1
- package/build-module/components/block-manager/checklist.js +0 -27
- package/build-module/components/block-manager/checklist.js.map +0 -1
- package/build-module/components/block-manager/index.js +0 -118
- package/build-module/components/block-manager/index.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +0 -29
- package/build-module/components/preferences-modal/options/enable-feature.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-panel.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -24
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
- package/build-module/components/preferences-modal/options/index.js +0 -6
- package/build-module/components/preferences-modal/options/index.js.map +0 -1
- package/src/components/block-manager/category.js +0 -94
- package/src/components/block-manager/checklist.js +0 -30
- package/src/components/block-manager/index.js +0 -158
- package/src/components/block-manager/style.scss +0 -82
- package/src/components/preferences-modal/options/enable-feature.js +0 -31
- package/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -23
- package/src/components/preferences-modal/options/index.js +0 -5
- /package/src/components/preferences-modal/{options/test → test}/enable-custom-fields.js +0 -0
|
@@ -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 {
|
|
9
|
-
import {
|
|
10
|
-
|
|
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
|
|
37
|
-
|
|
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
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
'
|
|
45
|
+
'Review settings, such as visibility and tags.'
|
|
194
46
|
) }
|
|
195
|
-
label={ __( '
|
|
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
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
|
295
|
-
|
|
296
|
-
|
|
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 {
|
|
7
|
+
import { privateApis as preferencesPrivateApis } from '@wordpress/preferences';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
|
-
import
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
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="
|
|
56
|
+
class="preferences-modal__section"
|
|
57
57
|
>
|
|
58
58
|
<legend
|
|
59
|
-
class="
|
|
59
|
+
class="preferences-modal__section-legend"
|
|
60
60
|
>
|
|
61
61
|
<h2
|
|
62
|
-
class="
|
|
62
|
+
class="preferences-modal__section-title"
|
|
63
63
|
>
|
|
64
64
|
Advanced panels
|
|
65
65
|
</h2>
|
|
66
66
|
</legend>
|
|
67
67
|
<div
|
|
68
|
-
class="
|
|
68
|
+
class="preferences-modal__section-content"
|
|
69
69
|
>
|
|
70
70
|
<div
|
|
71
|
-
class="
|
|
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="
|
|
168
|
+
class="preferences-modal__section"
|
|
169
169
|
>
|
|
170
170
|
<legend
|
|
171
|
-
class="
|
|
171
|
+
class="preferences-modal__section-legend"
|
|
172
172
|
>
|
|
173
173
|
<h2
|
|
174
|
-
class="
|
|
174
|
+
class="preferences-modal__section-title"
|
|
175
175
|
>
|
|
176
176
|
Advanced panels
|
|
177
177
|
</h2>
|
|
178
178
|
</legend>
|
|
179
179
|
<div
|
|
180
|
-
class="
|
|
180
|
+
class="preferences-modal__section-content"
|
|
181
181
|
>
|
|
182
182
|
<div
|
|
183
|
-
class="
|
|
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="
|
|
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="
|
|
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="
|
|
364
|
+
class="preferences-modal__section"
|
|
365
365
|
>
|
|
366
366
|
<legend
|
|
367
|
-
class="
|
|
367
|
+
class="preferences-modal__section-legend"
|
|
368
368
|
>
|
|
369
369
|
<h2
|
|
370
|
-
class="
|
|
370
|
+
class="preferences-modal__section-title"
|
|
371
371
|
>
|
|
372
372
|
Advanced panels
|
|
373
373
|
</h2>
|
|
374
374
|
</legend>
|
|
375
375
|
<div
|
|
376
|
-
class="
|
|
376
|
+
class="preferences-modal__section-content"
|
|
377
377
|
>
|
|
378
378
|
<div
|
|
379
|
-
class="
|
|
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="
|
|
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 {
|
|
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 {
|
|
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.
|