@wordpress/block-editor 8.0.13 → 8.0.17
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/components/block-preview/auto.js +23 -5
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +88 -0
- package/build/components/colors-gradients/dropdown.js.map +1 -0
- package/build/components/colors-gradients/panel-color-gradient-settings.js +6 -5
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/font-appearance-control/index.js +11 -11
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/iframe/index.js +2 -4
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +5 -2
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/hooks/border-color.js +11 -5
- package/build/hooks/border-color.js.map +1 -1
- package/build/hooks/color.js +3 -3
- package/build/hooks/color.js.map +1 -1
- package/build/store/defaults.js +1 -0
- package/build/store/defaults.js.map +1 -1
- package/build-module/components/block-preview/auto.js +24 -5
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +75 -0
- package/build-module/components/colors-gradients/dropdown.js.map +1 -0
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +8 -7
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +12 -12
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +2 -4
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +5 -2
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/hooks/border-color.js +11 -5
- package/build-module/hooks/border-color.js.map +1 -1
- package/build-module/hooks/color.js +3 -3
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/store/defaults.js +1 -0
- package/build-module/store/defaults.js.map +1 -1
- package/build-style/style-rtl.css +42 -0
- package/build-style/style.css +42 -0
- package/package.json +4 -4
- package/src/components/block-preview/auto.js +29 -1
- package/src/components/colors-gradients/dropdown.js +91 -0
- package/src/components/colors-gradients/panel-color-gradient-settings.js +23 -19
- package/src/components/colors-gradients/style.scss +49 -0
- package/src/components/font-appearance-control/index.js +12 -12
- package/src/components/iframe/index.js +3 -7
- package/src/components/index.js +1 -0
- package/src/components/link-control/link-preview.js +2 -1
- package/src/hooks/border-color.js +14 -6
- package/src/hooks/color.js +3 -3
- package/src/hooks/dimensions.scss +5 -0
- package/src/store/defaults.js +1 -0
- package/src/style.scss +1 -0
|
@@ -37,4 +37,53 @@
|
|
|
37
37
|
.block-editor-block-inspector & .components-base-control {
|
|
38
38
|
margin-bottom: inherit;
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
.block-editor-panel-color-gradient-settings__dropdown {
|
|
42
|
+
display: block;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.block-editor-panel-color-gradient-settings__dropdown {
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content {
|
|
51
|
+
& > div {
|
|
52
|
+
width: $sidebar-width;
|
|
53
|
+
}
|
|
40
54
|
}
|
|
55
|
+
|
|
56
|
+
@include break-medium() {
|
|
57
|
+
.block-editor-panel-color-gradient-settings__dropdown-content {
|
|
58
|
+
.components-popover__content {
|
|
59
|
+
margin-right: #{ math.div($sidebar-width, 2) + $grid-unit-20 } !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.is-from-top .components-popover__content {
|
|
63
|
+
margin-top: #{ -($grid-unit-60 + $grid-unit-15) } !important;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.is-from-bottom .components-popover__content {
|
|
67
|
+
margin-bottom: #{ -($grid-unit-60 + $grid-unit-15) } !important;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.block-editor-panel-color-gradient-settings__dropdown:last-child > div {
|
|
73
|
+
border-bottom-width: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.block-editor-panel-color-gradient-settings__item {
|
|
77
|
+
padding-top: $grid-unit-15 !important;
|
|
78
|
+
padding-bottom: $grid-unit-15 !important;
|
|
79
|
+
.block-editor-panel-color-gradient-settings__color-indicator {
|
|
80
|
+
// Show a diagonal line (crossed out) for empty swatches.
|
|
81
|
+
background: linear-gradient(-45deg, transparent 48%, $gray-300 48%, $gray-300 52%, transparent 52%);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.is-open {
|
|
85
|
+
background: $gray-100;
|
|
86
|
+
color: var(--wp-admin-theme-color);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
@@ -3,54 +3,54 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { CustomSelectControl } from '@wordpress/components';
|
|
5
5
|
import { useMemo } from '@wordpress/element';
|
|
6
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
6
|
+
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
7
7
|
|
|
8
8
|
const FONT_STYLES = [
|
|
9
9
|
{
|
|
10
|
-
name:
|
|
10
|
+
name: _x( 'Regular', 'font style' ),
|
|
11
11
|
value: 'normal',
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
name:
|
|
14
|
+
name: _x( 'Italic', 'font style' ),
|
|
15
15
|
value: 'italic',
|
|
16
16
|
},
|
|
17
17
|
];
|
|
18
18
|
|
|
19
19
|
const FONT_WEIGHTS = [
|
|
20
20
|
{
|
|
21
|
-
name:
|
|
21
|
+
name: _x( 'Thin', 'font weight' ),
|
|
22
22
|
value: '100',
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
name:
|
|
25
|
+
name: _x( 'Extra Light', 'font weight' ),
|
|
26
26
|
value: '200',
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
name:
|
|
29
|
+
name: _x( 'Light', 'font weight' ),
|
|
30
30
|
value: '300',
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
name:
|
|
33
|
+
name: _x( 'Regular', 'font weight' ),
|
|
34
34
|
value: '400',
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
name:
|
|
37
|
+
name: _x( 'Medium', 'font weight' ),
|
|
38
38
|
value: '500',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
name:
|
|
41
|
+
name: _x( 'Semi Bold', 'font weight' ),
|
|
42
42
|
value: '600',
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
name:
|
|
45
|
+
name: _x( 'Bold', 'font weight' ),
|
|
46
46
|
value: '700',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
name:
|
|
49
|
+
name: _x( 'Extra Bold', 'font weight' ),
|
|
50
50
|
value: '800',
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
name:
|
|
53
|
+
name: _x( 'Black', 'font weight' ),
|
|
54
54
|
value: '900',
|
|
55
55
|
},
|
|
56
56
|
];
|
|
@@ -75,13 +75,9 @@ function styleSheetsCompat( doc ) {
|
|
|
75
75
|
);
|
|
76
76
|
|
|
77
77
|
if ( isMatch && ! doc.getElementById( ownerNode.id ) ) {
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
For blocks, use the block API's style (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#style) or editorStyle (https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#editor-style).
|
|
82
|
-
For themes, use add_editor_style (https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#editor-styles).`,
|
|
83
|
-
ownerNode.outerHTML
|
|
84
|
-
);
|
|
78
|
+
// Display warning once we have a way to add style dependencies to the editor.
|
|
79
|
+
// See: https://github.com/WordPress/gutenberg/pull/37466.
|
|
80
|
+
|
|
85
81
|
doc.head.appendChild( ownerNode.cloneNode( true ) );
|
|
86
82
|
|
|
87
83
|
// Add inline styles belonging to the stylesheet.
|
package/src/components/index.js
CHANGED
|
@@ -48,6 +48,7 @@ export { default as __experimentalLetterSpacingControl } from './letter-spacing-
|
|
|
48
48
|
export { default as __experimentalTextDecorationControl } from './text-decoration-control';
|
|
49
49
|
export { default as __experimentalTextTransformControl } from './text-transform-control';
|
|
50
50
|
export { default as __experimentalColorGradientControl } from './colors-gradients/control';
|
|
51
|
+
export { default as __experimentalColorGradientSettingsDropdown } from './colors-gradients/dropdown';
|
|
51
52
|
export { default as __experimentalPanelColorGradientSettings } from './colors-gradients/panel-color-gradient-settings';
|
|
52
53
|
export {
|
|
53
54
|
default as __experimentalImageEditor,
|
|
@@ -44,7 +44,8 @@ export default function LinkPreview( {
|
|
|
44
44
|
|
|
45
45
|
const displayTitle = richData?.title || value?.title || displayURL;
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
// url can be undefined if the href attribute is unset
|
|
48
|
+
const isEmptyURL = ! value?.url?.length;
|
|
48
49
|
|
|
49
50
|
let icon;
|
|
50
51
|
|
|
@@ -14,7 +14,7 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import ColorGradientSettingsDropdown from '../components/colors-gradients/dropdown';
|
|
18
18
|
import useMultipleOriginColorsAndGradients from '../components/colors-gradients/use-multiple-origin-colors-and-gradients';
|
|
19
19
|
import {
|
|
20
20
|
getColorClassName,
|
|
@@ -85,14 +85,22 @@ export function BorderColorEdit( props ) {
|
|
|
85
85
|
} );
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
const settings = [
|
|
89
|
+
{
|
|
90
|
+
label: __( 'Color' ),
|
|
91
|
+
onColorChange: onChangeColor,
|
|
92
|
+
colorValue,
|
|
93
|
+
clearable: false,
|
|
94
|
+
},
|
|
95
|
+
];
|
|
88
96
|
return (
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
clearable={ false }
|
|
97
|
+
<ColorGradientSettingsDropdown
|
|
98
|
+
settings={ settings }
|
|
99
|
+
disableCustomColors
|
|
100
|
+
disableCustomGradients
|
|
94
101
|
__experimentalHasMultipleOrigins
|
|
95
102
|
__experimentalIsRenderedInSidebar
|
|
103
|
+
enableAlpha
|
|
96
104
|
{ ...colorGradientSettings }
|
|
97
105
|
/>
|
|
98
106
|
);
|
package/src/hooks/color.js
CHANGED
|
@@ -382,7 +382,7 @@ export function ColorEdit( props ) {
|
|
|
382
382
|
...( hasTextColor
|
|
383
383
|
? [
|
|
384
384
|
{
|
|
385
|
-
label: __( 'Text
|
|
385
|
+
label: __( 'Text' ),
|
|
386
386
|
onColorChange: onChangeColor( 'text' ),
|
|
387
387
|
colorValue: getColorObjectByAttributeValues(
|
|
388
388
|
allSolids,
|
|
@@ -395,7 +395,7 @@ export function ColorEdit( props ) {
|
|
|
395
395
|
...( hasBackgroundColor || hasGradientColor
|
|
396
396
|
? [
|
|
397
397
|
{
|
|
398
|
-
label: __( 'Background
|
|
398
|
+
label: __( 'Background' ),
|
|
399
399
|
onColorChange: hasBackgroundColor
|
|
400
400
|
? onChangeColor( 'background' )
|
|
401
401
|
: undefined,
|
|
@@ -414,7 +414,7 @@ export function ColorEdit( props ) {
|
|
|
414
414
|
...( hasLinkColor
|
|
415
415
|
? [
|
|
416
416
|
{
|
|
417
|
-
label: __( 'Link
|
|
417
|
+
label: __( 'Link' ),
|
|
418
418
|
onColorChange: onChangeLinkColor,
|
|
419
419
|
colorValue: getLinkColorFromAttributeValue(
|
|
420
420
|
allSolids,
|
package/src/store/defaults.js
CHANGED
|
@@ -156,6 +156,7 @@ export const SETTINGS_DEFAULTS = {
|
|
|
156
156
|
__experimentalBlockPatterns: [],
|
|
157
157
|
__experimentalBlockPatternCategories: [],
|
|
158
158
|
__experimentalSpotlightEntityBlocks: [],
|
|
159
|
+
__experimentalGenerateAnchors: false,
|
|
159
160
|
__unstableGalleryWithImageBlocks: false,
|
|
160
161
|
|
|
161
162
|
// gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
|
package/src/style.scss
CHANGED