@elementor/editor-editing-panel 1.23.0 → 1.27.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 +84 -0
- package/dist/index.js +603 -455
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +568 -425
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -9
- package/src/components/add-or-remove-content.tsx +1 -1
- package/src/components/{control-label-with-adornments.tsx → control-label.tsx} +3 -3
- package/src/components/css-classes/css-class-item.tsx +18 -7
- package/src/components/css-classes/css-class-menu.tsx +55 -9
- package/src/components/css-classes/css-class-selector.tsx +9 -8
- package/src/components/editing-panel-tabs.tsx +1 -1
- package/src/components/editing-panel.tsx +18 -15
- package/src/components/multi-combobox.tsx +12 -1
- package/src/components/settings-tab.tsx +2 -2
- package/src/components/style-indicator.tsx +23 -0
- package/src/components/style-sections/border-section/border-color-field.tsx +2 -1
- package/src/components/style-sections/border-section/border-radius-field.tsx +4 -5
- package/src/components/style-sections/border-section/border-style-field.tsx +2 -1
- package/src/components/style-sections/border-section/border-width-field.tsx +2 -3
- package/src/components/style-sections/layout-section/align-content-field.tsx +2 -1
- package/src/components/style-sections/layout-section/align-items-field.tsx +2 -1
- package/src/components/style-sections/layout-section/align-self-child-field.tsx +2 -1
- package/src/components/style-sections/layout-section/display-field.tsx +2 -1
- package/src/components/style-sections/layout-section/flex-direction-field.tsx +2 -1
- package/src/components/style-sections/layout-section/flex-order-field.tsx +20 -24
- package/src/components/style-sections/layout-section/flex-size-field.tsx +31 -19
- package/src/components/style-sections/layout-section/justify-content-field.tsx +5 -4
- package/src/components/style-sections/layout-section/layout-section.tsx +2 -2
- package/src/components/style-sections/layout-section/wrap-field.tsx +2 -1
- package/src/components/style-sections/position-section/dimensions-field.tsx +2 -1
- package/src/components/style-sections/position-section/position-field.tsx +2 -1
- package/src/components/style-sections/position-section/z-index-field.tsx +2 -1
- package/src/components/style-sections/size-section/overflow-field.tsx +2 -1
- package/src/components/style-sections/size-section/size-section.tsx +2 -1
- package/src/components/style-sections/typography-section/font-family-field.tsx +2 -1
- package/src/components/style-sections/typography-section/font-size-field.tsx +2 -1
- package/src/components/style-sections/typography-section/font-style-field.tsx +2 -2
- package/src/components/style-sections/typography-section/font-weight-field.tsx +2 -1
- package/src/components/style-sections/typography-section/letter-spacing-field.tsx +2 -1
- package/src/components/style-sections/typography-section/line-height-field.tsx +2 -1
- package/src/components/style-sections/typography-section/text-alignment-field.tsx +7 -7
- package/src/components/style-sections/typography-section/text-color-field.tsx +2 -1
- package/src/components/style-sections/typography-section/text-decoration-field.tsx +2 -1
- package/src/components/style-sections/typography-section/text-direction-field.tsx +2 -1
- package/src/components/style-sections/typography-section/text-stroke-field.tsx +9 -9
- package/src/components/style-sections/typography-section/transform-field.tsx +2 -1
- package/src/components/style-sections/typography-section/word-spacing-field.tsx +2 -1
- package/src/contexts/style-context.tsx +1 -1
- package/src/controls-registry/control-type-container.tsx +2 -2
- package/src/dynamics/components/dynamic-selection-control.tsx +2 -2
- package/src/dynamics/components/dynamic-selection.tsx +4 -4
- package/src/dynamics/dynamic-transformer.ts +61 -0
- package/src/dynamics/errors.ts +6 -0
- package/src/dynamics/init.ts +6 -0
- package/src/dynamics/types.ts +17 -0
- package/src/styles-inheritance/create-snapshots-manager.ts +8 -8
- package/src/styles-inheritance/create-styles-inheritance.ts +8 -4
- package/src/styles-inheritance/styles-inheritance-indicator.tsx +17 -34
- package/src/styles-inheritance/types.ts +7 -6
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
ControlLabel,
|
|
5
|
-
ControlToggleButtonGroup,
|
|
6
|
-
NumberControl,
|
|
7
|
-
type ToggleButtonGroupItem,
|
|
8
|
-
} from '@elementor/editor-controls';
|
|
3
|
+
import { ControlToggleButtonGroup, NumberControl, type ToggleButtonGroupItem } from '@elementor/editor-controls';
|
|
9
4
|
import { type NumberPropValue } from '@elementor/editor-props';
|
|
10
5
|
import { ArrowDownSmallIcon, ArrowUpSmallIcon, PencilIcon } from '@elementor/icons';
|
|
11
6
|
import { DirectionProvider, Grid, ThemeProvider } from '@elementor/ui';
|
|
@@ -14,6 +9,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
14
9
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
15
10
|
import { useDirection } from '../../../hooks/use-direction';
|
|
16
11
|
import { useStylesField } from '../../../hooks/use-styles-field';
|
|
12
|
+
import { ControlLabel } from '../../control-label';
|
|
17
13
|
import { SectionContent } from '../../section-content';
|
|
18
14
|
|
|
19
15
|
type GroupControlItemOption = 'first' | 'last' | 'custom';
|
|
@@ -71,23 +67,23 @@ export const FlexOrderField = () => {
|
|
|
71
67
|
return (
|
|
72
68
|
<DirectionProvider rtl={ isSiteRtl }>
|
|
73
69
|
<ThemeProvider>
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
<Grid
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
<StylesField bind={ 'order' }>
|
|
71
|
+
<SectionContent>
|
|
72
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
73
|
+
<Grid item xs={ 6 }>
|
|
74
|
+
<ControlLabel>{ __( 'Order', 'elementor' ) }</ControlLabel>
|
|
75
|
+
</Grid>
|
|
76
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
77
|
+
<ControlToggleButtonGroup
|
|
78
|
+
items={ items }
|
|
79
|
+
value={ groupControlValue }
|
|
80
|
+
onChange={ handleToggleButtonChange }
|
|
81
|
+
exclusive={ true }
|
|
82
|
+
/>
|
|
83
|
+
</Grid>
|
|
86
84
|
</Grid>
|
|
87
|
-
</Grid>
|
|
88
85
|
|
|
89
|
-
|
|
90
|
-
<StylesField bind={ 'order' }>
|
|
86
|
+
{ CUSTOM === groupControlValue && (
|
|
91
87
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
92
88
|
<Grid item xs={ 6 }>
|
|
93
89
|
<ControlLabel>{ __( 'Custom order', 'elementor' ) }</ControlLabel>
|
|
@@ -100,9 +96,9 @@ export const FlexOrderField = () => {
|
|
|
100
96
|
/>
|
|
101
97
|
</Grid>
|
|
102
98
|
</Grid>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</
|
|
99
|
+
) }
|
|
100
|
+
</SectionContent>
|
|
101
|
+
</StylesField>
|
|
106
102
|
</ThemeProvider>
|
|
107
103
|
</DirectionProvider>
|
|
108
104
|
);
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useMemo, useState } from 'react';
|
|
3
3
|
import {
|
|
4
|
-
ControlLabel,
|
|
5
4
|
ControlToggleButtonGroup,
|
|
6
5
|
NumberControl,
|
|
7
6
|
SizeControl,
|
|
8
7
|
type ToggleButtonGroupItem,
|
|
9
8
|
} from '@elementor/editor-controls';
|
|
10
|
-
import type
|
|
9
|
+
import { numberPropTypeUtil, type NumberPropValue, type SizePropValue } from '@elementor/editor-props';
|
|
11
10
|
import { ExpandIcon, PencilIcon, ShrinkIcon } from '@elementor/icons';
|
|
12
11
|
import { DirectionProvider, Grid, ThemeProvider } from '@elementor/ui';
|
|
13
12
|
import { __ } from '@wordpress/i18n';
|
|
14
13
|
|
|
15
14
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
16
15
|
import { useDirection } from '../../../hooks/use-direction';
|
|
17
|
-
import {
|
|
16
|
+
import { useStylesFields } from '../../../hooks/use-styles-fields';
|
|
17
|
+
import { ControlLabel } from '../../control-label';
|
|
18
18
|
import { SectionContent } from '../../section-content';
|
|
19
19
|
|
|
20
20
|
type GroupItem = 'flex-grow' | 'flex-shrink' | 'custom';
|
|
@@ -43,38 +43,49 @@ const items: ToggleButtonGroupItem< GroupItem >[] = [
|
|
|
43
43
|
];
|
|
44
44
|
|
|
45
45
|
export const FlexSizeField = () => {
|
|
46
|
-
const { isSiteRtl } = useDirection()
|
|
47
|
-
[ growField, setGrowField ] = useStylesField< NumberPropValue | null >( 'flex-grow' ),
|
|
48
|
-
[ shrinkField, setShrinkField ] = useStylesField< NumberPropValue | null >( 'flex-shrink' ),
|
|
49
|
-
[ basisField, setBasisField ] = useStylesField< SizePropValue | null >( 'flex-basis' );
|
|
46
|
+
const { isSiteRtl } = useDirection();
|
|
50
47
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
const [ fields, setFields ] = useStylesFields< {
|
|
49
|
+
'flex-grow': NumberPropValue | null;
|
|
50
|
+
'flex-shrink': NumberPropValue | null;
|
|
51
|
+
'flex-basis': SizePropValue | null;
|
|
52
|
+
} >( [ 'flex-grow', 'flex-shrink', 'flex-basis' ] );
|
|
53
|
+
|
|
54
|
+
const grow = fields?.[ 'flex-grow' ]?.value || null;
|
|
55
|
+
const shrink = fields?.[ 'flex-shrink' ]?.value || null;
|
|
56
|
+
const basis = fields?.[ 'flex-basis' ]?.value || null;
|
|
54
57
|
|
|
55
58
|
const currentGroup = useMemo( () => getActiveGroup( { grow, shrink, basis } ), [ grow, shrink, basis ] ),
|
|
56
59
|
[ activeGroup, setActiveGroup ] = useState( currentGroup );
|
|
57
60
|
|
|
58
61
|
const onChangeGroup = ( group: GroupItem | null = null ) => {
|
|
59
62
|
setActiveGroup( group );
|
|
60
|
-
setBasisField( null );
|
|
61
63
|
|
|
62
64
|
if ( ! group || group === 'custom' ) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
setFields( {
|
|
66
|
+
'flex-basis': null,
|
|
67
|
+
'flex-grow': null,
|
|
68
|
+
'flex-shrink': null,
|
|
69
|
+
} );
|
|
65
70
|
|
|
66
71
|
return;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
if ( group === 'flex-grow' ) {
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
setFields( {
|
|
76
|
+
'flex-basis': null,
|
|
77
|
+
'flex-grow': numberPropTypeUtil.create( DEFAULT ),
|
|
78
|
+
'flex-shrink': null,
|
|
79
|
+
} );
|
|
72
80
|
|
|
73
81
|
return;
|
|
74
82
|
}
|
|
75
83
|
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
setFields( {
|
|
85
|
+
'flex-basis': null,
|
|
86
|
+
'flex-grow': null,
|
|
87
|
+
'flex-shrink': numberPropTypeUtil.create( DEFAULT ),
|
|
88
|
+
} );
|
|
78
89
|
};
|
|
79
90
|
|
|
80
91
|
return (
|
|
@@ -83,7 +94,9 @@ export const FlexSizeField = () => {
|
|
|
83
94
|
<SectionContent>
|
|
84
95
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
85
96
|
<Grid item xs={ 6 }>
|
|
86
|
-
<
|
|
97
|
+
<StylesField bind={ activeGroup ?? '' }>
|
|
98
|
+
<ControlLabel>{ __( 'Size', 'elementor' ) }</ControlLabel>
|
|
99
|
+
</StylesField>
|
|
87
100
|
</Grid>
|
|
88
101
|
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
89
102
|
<ControlToggleButtonGroup
|
|
@@ -94,7 +107,6 @@ export const FlexSizeField = () => {
|
|
|
94
107
|
/>
|
|
95
108
|
</Grid>
|
|
96
109
|
</Grid>
|
|
97
|
-
|
|
98
110
|
{ 'custom' === activeGroup && <FlexCustomField /> }
|
|
99
111
|
</SectionContent>
|
|
100
112
|
</ThemeProvider>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import {
|
|
4
4
|
JustifyBottomIcon,
|
|
5
5
|
JustifyCenterIcon as CenterIcon,
|
|
@@ -13,9 +13,10 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
13
|
|
|
14
14
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
15
15
|
import { useDirection } from '../../../hooks/use-direction';
|
|
16
|
+
import { ControlLabel } from '../../control-label';
|
|
16
17
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
17
18
|
|
|
18
|
-
type JustifyContent = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
19
|
+
type JustifyContent = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
19
20
|
|
|
20
21
|
const StartIcon = withDirection( JustifyTopIcon );
|
|
21
22
|
const EndIcon = withDirection( JustifyBottomIcon );
|
|
@@ -27,7 +28,7 @@ const iconProps = {
|
|
|
27
28
|
|
|
28
29
|
const options: ToggleButtonGroupItem< JustifyContent >[] = [
|
|
29
30
|
{
|
|
30
|
-
value: 'start',
|
|
31
|
+
value: 'flex-start',
|
|
31
32
|
label: __( 'Start', 'elementor' ),
|
|
32
33
|
renderContent: ( { size } ) => <RotatedIcon icon={ StartIcon } size={ size } { ...iconProps } />,
|
|
33
34
|
showTooltip: true,
|
|
@@ -39,7 +40,7 @@ const options: ToggleButtonGroupItem< JustifyContent >[] = [
|
|
|
39
40
|
showTooltip: true,
|
|
40
41
|
},
|
|
41
42
|
{
|
|
42
|
-
value: 'end',
|
|
43
|
+
value: 'flex-end',
|
|
43
44
|
label: __( 'End', 'elementor' ),
|
|
44
45
|
renderContent: ( { size } ) => <RotatedIcon icon={ EndIcon } size={ size } { ...iconProps } />,
|
|
45
46
|
showTooltip: true,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ControlFormLabel } from '@elementor/editor-controls';
|
|
3
3
|
import { useParentElement } from '@elementor/editor-elements';
|
|
4
4
|
import { type StringPropValue } from '@elementor/editor-props';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
@@ -54,7 +54,7 @@ const FlexFields = () => {
|
|
|
54
54
|
const FlexChildFields = () => (
|
|
55
55
|
<>
|
|
56
56
|
<PanelDivider />
|
|
57
|
-
<
|
|
57
|
+
<ControlFormLabel>{ __( 'Flex child', 'elementor' ) }</ControlFormLabel>
|
|
58
58
|
<AlignSelfChild />
|
|
59
59
|
<FlexOrderField />
|
|
60
60
|
<FlexSizeField />
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon } from '@elementor/icons';
|
|
4
4
|
import { DirectionProvider, Grid, ThemeProvider } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
8
8
|
import { useDirection } from '../../../hooks/use-direction';
|
|
9
|
+
import { ControlLabel } from '../../control-label';
|
|
9
10
|
|
|
10
11
|
type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
11
12
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SizeControl } from '@elementor/editor-controls';
|
|
3
3
|
import { SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from '@elementor/icons';
|
|
4
4
|
import { Grid, Stack, withDirection } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
8
8
|
import { useDirection } from '../../../hooks/use-direction';
|
|
9
|
+
import { ControlLabel } from '../../control-label';
|
|
9
10
|
import { RotatedIcon } from '../layout-section/utils/rotated-icon';
|
|
10
11
|
|
|
11
12
|
type Side = 'inset-inline-start' | 'inset-inline-end' | 'inset-block-start' | 'inset-block-end';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SelectControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
|
|
8
9
|
const positionOptions = [
|
|
9
10
|
{ label: __( 'Static', 'elementor' ), value: 'static' },
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NumberControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
|
|
8
9
|
export const ZIndexField = () => {
|
|
9
10
|
return (
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { EyeIcon, EyeOffIcon, LetterAIcon } from '@elementor/icons';
|
|
4
4
|
import { Grid } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
8
|
+
import { ControlLabel } from '../../control-label';
|
|
8
9
|
|
|
9
10
|
type Overflows = 'visible' | 'hidden' | 'auto';
|
|
10
11
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ExtendedValue, SizeControl } from '@elementor/editor-controls';
|
|
3
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 { ControlLabel } from '../../control-label';
|
|
7
8
|
import { PanelDivider } from '../../panel-divider';
|
|
8
9
|
import { SectionContent } from '../../section-content';
|
|
9
10
|
import { OverflowField } from './overflow-field';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FontFamilyControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
import { useFontFamilies } from './hooks/use-font-families';
|
|
8
9
|
|
|
9
10
|
export const FontFamilyField = () => {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SizeControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
|
|
8
9
|
export const FontSizeField = () => {
|
|
9
10
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ControlFormLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { ItalicIcon, MinusIcon } from '@elementor/icons';
|
|
4
4
|
import { Grid } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
@@ -26,7 +26,7 @@ export const FontStyleField = () => (
|
|
|
26
26
|
<StylesField bind="font-style">
|
|
27
27
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
28
28
|
<Grid item xs={ 6 }>
|
|
29
|
-
<
|
|
29
|
+
<ControlFormLabel>{ __( 'Font style', 'elementor' ) }</ControlFormLabel>
|
|
30
30
|
</Grid>
|
|
31
31
|
<Grid item xs={ 6 } display="flex" justifyContent="end">
|
|
32
32
|
<ToggleControl options={ options } />
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SelectControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
|
|
8
9
|
const fontWeightOptions = [
|
|
9
10
|
{ value: '100', label: __( '100 - Thin', 'elementor' ) },
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SizeControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
|
|
8
9
|
export const LetterSpacingField = () => {
|
|
9
10
|
return (
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SizeControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
|
|
8
9
|
export const LineHeightField = () => {
|
|
9
10
|
return (
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from '@elementor/icons';
|
|
4
4
|
import { Grid, withDirection } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
8
|
-
import {
|
|
8
|
+
import { ControlLabel } from '../../control-label';
|
|
9
9
|
|
|
10
10
|
type Alignments = 'start' | 'center' | 'end' | 'justify';
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const AlignStartIcon = withDirection( AlignLeftIcon );
|
|
13
|
+
const AlignEndIcon = withDirection( AlignRightIcon );
|
|
14
14
|
|
|
15
15
|
const options: ToggleButtonGroupItem< Alignments >[] = [
|
|
16
16
|
{
|
|
17
17
|
value: 'start',
|
|
18
18
|
label: __( 'Start', 'elementor' ),
|
|
19
|
-
renderContent: () => <
|
|
19
|
+
renderContent: ( { size } ) => <AlignStartIcon fontSize={ size } />,
|
|
20
20
|
showTooltip: true,
|
|
21
21
|
},
|
|
22
22
|
{
|
|
@@ -28,7 +28,7 @@ const options: ToggleButtonGroupItem< Alignments >[] = [
|
|
|
28
28
|
{
|
|
29
29
|
value: 'end',
|
|
30
30
|
label: __( 'End', 'elementor' ),
|
|
31
|
-
renderContent: () => <
|
|
31
|
+
renderContent: ( { size } ) => <AlignEndIcon fontSize={ size } />,
|
|
32
32
|
showTooltip: true,
|
|
33
33
|
},
|
|
34
34
|
{
|
|
@@ -44,7 +44,7 @@ export const TextAlignmentField = () => {
|
|
|
44
44
|
<StylesField bind={ 'text-align' }>
|
|
45
45
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
46
46
|
<Grid item xs={ 6 }>
|
|
47
|
-
<ControlLabel>{ __( '
|
|
47
|
+
<ControlLabel>{ __( 'Text align', 'elementor' ) }</ControlLabel>
|
|
48
48
|
</Grid>
|
|
49
49
|
<Grid item xs={ 6 } display="flex" justifyContent="end">
|
|
50
50
|
<ToggleControl options={ options } />
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ColorControl
|
|
2
|
+
import { ColorControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
|
|
8
9
|
export const TextColorField = () => {
|
|
9
10
|
return (
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ToggleControl, type ToggleControlProps } from '@elementor/editor-controls';
|
|
3
3
|
import { MinusIcon, OverlineIcon, StrikethroughIcon, UnderlineIcon } from '@elementor/icons';
|
|
4
4
|
import { Grid } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
8
|
+
import { ControlLabel } from '../../control-label';
|
|
8
9
|
|
|
9
10
|
type Decoration = 'none' | 'underline' | 'line-through' | 'overline';
|
|
10
11
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { TextDirectionLtrIcon, TextDirectionRtlIcon } from '@elementor/icons';
|
|
4
4
|
import { Grid } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
8
|
+
import { ControlLabel } from '../../control-label';
|
|
8
9
|
|
|
9
10
|
type Direction = 'ltr' | 'rtl';
|
|
10
11
|
|
|
@@ -37,15 +37,15 @@ export const TextStrokeField = () => {
|
|
|
37
37
|
const hasTextStroke = Boolean( textStroke );
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
<StylesField bind={ 'stroke' }>
|
|
41
|
+
<AddOrRemoveContent
|
|
42
|
+
label={ __( 'Text stroke', 'elementor' ) }
|
|
43
|
+
isAdded={ hasTextStroke }
|
|
44
|
+
onAdd={ addTextStroke }
|
|
45
|
+
onRemove={ removeTextStroke }
|
|
46
|
+
>
|
|
47
47
|
<StrokeControl />
|
|
48
|
-
</
|
|
49
|
-
</
|
|
48
|
+
</AddOrRemoveContent>
|
|
49
|
+
</StylesField>
|
|
50
50
|
);
|
|
51
51
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon, MinusIcon } from '@elementor/icons';
|
|
4
4
|
import { Grid } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
8
|
+
import { ControlLabel } from '../../control-label';
|
|
8
9
|
|
|
9
10
|
type Transforms = 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
10
11
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SizeControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
|
|
8
9
|
export const WordSpacingField = () => {
|
|
9
10
|
return (
|
|
@@ -50,7 +50,7 @@ export function useStyle() {
|
|
|
50
50
|
return context;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
function getProviderByStyleId( styleId: StyleDefinitionID ) {
|
|
53
|
+
export function getProviderByStyleId( styleId: StyleDefinitionID ) {
|
|
54
54
|
const styleProvider = stylesRepository.getProviders().find( ( provider ) => {
|
|
55
55
|
return provider.actions.get().find( ( style ) => style.id === styleId );
|
|
56
56
|
} );
|
|
@@ -23,7 +23,7 @@ const StyledContainer = styled( Box, {
|
|
|
23
23
|
const getGridLayout = ( layout: ControlLayout ) => ( {
|
|
24
24
|
justifyContent: 'space-between',
|
|
25
25
|
gridTemplateColumns: {
|
|
26
|
-
full: '1fr',
|
|
27
|
-
'two-columns': 'repeat(2, 1fr)',
|
|
26
|
+
full: 'minmax(0, 1fr)',
|
|
27
|
+
'two-columns': 'repeat(2, minmax(0, 1fr))',
|
|
28
28
|
}[ layout ],
|
|
29
29
|
} );
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useId } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ControlFormLabel, useBoundProp } from '@elementor/editor-controls';
|
|
4
4
|
import type { Control, ControlsSection } from '@elementor/editor-elements';
|
|
5
5
|
import { DatabaseIcon, SettingsIcon, XIcon } from '@elementor/icons';
|
|
6
6
|
import {
|
|
@@ -181,7 +181,7 @@ const Control = ( { control }: { control: Control[ 'value' ] } ) => {
|
|
|
181
181
|
<Grid container gap={ 0.75 }>
|
|
182
182
|
{ control.label ? (
|
|
183
183
|
<Grid item xs={ 12 }>
|
|
184
|
-
<
|
|
184
|
+
<ControlFormLabel>{ control.label }</ControlFormLabel>
|
|
185
185
|
</Grid>
|
|
186
186
|
) : null }
|
|
187
187
|
<Grid item xs={ 12 }>
|
|
@@ -58,12 +58,12 @@ export const DynamicSelection = ( { onSelect }: DynamicSelectionProps ) => {
|
|
|
58
58
|
setSearchValue( event.target.value );
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
const handleSetDynamicTag = ( value: string ) => {
|
|
61
|
+
const handleSetDynamicTag = ( value: string, label: string ) => {
|
|
62
62
|
if ( ! isCurrentValueDynamic ) {
|
|
63
63
|
updatePropValueHistory( anyValue );
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
setValue( { name: value, settings: {} } );
|
|
66
|
+
setValue( { name: value, settings: { label } } );
|
|
67
67
|
|
|
68
68
|
onSelect?.();
|
|
69
69
|
};
|
|
@@ -110,8 +110,8 @@ export const DynamicSelection = ( { onSelect }: DynamicSelectionProps ) => {
|
|
|
110
110
|
selected={ isSelected }
|
|
111
111
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
112
112
|
autoFocus={ isSelected }
|
|
113
|
-
sx={ { px:
|
|
114
|
-
onClick={ () => handleSetDynamicTag( value ) }
|
|
113
|
+
sx={ { px: 3.5, typography: 'caption' } }
|
|
114
|
+
onClick={ () => handleSetDynamicTag( value, tagLabel ) }
|
|
115
115
|
>
|
|
116
116
|
{ tagLabel }
|
|
117
117
|
</MenuItem>
|