@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.
- package/build/button/edit.js +1 -1
- package/build/button/edit.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -2
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/details/index.js +1 -1
- package/build/details/index.js.map +1 -1
- package/build/gallery/constants.js +2 -1
- package/build/gallery/constants.js.map +1 -1
- package/build/gallery/edit.js +93 -15
- package/build/gallery/edit.js.map +1 -1
- package/build/image/edit.js +6 -0
- package/build/image/edit.js.map +1 -1
- package/build/list/index.js +0 -1
- package/build/list/index.js.map +1 -1
- package/build/more/edit.native.js +17 -32
- package/build/more/edit.native.js.map +1 -1
- package/build/navigation-link/edit.js +17 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/post-author/edit.js +78 -35
- package/build/post-author/edit.js.map +1 -1
- package/build/post-comments-form/form.js +1 -1
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-featured-image/edit.js +2 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/search/edit.js +1 -1
- package/build/search/edit.js.map +1 -1
- package/build/site-logo/edit.js +16 -5
- package/build/site-logo/edit.js.map +1 -1
- package/build-module/button/edit.js +1 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +2 -2
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/details/index.js +1 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/gallery/constants.js +1 -0
- package/build-module/gallery/constants.js.map +1 -1
- package/build-module/gallery/edit.js +95 -17
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/image/edit.js +6 -0
- package/build-module/image/edit.js.map +1 -1
- package/build-module/list/index.js +0 -1
- package/build-module/list/index.js.map +1 -1
- package/build-module/more/edit.native.js +16 -30
- package/build-module/more/edit.native.js.map +1 -1
- package/build-module/navigation-link/edit.js +18 -2
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/post-author/edit.js +78 -35
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +1 -1
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-featured-image/edit.js +2 -1
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/search/edit.js +1 -1
- package/build-module/search/edit.js.map +1 -1
- package/build-module/site-logo/edit.js +17 -6
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-style/editor-rtl.css +0 -13
- package/build-style/editor.css +0 -13
- package/build-style/gallery/editor-rtl.css +0 -13
- package/build-style/gallery/editor.css +0 -13
- package/build-style/navigation/style-rtl.css +1 -0
- package/build-style/navigation/style.css +1 -0
- package/build-style/style-rtl.css +1 -0
- package/build-style/style.css +1 -0
- package/package.json +35 -35
- package/src/button/edit.js +1 -1
- package/src/cover/edit/inspector-controls.js +1 -1
- package/src/details/index.js +1 -1
- package/src/gallery/constants.js +1 -0
- package/src/gallery/edit.js +182 -68
- package/src/gallery/editor.scss +0 -17
- package/src/image/edit.js +12 -0
- package/src/list/block.json +0 -1
- package/src/more/edit.native.js +19 -33
- package/src/navigation/style.scss +1 -0
- package/src/navigation-link/edit.js +18 -1
- package/src/post-author/edit.js +91 -40
- package/src/post-comments-form/form.js +1 -1
- package/src/post-featured-image/edit.js +1 -0
- package/src/rss/index.php +2 -1
- package/src/search/edit.js +1 -1
- 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.
|
package/build-style/editor.css
CHANGED
|
@@ -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.
|
package/build-style/style.css
CHANGED
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.
|
|
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": "^
|
|
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": "
|
|
94
|
+
"gitHead": "5e146e949c2765411a8310bcc2641a88d036a6d9"
|
|
95
95
|
}
|
package/src/button/edit.js
CHANGED
|
@@ -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
|
>
|
package/src/details/index.js
CHANGED
package/src/gallery/constants.js
CHANGED
|
@@ -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';
|
package/src/gallery/edit.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
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
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
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={ __( '
|
|
622
|
-
checked={
|
|
623
|
-
onChange={
|
|
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
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
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">
|
package/src/gallery/editor.scss
CHANGED
|
@@ -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 ) {
|
package/src/list/block.json
CHANGED
package/src/more/edit.native.js
CHANGED
|
@@ -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
|
-
|
|
15
|
-
|
|
16
|
-
super( ...arguments );
|
|
13
|
+
function MoreEdit( { attributes, getStylesFromColorScheme } ) {
|
|
14
|
+
const { customText } = attributes;
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 );
|