@wordpress/edit-post 5.0.2 → 5.0.6
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/README.md +1 -1
- package/build/components/header/fullscreen-mode-close/index.js +19 -3
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js +10 -3
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/template-title/index.js +1 -1
- package/build/components/header/template-title/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +1 -3
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -8
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +1 -3
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js +5 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +1 -4
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +54 -16
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +1 -0
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/template/actions.js +6 -1
- package/build/components/sidebar/template/actions.js.map +1 -1
- package/build/components/sidebar/template/index.js +5 -2
- package/build/components/sidebar/template/index.js.map +1 -1
- package/build/components/sidebar/template-summary/index.js +2 -1
- package/build/components/sidebar/template-summary/index.js.map +1 -1
- package/build/editor.js +16 -6
- package/build/editor.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js +1 -1
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/build/store/selectors.js +5 -3
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js +19 -4
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js +11 -4
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/template-title/index.js +1 -1
- package/build-module/components/header/template-title/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -3
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -8
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +2 -4
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +5 -1
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +1 -4
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +55 -18
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -0
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/template/actions.js +6 -1
- package/build-module/components/sidebar/template/actions.js.map +1 -1
- package/build-module/components/sidebar/template/index.js +5 -2
- package/build-module/components/sidebar/template/index.js.map +1 -1
- package/build-module/components/sidebar/template-summary/index.js +2 -1
- package/build-module/components/sidebar/template-summary/index.js.map +1 -1
- package/build-module/editor.js +15 -6
- package/build-module/editor.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js +1 -1
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +5 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/selectors.js +5 -3
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +30 -53
- package/build-style/style.css +30 -53
- package/package.json +27 -27
- package/src/components/header/fullscreen-mode-close/index.js +37 -15
- package/src/components/header/header-toolbar/index.native.js +8 -2
- package/src/components/header/template-title/index.js +3 -1
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +15 -12
- package/src/components/keyboard-shortcut-help-modal/index.js +1 -3
- package/src/components/keyboard-shortcuts/index.js +19 -32
- package/src/components/layout/index.js +2 -6
- package/src/components/layout/index.native.js +7 -1
- package/src/components/meta-boxes/index.js +2 -9
- package/src/components/preferences-modal/index.js +91 -26
- package/src/components/preferences-modal/style.scss +6 -56
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +330 -130
- package/src/components/secondary-sidebar/inserter-sidebar.js +1 -0
- package/src/components/secondary-sidebar/list-view-sidebar.js +1 -0
- package/src/components/sidebar/plugin-sidebar/index.js +1 -1
- package/src/components/sidebar/template/actions.js +6 -1
- package/src/components/sidebar/template/index.js +5 -3
- package/src/components/sidebar/template-summary/index.js +1 -1
- package/src/components/sidebar/template-summary/style.scss +2 -1
- package/src/components/visual-editor/style.scss +4 -5
- package/src/components/welcome-guide/style.scss +5 -0
- package/src/editor.js +98 -78
- package/src/hooks/validate-multiple-use/index.js +1 -1
- package/src/index.js +3 -0
- package/src/store/selectors.js +7 -3
|
@@ -40,151 +40,351 @@ exports[`PreferencesModal should match snapshot when the modal is active small v
|
|
|
40
40
|
onRequestClose={[Function]}
|
|
41
41
|
title="Preferences"
|
|
42
42
|
>
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
onActivateMenu={[Function]}
|
|
43
|
+
<NavigatorProvider
|
|
44
|
+
initialPath="/"
|
|
46
45
|
>
|
|
47
|
-
<
|
|
48
|
-
|
|
46
|
+
<NavigatorScreen
|
|
47
|
+
path="/"
|
|
49
48
|
>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
49
|
+
<Card
|
|
50
|
+
isBorderless={true}
|
|
51
|
+
size="small"
|
|
52
|
+
>
|
|
53
|
+
<CardBody>
|
|
54
|
+
<ItemGroup>
|
|
55
|
+
<NavigationButton
|
|
56
|
+
as={
|
|
57
|
+
Object {
|
|
58
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
59
|
+
"__contextSystemKey__": Array [
|
|
60
|
+
"Item",
|
|
61
|
+
],
|
|
62
|
+
"render": [Function],
|
|
63
|
+
"selector": ".components-item",
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
isAction={true}
|
|
67
|
+
key="general"
|
|
68
|
+
path="general"
|
|
69
|
+
>
|
|
70
|
+
<HStack
|
|
71
|
+
justify="space-between"
|
|
72
|
+
>
|
|
73
|
+
<FlexItem>
|
|
74
|
+
<Truncate>
|
|
75
|
+
General
|
|
76
|
+
</Truncate>
|
|
77
|
+
</FlexItem>
|
|
78
|
+
<FlexItem>
|
|
79
|
+
<Icon
|
|
80
|
+
icon={
|
|
81
|
+
<SVG
|
|
82
|
+
viewBox="0 0 24 24"
|
|
83
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
84
|
+
>
|
|
85
|
+
<Path
|
|
86
|
+
d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
|
87
|
+
/>
|
|
88
|
+
</SVG>
|
|
89
|
+
}
|
|
90
|
+
/>
|
|
91
|
+
</FlexItem>
|
|
92
|
+
</HStack>
|
|
93
|
+
</NavigationButton>
|
|
94
|
+
<NavigationButton
|
|
95
|
+
as={
|
|
96
|
+
Object {
|
|
97
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
98
|
+
"__contextSystemKey__": Array [
|
|
99
|
+
"Item",
|
|
100
|
+
],
|
|
101
|
+
"render": [Function],
|
|
102
|
+
"selector": ".components-item",
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
isAction={true}
|
|
106
|
+
key="blocks"
|
|
107
|
+
path="blocks"
|
|
108
|
+
>
|
|
109
|
+
<HStack
|
|
110
|
+
justify="space-between"
|
|
111
|
+
>
|
|
112
|
+
<FlexItem>
|
|
113
|
+
<Truncate>
|
|
114
|
+
Blocks
|
|
115
|
+
</Truncate>
|
|
116
|
+
</FlexItem>
|
|
117
|
+
<FlexItem>
|
|
118
|
+
<Icon
|
|
119
|
+
icon={
|
|
120
|
+
<SVG
|
|
121
|
+
viewBox="0 0 24 24"
|
|
122
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
123
|
+
>
|
|
124
|
+
<Path
|
|
125
|
+
d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
|
126
|
+
/>
|
|
127
|
+
</SVG>
|
|
128
|
+
}
|
|
129
|
+
/>
|
|
130
|
+
</FlexItem>
|
|
131
|
+
</HStack>
|
|
132
|
+
</NavigationButton>
|
|
133
|
+
<NavigationButton
|
|
134
|
+
as={
|
|
135
|
+
Object {
|
|
136
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
137
|
+
"__contextSystemKey__": Array [
|
|
138
|
+
"Item",
|
|
139
|
+
],
|
|
140
|
+
"render": [Function],
|
|
141
|
+
"selector": ".components-item",
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
isAction={true}
|
|
145
|
+
key="panels"
|
|
146
|
+
path="panels"
|
|
147
|
+
>
|
|
148
|
+
<HStack
|
|
149
|
+
justify="space-between"
|
|
150
|
+
>
|
|
151
|
+
<FlexItem>
|
|
152
|
+
<Truncate>
|
|
153
|
+
Panels
|
|
154
|
+
</Truncate>
|
|
155
|
+
</FlexItem>
|
|
156
|
+
<FlexItem>
|
|
157
|
+
<Icon
|
|
158
|
+
icon={
|
|
159
|
+
<SVG
|
|
160
|
+
viewBox="0 0 24 24"
|
|
161
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
162
|
+
>
|
|
163
|
+
<Path
|
|
164
|
+
d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
|
165
|
+
/>
|
|
166
|
+
</SVG>
|
|
167
|
+
}
|
|
168
|
+
/>
|
|
169
|
+
</FlexItem>
|
|
170
|
+
</HStack>
|
|
171
|
+
</NavigationButton>
|
|
172
|
+
</ItemGroup>
|
|
173
|
+
</CardBody>
|
|
174
|
+
</Card>
|
|
175
|
+
</NavigatorScreen>
|
|
176
|
+
<NavigatorScreen
|
|
67
177
|
key="general-menu"
|
|
68
|
-
|
|
69
|
-
parentMenu="preferences-menu"
|
|
70
|
-
title="General"
|
|
178
|
+
path="general"
|
|
71
179
|
>
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
180
|
+
<Card
|
|
181
|
+
isBorderless={true}
|
|
182
|
+
size="large"
|
|
183
|
+
>
|
|
184
|
+
<CardHeader
|
|
185
|
+
gap="6"
|
|
186
|
+
isBorderless={false}
|
|
187
|
+
justify="left"
|
|
188
|
+
size="small"
|
|
76
189
|
>
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
/>
|
|
92
|
-
<WithSelect(WithDispatch(BaseOption))
|
|
93
|
-
featureName="themeStyles"
|
|
94
|
-
help="Make the editor look like your theme."
|
|
95
|
-
label="Use theme styles"
|
|
96
|
-
/>
|
|
97
|
-
<WithSelect(WithDispatch(BaseOption))
|
|
98
|
-
featureName="showBlockBreadcrumbs"
|
|
99
|
-
help="Shows block breadcrumbs at the bottom of the editor."
|
|
100
|
-
label="Display block breadcrumbs"
|
|
190
|
+
<NavigationButton
|
|
191
|
+
aria-label="Navigate to the previous view"
|
|
192
|
+
icon={
|
|
193
|
+
<SVG
|
|
194
|
+
viewBox="0 0 24 24"
|
|
195
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
196
|
+
>
|
|
197
|
+
<Path
|
|
198
|
+
d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
|
|
199
|
+
/>
|
|
200
|
+
</SVG>
|
|
201
|
+
}
|
|
202
|
+
isBack={true}
|
|
203
|
+
path="/"
|
|
101
204
|
/>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
205
|
+
<Text
|
|
206
|
+
size="16"
|
|
207
|
+
>
|
|
208
|
+
General
|
|
209
|
+
</Text>
|
|
210
|
+
</CardHeader>
|
|
211
|
+
<CardBody>
|
|
212
|
+
<Section
|
|
213
|
+
description="Customize options related to the block editor interface and editing flow."
|
|
214
|
+
title="Appearance"
|
|
215
|
+
>
|
|
216
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
217
|
+
featureName="reducedUI"
|
|
218
|
+
help="Compacts options and outlines in the toolbar."
|
|
219
|
+
label="Reduce the interface"
|
|
220
|
+
/>
|
|
221
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
222
|
+
featureName="focusMode"
|
|
223
|
+
help="Highlights the current block and fades other content."
|
|
224
|
+
label="Spotlight mode"
|
|
225
|
+
/>
|
|
226
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
227
|
+
featureName="showIconLabels"
|
|
228
|
+
help="Shows text instead of icons."
|
|
229
|
+
label="Display button labels"
|
|
230
|
+
/>
|
|
231
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
232
|
+
featureName="themeStyles"
|
|
233
|
+
help="Make the editor look like your theme."
|
|
234
|
+
label="Use theme styles"
|
|
235
|
+
/>
|
|
236
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
237
|
+
featureName="showBlockBreadcrumbs"
|
|
238
|
+
help="Shows block breadcrumbs at the bottom of the editor."
|
|
239
|
+
label="Display block breadcrumbs"
|
|
240
|
+
/>
|
|
241
|
+
</Section>
|
|
242
|
+
</CardBody>
|
|
243
|
+
</Card>
|
|
244
|
+
</NavigatorScreen>
|
|
245
|
+
<NavigatorScreen
|
|
106
246
|
key="blocks-menu"
|
|
107
|
-
|
|
108
|
-
parentMenu="preferences-menu"
|
|
109
|
-
title="Blocks"
|
|
247
|
+
path="blocks"
|
|
110
248
|
>
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
249
|
+
<Card
|
|
250
|
+
isBorderless={true}
|
|
251
|
+
size="large"
|
|
252
|
+
>
|
|
253
|
+
<CardHeader
|
|
254
|
+
gap="6"
|
|
255
|
+
isBorderless={false}
|
|
256
|
+
justify="left"
|
|
257
|
+
size="small"
|
|
115
258
|
>
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
259
|
+
<NavigationButton
|
|
260
|
+
aria-label="Navigate to the previous view"
|
|
261
|
+
icon={
|
|
262
|
+
<SVG
|
|
263
|
+
viewBox="0 0 24 24"
|
|
264
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
265
|
+
>
|
|
266
|
+
<Path
|
|
267
|
+
d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
|
|
268
|
+
/>
|
|
269
|
+
</SVG>
|
|
270
|
+
}
|
|
271
|
+
isBack={true}
|
|
272
|
+
path="/"
|
|
125
273
|
/>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
274
|
+
<Text
|
|
275
|
+
size="16"
|
|
276
|
+
>
|
|
277
|
+
Blocks
|
|
278
|
+
</Text>
|
|
279
|
+
</CardHeader>
|
|
280
|
+
<CardBody>
|
|
281
|
+
<Section
|
|
282
|
+
description="Customize how you interact with blocks in the block library and editing canvas."
|
|
283
|
+
title="Block interactions"
|
|
284
|
+
>
|
|
285
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
286
|
+
featureName="mostUsedBlocks"
|
|
287
|
+
help="Places the most frequent blocks in the block library."
|
|
288
|
+
label="Show most used blocks"
|
|
289
|
+
/>
|
|
290
|
+
<WithSelect(WithDispatch(BaseOption))
|
|
291
|
+
featureName="keepCaretInsideBlock"
|
|
292
|
+
help="Aids screen readers by stopping text caret from leaving blocks."
|
|
293
|
+
label="Contain text cursor inside block"
|
|
294
|
+
/>
|
|
295
|
+
</Section>
|
|
296
|
+
<Section
|
|
297
|
+
description="Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."
|
|
298
|
+
title="Visible blocks"
|
|
299
|
+
>
|
|
300
|
+
<WithSelect(BlockManager) />
|
|
301
|
+
</Section>
|
|
302
|
+
</CardBody>
|
|
303
|
+
</Card>
|
|
304
|
+
</NavigatorScreen>
|
|
305
|
+
<NavigatorScreen
|
|
136
306
|
key="panels-menu"
|
|
137
|
-
|
|
138
|
-
parentMenu="preferences-menu"
|
|
139
|
-
title="Panels"
|
|
307
|
+
path="panels"
|
|
140
308
|
>
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
309
|
+
<Card
|
|
310
|
+
isBorderless={true}
|
|
311
|
+
size="large"
|
|
312
|
+
>
|
|
313
|
+
<CardHeader
|
|
314
|
+
gap="6"
|
|
315
|
+
isBorderless={false}
|
|
316
|
+
justify="left"
|
|
317
|
+
size="small"
|
|
145
318
|
>
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
<WithSelect(IfCondition(WithDispatch(BaseOption)))
|
|
158
|
-
label="Excerpt"
|
|
159
|
-
panelName="post-excerpt"
|
|
160
|
-
/>
|
|
161
|
-
</PostExcerptCheck>
|
|
162
|
-
<WithSelect(PostTypeSupportCheck)
|
|
163
|
-
supportKeys={
|
|
164
|
-
Array [
|
|
165
|
-
"comments",
|
|
166
|
-
"trackbacks",
|
|
167
|
-
]
|
|
319
|
+
<NavigationButton
|
|
320
|
+
aria-label="Navigate to the previous view"
|
|
321
|
+
icon={
|
|
322
|
+
<SVG
|
|
323
|
+
viewBox="0 0 24 24"
|
|
324
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
325
|
+
>
|
|
326
|
+
<Path
|
|
327
|
+
d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
|
|
328
|
+
/>
|
|
329
|
+
</SVG>
|
|
168
330
|
}
|
|
331
|
+
isBack={true}
|
|
332
|
+
path="/"
|
|
333
|
+
/>
|
|
334
|
+
<Text
|
|
335
|
+
size="16"
|
|
169
336
|
>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
337
|
+
Panels
|
|
338
|
+
</Text>
|
|
339
|
+
</CardHeader>
|
|
340
|
+
<CardBody>
|
|
341
|
+
<Section
|
|
342
|
+
description="Choose what displays in the panel."
|
|
343
|
+
title="Document settings"
|
|
344
|
+
>
|
|
345
|
+
<EnablePluginDocumentSettingPanelOptionSlot />
|
|
346
|
+
<WithSelect(PostTaxonomies)
|
|
347
|
+
taxonomyWrapper={[Function]}
|
|
179
348
|
/>
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
349
|
+
<PostFeaturedImageCheck>
|
|
350
|
+
<WithSelect(IfCondition(WithDispatch(BaseOption)))
|
|
351
|
+
label="Featured image"
|
|
352
|
+
panelName="featured-image"
|
|
353
|
+
/>
|
|
354
|
+
</PostFeaturedImageCheck>
|
|
355
|
+
<PostExcerptCheck>
|
|
356
|
+
<WithSelect(IfCondition(WithDispatch(BaseOption)))
|
|
357
|
+
label="Excerpt"
|
|
358
|
+
panelName="post-excerpt"
|
|
359
|
+
/>
|
|
360
|
+
</PostExcerptCheck>
|
|
361
|
+
<WithSelect(PostTypeSupportCheck)
|
|
362
|
+
supportKeys={
|
|
363
|
+
Array [
|
|
364
|
+
"comments",
|
|
365
|
+
"trackbacks",
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
>
|
|
369
|
+
<WithSelect(IfCondition(WithDispatch(BaseOption)))
|
|
370
|
+
label="Discussion"
|
|
371
|
+
panelName="discussion-panel"
|
|
372
|
+
/>
|
|
373
|
+
</WithSelect(PostTypeSupportCheck)>
|
|
374
|
+
<PageAttributesCheck>
|
|
375
|
+
<WithSelect(IfCondition(WithDispatch(BaseOption)))
|
|
376
|
+
label="Page attributes"
|
|
377
|
+
panelName="page-attributes"
|
|
378
|
+
/>
|
|
379
|
+
</PageAttributesCheck>
|
|
380
|
+
</Section>
|
|
381
|
+
<WithSelect(MetaBoxesSection)
|
|
382
|
+
description="Add extra areas to the editor."
|
|
383
|
+
title="Additional"
|
|
384
|
+
/>
|
|
385
|
+
</CardBody>
|
|
386
|
+
</Card>
|
|
387
|
+
</NavigatorScreen>
|
|
388
|
+
</NavigatorProvider>
|
|
189
389
|
</Modal>
|
|
190
390
|
`;
|
|
@@ -63,6 +63,11 @@ function PostTemplateActions() {
|
|
|
63
63
|
|
|
64
64
|
async function onCreateTemplate( event ) {
|
|
65
65
|
event.preventDefault();
|
|
66
|
+
|
|
67
|
+
if ( isBusy ) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
66
71
|
setIsBusy( true );
|
|
67
72
|
|
|
68
73
|
const newTemplateContent =
|
|
@@ -137,7 +142,7 @@ function PostTemplateActions() {
|
|
|
137
142
|
} }
|
|
138
143
|
overlayClassName="edit-post-template__modal"
|
|
139
144
|
>
|
|
140
|
-
<form onSubmit={
|
|
145
|
+
<form onSubmit={ onCreateTemplate }>
|
|
141
146
|
<Flex align="flex-start" gap={ 8 }>
|
|
142
147
|
<FlexItem>
|
|
143
148
|
<TextControl
|
|
@@ -47,13 +47,15 @@ export function TemplatePanel() {
|
|
|
47
47
|
getCurrentPostType,
|
|
48
48
|
} = select( editorStore );
|
|
49
49
|
const { getPostType, getEntityRecords, canUser } = select( coreStore );
|
|
50
|
-
const
|
|
51
|
-
|
|
50
|
+
const currentPostType = getCurrentPostType();
|
|
51
|
+
const _isViewable = getPostType( currentPostType )?.viewable ?? false;
|
|
52
52
|
const _supportsTemplateMode =
|
|
53
53
|
select( editorStore ).getEditorSettings().supportsTemplateMode &&
|
|
54
54
|
_isViewable;
|
|
55
55
|
|
|
56
|
-
const wpTemplates = getEntityRecords( 'postType', 'wp_template'
|
|
56
|
+
const wpTemplates = getEntityRecords( 'postType', 'wp_template', {
|
|
57
|
+
post_type: currentPostType,
|
|
58
|
+
} );
|
|
57
59
|
|
|
58
60
|
const newAvailableTemplates = fromPairs(
|
|
59
61
|
( wpTemplates || [] ).map( ( { slug, title } ) => [
|
|
@@ -42,12 +42,11 @@
|
|
|
42
42
|
// Center.
|
|
43
43
|
margin-left: auto;
|
|
44
44
|
margin-right: auto;
|
|
45
|
-
|
|
46
|
-
// Margins between the title and the first block, or appender, do not collapse.
|
|
47
|
-
// However in that support block gap, the first items in post content do not have a top margin.
|
|
48
|
-
// By leveraging the gap variable, with a fallback of zero, we handle both cases.
|
|
49
|
-
margin-bottom: var(--wp--style--block-gap, 0);
|
|
50
45
|
}
|
|
46
|
+
|
|
47
|
+
// Add extra margin at the top, to push down the Title area in the post editor.
|
|
48
|
+
margin-top: 4rem;
|
|
49
|
+
margin-bottom: var(--wp--style--block-gap);
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
.edit-post-visual-editor__exit-template-mode {
|