@wordpress/block-library 9.26.0 → 9.26.1-next.719a03cbe.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 (82) hide show
  1. package/build/button/edit.js +1 -1
  2. package/build/button/edit.js.map +1 -1
  3. package/build/cover/edit/inspector-controls.js +2 -2
  4. package/build/cover/edit/inspector-controls.js.map +1 -1
  5. package/build/details/index.js +1 -1
  6. package/build/details/index.js.map +1 -1
  7. package/build/gallery/constants.js +2 -1
  8. package/build/gallery/constants.js.map +1 -1
  9. package/build/gallery/edit.js +93 -15
  10. package/build/gallery/edit.js.map +1 -1
  11. package/build/image/edit.js +6 -0
  12. package/build/image/edit.js.map +1 -1
  13. package/build/list/index.js +0 -1
  14. package/build/list/index.js.map +1 -1
  15. package/build/more/edit.native.js +17 -32
  16. package/build/more/edit.native.js.map +1 -1
  17. package/build/navigation-link/edit.js +17 -1
  18. package/build/navigation-link/edit.js.map +1 -1
  19. package/build/post-author/edit.js +78 -35
  20. package/build/post-author/edit.js.map +1 -1
  21. package/build/post-comments-form/form.js +1 -1
  22. package/build/post-comments-form/form.js.map +1 -1
  23. package/build/post-featured-image/edit.js +2 -1
  24. package/build/post-featured-image/edit.js.map +1 -1
  25. package/build/search/edit.js +1 -1
  26. package/build/search/edit.js.map +1 -1
  27. package/build/site-logo/edit.js +16 -5
  28. package/build/site-logo/edit.js.map +1 -1
  29. package/build-module/button/edit.js +1 -1
  30. package/build-module/button/edit.js.map +1 -1
  31. package/build-module/cover/edit/inspector-controls.js +2 -2
  32. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  33. package/build-module/details/index.js +1 -1
  34. package/build-module/details/index.js.map +1 -1
  35. package/build-module/gallery/constants.js +1 -0
  36. package/build-module/gallery/constants.js.map +1 -1
  37. package/build-module/gallery/edit.js +95 -17
  38. package/build-module/gallery/edit.js.map +1 -1
  39. package/build-module/image/edit.js +6 -0
  40. package/build-module/image/edit.js.map +1 -1
  41. package/build-module/list/index.js +0 -1
  42. package/build-module/list/index.js.map +1 -1
  43. package/build-module/more/edit.native.js +16 -30
  44. package/build-module/more/edit.native.js.map +1 -1
  45. package/build-module/navigation-link/edit.js +18 -2
  46. package/build-module/navigation-link/edit.js.map +1 -1
  47. package/build-module/post-author/edit.js +78 -35
  48. package/build-module/post-author/edit.js.map +1 -1
  49. package/build-module/post-comments-form/form.js +1 -1
  50. package/build-module/post-comments-form/form.js.map +1 -1
  51. package/build-module/post-featured-image/edit.js +2 -1
  52. package/build-module/post-featured-image/edit.js.map +1 -1
  53. package/build-module/search/edit.js +1 -1
  54. package/build-module/search/edit.js.map +1 -1
  55. package/build-module/site-logo/edit.js +17 -6
  56. package/build-module/site-logo/edit.js.map +1 -1
  57. package/build-style/editor-rtl.css +0 -13
  58. package/build-style/editor.css +0 -13
  59. package/build-style/gallery/editor-rtl.css +0 -13
  60. package/build-style/gallery/editor.css +0 -13
  61. package/build-style/navigation/style-rtl.css +1 -0
  62. package/build-style/navigation/style.css +1 -0
  63. package/build-style/style-rtl.css +1 -0
  64. package/build-style/style.css +1 -0
  65. package/package.json +35 -35
  66. package/src/button/edit.js +1 -1
  67. package/src/cover/edit/inspector-controls.js +1 -1
  68. package/src/details/index.js +1 -1
  69. package/src/gallery/constants.js +1 -0
  70. package/src/gallery/edit.js +182 -68
  71. package/src/gallery/editor.scss +0 -17
  72. package/src/image/edit.js +12 -0
  73. package/src/list/block.json +0 -1
  74. package/src/more/edit.native.js +19 -33
  75. package/src/navigation/style.scss +1 -0
  76. package/src/navigation-link/edit.js +18 -1
  77. package/src/post-author/edit.js +91 -40
  78. package/src/post-comments-form/form.js +1 -1
  79. package/src/post-featured-image/edit.js +1 -0
  80. package/src/rss/index.php +2 -1
  81. package/src/search/edit.js +1 -1
  82. package/src/site-logo/edit.js +22 -10
@@ -1060,19 +1060,6 @@ div[data-type="core/freeform"].is-selected .block-library-classic__toolbar {
1060
1060
  margin-left: 8px;
1061
1061
  }
1062
1062
 
1063
- .gallery-image-sizes .components-base-control__label {
1064
- margin-bottom: 4px;
1065
- }
1066
- .gallery-image-sizes .gallery-image-sizes__loading {
1067
- display: flex;
1068
- align-items: center;
1069
- color: #757575;
1070
- font-size: 12px;
1071
- }
1072
- .gallery-image-sizes .components-spinner {
1073
- margin: 0 4px 0 8px;
1074
- }
1075
-
1076
1063
  /**
1077
1064
  * Deprecated css past this point. This can be removed once all galleries are migrated
1078
1065
  * to V2.
@@ -1066,19 +1066,6 @@ div[data-type="core/freeform"].is-selected .block-library-classic__toolbar {
1066
1066
  margin-right: 8px;
1067
1067
  }
1068
1068
 
1069
- .gallery-image-sizes .components-base-control__label {
1070
- margin-bottom: 4px;
1071
- }
1072
- .gallery-image-sizes .gallery-image-sizes__loading {
1073
- display: flex;
1074
- align-items: center;
1075
- color: #757575;
1076
- font-size: 12px;
1077
- }
1078
- .gallery-image-sizes .components-spinner {
1079
- margin: 0 8px 0 4px;
1080
- }
1081
-
1082
1069
  /**
1083
1070
  * Deprecated css past this point. This can be removed once all galleries are migrated
1084
1071
  * to V2.
@@ -184,19 +184,6 @@
184
184
  margin-left: 8px;
185
185
  }
186
186
 
187
- .gallery-image-sizes .components-base-control__label {
188
- margin-bottom: 4px;
189
- }
190
- .gallery-image-sizes .gallery-image-sizes__loading {
191
- display: flex;
192
- align-items: center;
193
- color: #757575;
194
- font-size: 12px;
195
- }
196
- .gallery-image-sizes .components-spinner {
197
- margin: 0 4px 0 8px;
198
- }
199
-
200
187
  /**
201
188
  * Deprecated css past this point. This can be removed once all galleries are migrated
202
189
  * to V2.
@@ -184,19 +184,6 @@
184
184
  margin-right: 8px;
185
185
  }
186
186
 
187
- .gallery-image-sizes .components-base-control__label {
188
- margin-bottom: 4px;
189
- }
190
- .gallery-image-sizes .gallery-image-sizes__loading {
191
- display: flex;
192
- align-items: center;
193
- color: #757575;
194
- font-size: 12px;
195
- }
196
- .gallery-image-sizes .components-spinner {
197
- margin: 0 8px 0 4px;
198
- }
199
-
200
187
  /**
201
188
  * Deprecated css past this point. This can be removed once all galleries are migrated
202
189
  * to V2.
@@ -164,6 +164,7 @@
164
164
  }
165
165
  .wp-block-navigation .wp-block-navigation-item__content {
166
166
  display: block;
167
+ z-index: 1;
167
168
  }
168
169
  .wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
169
170
  color: inherit;
@@ -164,6 +164,7 @@
164
164
  }
165
165
  .wp-block-navigation .wp-block-navigation-item__content {
166
166
  display: block;
167
+ z-index: 1;
167
168
  }
168
169
  .wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
169
170
  color: inherit;
@@ -2282,6 +2282,7 @@ ul {
2282
2282
  }
2283
2283
  .wp-block-navigation .wp-block-navigation-item__content {
2284
2284
  display: block;
2285
+ z-index: 1;
2285
2286
  }
2286
2287
  .wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
2287
2288
  color: inherit;
@@ -2312,6 +2312,7 @@ ul {
2312
2312
  }
2313
2313
  .wp-block-navigation .wp-block-navigation-item__content {
2314
2314
  display: block;
2315
+ z-index: 1;
2315
2316
  }
2316
2317
  .wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
2317
2318
  color: inherit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.26.0",
3
+ "version": "9.26.1-next.719a03cbe.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -41,39 +41,39 @@
41
41
  ],
42
42
  "dependencies": {
43
43
  "@babel/runtime": "7.25.7",
44
- "@wordpress/a11y": "^4.26.0",
45
- "@wordpress/api-fetch": "^7.26.0",
46
- "@wordpress/autop": "^4.26.0",
47
- "@wordpress/blob": "^4.26.0",
48
- "@wordpress/block-editor": "^14.21.0",
49
- "@wordpress/blocks": "^14.15.0",
50
- "@wordpress/components": "^29.12.0",
51
- "@wordpress/compose": "^7.26.0",
52
- "@wordpress/core-data": "^7.26.0",
53
- "@wordpress/data": "^10.26.0",
54
- "@wordpress/date": "^5.26.0",
55
- "@wordpress/deprecated": "^4.26.0",
56
- "@wordpress/dom": "^4.26.0",
57
- "@wordpress/element": "^6.26.0",
58
- "@wordpress/escape-html": "^3.26.0",
59
- "@wordpress/hooks": "^4.26.0",
60
- "@wordpress/html-entities": "^4.26.0",
61
- "@wordpress/i18n": "^5.26.0",
62
- "@wordpress/icons": "^10.26.0",
63
- "@wordpress/interactivity": "^6.26.0",
64
- "@wordpress/interactivity-router": "^2.26.0",
65
- "@wordpress/keyboard-shortcuts": "^5.26.0",
66
- "@wordpress/keycodes": "^4.26.0",
67
- "@wordpress/notices": "^5.26.0",
68
- "@wordpress/patterns": "^2.26.0",
69
- "@wordpress/primitives": "^4.26.0",
70
- "@wordpress/private-apis": "^1.26.0",
71
- "@wordpress/reusable-blocks": "^5.26.0",
72
- "@wordpress/rich-text": "^7.26.0",
73
- "@wordpress/server-side-render": "^6.2.0",
74
- "@wordpress/url": "^4.26.0",
75
- "@wordpress/viewport": "^6.26.0",
76
- "@wordpress/wordcount": "^4.26.0",
44
+ "@wordpress/a11y": "^4.26.1-next.719a03cbe.0",
45
+ "@wordpress/api-fetch": "^7.26.1-next.719a03cbe.0",
46
+ "@wordpress/autop": "^4.26.1-next.719a03cbe.0",
47
+ "@wordpress/blob": "^4.26.1-next.719a03cbe.0",
48
+ "@wordpress/block-editor": "^14.21.1-next.719a03cbe.0",
49
+ "@wordpress/blocks": "^14.15.1-next.719a03cbe.0",
50
+ "@wordpress/components": "^29.13.1-next.719a03cbe.0",
51
+ "@wordpress/compose": "^7.26.1-next.719a03cbe.0",
52
+ "@wordpress/core-data": "^7.26.1-next.719a03cbe.0",
53
+ "@wordpress/data": "^10.26.1-next.719a03cbe.0",
54
+ "@wordpress/date": "^5.26.1-next.719a03cbe.0",
55
+ "@wordpress/deprecated": "^4.26.1-next.719a03cbe.0",
56
+ "@wordpress/dom": "^4.26.1-next.719a03cbe.0",
57
+ "@wordpress/element": "^6.26.1-next.719a03cbe.0",
58
+ "@wordpress/escape-html": "^3.26.1-next.719a03cbe.0",
59
+ "@wordpress/hooks": "^4.26.1-next.719a03cbe.0",
60
+ "@wordpress/html-entities": "^4.26.1-next.719a03cbe.0",
61
+ "@wordpress/i18n": "^6.0.1-next.719a03cbe.0",
62
+ "@wordpress/icons": "^10.26.2-next.719a03cbe.0",
63
+ "@wordpress/interactivity": "^6.26.1-next.719a03cbe.0",
64
+ "@wordpress/interactivity-router": "^2.26.1-next.719a03cbe.0",
65
+ "@wordpress/keyboard-shortcuts": "^5.26.1-next.719a03cbe.0",
66
+ "@wordpress/keycodes": "^4.26.1-next.719a03cbe.0",
67
+ "@wordpress/notices": "^5.26.1-next.719a03cbe.0",
68
+ "@wordpress/patterns": "^2.26.1-next.719a03cbe.0",
69
+ "@wordpress/primitives": "^4.26.1-next.719a03cbe.0",
70
+ "@wordpress/private-apis": "^1.26.1-next.719a03cbe.0",
71
+ "@wordpress/reusable-blocks": "^5.26.1-next.719a03cbe.0",
72
+ "@wordpress/rich-text": "^7.26.1-next.719a03cbe.0",
73
+ "@wordpress/server-side-render": "^6.2.1-next.719a03cbe.0",
74
+ "@wordpress/url": "^4.26.1-next.719a03cbe.0",
75
+ "@wordpress/viewport": "^6.26.1-next.719a03cbe.0",
76
+ "@wordpress/wordcount": "^4.26.1-next.719a03cbe.0",
77
77
  "change-case": "^4.1.2",
78
78
  "clsx": "^2.1.1",
79
79
  "colord": "^2.7.0",
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "35e26942820d8237771af0c58e45b4303f0497f1"
94
+ "gitHead": "5e146e949c2765411a8310bcc2641a88d036a6d9"
95
95
  }
@@ -159,7 +159,7 @@ function WidthPanel( { selectedWidth, setAttributes } ) {
159
159
  key={ widthValue }
160
160
  value={ widthValue }
161
161
  label={ sprintf(
162
- /* translators: Percentage value. */
162
+ /* translators: %d: Percentage value. */
163
163
  __( '%d%%' ),
164
164
  widthValue
165
165
  ) }
@@ -198,8 +198,8 @@ export default function CoverInspectorControls( {
198
198
  focalPoint: undefined,
199
199
  isRepeated: false,
200
200
  alt: '',
201
- sizeSlug: undefined,
202
201
  } );
202
+ updateImage( DEFAULT_MEDIA_SIZE_SLUG );
203
203
  } }
204
204
  dropdownMenuProps={ dropdownMenuProps }
205
205
  >
@@ -50,7 +50,7 @@ export const settings = {
50
50
  return ! hasSummary
51
51
  ? __( 'Details. Empty.' )
52
52
  : sprintf(
53
- /* translators: accessibility text; summary title. */
53
+ /* translators: %s: accessibility text; summary title. */
54
54
  __( 'Details. %s' ),
55
55
  summary
56
56
  );
@@ -4,3 +4,4 @@ export const LINK_DESTINATION_LIGHTBOX = 'lightbox';
4
4
  export const LINK_DESTINATION_ATTACHMENT = 'attachment';
5
5
  export const LINK_DESTINATION_MEDIA_WP_CORE = 'file';
6
6
  export const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post';
7
+ export const DEFAULT_MEDIA_SIZE_SLUG = 'large';
@@ -7,15 +7,15 @@ import clsx from 'clsx';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import {
10
- BaseControl,
11
- PanelBody,
12
10
  SelectControl,
13
11
  ToggleControl,
14
12
  RangeControl,
15
- Spinner,
16
13
  MenuGroup,
17
14
  MenuItem,
15
+ __experimentalToolsPanel as ToolsPanel,
16
+ __experimentalToolsPanelItem as ToolsPanelItem,
18
17
  ToolbarDropdownMenu,
18
+ PanelBody,
19
19
  } from '@wordpress/components';
20
20
  import {
21
21
  store as blockEditorStore,
@@ -48,6 +48,7 @@ import {
48
48
  import { sharedIcon } from './shared-icon';
49
49
  import { defaultColumnsNumber, pickRelevantMediaFiles } from './shared';
50
50
  import { getHrefAndDestination } from './utils';
51
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
51
52
  import {
52
53
  getUpdatedLinkTargetSettings,
53
54
  getImageSizeAttributes,
@@ -58,6 +59,7 @@ import {
58
59
  LINK_DESTINATION_MEDIA,
59
60
  LINK_DESTINATION_NONE,
60
61
  LINK_DESTINATION_LIGHTBOX,
62
+ DEFAULT_MEDIA_SIZE_SLUG,
61
63
  } from './constants';
62
64
  import useImageSizes from './use-image-sizes';
63
65
  import useGetNewImages from './use-get-new-images';
@@ -465,7 +467,7 @@ export default function GalleryEdit( props ) {
465
467
  sprintf(
466
468
  /* translators: %s: image size settings */
467
469
  __( 'All gallery image sizes updated to: %s' ),
468
- imageSize.label
470
+ imageSize?.label ?? newSizeSlug
469
471
  ),
470
472
  {
471
473
  id: 'gallery-attributes-sizeSlug',
@@ -546,6 +548,8 @@ export default function GalleryEdit( props ) {
546
548
  ...nativeInnerBlockProps,
547
549
  } );
548
550
 
551
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
552
+
549
553
  if ( ! hasImages ) {
550
554
  return (
551
555
  <View { ...innerBlocksProps }>
@@ -560,39 +564,163 @@ export default function GalleryEdit( props ) {
560
564
  return (
561
565
  <>
562
566
  <InspectorControls>
563
- <PanelBody title={ __( 'Settings' ) }>
564
- { images.length > 1 && (
565
- <RangeControl
566
- __nextHasNoMarginBottom
567
- label={ __( 'Columns' ) }
568
- value={
569
- columns
570
- ? columns
571
- : defaultColumnsNumber( images.length )
567
+ { Platform.isWeb && (
568
+ <ToolsPanel
569
+ label={ __( 'Settings' ) }
570
+ resetAll={ () => {
571
+ setAttributes( {
572
+ columns: undefined,
573
+ imageCrop: true,
574
+ randomOrder: false,
575
+ } );
576
+
577
+ if ( sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG ) {
578
+ updateImagesSize( DEFAULT_MEDIA_SIZE_SLUG );
572
579
  }
573
- onChange={ setColumnsNumber }
574
- min={ 1 }
575
- max={ Math.min( MAX_COLUMNS, images.length ) }
576
- { ...MOBILE_CONTROL_PROPS_RANGE_CONTROL }
577
- required
578
- __next40pxDefaultSize
579
- />
580
- ) }
581
- { imageSizeOptions?.length > 0 && (
582
- <SelectControl
583
- __nextHasNoMarginBottom
584
- label={ __( 'Resolution' ) }
585
- help={ __(
586
- 'Select the size of the source images.'
587
- ) }
588
- value={ sizeSlug }
589
- options={ imageSizeOptions }
590
- onChange={ updateImagesSize }
591
- hideCancelButton
592
- size="__unstable-large"
593
- />
594
- ) }
595
- { Platform.isNative ? (
580
+
581
+ if ( linkTarget ) {
582
+ toggleOpenInNewTab( false );
583
+ }
584
+ } }
585
+ dropdownMenuProps={ dropdownMenuProps }
586
+ >
587
+ { images.length > 1 && (
588
+ <ToolsPanelItem
589
+ isShownByDefault
590
+ label={ __( 'Columns' ) }
591
+ hasValue={ () =>
592
+ !! columns && columns !== images.length
593
+ }
594
+ onDeselect={ () =>
595
+ setColumnsNumber( undefined )
596
+ }
597
+ >
598
+ <RangeControl
599
+ __nextHasNoMarginBottom
600
+ label={ __( 'Columns' ) }
601
+ value={
602
+ columns
603
+ ? columns
604
+ : defaultColumnsNumber(
605
+ images.length
606
+ )
607
+ }
608
+ onChange={ setColumnsNumber }
609
+ min={ 1 }
610
+ max={ Math.min(
611
+ MAX_COLUMNS,
612
+ images.length
613
+ ) }
614
+ required
615
+ __next40pxDefaultSize
616
+ />
617
+ </ToolsPanelItem>
618
+ ) }
619
+ { imageSizeOptions?.length > 0 && (
620
+ <ToolsPanelItem
621
+ isShownByDefault
622
+ label={ __( 'Resolution' ) }
623
+ hasValue={ () =>
624
+ sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG
625
+ }
626
+ onDeselect={ () =>
627
+ updateImagesSize( DEFAULT_MEDIA_SIZE_SLUG )
628
+ }
629
+ >
630
+ <SelectControl
631
+ __nextHasNoMarginBottom
632
+ label={ __( 'Resolution' ) }
633
+ help={ __(
634
+ 'Select the size of the source images.'
635
+ ) }
636
+ value={ sizeSlug }
637
+ options={ imageSizeOptions }
638
+ onChange={ updateImagesSize }
639
+ hideCancelButton
640
+ size="__unstable-large"
641
+ />
642
+ </ToolsPanelItem>
643
+ ) }
644
+ <ToolsPanelItem
645
+ isShownByDefault
646
+ label={ __( 'Crop images to fit' ) }
647
+ hasValue={ () => ! imageCrop }
648
+ onDeselect={ () =>
649
+ setAttributes( { imageCrop: true } )
650
+ }
651
+ >
652
+ <ToggleControl
653
+ __nextHasNoMarginBottom
654
+ label={ __( 'Crop images to fit' ) }
655
+ checked={ !! imageCrop }
656
+ onChange={ toggleImageCrop }
657
+ />
658
+ </ToolsPanelItem>
659
+ <ToolsPanelItem
660
+ isShownByDefault
661
+ label={ __( 'Randomize order' ) }
662
+ hasValue={ () => !! randomOrder }
663
+ onDeselect={ () =>
664
+ setAttributes( { randomOrder: false } )
665
+ }
666
+ >
667
+ <ToggleControl
668
+ __nextHasNoMarginBottom
669
+ label={ __( 'Randomize order' ) }
670
+ checked={ !! randomOrder }
671
+ onChange={ toggleRandomOrder }
672
+ />
673
+ </ToolsPanelItem>
674
+ { hasLinkTo && (
675
+ <ToolsPanelItem
676
+ isShownByDefault
677
+ label={ __( 'Open images in new tab' ) }
678
+ hasValue={ () => !! linkTarget }
679
+ onDeselect={ () => toggleOpenInNewTab( false ) }
680
+ >
681
+ <ToggleControl
682
+ __nextHasNoMarginBottom
683
+ label={ __( 'Open images in new tab' ) }
684
+ checked={ linkTarget === '_blank' }
685
+ onChange={ toggleOpenInNewTab }
686
+ />
687
+ </ToolsPanelItem>
688
+ ) }
689
+ </ToolsPanel>
690
+ ) }
691
+ { Platform.isNative && (
692
+ <PanelBody title={ __( 'Settings' ) }>
693
+ { images.length > 1 && (
694
+ <RangeControl
695
+ __nextHasNoMarginBottom
696
+ label={ __( 'Columns' ) }
697
+ value={
698
+ columns
699
+ ? columns
700
+ : defaultColumnsNumber( images.length )
701
+ }
702
+ onChange={ setColumnsNumber }
703
+ min={ 1 }
704
+ max={ Math.min( MAX_COLUMNS, images.length ) }
705
+ { ...MOBILE_CONTROL_PROPS_RANGE_CONTROL }
706
+ required
707
+ __next40pxDefaultSize
708
+ />
709
+ ) }
710
+ { imageSizeOptions?.length > 0 && (
711
+ <SelectControl
712
+ __nextHasNoMarginBottom
713
+ label={ __( 'Resolution' ) }
714
+ help={ __(
715
+ 'Select the size of the source images.'
716
+ ) }
717
+ value={ sizeSlug }
718
+ options={ imageSizeOptions }
719
+ onChange={ updateImagesSize }
720
+ hideCancelButton
721
+ size="__unstable-large"
722
+ />
723
+ ) }
596
724
  <SelectControl
597
725
  __nextHasNoMarginBottom
598
726
  label={ __( 'Link' ) }
@@ -602,42 +730,28 @@ export default function GalleryEdit( props ) {
602
730
  hideCancelButton
603
731
  size="__unstable-large"
604
732
  />
605
- ) : null }
606
- <ToggleControl
607
- __nextHasNoMarginBottom
608
- label={ __( 'Crop images to fit' ) }
609
- checked={ !! imageCrop }
610
- onChange={ toggleImageCrop }
611
- />
612
- <ToggleControl
613
- __nextHasNoMarginBottom
614
- label={ __( 'Randomize order' ) }
615
- checked={ !! randomOrder }
616
- onChange={ toggleRandomOrder }
617
- />
618
- { hasLinkTo && (
619
733
  <ToggleControl
620
734
  __nextHasNoMarginBottom
621
- label={ __( 'Open images in new tab' ) }
622
- checked={ linkTarget === '_blank' }
623
- onChange={ toggleOpenInNewTab }
735
+ label={ __( 'Crop images to fit' ) }
736
+ checked={ !! imageCrop }
737
+ onChange={ toggleImageCrop }
624
738
  />
625
- ) }
626
- { Platform.isWeb && ! imageSizeOptions && hasImageIds && (
627
- <BaseControl
628
- className="gallery-image-sizes"
739
+ <ToggleControl
629
740
  __nextHasNoMarginBottom
630
- >
631
- <BaseControl.VisualLabel>
632
- { __( 'Resolution' ) }
633
- </BaseControl.VisualLabel>
634
- <View className="gallery-image-sizes__loading">
635
- <Spinner />
636
- { __( 'Loading options…' ) }
637
- </View>
638
- </BaseControl>
639
- ) }
640
- </PanelBody>
741
+ label={ __( 'Randomize order' ) }
742
+ checked={ !! randomOrder }
743
+ onChange={ toggleRandomOrder }
744
+ />
745
+ { hasLinkTo && (
746
+ <ToggleControl
747
+ __nextHasNoMarginBottom
748
+ label={ __( 'Open images in new tab' ) }
749
+ checked={ linkTarget === '_blank' }
750
+ onChange={ toggleOpenInNewTab }
751
+ />
752
+ ) }
753
+ </PanelBody>
754
+ ) }
641
755
  </InspectorControls>
642
756
  { Platform.isWeb ? (
643
757
  <BlockControls group="block">
@@ -68,23 +68,6 @@
68
68
  }
69
69
  }
70
70
 
71
- .gallery-image-sizes {
72
- .components-base-control__label {
73
- margin-bottom: 4px;
74
- }
75
-
76
- .gallery-image-sizes__loading {
77
- display: flex;
78
- align-items: center;
79
- color: $gray-700;
80
- font-size: $helptext-font-size;
81
- }
82
-
83
- .components-spinner {
84
- margin: 0 8px 0 4px;
85
- }
86
- }
87
-
88
71
  /**
89
72
  * Deprecated css past this point. This can be removed once all galleries are migrated
90
73
  * to V2.
package/src/image/edit.js CHANGED
@@ -249,6 +249,18 @@ export function ImageEdit( {
249
249
 
250
250
  let mediaAttributes = pickRelevantMediaFiles( media, newSize );
251
251
 
252
+ // Normalize newline characters in caption to <br />
253
+ // to preserve line breaks in both editor and frontend.
254
+ if (
255
+ typeof mediaAttributes.caption === 'string' &&
256
+ mediaAttributes.caption.includes( '\n' )
257
+ ) {
258
+ mediaAttributes.caption = mediaAttributes.caption.replace(
259
+ /\n/g,
260
+ '<br>'
261
+ );
262
+ }
263
+
252
264
  // If a caption text was meanwhile written by the user,
253
265
  // make sure the text is not overwritten by empty captions.
254
266
  if ( captionRef.current && ! mediaAttributes.caption ) {
@@ -19,7 +19,6 @@
19
19
  "source": "html",
20
20
  "selector": "ol,ul",
21
21
  "multiline": "li",
22
- "__unstableMultilineWrapperTags": [ "ol", "ul" ],
23
22
  "default": "",
24
23
  "role": "content"
25
24
  },
@@ -2,7 +2,6 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { Component } from '@wordpress/element';
6
5
  import { withPreferredColorScheme } from '@wordpress/compose';
7
6
  import { HorizontalRule } from '@wordpress/components';
8
7
 
@@ -11,40 +10,27 @@ import { HorizontalRule } from '@wordpress/components';
11
10
  */
12
11
  import styles from './editor.scss';
13
12
 
14
- export class MoreEdit extends Component {
15
- constructor() {
16
- super( ...arguments );
13
+ function MoreEdit( { attributes, getStylesFromColorScheme } ) {
14
+ const { customText } = attributes;
17
15
 
18
- this.state = {
19
- defaultText: __( 'Read more' ),
20
- };
21
- }
16
+ const textStyle = getStylesFromColorScheme(
17
+ styles.moreText,
18
+ styles.moreTextDark
19
+ );
20
+ const lineStyle = getStylesFromColorScheme(
21
+ styles.moreLine,
22
+ styles.moreLineDark
23
+ );
22
24
 
23
- render() {
24
- const { attributes, getStylesFromColorScheme } = this.props;
25
- const { customText } = attributes;
26
- const { defaultText } = this.state;
27
-
28
- const content = customText || defaultText;
29
- const textStyle = getStylesFromColorScheme(
30
- styles.moreText,
31
- styles.moreTextDark
32
- );
33
- const lineStyle = getStylesFromColorScheme(
34
- styles.moreLine,
35
- styles.moreLineDark
36
- );
37
-
38
- return (
39
- <HorizontalRule
40
- text={ content }
41
- marginLeft={ 0 }
42
- marginRight={ 0 }
43
- textStyle={ textStyle }
44
- lineStyle={ lineStyle }
45
- />
46
- );
47
- }
25
+ return (
26
+ <HorizontalRule
27
+ text={ customText || __( 'Read more' ) }
28
+ marginLeft={ 0 }
29
+ marginRight={ 0 }
30
+ textStyle={ textStyle }
31
+ lineStyle={ lineStyle }
32
+ />
33
+ );
48
34
  }
49
35
 
50
36
  export default withPreferredColorScheme( MoreEdit );