@wordpress/edit-post 6.12.1-next.d6164808d3.0 → 6.14.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 (44) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/block-manager/checklist.js +7 -7
  3. package/build/components/block-manager/checklist.js.map +1 -1
  4. package/build/components/sidebar/featured-image/index.js +7 -1
  5. package/build/components/sidebar/featured-image/index.js.map +1 -1
  6. package/build/components/sidebar/page-attributes/index.js +8 -1
  7. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  8. package/build/components/visual-editor/index.js +4 -3
  9. package/build/components/visual-editor/index.js.map +1 -1
  10. package/build/editor.js +3 -1
  11. package/build/editor.js.map +1 -1
  12. package/build/index.js +4 -1
  13. package/build/index.js.map +1 -1
  14. package/build-module/components/block-manager/checklist.js +7 -6
  15. package/build-module/components/block-manager/checklist.js.map +1 -1
  16. package/build-module/components/sidebar/featured-image/index.js +8 -2
  17. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  18. package/build-module/components/sidebar/page-attributes/index.js +9 -2
  19. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  20. package/build-module/components/visual-editor/index.js +4 -3
  21. package/build-module/components/visual-editor/index.js.map +1 -1
  22. package/build-module/editor.js +4 -2
  23. package/build-module/editor.js.map +1 -1
  24. package/build-module/index.js +4 -1
  25. package/build-module/index.js.map +1 -1
  26. package/build-style/style-rtl.css +9 -13
  27. package/build-style/style.css +9 -13
  28. package/package.json +27 -27
  29. package/src/components/block-manager/checklist.js +3 -6
  30. package/src/components/browser-url/test/index.js +23 -32
  31. package/src/components/header/test/index.js +21 -13
  32. package/src/components/preferences-modal/options/test/__snapshots__/enable-custom-fields.js.snap +192 -88
  33. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +878 -255
  34. package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +394 -35
  35. package/src/components/preferences-modal/test/index.js +13 -7
  36. package/src/components/preferences-modal/test/meta-boxes-section.js +15 -9
  37. package/src/components/sidebar/featured-image/index.js +3 -2
  38. package/src/components/sidebar/page-attributes/index.js +3 -2
  39. package/src/components/sidebar/plugin-post-publish-panel/test/__snapshots__/index.js.snap +1 -1
  40. package/src/components/sidebar/plugin-pre-publish-panel/test/__snapshots__/index.js.snap +1 -2
  41. package/src/components/visual-editor/index.js +7 -3
  42. package/src/editor.js +2 -2
  43. package/src/index.js +4 -0
  44. package/src/components/header/test/__snapshots__/index.js.snap +0 -31
@@ -1,48 +1,407 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`MetaBoxesSection renders a Custom Fields option 1`] = `
4
- <Section
5
- title="Advanced panels"
4
+ .emotion-0 {
5
+ font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
6
+ font-size: 13px;
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ .emotion-0 *,
11
+ .emotion-0 *::before,
12
+ .emotion-0 *::after {
13
+ box-sizing: inherit;
14
+ }
15
+
16
+ .components-panel__row .emotion-2 {
17
+ margin-bottom: inherit;
18
+ }
19
+
20
+ .emotion-4 {
21
+ display: -webkit-box;
22
+ display: -webkit-flex;
23
+ display: -ms-flexbox;
24
+ display: flex;
25
+ -webkit-align-items: center;
26
+ -webkit-box-align: center;
27
+ -ms-flex-align: center;
28
+ align-items: center;
29
+ -webkit-flex-direction: row;
30
+ -ms-flex-direction: row;
31
+ flex-direction: row;
32
+ gap: calc(4px * 3);
33
+ -webkit-box-pack: start;
34
+ -ms-flex-pack: start;
35
+ -webkit-justify-content: flex-start;
36
+ justify-content: flex-start;
37
+ width: 100%;
38
+ }
39
+
40
+ .emotion-4>* {
41
+ min-width: 0;
42
+ }
43
+
44
+ <fieldset
45
+ class="interface-preferences-modal__section"
6
46
  >
7
- <WithSelect(EnableCustomFieldsOption)
8
- label="Custom fields"
9
- />
10
- </Section>
47
+ <legend
48
+ class="interface-preferences-modal__section-legend"
49
+ >
50
+ <h2
51
+ class="interface-preferences-modal__section-title"
52
+ >
53
+ Advanced panels
54
+ </h2>
55
+ </legend>
56
+ <div
57
+ class="interface-preferences-modal__option"
58
+ >
59
+ <div
60
+ class="components-base-control components-toggle-control emotion-0 emotion-1"
61
+ >
62
+ <div
63
+ class="components-base-control__field emotion-2 emotion-3"
64
+ >
65
+ <div
66
+ class="components-flex components-h-stack emotion-4 emotion-5"
67
+ data-wp-c16t="true"
68
+ data-wp-component="HStack"
69
+ >
70
+ <span
71
+ class="components-form-toggle"
72
+ >
73
+ <input
74
+ class="components-form-toggle__input"
75
+ id="inspector-toggle-control-0"
76
+ type="checkbox"
77
+ />
78
+ <span
79
+ class="components-form-toggle__track"
80
+ />
81
+ <span
82
+ class="components-form-toggle__thumb"
83
+ />
84
+ </span>
85
+ <label
86
+ class="components-toggle-control__label"
87
+ for="inspector-toggle-control-0"
88
+ >
89
+ Custom fields
90
+ </label>
91
+ </div>
92
+ </div>
93
+ </div>
94
+ </div>
95
+ </fieldset>
11
96
  `;
12
97
 
13
98
  exports[`MetaBoxesSection renders a Custom Fields option and meta box options 1`] = `
14
- <Section
15
- title="Advanced panels"
99
+ .emotion-0 {
100
+ font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
101
+ font-size: 13px;
102
+ box-sizing: border-box;
103
+ }
104
+
105
+ .emotion-0 *,
106
+ .emotion-0 *::before,
107
+ .emotion-0 *::after {
108
+ box-sizing: inherit;
109
+ }
110
+
111
+ .components-panel__row .emotion-2 {
112
+ margin-bottom: inherit;
113
+ }
114
+
115
+ .emotion-4 {
116
+ display: -webkit-box;
117
+ display: -webkit-flex;
118
+ display: -ms-flexbox;
119
+ display: flex;
120
+ -webkit-align-items: center;
121
+ -webkit-box-align: center;
122
+ -ms-flex-align: center;
123
+ align-items: center;
124
+ -webkit-flex-direction: row;
125
+ -ms-flex-direction: row;
126
+ flex-direction: row;
127
+ gap: calc(4px * 3);
128
+ -webkit-box-pack: start;
129
+ -ms-flex-pack: start;
130
+ -webkit-justify-content: flex-start;
131
+ justify-content: flex-start;
132
+ width: 100%;
133
+ }
134
+
135
+ .emotion-4>* {
136
+ min-width: 0;
137
+ }
138
+
139
+ <fieldset
140
+ class="interface-preferences-modal__section"
16
141
  >
17
- <WithSelect(EnableCustomFieldsOption)
18
- label="Custom fields"
19
- />
20
- <WithSelect(IfCondition(WithDispatch(BaseOption)))
21
- key="test1"
22
- label="Meta Box 1"
23
- panelName="meta-box-test1"
24
- />
25
- <WithSelect(IfCondition(WithDispatch(BaseOption)))
26
- key="test2"
27
- label="Meta Box 2"
28
- panelName="meta-box-test2"
29
- />
30
- </Section>
142
+ <legend
143
+ class="interface-preferences-modal__section-legend"
144
+ >
145
+ <h2
146
+ class="interface-preferences-modal__section-title"
147
+ >
148
+ Advanced panels
149
+ </h2>
150
+ </legend>
151
+ <div
152
+ class="interface-preferences-modal__option"
153
+ >
154
+ <div
155
+ class="components-base-control components-toggle-control emotion-0 emotion-1"
156
+ >
157
+ <div
158
+ class="components-base-control__field emotion-2 emotion-3"
159
+ >
160
+ <div
161
+ class="components-flex components-h-stack emotion-4 emotion-5"
162
+ data-wp-c16t="true"
163
+ data-wp-component="HStack"
164
+ >
165
+ <span
166
+ class="components-form-toggle"
167
+ >
168
+ <input
169
+ class="components-form-toggle__input"
170
+ id="inspector-toggle-control-3"
171
+ type="checkbox"
172
+ />
173
+ <span
174
+ class="components-form-toggle__track"
175
+ />
176
+ <span
177
+ class="components-form-toggle__thumb"
178
+ />
179
+ </span>
180
+ <label
181
+ class="components-toggle-control__label"
182
+ for="inspector-toggle-control-3"
183
+ >
184
+ Custom fields
185
+ </label>
186
+ </div>
187
+ </div>
188
+ </div>
189
+ </div>
190
+ <div
191
+ class="interface-preferences-modal__option"
192
+ >
193
+ <div
194
+ class="components-base-control components-toggle-control emotion-0 emotion-1"
195
+ >
196
+ <div
197
+ class="components-base-control__field emotion-2 emotion-3"
198
+ >
199
+ <div
200
+ class="components-flex components-h-stack emotion-4 emotion-5"
201
+ data-wp-c16t="true"
202
+ data-wp-component="HStack"
203
+ >
204
+ <span
205
+ class="components-form-toggle is-checked"
206
+ >
207
+ <input
208
+ checked=""
209
+ class="components-form-toggle__input"
210
+ id="inspector-toggle-control-4"
211
+ type="checkbox"
212
+ />
213
+ <span
214
+ class="components-form-toggle__track"
215
+ />
216
+ <span
217
+ class="components-form-toggle__thumb"
218
+ />
219
+ </span>
220
+ <label
221
+ class="components-toggle-control__label"
222
+ for="inspector-toggle-control-4"
223
+ >
224
+ Meta Box 1
225
+ </label>
226
+ </div>
227
+ </div>
228
+ </div>
229
+ </div>
230
+ <div
231
+ class="interface-preferences-modal__option"
232
+ >
233
+ <div
234
+ class="components-base-control components-toggle-control emotion-0 emotion-1"
235
+ >
236
+ <div
237
+ class="components-base-control__field emotion-2 emotion-3"
238
+ >
239
+ <div
240
+ class="components-flex components-h-stack emotion-4 emotion-5"
241
+ data-wp-c16t="true"
242
+ data-wp-component="HStack"
243
+ >
244
+ <span
245
+ class="components-form-toggle is-checked"
246
+ >
247
+ <input
248
+ checked=""
249
+ class="components-form-toggle__input"
250
+ id="inspector-toggle-control-5"
251
+ type="checkbox"
252
+ />
253
+ <span
254
+ class="components-form-toggle__track"
255
+ />
256
+ <span
257
+ class="components-form-toggle__thumb"
258
+ />
259
+ </span>
260
+ <label
261
+ class="components-toggle-control__label"
262
+ for="inspector-toggle-control-5"
263
+ >
264
+ Meta Box 2
265
+ </label>
266
+ </div>
267
+ </div>
268
+ </div>
269
+ </div>
270
+ </fieldset>
31
271
  `;
32
272
 
33
273
  exports[`MetaBoxesSection renders meta box options 1`] = `
34
- <Section
35
- title="Advanced panels"
274
+ .emotion-0 {
275
+ font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;
276
+ font-size: 13px;
277
+ box-sizing: border-box;
278
+ }
279
+
280
+ .emotion-0 *,
281
+ .emotion-0 *::before,
282
+ .emotion-0 *::after {
283
+ box-sizing: inherit;
284
+ }
285
+
286
+ .components-panel__row .emotion-2 {
287
+ margin-bottom: inherit;
288
+ }
289
+
290
+ .emotion-4 {
291
+ display: -webkit-box;
292
+ display: -webkit-flex;
293
+ display: -ms-flexbox;
294
+ display: flex;
295
+ -webkit-align-items: center;
296
+ -webkit-box-align: center;
297
+ -ms-flex-align: center;
298
+ align-items: center;
299
+ -webkit-flex-direction: row;
300
+ -ms-flex-direction: row;
301
+ flex-direction: row;
302
+ gap: calc(4px * 3);
303
+ -webkit-box-pack: start;
304
+ -ms-flex-pack: start;
305
+ -webkit-justify-content: flex-start;
306
+ justify-content: flex-start;
307
+ width: 100%;
308
+ }
309
+
310
+ .emotion-4>* {
311
+ min-width: 0;
312
+ }
313
+
314
+ <fieldset
315
+ class="interface-preferences-modal__section"
36
316
  >
37
- <WithSelect(IfCondition(WithDispatch(BaseOption)))
38
- key="test1"
39
- label="Meta Box 1"
40
- panelName="meta-box-test1"
41
- />
42
- <WithSelect(IfCondition(WithDispatch(BaseOption)))
43
- key="test2"
44
- label="Meta Box 2"
45
- panelName="meta-box-test2"
46
- />
47
- </Section>
317
+ <legend
318
+ class="interface-preferences-modal__section-legend"
319
+ >
320
+ <h2
321
+ class="interface-preferences-modal__section-title"
322
+ >
323
+ Advanced panels
324
+ </h2>
325
+ </legend>
326
+ <div
327
+ class="interface-preferences-modal__option"
328
+ >
329
+ <div
330
+ class="components-base-control components-toggle-control emotion-0 emotion-1"
331
+ >
332
+ <div
333
+ class="components-base-control__field emotion-2 emotion-3"
334
+ >
335
+ <div
336
+ class="components-flex components-h-stack emotion-4 emotion-5"
337
+ data-wp-c16t="true"
338
+ data-wp-component="HStack"
339
+ >
340
+ <span
341
+ class="components-form-toggle is-checked"
342
+ >
343
+ <input
344
+ checked=""
345
+ class="components-form-toggle__input"
346
+ id="inspector-toggle-control-1"
347
+ type="checkbox"
348
+ />
349
+ <span
350
+ class="components-form-toggle__track"
351
+ />
352
+ <span
353
+ class="components-form-toggle__thumb"
354
+ />
355
+ </span>
356
+ <label
357
+ class="components-toggle-control__label"
358
+ for="inspector-toggle-control-1"
359
+ >
360
+ Meta Box 1
361
+ </label>
362
+ </div>
363
+ </div>
364
+ </div>
365
+ </div>
366
+ <div
367
+ class="interface-preferences-modal__option"
368
+ >
369
+ <div
370
+ class="components-base-control components-toggle-control emotion-0 emotion-1"
371
+ >
372
+ <div
373
+ class="components-base-control__field emotion-2 emotion-3"
374
+ >
375
+ <div
376
+ class="components-flex components-h-stack emotion-4 emotion-5"
377
+ data-wp-c16t="true"
378
+ data-wp-component="HStack"
379
+ >
380
+ <span
381
+ class="components-form-toggle is-checked"
382
+ >
383
+ <input
384
+ checked=""
385
+ class="components-form-toggle__input"
386
+ id="inspector-toggle-control-2"
387
+ type="checkbox"
388
+ />
389
+ <span
390
+ class="components-form-toggle__track"
391
+ />
392
+ <span
393
+ class="components-form-toggle__thumb"
394
+ />
395
+ </span>
396
+ <label
397
+ class="components-toggle-control__label"
398
+ for="inspector-toggle-control-2"
399
+ >
400
+ Meta Box 2
401
+ </label>
402
+ </div>
403
+ </div>
404
+ </div>
405
+ </div>
406
+ </fieldset>
48
407
  `;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { shallow } from 'enzyme';
4
+ import { render, screen } from '@testing-library/react';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -23,20 +23,26 @@ describe( 'EditPostPreferencesModal', () => {
23
23
  it( 'large viewports', () => {
24
24
  useSelect.mockImplementation( () => true );
25
25
  useViewportMatch.mockImplementation( () => true );
26
- const wrapper = shallow( <EditPostPreferencesModal /> );
27
- expect( wrapper ).toMatchSnapshot();
26
+ render( <EditPostPreferencesModal /> );
27
+ expect(
28
+ screen.getByRole( 'dialog', { name: 'Preferences' } )
29
+ ).toMatchSnapshot();
28
30
  } );
29
31
  it( 'small viewports', () => {
30
32
  useSelect.mockImplementation( () => true );
31
33
  useViewportMatch.mockImplementation( () => false );
32
- const wrapper = shallow( <EditPostPreferencesModal /> );
33
- expect( wrapper ).toMatchSnapshot();
34
+ render( <EditPostPreferencesModal /> );
35
+ expect(
36
+ screen.getByRole( 'dialog', { name: 'Preferences' } )
37
+ ).toMatchSnapshot();
34
38
  } );
35
39
  } );
36
40
 
37
41
  it( 'should not render when the modal is not active', () => {
38
42
  useSelect.mockImplementation( () => false );
39
- const wrapper = shallow( <EditPostPreferencesModal /> );
40
- expect( wrapper.isEmptyRender() ).toBe( true );
43
+ render( <EditPostPreferencesModal /> );
44
+ expect(
45
+ screen.queryByRole( 'dialog', { name: 'Preferences' } )
46
+ ).not.toBeInTheDocument();
41
47
  } );
42
48
  } );
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { shallow } from 'enzyme';
4
+ import { render, screen } from '@testing-library/react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -10,7 +10,7 @@ import { MetaBoxesSection } from '../meta-boxes-section';
10
10
 
11
11
  describe( 'MetaBoxesSection', () => {
12
12
  it( 'does not render if there are no options', () => {
13
- const wrapper = shallow(
13
+ render(
14
14
  <MetaBoxesSection
15
15
  areCustomFieldsRegistered={ false }
16
16
  metaBoxes={ [
@@ -18,11 +18,11 @@ describe( 'MetaBoxesSection', () => {
18
18
  ] }
19
19
  />
20
20
  );
21
- expect( wrapper.isEmptyRender() ).toBe( true );
21
+ expect( screen.queryByRole( 'group' ) ).not.toBeInTheDocument();
22
22
  } );
23
23
 
24
24
  it( 'renders a Custom Fields option', () => {
25
- const wrapper = shallow(
25
+ render(
26
26
  <MetaBoxesSection
27
27
  title="Advanced panels"
28
28
  areCustomFieldsRegistered
@@ -31,11 +31,13 @@ describe( 'MetaBoxesSection', () => {
31
31
  ] }
32
32
  />
33
33
  );
34
- expect( wrapper ).toMatchSnapshot();
34
+ expect(
35
+ screen.getByRole( 'group', { name: 'Advanced panels' } )
36
+ ).toMatchSnapshot();
35
37
  } );
36
38
 
37
39
  it( 'renders meta box options', () => {
38
- const wrapper = shallow(
40
+ render(
39
41
  <MetaBoxesSection
40
42
  title="Advanced panels"
41
43
  areCustomFieldsRegistered={ false }
@@ -46,11 +48,13 @@ describe( 'MetaBoxesSection', () => {
46
48
  ] }
47
49
  />
48
50
  );
49
- expect( wrapper ).toMatchSnapshot();
51
+ expect(
52
+ screen.getByRole( 'group', { name: 'Advanced panels' } )
53
+ ).toMatchSnapshot();
50
54
  } );
51
55
 
52
56
  it( 'renders a Custom Fields option and meta box options', () => {
53
- const wrapper = shallow(
57
+ render(
54
58
  <MetaBoxesSection
55
59
  title="Advanced panels"
56
60
  areCustomFieldsRegistered
@@ -61,6 +65,8 @@ describe( 'MetaBoxesSection', () => {
61
65
  ] }
62
66
  />
63
67
  );
64
- expect( wrapper ).toMatchSnapshot();
68
+ expect(
69
+ screen.getByRole( 'group', { name: 'Advanced panels' } )
70
+ ).toMatchSnapshot();
65
71
  } );
66
72
  } );
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { get, partial } from 'lodash';
4
+ import { get } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -66,7 +66,8 @@ const applyWithDispatch = withDispatch( ( dispatch ) => {
66
66
  const { toggleEditorPanelOpened } = dispatch( editPostStore );
67
67
 
68
68
  return {
69
- onTogglePanel: partial( toggleEditorPanelOpened, PANEL_NAME ),
69
+ onTogglePanel: ( ...args ) =>
70
+ toggleEditorPanelOpened( PANEL_NAME, ...args ),
70
71
  };
71
72
  } );
72
73
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { get, partial } from 'lodash';
4
+ import { get } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -46,7 +46,8 @@ export function PageAttributes() {
46
46
  return null;
47
47
  }
48
48
 
49
- const onTogglePanel = partial( toggleEditorPanelOpened, PANEL_NAME );
49
+ const onTogglePanel = ( ...args ) =>
50
+ toggleEditorPanelOpened( PANEL_NAME, ...args );
50
51
 
51
52
  return (
52
53
  <PageAttributesCheck>
@@ -1,3 +1,3 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`PluginPostPublishPanel renders fill properly 1`] = `"<div class=\\"components-panel__body my-plugin-post-publish-panel is-opened\\"><h2 class=\\"components-panel__body-title\\"><button type=\\"button\\" aria-expanded=\\"true\\" class=\\"components-button components-panel__body-toggle\\"><span aria-hidden=\\"true\\"><svg width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" xmlns=\\"http://www.w3.org/2000/svg\\" class=\\"components-panel__arrow\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z\\"></path></svg></span>My panel title</button></h2>My panel content</div>"`;
3
+ exports[`PluginPostPublishPanel renders fill properly 1`] = `"<div class=\\"components-panel__body my-plugin-post-publish-panel is-opened\\"><h2 class=\\"components-panel__body-title\\"><button type=\\"button\\" aria-expanded=\\"true\\" class=\\"components-button components-panel__body-toggle\\"><span aria-hidden=\\"true\\"><svg viewBox=\\"0 0 24 24\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" class=\\"components-panel__arrow\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z\\"></path></svg></span>My panel title</button></h2>My panel content</div>"`;
@@ -1,4 +1,3 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`PluginPrePublishPanel renders fill properly 1`] = `"<div class=\\"components-panel__body my-plugin-pre-publish-panel is-opened\\"><h2 class=\\"components-panel__body-title\\"><button type=\\"button\\" aria-expanded=\\"true\\" class=\\"components-button components-panel__body-toggle\\"><span aria-hidden=\\"true\\"><svg width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" xmlns=\\"http://www.w3.org/2000/svg\\" class=\\"components-panel__arrow\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z\\"></path></svg></span>My panel title</button></h2>My panel content</div>"`;
4
- q
3
+ exports[`PluginPrePublishPanel renders fill properly 1`] = `"<div class=\\"components-panel__body my-plugin-pre-publish-panel is-opened\\"><h2 class=\\"components-panel__body-title\\"><button type=\\"button\\" aria-expanded=\\"true\\" class=\\"components-button components-panel__body-toggle\\"><span aria-hidden=\\"true\\"><svg viewBox=\\"0 0 24 24\\" xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"24\\" height=\\"24\\" class=\\"components-panel__arrow\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z\\"></path></svg></span>My panel title</button></h2>My panel content</div>"`;
@@ -185,10 +185,14 @@ export default function VisualEditor( { styles } ) {
185
185
  // so we add the constrained type.
186
186
  return { ...defaultLayout, type: 'constrained' };
187
187
  }
188
- // Set constrained layout for classic themes so all alignments are supported.
189
- return { type: 'constrained' };
188
+ // Set default layout for classic themes so all alignments are supported.
189
+ return { type: 'default' };
190
190
  }, [ isTemplateMode, themeSupportsLayout, defaultLayout ] );
191
191
 
192
+ const blockListLayoutClass = themeSupportsLayout
193
+ ? 'is-layout-constrained'
194
+ : 'is-layout-flow';
195
+
192
196
  const titleRef = useRef();
193
197
  useEffect( () => {
194
198
  if ( isWelcomeGuideVisible || ! isCleanNewPost() ) {
@@ -267,7 +271,7 @@ export default function VisualEditor( { styles } ) {
267
271
  className={
268
272
  isTemplateMode
269
273
  ? 'wp-site-blocks'
270
- : 'is-layout-constrained' // Ensure root level blocks receive default/flow blockGap styling rules.
274
+ : `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.
271
275
  }
272
276
  __experimentalLayout={ layout }
273
277
  />
package/src/editor.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { forEach, map, without } from 'lodash';
4
+ import { map, without } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -162,7 +162,7 @@ function Editor( {
162
162
  const styles = useMemo( () => {
163
163
  const themeStyles = [];
164
164
  const presetStyles = [];
165
- forEach( settings.styles, ( style ) => {
165
+ settings.styles?.forEach( ( style ) => {
166
166
  if ( ! style.__unstableType || style.__unstableType === 'theme' ) {
167
167
  themeStyles.push( style );
168
168
  } else {
package/src/index.js CHANGED
@@ -177,6 +177,10 @@ export function initializeEditor(
177
177
  } );
178
178
  }
179
179
 
180
+ // Prevent the default browser action for files dropped outside of dropzones.
181
+ window.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );
182
+ window.addEventListener( 'drop', ( e ) => e.preventDefault(), false );
183
+
180
184
  render(
181
185
  <Editor
182
186
  settings={ settings }