@elementor/editor-editing-panel 1.11.0 → 1.12.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/CHANGELOG.md +42 -0
- package/dist/index.js +483 -473
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +425 -415
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/components/css-classes/css-class-item.tsx +2 -0
- package/src/components/css-classes/css-class-selector.tsx +2 -7
- package/src/components/panel-divider.tsx +4 -0
- package/src/components/style-sections/border-section/border-color-field.tsx +1 -1
- package/src/components/style-sections/border-section/border-radius-field.tsx +33 -15
- package/src/components/style-sections/border-section/border-section.tsx +3 -2
- package/src/components/style-sections/border-section/border-style-field.tsx +2 -2
- package/src/components/style-sections/border-section/border-width-field.tsx +1 -1
- package/src/components/style-sections/layout-section/layout-section.tsx +4 -3
- package/src/components/style-sections/position-section/position-field.tsx +1 -1
- package/src/components/style-sections/size-section/size-section.tsx +7 -6
- package/src/components/style-sections/spacing-section/spacing-section.tsx +3 -2
- package/src/components/style-sections/typography-section/font-family-field.tsx +2 -2
- package/src/components/style-sections/typography-section/font-size-field.tsx +1 -1
- package/src/components/style-sections/typography-section/font-style-field.tsx +36 -0
- package/src/components/style-sections/typography-section/font-weight-field.tsx +2 -2
- package/src/components/style-sections/typography-section/letter-spacing-field.tsx +1 -1
- package/src/components/style-sections/typography-section/line-height-field.tsx +1 -1
- package/src/components/style-sections/typography-section/text-color-field.tsx +1 -1
- package/src/components/style-sections/typography-section/{text-style-field.tsx → text-decoration-field.tsx} +3 -24
- package/src/components/style-sections/typography-section/text-stroke-field.tsx +3 -3
- package/src/components/style-sections/typography-section/transform-field.tsx +1 -1
- package/src/components/style-sections/typography-section/typography-section.tsx +8 -5
- package/src/components/style-sections/typography-section/word-spacing-field.tsx +1 -1
- package/src/controls-registry/settings-field.tsx +1 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-editing-panel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@elementor/editor": "0.18.0",
|
|
43
|
-
"@elementor/editor-controls": "0.
|
|
44
|
-
"@elementor/editor-elements": "0.5.
|
|
43
|
+
"@elementor/editor-controls": "0.11.0",
|
|
44
|
+
"@elementor/editor-elements": "0.5.4",
|
|
45
45
|
"@elementor/editor-panels": "0.11.0",
|
|
46
|
-
"@elementor/editor-props": "0.9.
|
|
46
|
+
"@elementor/editor-props": "0.9.2",
|
|
47
47
|
"@elementor/editor-responsive": "0.13.0",
|
|
48
|
-
"@elementor/editor-styles": "0.5.
|
|
49
|
-
"@elementor/editor-styles-repository": "0.7.
|
|
50
|
-
"@elementor/editor-ui": "0.
|
|
48
|
+
"@elementor/editor-styles": "0.5.7",
|
|
49
|
+
"@elementor/editor-styles-repository": "0.7.2",
|
|
50
|
+
"@elementor/editor-ui": "0.4.0",
|
|
51
51
|
"@elementor/editor-v1-adapters": "0.10.0",
|
|
52
52
|
"@elementor/icons": "1.31.0",
|
|
53
53
|
"@elementor/locations": "0.7.6",
|
|
@@ -169,13 +169,8 @@ function useCreateActions( {
|
|
|
169
169
|
pushAppliedId( createdId );
|
|
170
170
|
setActiveId( createdId );
|
|
171
171
|
},
|
|
172
|
-
condition: (
|
|
173
|
-
|
|
174
|
-
( option ) => option.label.toLowerCase() === inputValue.toLowerCase()
|
|
175
|
-
);
|
|
176
|
-
|
|
177
|
-
return !! inputValue && isUniqueLabel;
|
|
178
|
-
},
|
|
172
|
+
condition: ( _, inputValue ) =>
|
|
173
|
+
stylesRepository.isLabelValid( inputValue ) && ! stylesRepository.isLabelExist( inputValue ),
|
|
179
174
|
// translators: %s is the singular label of css class provider (e.g "Global CSS Class").
|
|
180
175
|
group: __( 'Create New %s', 'elementor' ).replace( '%s', provider.labels?.singular ?? '' ),
|
|
181
176
|
};
|
|
@@ -10,7 +10,7 @@ export const BorderColorField = () => {
|
|
|
10
10
|
<StylesField bind={ 'border-color' }>
|
|
11
11
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
12
12
|
<Grid item xs={ 6 }>
|
|
13
|
-
<ControlLabel>{ __( 'Border
|
|
13
|
+
<ControlLabel>{ __( 'Border color', 'elementor' ) }</ControlLabel>
|
|
14
14
|
</Grid>
|
|
15
15
|
<Grid item xs={ 6 }>
|
|
16
16
|
<ColorControl />
|
|
@@ -8,39 +8,57 @@ import {
|
|
|
8
8
|
RadiusTopLeftIcon,
|
|
9
9
|
RadiusTopRightIcon,
|
|
10
10
|
} from '@elementor/icons';
|
|
11
|
+
import { withDirection } from '@elementor/ui';
|
|
11
12
|
import { __ } from '@wordpress/i18n';
|
|
12
13
|
|
|
13
14
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
15
|
+
import { useDirection } from '../../../hooks/use-direction';
|
|
16
|
+
import { RotatedIcon } from '../layout-section/utils/rotated-icon';
|
|
14
17
|
|
|
15
|
-
const
|
|
18
|
+
const StartStartIcon = withDirection( RadiusTopLeftIcon );
|
|
19
|
+
const StartEndIcon = withDirection( RadiusTopRightIcon );
|
|
20
|
+
const EndStartIcon = withDirection( RadiusBottomLeftIcon );
|
|
21
|
+
const EndEndIcon = withDirection( RadiusBottomRightIcon );
|
|
22
|
+
|
|
23
|
+
const getStartStartLabel = ( isSiteRtl: boolean ) =>
|
|
24
|
+
isSiteRtl ? __( 'Top right', 'elementor' ) : __( 'Top left', 'elementor' );
|
|
25
|
+
const getStartEndLabel = ( isSiteRtl: boolean ) =>
|
|
26
|
+
isSiteRtl ? __( 'Top left', 'elementor' ) : __( 'Top right', 'elementor' );
|
|
27
|
+
const getEndStartLabel = ( isSiteRtl: boolean ) =>
|
|
28
|
+
isSiteRtl ? __( 'Bottom right', 'elementor' ) : __( 'Bottom left', 'elementor' );
|
|
29
|
+
const getEndEndLabel = ( isSiteRtl: boolean ) =>
|
|
30
|
+
isSiteRtl ? __( 'Bottom left', 'elementor' ) : __( 'Bottom right', 'elementor' );
|
|
31
|
+
const getCorners = ( isSiteRtl: boolean ): EqualUnequalItems => [
|
|
16
32
|
{
|
|
17
|
-
label:
|
|
18
|
-
icon: <
|
|
19
|
-
bind: '
|
|
33
|
+
label: getStartStartLabel( isSiteRtl ),
|
|
34
|
+
icon: <RotatedIcon icon={ StartStartIcon } size="tiny" />,
|
|
35
|
+
bind: 'start-start',
|
|
20
36
|
},
|
|
21
37
|
{
|
|
22
|
-
label:
|
|
23
|
-
icon: <
|
|
24
|
-
bind: '
|
|
38
|
+
label: getStartEndLabel( isSiteRtl ),
|
|
39
|
+
icon: <RotatedIcon icon={ StartEndIcon } size="tiny" />,
|
|
40
|
+
bind: 'start-end',
|
|
25
41
|
},
|
|
26
42
|
{
|
|
27
|
-
label:
|
|
28
|
-
icon: <
|
|
29
|
-
bind: '
|
|
43
|
+
label: getEndEndLabel( isSiteRtl ),
|
|
44
|
+
icon: <RotatedIcon icon={ EndEndIcon } size="tiny" />,
|
|
45
|
+
bind: 'end-end',
|
|
30
46
|
},
|
|
31
47
|
{
|
|
32
|
-
label:
|
|
33
|
-
icon: <
|
|
34
|
-
bind: '
|
|
48
|
+
label: getEndStartLabel( isSiteRtl ),
|
|
49
|
+
icon: <RotatedIcon icon={ EndStartIcon } size="tiny" />,
|
|
50
|
+
bind: 'end-start',
|
|
35
51
|
},
|
|
36
52
|
];
|
|
37
53
|
|
|
38
54
|
export const BorderRadiusField = () => {
|
|
55
|
+
const { isSiteRtl } = useDirection();
|
|
56
|
+
|
|
39
57
|
return (
|
|
40
58
|
<StylesField bind={ 'border-radius' }>
|
|
41
59
|
<EqualUnequalSizesControl
|
|
42
|
-
items={
|
|
43
|
-
label={ __( 'Border
|
|
60
|
+
items={ getCorners( isSiteRtl ) }
|
|
61
|
+
label={ __( 'Border radius', 'elementor' ) }
|
|
44
62
|
icon={ <BorderCornersIcon fontSize={ 'tiny' } /> }
|
|
45
63
|
multiSizePropTypeUtil={ borderRadiusPropTypeUtil }
|
|
46
64
|
/>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Stack } from '@elementor/ui';
|
|
3
3
|
|
|
4
|
+
import { PanelDivider } from '../../panel-divider';
|
|
4
5
|
import { BorderField } from './border-field';
|
|
5
6
|
import { BorderRadiusField } from './border-radius-field';
|
|
6
7
|
|
|
7
8
|
export const BorderSection = () => (
|
|
8
9
|
<Stack gap={ 1.5 }>
|
|
9
10
|
<BorderRadiusField />
|
|
10
|
-
<
|
|
11
|
+
<PanelDivider />
|
|
11
12
|
<BorderField />
|
|
12
13
|
</Stack>
|
|
13
14
|
);
|
|
@@ -21,9 +21,9 @@ export const BorderStyleField = () => {
|
|
|
21
21
|
<StylesField bind={ 'border-style' }>
|
|
22
22
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
23
23
|
<Grid item xs={ 6 }>
|
|
24
|
-
<ControlLabel>{ __( 'Border
|
|
24
|
+
<ControlLabel>{ __( 'Border type', 'elementor' ) }</ControlLabel>
|
|
25
25
|
</Grid>
|
|
26
|
-
<Grid item xs={ 6 }>
|
|
26
|
+
<Grid item xs={ 6 } sx={ { overflow: 'hidden' } }>
|
|
27
27
|
<SelectControl options={ borderStyles } />
|
|
28
28
|
</Grid>
|
|
29
29
|
</Grid>
|
|
@@ -34,7 +34,7 @@ export const BorderWidthField = () => {
|
|
|
34
34
|
<StylesField bind={ 'border-width' }>
|
|
35
35
|
<EqualUnequalSizesControl
|
|
36
36
|
items={ edges }
|
|
37
|
-
label={ __( 'Border
|
|
37
|
+
label={ __( 'Border width', 'elementor' ) }
|
|
38
38
|
icon={ <SideAllIcon fontSize={ 'tiny' } /> }
|
|
39
39
|
multiSizePropTypeUtil={ borderWidthPropTypeUtil }
|
|
40
40
|
/>
|
|
@@ -2,12 +2,13 @@ import * as React from 'react';
|
|
|
2
2
|
import { ControlLabel } from '@elementor/editor-controls';
|
|
3
3
|
import { useParentElement } from '@elementor/editor-elements';
|
|
4
4
|
import { type StringPropValue } from '@elementor/editor-props';
|
|
5
|
-
import {
|
|
5
|
+
import { Stack } from '@elementor/ui';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
|
|
8
8
|
import { useElement } from '../../../contexts/element-context';
|
|
9
9
|
import { useComputedStyle } from '../../../hooks/use-computed-style';
|
|
10
10
|
import { useStylesField } from '../../../hooks/use-styles-field';
|
|
11
|
+
import { PanelDivider } from '../../panel-divider';
|
|
11
12
|
import { AlignItemsField } from './align-items-field';
|
|
12
13
|
import { AlignSelfChild } from './align-self-child-field';
|
|
13
14
|
import { DisplayField } from './display-field';
|
|
@@ -38,7 +39,7 @@ const FlexFields = () => (
|
|
|
38
39
|
<FlexDirectionField />
|
|
39
40
|
<JustifyContentField />
|
|
40
41
|
<AlignItemsField />
|
|
41
|
-
<
|
|
42
|
+
<PanelDivider />
|
|
42
43
|
<GapControlField />
|
|
43
44
|
<WrapField />
|
|
44
45
|
</>
|
|
@@ -46,7 +47,7 @@ const FlexFields = () => (
|
|
|
46
47
|
|
|
47
48
|
const FlexChildFields = () => (
|
|
48
49
|
<>
|
|
49
|
-
<
|
|
50
|
+
<PanelDivider />
|
|
50
51
|
<ControlLabel>{ __( 'Flex child', 'elementor' ) }</ControlLabel>
|
|
51
52
|
<AlignSelfChild />
|
|
52
53
|
<FlexOrderField />
|
|
@@ -24,7 +24,7 @@ export const PositionField = ( { onChange }: Props ) => {
|
|
|
24
24
|
<Grid item xs={ 6 }>
|
|
25
25
|
<ControlLabel>{ __( 'Position', 'elementor' ) }</ControlLabel>
|
|
26
26
|
</Grid>
|
|
27
|
-
<Grid item xs={ 6 }>
|
|
27
|
+
<Grid item xs={ 6 } sx={ { overflow: 'hidden' } }>
|
|
28
28
|
<SelectControl options={ positionOptions } onChange={ onChange } />
|
|
29
29
|
</Grid>
|
|
30
30
|
</Grid>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ControlLabel, SizeControl } from '@elementor/editor-controls';
|
|
3
|
-
import {
|
|
3
|
+
import { Grid, Stack } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField, type StylesFieldProps } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { PanelDivider } from '../../panel-divider';
|
|
7
8
|
import { OverflowField } from './overflow-field';
|
|
8
9
|
|
|
9
10
|
export const SizeSection = () => {
|
|
@@ -19,21 +20,21 @@ export const SizeSection = () => {
|
|
|
19
20
|
</Grid>
|
|
20
21
|
<Grid container gap={ 2 } flexWrap="nowrap">
|
|
21
22
|
<Grid item xs={ 6 }>
|
|
22
|
-
<SizeField bind="min-width" label={ __( 'Min.
|
|
23
|
+
<SizeField bind="min-width" label={ __( 'Min. width', 'elementor' ) } />
|
|
23
24
|
</Grid>
|
|
24
25
|
<Grid item xs={ 6 }>
|
|
25
|
-
<SizeField bind="min-height" label={ __( 'Min.
|
|
26
|
+
<SizeField bind="min-height" label={ __( 'Min. height', 'elementor' ) } />
|
|
26
27
|
</Grid>
|
|
27
28
|
</Grid>
|
|
28
29
|
<Grid container gap={ 2 } flexWrap="nowrap">
|
|
29
30
|
<Grid item xs={ 6 }>
|
|
30
|
-
<SizeField bind="max-width" label={ __( 'Max.
|
|
31
|
+
<SizeField bind="max-width" label={ __( 'Max. width', 'elementor' ) } />
|
|
31
32
|
</Grid>
|
|
32
33
|
<Grid item xs={ 6 }>
|
|
33
|
-
<SizeField bind="max-height" label={ __( 'Max.
|
|
34
|
+
<SizeField bind="max-height" label={ __( 'Max. height', 'elementor' ) } />
|
|
34
35
|
</Grid>
|
|
35
36
|
</Grid>
|
|
36
|
-
<
|
|
37
|
+
<PanelDivider />
|
|
37
38
|
<Stack>
|
|
38
39
|
<OverflowField />
|
|
39
40
|
</Stack>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LinkedDimensionsControl } from '@elementor/editor-controls';
|
|
3
|
-
import {
|
|
3
|
+
import { Stack } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { PanelDivider } from '../../panel-divider';
|
|
7
8
|
|
|
8
9
|
export const SpacingSection = () => {
|
|
9
10
|
return (
|
|
@@ -11,7 +12,7 @@ export const SpacingSection = () => {
|
|
|
11
12
|
<StylesField bind={ 'padding' }>
|
|
12
13
|
<LinkedDimensionsControl label={ __( 'Padding', 'elementor' ) } />
|
|
13
14
|
</StylesField>
|
|
14
|
-
<
|
|
15
|
+
<PanelDivider />
|
|
15
16
|
<StylesField bind={ 'margin' }>
|
|
16
17
|
<LinkedDimensionsControl label={ __( 'Margin', 'elementor' ) } />
|
|
17
18
|
</StylesField>
|
|
@@ -17,9 +17,9 @@ export const FontFamilyField = () => {
|
|
|
17
17
|
<StylesField bind="font-family">
|
|
18
18
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
19
19
|
<Grid item xs={ 6 }>
|
|
20
|
-
<ControlLabel>{ __( 'Font
|
|
20
|
+
<ControlLabel>{ __( 'Font family', 'elementor' ) }</ControlLabel>
|
|
21
21
|
</Grid>
|
|
22
|
-
<Grid item xs={ 6 }>
|
|
22
|
+
<Grid item xs={ 6 } sx={ { overflow: 'hidden' } }>
|
|
23
23
|
<FontFamilyControl fontFamilies={ fontFamilies } />
|
|
24
24
|
</Grid>
|
|
25
25
|
</Grid>
|
|
@@ -10,7 +10,7 @@ export const FontSizeField = () => {
|
|
|
10
10
|
<StylesField bind="font-size">
|
|
11
11
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
12
12
|
<Grid item xs={ 6 }>
|
|
13
|
-
<ControlLabel>{ __( 'Font
|
|
13
|
+
<ControlLabel>{ __( 'Font size', 'elementor' ) }</ControlLabel>
|
|
14
14
|
</Grid>
|
|
15
15
|
<Grid item xs={ 6 }>
|
|
16
16
|
<SizeControl />
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ControlLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
|
+
import { ItalicIcon, MinusIcon } from '@elementor/icons';
|
|
4
|
+
import { Grid } from '@elementor/ui';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
import { StylesField } from '../../../controls-registry/styles-field';
|
|
8
|
+
|
|
9
|
+
type FontStyle = 'normal' | 'italic';
|
|
10
|
+
const options: ToggleButtonGroupItem< FontStyle >[] = [
|
|
11
|
+
{
|
|
12
|
+
value: 'normal',
|
|
13
|
+
label: __( 'Normal', 'elementor' ),
|
|
14
|
+
renderContent: ( { size } ) => <MinusIcon fontSize={ size } />,
|
|
15
|
+
showTooltip: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
value: 'italic',
|
|
19
|
+
label: __( 'Italic', 'elementor' ),
|
|
20
|
+
renderContent: ( { size } ) => <ItalicIcon fontSize={ size } />,
|
|
21
|
+
showTooltip: true,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export const FontStyleField = () => (
|
|
26
|
+
<StylesField bind="font-style">
|
|
27
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
28
|
+
<Grid item xs={ 6 }>
|
|
29
|
+
<ControlLabel>{ __( 'Font Style', 'elementor' ) }</ControlLabel>
|
|
30
|
+
</Grid>
|
|
31
|
+
<Grid item xs={ 6 } display="flex" justifyContent="end">
|
|
32
|
+
<ToggleControl options={ options } />
|
|
33
|
+
</Grid>
|
|
34
|
+
</Grid>
|
|
35
|
+
</StylesField>
|
|
36
|
+
);
|
|
@@ -22,9 +22,9 @@ export const FontWeightField = () => {
|
|
|
22
22
|
<StylesField bind="font-weight">
|
|
23
23
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
24
24
|
<Grid item xs={ 6 }>
|
|
25
|
-
<ControlLabel>{ __( 'Font
|
|
25
|
+
<ControlLabel>{ __( 'Font weight', 'elementor' ) }</ControlLabel>
|
|
26
26
|
</Grid>
|
|
27
|
-
<Grid item xs={ 6 }>
|
|
27
|
+
<Grid item xs={ 6 } sx={ { overflow: 'hidden' } }>
|
|
28
28
|
<SelectControl options={ fontWeightOptions } />
|
|
29
29
|
</Grid>
|
|
30
30
|
</Grid>
|
|
@@ -10,7 +10,7 @@ export const LetterSpacingField = () => {
|
|
|
10
10
|
<StylesField bind="letter-spacing">
|
|
11
11
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
12
12
|
<Grid item xs={ 6 }>
|
|
13
|
-
<ControlLabel>{ __( 'Letter
|
|
13
|
+
<ControlLabel>{ __( 'Letter spacing', 'elementor' ) }</ControlLabel>
|
|
14
14
|
</Grid>
|
|
15
15
|
<Grid item xs={ 6 }>
|
|
16
16
|
<SizeControl />
|
|
@@ -10,7 +10,7 @@ export const LineHeightField = () => {
|
|
|
10
10
|
<StylesField bind="line-height">
|
|
11
11
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
12
12
|
<Grid item xs={ 6 }>
|
|
13
|
-
<ControlLabel>{ __( 'Line
|
|
13
|
+
<ControlLabel>{ __( 'Line height', 'elementor' ) }</ControlLabel>
|
|
14
14
|
</Grid>
|
|
15
15
|
<Grid item xs={ 6 }>
|
|
16
16
|
<SizeControl />
|
|
@@ -10,7 +10,7 @@ export const TextColorField = () => {
|
|
|
10
10
|
<StylesField bind="color">
|
|
11
11
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
12
12
|
<Grid item xs={ 6 }>
|
|
13
|
-
<ControlLabel>{ __( 'Text
|
|
13
|
+
<ControlLabel>{ __( 'Text color', 'elementor' ) }</ControlLabel>
|
|
14
14
|
</Grid>
|
|
15
15
|
<Grid item xs={ 6 }>
|
|
16
16
|
<ColorControl />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ControlLabel } from '@elementor/editor-controls';
|
|
3
3
|
import { type StringPropValue } from '@elementor/editor-props';
|
|
4
|
-
import {
|
|
4
|
+
import { StrikethroughIcon, UnderlineIcon } from '@elementor/icons';
|
|
5
5
|
import { Grid, ToggleButton as ToggleButtonBase, ToggleButtonGroup, type ToggleButtonProps } from '@elementor/ui';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
|
|
@@ -9,23 +9,10 @@ import { useStylesField } from '../../../hooks/use-styles-field';
|
|
|
9
9
|
|
|
10
10
|
const buttonSize = 'tiny';
|
|
11
11
|
|
|
12
|
-
export const
|
|
13
|
-
const [ fontStyle, setFontStyle ] = useStylesField< StringPropValue | null >( 'font-style' );
|
|
12
|
+
export const TextDecorationField = () => {
|
|
14
13
|
const [ textDecoration, setTextDecoration ] = useStylesField< StringPropValue | null >( 'text-decoration' );
|
|
15
14
|
|
|
16
|
-
const formats = [
|
|
17
|
-
|
|
18
|
-
const handleSetFontStyle = ( newValue: string | null ) => {
|
|
19
|
-
if ( newValue === null ) {
|
|
20
|
-
return setFontStyle( null );
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
setFontStyle( {
|
|
24
|
-
$$type: 'string',
|
|
25
|
-
value: newValue,
|
|
26
|
-
} );
|
|
27
|
-
};
|
|
28
|
-
|
|
15
|
+
const formats = [ ...( textDecoration?.value || '' ).split( ' ' ) ];
|
|
29
16
|
const handleSetTextDecoration = ( newValue: string | null ) => {
|
|
30
17
|
if ( newValue === null ) {
|
|
31
18
|
return setTextDecoration( null );
|
|
@@ -44,14 +31,6 @@ export const TextStyleField = () => {
|
|
|
44
31
|
</Grid>
|
|
45
32
|
<Grid item xs={ 6 } display="flex" justifyContent="end">
|
|
46
33
|
<ToggleButtonGroup value={ formats }>
|
|
47
|
-
<ToggleButton
|
|
48
|
-
value="italic"
|
|
49
|
-
onChange={ ( v ) => handleSetFontStyle( fontStyle?.value === v ? null : v ) }
|
|
50
|
-
aria-label="italic"
|
|
51
|
-
sx={ { marginLeft: 'auto' } }
|
|
52
|
-
>
|
|
53
|
-
<ItalicIcon fontSize={ buttonSize } />
|
|
54
|
-
</ToggleButton>
|
|
55
34
|
<ShorthandControl
|
|
56
35
|
value="line-through"
|
|
57
36
|
currentValues={ textDecoration?.value || '' }
|
|
@@ -24,7 +24,7 @@ const initTextStroke = {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export const TextStrokeField = () => {
|
|
27
|
-
const [ textStroke, setTextStroke ] = useStylesField( '
|
|
27
|
+
const [ textStroke, setTextStroke ] = useStylesField( 'stroke' );
|
|
28
28
|
|
|
29
29
|
const addTextStroke = () => {
|
|
30
30
|
setTextStroke( initTextStroke );
|
|
@@ -38,12 +38,12 @@ export const TextStrokeField = () => {
|
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
40
|
<AddOrRemoveContent
|
|
41
|
-
label={ __( 'Text
|
|
41
|
+
label={ __( 'Text stroke', 'elementor' ) }
|
|
42
42
|
isAdded={ hasTextStroke }
|
|
43
43
|
onAdd={ addTextStroke }
|
|
44
44
|
onRemove={ removeTextStroke }
|
|
45
45
|
>
|
|
46
|
-
<StylesField bind={ '
|
|
46
|
+
<StylesField bind={ 'stroke' }>
|
|
47
47
|
<StrokeControl />
|
|
48
48
|
</StylesField>
|
|
49
49
|
</AddOrRemoveContent>
|
|
@@ -39,7 +39,7 @@ export const TransformField = () => (
|
|
|
39
39
|
<StylesField bind={ 'text-transform' }>
|
|
40
40
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
41
41
|
<Grid item xs={ 6 }>
|
|
42
|
-
<ControlLabel>{ __( 'Text
|
|
42
|
+
<ControlLabel>{ __( 'Text transform', 'elementor' ) }</ControlLabel>
|
|
43
43
|
</Grid>
|
|
44
44
|
<Grid item xs={ 6 } display="flex" justifyContent="end">
|
|
45
45
|
<ToggleControl options={ options } />
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Stack } from '@elementor/ui';
|
|
3
3
|
|
|
4
4
|
import { CollapsibleContent } from '../../collapsible-content';
|
|
5
|
+
import { PanelDivider } from '../../panel-divider';
|
|
5
6
|
import { FontFamilyField } from './font-family-field';
|
|
6
7
|
import { FontSizeField } from './font-size-field';
|
|
8
|
+
import { FontStyleField } from './font-style-field';
|
|
7
9
|
import { FontWeightField } from './font-weight-field';
|
|
8
10
|
import { LetterSpacingField } from './letter-spacing-field';
|
|
9
11
|
import { LineHeightField } from './line-height-field';
|
|
10
12
|
import { TextAlignmentField } from './text-alignment-field';
|
|
11
13
|
import { TextColorField } from './text-color-field';
|
|
14
|
+
import { TextDecorationField } from './text-decoration-field';
|
|
12
15
|
import { TextDirectionField } from './text-direction-field';
|
|
13
16
|
import { TextStrokeField } from './text-stroke-field';
|
|
14
|
-
import { TextStyleField } from './text-style-field';
|
|
15
17
|
import { TransformField } from './transform-field';
|
|
16
18
|
import { WordSpacingField } from './word-spacing-field';
|
|
17
19
|
|
|
@@ -21,7 +23,7 @@ export const TypographySection = () => {
|
|
|
21
23
|
<FontFamilyField />
|
|
22
24
|
<FontWeightField />
|
|
23
25
|
<FontSizeField />
|
|
24
|
-
<
|
|
26
|
+
<PanelDivider />
|
|
25
27
|
<TextAlignmentField />
|
|
26
28
|
<TextColorField />
|
|
27
29
|
<CollapsibleContent>
|
|
@@ -29,10 +31,11 @@ export const TypographySection = () => {
|
|
|
29
31
|
<LineHeightField />
|
|
30
32
|
<LetterSpacingField />
|
|
31
33
|
<WordSpacingField />
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
+
<PanelDivider />
|
|
35
|
+
<TextDecorationField />
|
|
34
36
|
<TransformField />
|
|
35
37
|
<TextDirectionField />
|
|
38
|
+
<FontStyleField />
|
|
36
39
|
<TextStrokeField />
|
|
37
40
|
</Stack>
|
|
38
41
|
</CollapsibleContent>
|
|
@@ -10,7 +10,7 @@ export const WordSpacingField = () => {
|
|
|
10
10
|
<StylesField bind="word-spacing">
|
|
11
11
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
12
12
|
<Grid item xs={ 6 }>
|
|
13
|
-
<ControlLabel>{ __( 'Word
|
|
13
|
+
<ControlLabel>{ __( 'Word spacing', 'elementor' ) }</ControlLabel>
|
|
14
14
|
</Grid>
|
|
15
15
|
<Grid item xs={ 6 }>
|
|
16
16
|
<SizeControl />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { PropKeyProvider, PropProvider } from '@elementor/editor-controls';
|
|
3
3
|
import { updateElementSettings, useElementSetting } from '@elementor/editor-elements';
|
|
4
|
-
import { type
|
|
4
|
+
import { type PropKey, type PropValue } from '@elementor/editor-props';
|
|
5
5
|
|
|
6
6
|
import { useElement } from '../contexts/element-context';
|
|
7
7
|
import { createTopLevelOjectType } from './create-top-level-object-type';
|
|
@@ -16,16 +16,10 @@ export const SettingsField = ( { bind, children }: Props ) => {
|
|
|
16
16
|
|
|
17
17
|
const settingsValue = useElementSetting< PropValue >( element.id, bind );
|
|
18
18
|
|
|
19
|
-
const linkValue = useElementSetting< PropValue >( element.id, 'link' ) as LinkPropValue;
|
|
20
|
-
|
|
21
19
|
const value = { [ bind ]: settingsValue };
|
|
22
20
|
|
|
23
21
|
const propType = createTopLevelOjectType( { schema: elementType.propsSchema } );
|
|
24
22
|
|
|
25
|
-
if ( bind === 'tag' && linkValue?.value && 'div-block' === elementType.key ) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
23
|
const setValue = ( newValue: Record< string, PropValue > ) => {
|
|
30
24
|
updateElementSettings( {
|
|
31
25
|
id: element.id,
|