@elementor/editor-editing-panel 1.23.0 → 1.24.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 +20 -0
- package/dist/index.js +400 -352
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +367 -324
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- 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 +16 -5
- package/src/components/css-classes/css-class-selector.tsx +3 -3
- package/src/components/editing-panel-tabs.tsx +8 -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-sections/border-section/border-color-field.tsx +2 -1
- package/src/components/style-sections/border-section/border-style-field.tsx +2 -1
- 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 +6 -4
- 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 +2 -1
- 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/dynamics/components/dynamic-selection-control.tsx +2 -2
- package/src/dynamics/components/dynamic-selection.tsx +4 -4
- package/src/styles-inheritance/styles-inheritance-indicator.tsx +7 -6
|
@@ -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,10 +1,11 @@
|
|
|
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 { ControlLabel } from '../../control-label';
|
|
8
9
|
import { RotatedIcon } from '../layout-section/utils/rotated-icon';
|
|
9
10
|
|
|
10
11
|
type Alignments = 'start' | 'center' | 'end' | 'justify';
|
|
@@ -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 (
|
|
@@ -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>
|
|
@@ -6,7 +6,6 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
|
|
7
7
|
import { useStyle } from '../contexts/style-context';
|
|
8
8
|
import { useStylesInheritanceField } from '../contexts/styles-inheritance-context';
|
|
9
|
-
import { useStylesField } from '../hooks/use-styles-field';
|
|
10
9
|
|
|
11
10
|
const Circle = styled( 'div', {
|
|
12
11
|
shouldForwardProp: ( prop ) => prop !== 'variant',
|
|
@@ -17,21 +16,23 @@ const Circle = styled( 'div', {
|
|
|
17
16
|
background-color: ${ ( { theme, variant } ) => {
|
|
18
17
|
switch ( variant ) {
|
|
19
18
|
case 'overridden':
|
|
20
|
-
return theme.palette.warning.
|
|
19
|
+
return theme.palette.warning.light;
|
|
21
20
|
case 'global-affects':
|
|
22
|
-
return theme.palette.global.
|
|
21
|
+
return theme.palette.global.dark;
|
|
23
22
|
case 'local-affects':
|
|
24
23
|
return theme.palette.primary.main;
|
|
25
24
|
default:
|
|
26
|
-
return theme.palette.text.
|
|
25
|
+
return theme.palette.text.disabled;
|
|
27
26
|
}
|
|
28
27
|
} };
|
|
29
28
|
`;
|
|
30
29
|
|
|
31
30
|
export const StylesInheritanceIndicator = () => {
|
|
32
|
-
const {
|
|
31
|
+
const { value, path } = useBoundProp();
|
|
33
32
|
const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
|
|
34
|
-
|
|
33
|
+
|
|
34
|
+
// in the styles inheritance snapshot the keys are only those of the top level style schema attributes
|
|
35
|
+
const [ bind ] = path;
|
|
35
36
|
const inheritanceChain = useStylesInheritanceField( bind );
|
|
36
37
|
|
|
37
38
|
if ( ! inheritanceChain.length ) {
|