@elementor/editor-editing-panel 1.44.0 → 1.45.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 +479 -391
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +410 -320
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/components/style-sections/border-section/border-radius-field.tsx +12 -9
- package/src/components/style-sections/layout-section/align-content-field.tsx +10 -14
- package/src/components/style-sections/layout-section/align-items-field.tsx +13 -17
- package/src/components/style-sections/layout-section/align-self-child-field.tsx +13 -17
- package/src/components/style-sections/layout-section/flex-direction-field.tsx +13 -17
- package/src/components/style-sections/layout-section/flex-order-field.tsx +30 -33
- package/src/components/style-sections/layout-section/flex-size-field.tsx +60 -59
- package/src/components/style-sections/layout-section/justify-content-field.tsx +10 -14
- package/src/components/style-sections/layout-section/wrap-field.tsx +13 -17
- package/src/components/style-sections/position-section/dimensions-field.tsx +39 -21
- package/src/components/style-sections/position-section/offset-field.tsx +5 -2
- package/src/components/style-sections/size-section/size-section.tsx +51 -36
- package/src/components/style-sections/spacing-section/spacing-section.tsx +1 -1
- package/src/components/style-sections/typography-section/column-gap-field.tsx +5 -2
- package/src/components/style-sections/typography-section/font-size-field.tsx +5 -2
- package/src/components/style-sections/typography-section/letter-spacing-field.tsx +5 -2
- package/src/components/style-sections/typography-section/line-height-field.tsx +5 -2
- package/src/components/style-sections/typography-section/text-alignment-field.tsx +12 -9
- package/src/components/style-sections/typography-section/word-spacing-field.tsx +5 -2
- package/src/dynamics/components/background-control-dynamic-tag.tsx +48 -0
- package/src/dynamics/init.ts +21 -0
- package/src/styles-inheritance/components/ui-providers.tsx +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-editing-panel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@elementor/editor": "0.19.4",
|
|
43
|
-
"@elementor/editor-canvas": "0.
|
|
44
|
-
"@elementor/editor-controls": "0.
|
|
43
|
+
"@elementor/editor-canvas": "0.23.0",
|
|
44
|
+
"@elementor/editor-controls": "1.0.0",
|
|
45
45
|
"@elementor/editor-current-user": "0.5.0",
|
|
46
46
|
"@elementor/editor-documents": "0.13.6",
|
|
47
|
-
"@elementor/editor-elements": "0.8.
|
|
47
|
+
"@elementor/editor-elements": "0.8.5",
|
|
48
48
|
"@elementor/editor-panels": "0.15.4",
|
|
49
|
-
"@elementor/editor-props": "0.
|
|
49
|
+
"@elementor/editor-props": "0.13.0",
|
|
50
50
|
"@elementor/editor-responsive": "0.13.5",
|
|
51
|
-
"@elementor/editor-styles": "0.6.
|
|
52
|
-
"@elementor/editor-styles-repository": "0.10.
|
|
51
|
+
"@elementor/editor-styles": "0.6.9",
|
|
52
|
+
"@elementor/editor-styles-repository": "0.10.2",
|
|
53
53
|
"@elementor/editor-ui": "0.11.0",
|
|
54
54
|
"@elementor/editor-v1-adapters": "0.12.0",
|
|
55
55
|
"@elementor/icons": "1.44.0",
|
|
@@ -13,6 +13,7 @@ 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 { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
16
17
|
|
|
17
18
|
const StartStartIcon = withDirection( RadiusTopLeftIcon );
|
|
18
19
|
const StartEndIcon = withDirection( RadiusTopRightIcon );
|
|
@@ -55,14 +56,16 @@ export const BorderRadiusField = () => {
|
|
|
55
56
|
const { isSiteRtl } = useDirection();
|
|
56
57
|
|
|
57
58
|
return (
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
<UiProviders>
|
|
60
|
+
<StylesField bind={ 'border-radius' }>
|
|
61
|
+
<EqualUnequalSizesControl
|
|
62
|
+
items={ getCorners( isSiteRtl ) }
|
|
63
|
+
label={ __( 'Border radius', 'elementor' ) }
|
|
64
|
+
icon={ <BorderCornersIcon fontSize={ 'tiny' } /> }
|
|
65
|
+
tooltipLabel={ __( 'Adjust corners', 'elementor' ) }
|
|
66
|
+
multiSizePropTypeUtil={ borderRadiusPropTypeUtil }
|
|
67
|
+
/>
|
|
68
|
+
</StylesField>
|
|
69
|
+
</UiProviders>
|
|
67
70
|
);
|
|
68
71
|
};
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
JustifySpaceBetweenVerticalIcon as BetweenIcon,
|
|
9
9
|
JustifyTopIcon,
|
|
10
10
|
} from '@elementor/icons';
|
|
11
|
-
import {
|
|
11
|
+
import { Stack, withDirection } from '@elementor/ui';
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
|
|
14
14
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
15
|
-
import {
|
|
15
|
+
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
16
16
|
import { ControlLabel } from '../../control-label';
|
|
17
17
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
18
18
|
|
|
@@ -67,18 +67,14 @@ const options: ToggleButtonGroupItem< AlignContent >[] = [
|
|
|
67
67
|
];
|
|
68
68
|
|
|
69
69
|
export const AlignContentField = () => {
|
|
70
|
-
const { isSiteRtl } = useDirection();
|
|
71
|
-
|
|
72
70
|
return (
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</ThemeProvider>
|
|
82
|
-
</DirectionProvider>
|
|
71
|
+
<UiProviders>
|
|
72
|
+
<StylesField bind="align-content">
|
|
73
|
+
<Stack gap={ 1 }>
|
|
74
|
+
<ControlLabel>{ __( 'Align content', 'elementor' ) }</ControlLabel>
|
|
75
|
+
<ToggleControl options={ options } fullWidth={ true } />
|
|
76
|
+
</Stack>
|
|
77
|
+
</StylesField>
|
|
78
|
+
</UiProviders>
|
|
83
79
|
);
|
|
84
80
|
};
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
LayoutAlignRightIcon,
|
|
7
7
|
LayoutDistributeVerticalIcon as JustifyIcon,
|
|
8
8
|
} from '@elementor/icons';
|
|
9
|
-
import {
|
|
9
|
+
import { Grid, withDirection } from '@elementor/ui';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
|
|
12
12
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
13
|
-
import {
|
|
13
|
+
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
14
14
|
import { ControlLabel } from '../../control-label';
|
|
15
15
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
16
16
|
|
|
@@ -52,22 +52,18 @@ const options: ToggleButtonGroupItem< AlignItems >[] = [
|
|
|
52
52
|
];
|
|
53
53
|
|
|
54
54
|
export const AlignItemsField = () => {
|
|
55
|
-
const { isSiteRtl } = useDirection();
|
|
56
|
-
|
|
57
55
|
return (
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
<Grid
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
<ToggleControl options={ options } />
|
|
67
|
-
</Grid>
|
|
56
|
+
<UiProviders>
|
|
57
|
+
<StylesField bind="align-items">
|
|
58
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
59
|
+
<Grid item xs={ 6 }>
|
|
60
|
+
<ControlLabel>{ __( 'Align items', 'elementor' ) }</ControlLabel>
|
|
61
|
+
</Grid>
|
|
62
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
63
|
+
<ToggleControl options={ options } />
|
|
68
64
|
</Grid>
|
|
69
|
-
</
|
|
70
|
-
</
|
|
71
|
-
</
|
|
65
|
+
</Grid>
|
|
66
|
+
</StylesField>
|
|
67
|
+
</UiProviders>
|
|
72
68
|
);
|
|
73
69
|
};
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
LayoutAlignRightIcon,
|
|
7
7
|
LayoutDistributeVerticalIcon as JustifyIcon,
|
|
8
8
|
} from '@elementor/icons';
|
|
9
|
-
import {
|
|
9
|
+
import { Grid, type ToggleButtonProps, withDirection } from '@elementor/ui';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
|
|
12
12
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
13
|
-
import {
|
|
13
|
+
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
14
14
|
import { ControlLabel } from '../../control-label';
|
|
15
15
|
import { type FlexDirection } from './flex-direction-field';
|
|
16
16
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
@@ -85,22 +85,18 @@ const getOptions = ( parentStyleDirection: FlexDirection ) => [
|
|
|
85
85
|
];
|
|
86
86
|
|
|
87
87
|
export const AlignSelfChild = ( { parentStyleDirection }: { parentStyleDirection: FlexDirection } ) => {
|
|
88
|
-
const { isSiteRtl } = useDirection();
|
|
89
|
-
|
|
90
88
|
return (
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
<
|
|
94
|
-
<Grid
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
<ToggleControl options={ getOptions( parentStyleDirection as FlexDirection ) } />
|
|
100
|
-
</Grid>
|
|
89
|
+
<UiProviders>
|
|
90
|
+
<StylesField bind={ 'align-self' }>
|
|
91
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
92
|
+
<Grid item xs={ 6 }>
|
|
93
|
+
<ControlLabel>{ __( 'Align self', 'elementor' ) }</ControlLabel>
|
|
94
|
+
</Grid>
|
|
95
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'flex-end' } }>
|
|
96
|
+
<ToggleControl options={ getOptions( parentStyleDirection as FlexDirection ) } />
|
|
101
97
|
</Grid>
|
|
102
|
-
</
|
|
103
|
-
</
|
|
104
|
-
</
|
|
98
|
+
</Grid>
|
|
99
|
+
</StylesField>
|
|
100
|
+
</UiProviders>
|
|
105
101
|
);
|
|
106
102
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from '@elementor/icons';
|
|
4
|
-
import {
|
|
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 { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
9
9
|
import { ControlLabel } from '../../control-label';
|
|
10
10
|
|
|
11
11
|
export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
@@ -44,22 +44,18 @@ const options: ToggleButtonGroupItem< FlexDirection >[] = [
|
|
|
44
44
|
];
|
|
45
45
|
|
|
46
46
|
export const FlexDirectionField = () => {
|
|
47
|
-
const { isSiteRtl } = useDirection();
|
|
48
|
-
|
|
49
47
|
return (
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
<Grid
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
<ToggleControl options={ options } />
|
|
59
|
-
</Grid>
|
|
48
|
+
<UiProviders>
|
|
49
|
+
<StylesField bind="flex-direction">
|
|
50
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
51
|
+
<Grid item xs={ 6 }>
|
|
52
|
+
<ControlLabel>{ __( 'Direction', 'elementor' ) }</ControlLabel>
|
|
53
|
+
</Grid>
|
|
54
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
55
|
+
<ToggleControl options={ options } />
|
|
60
56
|
</Grid>
|
|
61
|
-
</
|
|
62
|
-
</
|
|
63
|
-
</
|
|
57
|
+
</Grid>
|
|
58
|
+
</StylesField>
|
|
59
|
+
</UiProviders>
|
|
64
60
|
);
|
|
65
61
|
};
|
|
@@ -3,13 +3,13 @@ import { useState } from 'react';
|
|
|
3
3
|
import { ControlToggleButtonGroup, NumberControl, type ToggleButtonGroupItem } from '@elementor/editor-controls';
|
|
4
4
|
import { type NumberPropValue } from '@elementor/editor-props';
|
|
5
5
|
import { ArrowDownSmallIcon, ArrowUpSmallIcon, PencilIcon } from '@elementor/icons';
|
|
6
|
-
import {
|
|
6
|
+
import { Grid } from '@elementor/ui';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
|
|
9
9
|
import { useStyle } from '../../../contexts/style-context';
|
|
10
10
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
11
|
-
import { useDirection } from '../../../hooks/use-direction';
|
|
12
11
|
import { useStylesField } from '../../../hooks/use-styles-field';
|
|
12
|
+
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
13
13
|
import { ControlLabel } from '../../control-label';
|
|
14
14
|
import { SectionContent } from '../../section-content';
|
|
15
15
|
|
|
@@ -48,7 +48,6 @@ const items: ToggleButtonGroupItem< GroupControlItemOption >[] = [
|
|
|
48
48
|
];
|
|
49
49
|
|
|
50
50
|
export const FlexOrderField = () => {
|
|
51
|
-
const { isSiteRtl } = useDirection();
|
|
52
51
|
const [ order, setOrder ] = useStylesField< NumberPropValue | null >( 'order' );
|
|
53
52
|
const { canEdit } = useStyle();
|
|
54
53
|
|
|
@@ -67,43 +66,41 @@ export const FlexOrderField = () => {
|
|
|
67
66
|
};
|
|
68
67
|
|
|
69
68
|
return (
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
<
|
|
69
|
+
<UiProviders>
|
|
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
|
+
disabled={ ! canEdit }
|
|
83
|
+
/>
|
|
84
|
+
</Grid>
|
|
85
|
+
</Grid>
|
|
86
|
+
|
|
87
|
+
{ CUSTOM === groupControlValue && (
|
|
74
88
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
75
89
|
<Grid item xs={ 6 }>
|
|
76
|
-
<ControlLabel>{ __( '
|
|
90
|
+
<ControlLabel>{ __( 'Custom order', 'elementor' ) }</ControlLabel>
|
|
77
91
|
</Grid>
|
|
78
92
|
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
exclusive={ true }
|
|
84
|
-
disabled={ ! canEdit }
|
|
93
|
+
<NumberControl
|
|
94
|
+
min={ FIRST_DEFAULT_VALUE + 1 }
|
|
95
|
+
max={ LAST_DEFAULT_VALUE - 1 }
|
|
96
|
+
shouldForceInt={ true }
|
|
85
97
|
/>
|
|
86
98
|
</Grid>
|
|
87
99
|
</Grid>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<ControlLabel>{ __( 'Custom order', 'elementor' ) }</ControlLabel>
|
|
93
|
-
</Grid>
|
|
94
|
-
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
95
|
-
<NumberControl
|
|
96
|
-
min={ FIRST_DEFAULT_VALUE + 1 }
|
|
97
|
-
max={ LAST_DEFAULT_VALUE - 1 }
|
|
98
|
-
shouldForceInt={ true }
|
|
99
|
-
/>
|
|
100
|
-
</Grid>
|
|
101
|
-
</Grid>
|
|
102
|
-
) }
|
|
103
|
-
</SectionContent>
|
|
104
|
-
</StylesField>
|
|
105
|
-
</ThemeProvider>
|
|
106
|
-
</DirectionProvider>
|
|
100
|
+
) }
|
|
101
|
+
</SectionContent>
|
|
102
|
+
</StylesField>
|
|
103
|
+
</UiProviders>
|
|
107
104
|
);
|
|
108
105
|
};
|
|
109
106
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useMemo, useState } from 'react';
|
|
2
|
+
import { type MutableRefObject, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
ControlToggleButtonGroup,
|
|
5
5
|
NumberControl,
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
} from '@elementor/editor-controls';
|
|
9
9
|
import { numberPropTypeUtil, type NumberPropValue, type SizePropValue } from '@elementor/editor-props';
|
|
10
10
|
import { ExpandIcon, PencilIcon, ShrinkIcon } from '@elementor/icons';
|
|
11
|
-
import {
|
|
11
|
+
import { Grid } from '@elementor/ui';
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
|
|
14
14
|
import { useStyle } from '../../../contexts/style-context';
|
|
15
15
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
16
|
-
import { useDirection } from '../../../hooks/use-direction';
|
|
17
16
|
import { useStylesFields } from '../../../hooks/use-styles-fields';
|
|
17
|
+
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
18
18
|
import { ControlLabel } from '../../control-label';
|
|
19
19
|
import { SectionContent } from '../../section-content';
|
|
20
20
|
|
|
@@ -44,7 +44,6 @@ const items: ToggleButtonGroupItem< GroupItem >[] = [
|
|
|
44
44
|
];
|
|
45
45
|
|
|
46
46
|
export const FlexSizeField = () => {
|
|
47
|
-
const { isSiteRtl } = useDirection();
|
|
48
47
|
const { canEdit } = useStyle();
|
|
49
48
|
|
|
50
49
|
const [ fields, setFields ] = useStylesFields< {
|
|
@@ -91,67 +90,69 @@ export const FlexSizeField = () => {
|
|
|
91
90
|
};
|
|
92
91
|
|
|
93
92
|
return (
|
|
94
|
-
<
|
|
95
|
-
<
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
<
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</ThemeProvider>
|
|
117
|
-
</DirectionProvider>
|
|
93
|
+
<UiProviders>
|
|
94
|
+
<SectionContent>
|
|
95
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
96
|
+
<StylesField bind={ activeGroup ?? '' }>
|
|
97
|
+
<Grid item xs={ 6 }>
|
|
98
|
+
<ControlLabel>{ __( 'Size', 'elementor' ) }</ControlLabel>
|
|
99
|
+
</Grid>
|
|
100
|
+
|
|
101
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
102
|
+
<ControlToggleButtonGroup
|
|
103
|
+
value={ activeGroup }
|
|
104
|
+
onChange={ onChangeGroup }
|
|
105
|
+
disabled={ ! canEdit }
|
|
106
|
+
items={ items }
|
|
107
|
+
exclusive={ true }
|
|
108
|
+
/>
|
|
109
|
+
</Grid>
|
|
110
|
+
</StylesField>
|
|
111
|
+
</Grid>
|
|
112
|
+
{ 'custom' === activeGroup && <FlexCustomField /> }
|
|
113
|
+
</SectionContent>
|
|
114
|
+
</UiProviders>
|
|
118
115
|
);
|
|
119
116
|
};
|
|
120
117
|
|
|
121
|
-
const FlexCustomField = () =>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
135
|
-
<Grid item xs={ 6 }>
|
|
136
|
-
<ControlLabel>{ __( 'Shrink', 'elementor' ) }</ControlLabel>
|
|
137
|
-
</Grid>
|
|
138
|
-
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
139
|
-
<NumberControl min={ 0 } shouldForceInt={ true } />
|
|
118
|
+
const FlexCustomField = () => {
|
|
119
|
+
const flexBasisRowRef: MutableRefObject< HTMLElement | undefined > = useRef();
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<>
|
|
123
|
+
<StylesField bind={ 'flex-grow' }>
|
|
124
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
125
|
+
<Grid item xs={ 6 }>
|
|
126
|
+
<ControlLabel>{ __( 'Grow', 'elementor' ) }</ControlLabel>
|
|
127
|
+
</Grid>
|
|
128
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
129
|
+
<NumberControl min={ 0 } shouldForceInt={ true } />
|
|
130
|
+
</Grid>
|
|
140
131
|
</Grid>
|
|
141
|
-
</
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
132
|
+
</StylesField>
|
|
133
|
+
<StylesField bind={ 'flex-shrink' }>
|
|
134
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
135
|
+
<Grid item xs={ 6 }>
|
|
136
|
+
<ControlLabel>{ __( 'Shrink', 'elementor' ) }</ControlLabel>
|
|
137
|
+
</Grid>
|
|
138
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
139
|
+
<NumberControl min={ 0 } shouldForceInt={ true } />
|
|
140
|
+
</Grid>
|
|
147
141
|
</Grid>
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
</StylesField>
|
|
143
|
+
<StylesField bind={ 'flex-basis' }>
|
|
144
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap" ref={ flexBasisRowRef }>
|
|
145
|
+
<Grid item xs={ 6 }>
|
|
146
|
+
<ControlLabel>{ __( 'Basis', 'elementor' ) }</ControlLabel>
|
|
147
|
+
</Grid>
|
|
148
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
149
|
+
<SizeControl extendedOptions={ [ 'auto' ] } anchorRef={ flexBasisRowRef } />
|
|
150
|
+
</Grid>
|
|
150
151
|
</Grid>
|
|
151
|
-
</
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
</StylesField>
|
|
153
|
+
</>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
155
156
|
|
|
156
157
|
const getActiveGroup = ( {
|
|
157
158
|
grow,
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
JustifySpaceBetweenVerticalIcon as BetweenIcon,
|
|
9
9
|
JustifyTopIcon,
|
|
10
10
|
} from '@elementor/icons';
|
|
11
|
-
import {
|
|
11
|
+
import { Stack, withDirection } from '@elementor/ui';
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
|
|
14
14
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
15
|
-
import {
|
|
15
|
+
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
16
16
|
import { ControlLabel } from '../../control-label';
|
|
17
17
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
18
18
|
|
|
@@ -66,18 +66,14 @@ const options: ToggleButtonGroupItem< JustifyContent >[] = [
|
|
|
66
66
|
];
|
|
67
67
|
|
|
68
68
|
export const JustifyContentField = () => {
|
|
69
|
-
const { isSiteRtl } = useDirection();
|
|
70
|
-
|
|
71
69
|
return (
|
|
72
|
-
<
|
|
73
|
-
<
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</ThemeProvider>
|
|
81
|
-
</DirectionProvider>
|
|
70
|
+
<UiProviders>
|
|
71
|
+
<StylesField bind="justify-content">
|
|
72
|
+
<Stack gap={ 0.75 }>
|
|
73
|
+
<ControlLabel>{ __( 'Justify content', 'elementor' ) }</ControlLabel>
|
|
74
|
+
<ToggleControl options={ options } fullWidth={ true } />
|
|
75
|
+
</Stack>
|
|
76
|
+
</StylesField>
|
|
77
|
+
</UiProviders>
|
|
82
78
|
);
|
|
83
79
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon } from '@elementor/icons';
|
|
4
|
-
import {
|
|
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 {
|
|
8
|
+
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
9
9
|
import { ControlLabel } from '../../control-label';
|
|
10
10
|
|
|
11
11
|
type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
@@ -32,22 +32,18 @@ const options: ToggleButtonGroupItem< FlexWrap >[] = [
|
|
|
32
32
|
];
|
|
33
33
|
|
|
34
34
|
export const WrapField = () => {
|
|
35
|
-
const { isSiteRtl } = useDirection();
|
|
36
|
-
|
|
37
35
|
return (
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
<Grid
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
<ToggleControl options={ options } />
|
|
47
|
-
</Grid>
|
|
36
|
+
<UiProviders>
|
|
37
|
+
<StylesField bind={ 'flex-wrap' }>
|
|
38
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
39
|
+
<Grid item xs={ 6 }>
|
|
40
|
+
<ControlLabel>{ __( 'Wrap', 'elementor' ) }</ControlLabel>
|
|
41
|
+
</Grid>
|
|
42
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'flex-end' } }>
|
|
43
|
+
<ToggleControl options={ options } />
|
|
48
44
|
</Grid>
|
|
49
|
-
</
|
|
50
|
-
</
|
|
51
|
-
</
|
|
45
|
+
</Grid>
|
|
46
|
+
</StylesField>
|
|
47
|
+
</UiProviders>
|
|
52
48
|
);
|
|
53
49
|
};
|