@elementor/editor-editing-panel 1.46.0 → 1.47.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 +48 -0
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +875 -753
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +787 -667
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/popover-scrollable-content.tsx +12 -0
- package/src/components/section-content.tsx +6 -16
- package/src/components/section.tsx +8 -4
- package/src/components/settings-tab.tsx +5 -2
- package/src/components/style-sections/background-section/background-section.tsx +4 -1
- package/src/components/style-sections/border-section/border-color-field.tsx +10 -16
- package/src/components/style-sections/border-section/border-radius-field.tsx +4 -2
- package/src/components/style-sections/border-section/border-style-field.tsx +11 -16
- package/src/components/style-sections/border-section/border-width-field.tsx +4 -2
- package/src/components/style-sections/effects-section/effects-section.tsx +19 -5
- package/src/components/style-sections/layout-section/align-content-field.tsx +11 -12
- package/src/components/style-sections/layout-section/align-items-field.tsx +8 -11
- package/src/components/style-sections/layout-section/align-self-child-field.tsx +11 -16
- package/src/components/style-sections/layout-section/display-field.tsx +6 -6
- package/src/components/style-sections/layout-section/flex-direction-field.tsx +11 -14
- package/src/components/style-sections/layout-section/flex-order-field.tsx +31 -34
- package/src/components/style-sections/layout-section/flex-size-field.tsx +28 -48
- package/src/components/style-sections/layout-section/gap-control-field.tsx +5 -6
- package/src/components/style-sections/layout-section/justify-content-field.tsx +11 -12
- package/src/components/style-sections/layout-section/opacity-control-field.tsx +9 -13
- package/src/components/style-sections/layout-section/wrap-field.tsx +10 -14
- package/src/components/style-sections/position-section/dimensions-field.tsx +4 -4
- package/src/components/style-sections/position-section/offset-field.tsx +12 -14
- package/src/components/style-sections/position-section/position-field.tsx +7 -11
- package/src/components/style-sections/position-section/z-index-field.tsx +7 -11
- package/src/components/style-sections/size-section/object-fit-field.tsx +7 -11
- package/src/components/style-sections/size-section/object-position-field.tsx +4 -1
- package/src/components/style-sections/size-section/overflow-field.tsx +7 -11
- package/src/components/style-sections/size-section/size-section.tsx +9 -7
- package/src/components/style-sections/spacing-section/spacing-section.tsx +7 -4
- package/src/components/style-sections/typography-section/column-count-field.tsx +7 -11
- package/src/components/style-sections/typography-section/column-gap-field.tsx +9 -13
- package/src/components/style-sections/typography-section/font-family-field.tsx +9 -11
- package/src/components/style-sections/typography-section/font-size-field.tsx +9 -13
- package/src/components/style-sections/typography-section/font-style-field.tsx +13 -13
- package/src/components/style-sections/typography-section/font-weight-field.tsx +7 -11
- package/src/components/style-sections/typography-section/letter-spacing-field.tsx +9 -13
- package/src/components/style-sections/typography-section/line-height-field.tsx +9 -13
- package/src/components/style-sections/typography-section/text-alignment-field.tsx +11 -14
- package/src/components/style-sections/typography-section/text-color-field.tsx +7 -11
- package/src/components/style-sections/typography-section/text-decoration-field.tsx +7 -11
- package/src/components/style-sections/typography-section/text-direction-field.tsx +7 -11
- package/src/components/style-sections/typography-section/text-stroke-field.tsx +4 -2
- package/src/components/style-sections/typography-section/transform-field.tsx +7 -11
- package/src/components/style-sections/typography-section/word-spacing-field.tsx +9 -13
- package/src/components/styles-field-layout.tsx +50 -0
- package/src/contexts/section-context.tsx +14 -0
- package/src/controls-registry/control-type-container.tsx +6 -2
- package/src/controls-registry/controls-registry.tsx +1 -1
- package/src/controls-registry/settings-field.tsx +65 -6
- package/src/controls-registry/styles-field.tsx +10 -2
- package/src/dynamics/components/dynamic-selection-control.tsx +10 -4
- package/src/dynamics/components/dynamic-selection.tsx +18 -14
- package/src/hooks/use-default-panel-settings.ts +4 -0
- package/src/index.ts +4 -0
- package/src/popover-action.tsx +8 -1
- package/src/styles-inheritance/components/styles-inheritance-indicator.tsx +4 -1
- package/src/styles-inheritance/components/styles-inheritance-infotip.tsx +9 -19
- package/src/sync/experiments-flags.ts +1 -0
- package/src/components/popover-content.tsx +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-editing-panel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,27 +39,27 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor": "0.20.
|
|
43
|
-
"@elementor/editor-canvas": "0.
|
|
44
|
-
"@elementor/editor-controls": "1.
|
|
42
|
+
"@elementor/editor": "0.20.1",
|
|
43
|
+
"@elementor/editor-canvas": "0.25.0",
|
|
44
|
+
"@elementor/editor-controls": "1.2.0",
|
|
45
45
|
"@elementor/editor-current-user": "0.5.0",
|
|
46
|
-
"@elementor/editor-documents": "0.13.
|
|
47
|
-
"@elementor/editor-elements": "0.8.
|
|
48
|
-
"@elementor/editor-panels": "0.16.
|
|
49
|
-
"@elementor/editor-props": "0.
|
|
50
|
-
"@elementor/editor-responsive": "0.13.
|
|
51
|
-
"@elementor/editor-styles": "0.6.
|
|
52
|
-
"@elementor/editor-styles-repository": "0.10.
|
|
53
|
-
"@elementor/editor-ui": "0.
|
|
54
|
-
"@elementor/editor-v1-adapters": "0.12.
|
|
46
|
+
"@elementor/editor-documents": "0.13.8",
|
|
47
|
+
"@elementor/editor-elements": "0.8.7",
|
|
48
|
+
"@elementor/editor-panels": "0.16.1",
|
|
49
|
+
"@elementor/editor-props": "0.15.0",
|
|
50
|
+
"@elementor/editor-responsive": "0.13.6",
|
|
51
|
+
"@elementor/editor-styles": "0.6.11",
|
|
52
|
+
"@elementor/editor-styles-repository": "0.10.4",
|
|
53
|
+
"@elementor/editor-ui": "0.13.0",
|
|
54
|
+
"@elementor/editor-v1-adapters": "0.12.1",
|
|
55
55
|
"@elementor/icons": "1.44.0",
|
|
56
56
|
"@elementor/locations": "0.8.0",
|
|
57
57
|
"@elementor/menus": "0.1.5",
|
|
58
58
|
"@elementor/schema": "0.1.2",
|
|
59
59
|
"@elementor/session": "0.1.0",
|
|
60
60
|
"@elementor/ui": "1.35.5",
|
|
61
|
-
"@elementor/utils": "0.
|
|
62
|
-
"@elementor/wp-media": "0.6.
|
|
61
|
+
"@elementor/utils": "0.5.0",
|
|
62
|
+
"@elementor/wp-media": "0.6.1",
|
|
63
63
|
"@wordpress/i18n": "^5.13.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PopoverScrollableContent as BasePopoverScrollableContent } from '@elementor/editor-ui';
|
|
3
|
+
|
|
4
|
+
import { useSectionWidth } from '../contexts/section-context';
|
|
5
|
+
|
|
6
|
+
type Props = React.ComponentProps< typeof BasePopoverScrollableContent >;
|
|
7
|
+
|
|
8
|
+
export const PopoverScrollableContent = ( props: Props ) => {
|
|
9
|
+
const sectionWidth = useSectionWidth();
|
|
10
|
+
|
|
11
|
+
return <BasePopoverScrollableContent { ...props } width={ sectionWidth } />;
|
|
12
|
+
};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Stack } from '@elementor/ui';
|
|
4
4
|
|
|
5
|
-
const SectionContentRefContext = createContext< React.RefObject< HTMLElement > | null >( null );
|
|
6
|
-
|
|
7
|
-
export const useSectionContentRef = () => useContext( SectionContentRefContext );
|
|
8
|
-
|
|
9
5
|
type SectionContentProps = PropsWithChildren< {
|
|
10
6
|
gap?: number;
|
|
11
7
|
sx?: {
|
|
@@ -13,14 +9,8 @@ type SectionContentProps = PropsWithChildren< {
|
|
|
13
9
|
};
|
|
14
10
|
} >;
|
|
15
11
|
|
|
16
|
-
export const SectionContent: FC< SectionContentProps > = ( { gap = 2, sx, children } ) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<Stack gap={ gap } sx={ { ...sx } } ref={ ref }>
|
|
22
|
-
{ children }
|
|
23
|
-
</Stack>
|
|
24
|
-
</SectionContentRefContext.Provider>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
12
|
+
export const SectionContent: FC< SectionContentProps > = ( { gap = 2, sx, children } ) => (
|
|
13
|
+
<Stack gap={ gap } sx={ { ...sx } }>
|
|
14
|
+
{ children }
|
|
15
|
+
</Stack>
|
|
16
|
+
);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type PropsWithChildren, type ReactNode, useId } from 'react';
|
|
2
|
+
import { type PropsWithChildren, type ReactNode, useId, useRef } from 'react';
|
|
3
3
|
import { isExperimentActive } from '@elementor/editor-v1-adapters';
|
|
4
4
|
import { Collapse, Divider, ListItemButton, ListItemText, Stack } from '@elementor/ui';
|
|
5
5
|
|
|
6
|
+
import { SectionRefContext } from '../contexts/section-context';
|
|
6
7
|
import { useStateByElement } from '../hooks/use-state-by-element';
|
|
7
8
|
import { EXPERIMENTAL_FEATURES } from '../sync/experiments-flags';
|
|
8
9
|
import { CollapseIcon } from './collapse-icon';
|
|
@@ -16,6 +17,7 @@ type Props = PropsWithChildren< {
|
|
|
16
17
|
|
|
17
18
|
export function Section( { title, children, defaultExpanded = false, titleEnd }: Props ) {
|
|
18
19
|
const [ isOpen, setIsOpen ] = useStateByElement( title, !! defaultExpanded );
|
|
20
|
+
const ref = useRef< HTMLElement >( null );
|
|
19
21
|
|
|
20
22
|
const handleClick = () => {
|
|
21
23
|
setIsOpen( ! isOpen );
|
|
@@ -46,9 +48,11 @@ export function Section( { title, children, defaultExpanded = false, titleEnd }:
|
|
|
46
48
|
<CollapseIcon open={ isOpen } color="secondary" fontSize="tiny" />
|
|
47
49
|
</ListItemButton>
|
|
48
50
|
<Collapse id={ contentId } aria-labelledby={ labelId } in={ isOpen } timeout="auto" unmountOnExit>
|
|
49
|
-
<
|
|
50
|
-
{
|
|
51
|
-
|
|
51
|
+
<SectionRefContext.Provider value={ ref }>
|
|
52
|
+
<Stack ref={ ref } gap={ 2.5 } p={ 2 }>
|
|
53
|
+
{ children }
|
|
54
|
+
</Stack>
|
|
55
|
+
</SectionRefContext.Provider>
|
|
52
56
|
</Collapse>
|
|
53
57
|
<Divider />
|
|
54
58
|
</>
|
|
@@ -70,12 +70,15 @@ const Control = ( { control }: { control: Control[ 'value' ] } ) => {
|
|
|
70
70
|
|
|
71
71
|
const layout = control.meta?.layout || getDefaultLayout( control.type as ControlType );
|
|
72
72
|
const controlProps = populateChildControlProps( control.props );
|
|
73
|
+
if ( layout === 'custom' ) {
|
|
74
|
+
controlProps.label = control.label;
|
|
75
|
+
}
|
|
73
76
|
|
|
74
77
|
return (
|
|
75
|
-
<SettingsField bind={ control.bind }>
|
|
78
|
+
<SettingsField bind={ control.bind } propDisplayName={ control.label || control.bind }>
|
|
76
79
|
{ control.meta?.topDivider && <Divider /> }
|
|
77
80
|
<ControlTypeContainer layout={ layout }>
|
|
78
|
-
{ control.label ? <ControlFormLabel>{ control.label }</ControlFormLabel> : null }
|
|
81
|
+
{ control.label && layout !== 'custom' ? <ControlFormLabel>{ control.label }</ControlFormLabel> : null }
|
|
79
82
|
<BaseControl type={ control.type as ControlType } props={ controlProps } />
|
|
80
83
|
</ControlTypeContainer>
|
|
81
84
|
</SettingsField>
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BackgroundControl } from '@elementor/editor-controls';
|
|
3
|
+
import { __ } from '@wordpress/i18n';
|
|
3
4
|
|
|
4
5
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
5
6
|
import { SectionContent } from '../../section-content';
|
|
6
7
|
|
|
8
|
+
const BACKGROUND_LABEL = __( 'Background', 'elementor' );
|
|
9
|
+
|
|
7
10
|
export const BackgroundSection = () => {
|
|
8
11
|
return (
|
|
9
12
|
<SectionContent>
|
|
10
|
-
<StylesField bind="background">
|
|
13
|
+
<StylesField bind="background" propDisplayName={ BACKGROUND_LABEL }>
|
|
11
14
|
<BackgroundControl />
|
|
12
15
|
</StylesField>
|
|
13
16
|
</SectionContent>
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ColorControl } from '@elementor/editor-controls';
|
|
3
|
-
import { Grid } from '@elementor/ui';
|
|
4
3
|
import { __ } from '@wordpress/i18n';
|
|
5
4
|
|
|
6
5
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
-
import {
|
|
6
|
+
import { StylesFieldLayout } from '../../styles-field-layout';
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</Grid>
|
|
19
|
-
</Grid>
|
|
20
|
-
</StylesField>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
8
|
+
const BORDER_COLOR_LABEL = __( 'Border color', 'elementor' );
|
|
9
|
+
|
|
10
|
+
export const BorderColorField = () => (
|
|
11
|
+
<StylesField bind="border-color" propDisplayName={ BORDER_COLOR_LABEL }>
|
|
12
|
+
<StylesFieldLayout label={ BORDER_COLOR_LABEL }>
|
|
13
|
+
<ColorControl />
|
|
14
|
+
</StylesFieldLayout>
|
|
15
|
+
</StylesField>
|
|
16
|
+
);
|
|
@@ -15,6 +15,8 @@ import { StylesField } from '../../../controls-registry/styles-field';
|
|
|
15
15
|
import { useDirection } from '../../../hooks/use-direction';
|
|
16
16
|
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
17
17
|
|
|
18
|
+
const BORDER_RADIUS_LABEL = __( 'Border radius', 'elementor' );
|
|
19
|
+
|
|
18
20
|
const StartStartIcon = withDirection( RadiusTopLeftIcon );
|
|
19
21
|
const StartEndIcon = withDirection( RadiusTopRightIcon );
|
|
20
22
|
const EndStartIcon = withDirection( RadiusBottomLeftIcon );
|
|
@@ -57,10 +59,10 @@ export const BorderRadiusField = () => {
|
|
|
57
59
|
|
|
58
60
|
return (
|
|
59
61
|
<UiProviders>
|
|
60
|
-
<StylesField bind={ 'border-radius' }>
|
|
62
|
+
<StylesField bind={ 'border-radius' } propDisplayName={ BORDER_RADIUS_LABEL }>
|
|
61
63
|
<EqualUnequalSizesControl
|
|
62
64
|
items={ getCorners( isSiteRtl ) }
|
|
63
|
-
label={
|
|
65
|
+
label={ BORDER_RADIUS_LABEL }
|
|
64
66
|
icon={ <BorderCornersIcon fontSize={ 'tiny' } /> }
|
|
65
67
|
tooltipLabel={ __( 'Adjust corners', 'elementor' ) }
|
|
66
68
|
multiSizePropTypeUtil={ borderRadiusPropTypeUtil }
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SelectControl } from '@elementor/editor-controls';
|
|
3
|
-
import { Grid } from '@elementor/ui';
|
|
4
3
|
import { __ } from '@wordpress/i18n';
|
|
5
4
|
|
|
6
5
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
-
import {
|
|
6
|
+
import { StylesFieldLayout } from '../../styles-field-layout';
|
|
7
|
+
|
|
8
|
+
const BORDER_TYPE_LABEL = __( 'Border type', 'elementor' );
|
|
8
9
|
|
|
9
10
|
const borderStyles = [
|
|
10
11
|
{ value: 'none', label: __( 'None', 'elementor' ) },
|
|
@@ -17,17 +18,11 @@ const borderStyles = [
|
|
|
17
18
|
{ value: 'inset', label: __( 'Inset', 'elementor' ) },
|
|
18
19
|
{ value: 'outset', label: __( 'Outset', 'elementor' ) },
|
|
19
20
|
];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<SelectControl options={ borderStyles } />
|
|
29
|
-
</Grid>
|
|
30
|
-
</Grid>
|
|
31
|
-
</StylesField>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
21
|
+
|
|
22
|
+
export const BorderStyleField = () => (
|
|
23
|
+
<StylesField bind="border-style" propDisplayName={ BORDER_TYPE_LABEL }>
|
|
24
|
+
<StylesFieldLayout label={ BORDER_TYPE_LABEL }>
|
|
25
|
+
<SelectControl options={ borderStyles } />
|
|
26
|
+
</StylesFieldLayout>
|
|
27
|
+
</StylesField>
|
|
28
|
+
);
|
|
@@ -8,6 +8,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
8
8
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
9
9
|
import { useDirection } from '../../../hooks/use-direction';
|
|
10
10
|
|
|
11
|
+
const BORDER_WIDTH_LABEL = __( 'Border width', 'elementor' );
|
|
12
|
+
|
|
11
13
|
const InlineStartIcon = withDirection( SideRightIcon );
|
|
12
14
|
const InlineEndIcon = withDirection( SideLeftIcon );
|
|
13
15
|
|
|
@@ -38,10 +40,10 @@ export const BorderWidthField = () => {
|
|
|
38
40
|
const { isSiteRtl } = useDirection();
|
|
39
41
|
|
|
40
42
|
return (
|
|
41
|
-
<StylesField bind={ 'border-width' }>
|
|
43
|
+
<StylesField bind={ 'border-width' } propDisplayName={ BORDER_WIDTH_LABEL }>
|
|
42
44
|
<EqualUnequalSizesControl
|
|
43
45
|
items={ getEdges( isSiteRtl ) }
|
|
44
|
-
label={
|
|
46
|
+
label={ BORDER_WIDTH_LABEL }
|
|
45
47
|
icon={ <SideAllIcon fontSize={ 'tiny' } /> }
|
|
46
48
|
tooltipLabel={ __( 'Adjust borders', 'elementor' ) }
|
|
47
49
|
multiSizePropTypeUtil={ borderWidthPropTypeUtil }
|
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BoxShadowRepeaterControl } from '@elementor/editor-controls';
|
|
2
|
+
import { BoxShadowRepeaterControl, FilterRepeaterControl } from '@elementor/editor-controls';
|
|
3
|
+
import { isExperimentActive } from '@elementor/editor-v1-adapters';
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
3
5
|
|
|
4
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { EXPERIMENTAL_FEATURES } from '../../../sync/experiments-flags';
|
|
5
8
|
import { PanelDivider } from '../../panel-divider';
|
|
6
9
|
import { SectionContent } from '../../section-content';
|
|
7
10
|
import { OpacityControlField } from '../layout-section/opacity-control-field';
|
|
8
11
|
|
|
12
|
+
const BOX_SHADOW_LABEL = __( 'Box shadow', 'elementor' );
|
|
13
|
+
const FILTER_LABEL = __( 'Filter', 'elementor' );
|
|
14
|
+
|
|
9
15
|
export const EffectsSection = () => {
|
|
16
|
+
const isVersion331Active = isExperimentActive( EXPERIMENTAL_FEATURES.V_3_31 );
|
|
17
|
+
|
|
10
18
|
return (
|
|
11
19
|
<SectionContent>
|
|
12
|
-
<
|
|
13
|
-
<OpacityControlField />
|
|
14
|
-
</StylesField>
|
|
20
|
+
<OpacityControlField />
|
|
15
21
|
<PanelDivider />
|
|
16
|
-
<StylesField bind="box-shadow">
|
|
22
|
+
<StylesField bind="box-shadow" propDisplayName={ BOX_SHADOW_LABEL }>
|
|
17
23
|
<BoxShadowRepeaterControl />
|
|
18
24
|
</StylesField>
|
|
25
|
+
{ isVersion331Active && (
|
|
26
|
+
<>
|
|
27
|
+
<PanelDivider />
|
|
28
|
+
<StylesField bind="filter" propDisplayName={ FILTER_LABEL }>
|
|
29
|
+
<FilterRepeaterControl />
|
|
30
|
+
</StylesField>
|
|
31
|
+
</>
|
|
32
|
+
) }
|
|
19
33
|
</SectionContent>
|
|
20
34
|
);
|
|
21
35
|
};
|
|
@@ -8,16 +8,18 @@ import {
|
|
|
8
8
|
JustifySpaceBetweenVerticalIcon as BetweenIcon,
|
|
9
9
|
JustifyTopIcon,
|
|
10
10
|
} from '@elementor/icons';
|
|
11
|
-
import {
|
|
11
|
+
import { withDirection } from '@elementor/ui';
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
|
|
14
14
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
15
15
|
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
16
|
-
import {
|
|
16
|
+
import { StylesFieldLayout } from '../../styles-field-layout';
|
|
17
17
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
18
18
|
|
|
19
19
|
type AlignContent = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
20
20
|
|
|
21
|
+
const ALIGN_CONTENT_LABEL = __( 'Align content', 'elementor' );
|
|
22
|
+
|
|
21
23
|
const StartIcon = withDirection( JustifyTopIcon );
|
|
22
24
|
const EndIcon = withDirection( JustifyBottomIcon );
|
|
23
25
|
|
|
@@ -66,15 +68,12 @@ const options: ToggleButtonGroupItem< AlignContent >[] = [
|
|
|
66
68
|
},
|
|
67
69
|
];
|
|
68
70
|
|
|
69
|
-
export const AlignContentField = () =>
|
|
70
|
-
|
|
71
|
+
export const AlignContentField = () => (
|
|
72
|
+
<StylesField bind="align-content" propDisplayName={ ALIGN_CONTENT_LABEL }>
|
|
71
73
|
<UiProviders>
|
|
72
|
-
<
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
<ToggleControl options={ options } fullWidth={ true } />
|
|
76
|
-
</Stack>
|
|
77
|
-
</StylesField>
|
|
74
|
+
<StylesFieldLayout label={ ALIGN_CONTENT_LABEL } direction="column">
|
|
75
|
+
<ToggleControl options={ options } fullWidth={ true } />
|
|
76
|
+
</StylesFieldLayout>
|
|
78
77
|
</UiProviders>
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
</StylesField>
|
|
79
|
+
);
|
|
@@ -6,16 +6,18 @@ import {
|
|
|
6
6
|
LayoutAlignRightIcon,
|
|
7
7
|
LayoutDistributeVerticalIcon as JustifyIcon,
|
|
8
8
|
} from '@elementor/icons';
|
|
9
|
-
import {
|
|
9
|
+
import { withDirection } from '@elementor/ui';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
|
|
12
12
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
13
13
|
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
14
|
-
import {
|
|
14
|
+
import { StylesFieldLayout } from '../../styles-field-layout';
|
|
15
15
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
16
16
|
|
|
17
17
|
type AlignItems = 'start' | 'center' | 'end' | 'stretch';
|
|
18
18
|
|
|
19
|
+
const ALIGN_ITEMS_LABEL = __( 'Align items', 'elementor' );
|
|
20
|
+
|
|
19
21
|
const StartIcon = withDirection( LayoutAlignLeftIcon );
|
|
20
22
|
const EndIcon = withDirection( LayoutAlignRightIcon );
|
|
21
23
|
|
|
@@ -54,15 +56,10 @@ const options: ToggleButtonGroupItem< AlignItems >[] = [
|
|
|
54
56
|
export const AlignItemsField = () => {
|
|
55
57
|
return (
|
|
56
58
|
<UiProviders>
|
|
57
|
-
<StylesField bind="align-items">
|
|
58
|
-
<
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
</Grid>
|
|
62
|
-
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
63
|
-
<ToggleControl options={ options } />
|
|
64
|
-
</Grid>
|
|
65
|
-
</Grid>
|
|
59
|
+
<StylesField bind="align-items" propDisplayName={ ALIGN_ITEMS_LABEL }>
|
|
60
|
+
<StylesFieldLayout label={ ALIGN_ITEMS_LABEL }>
|
|
61
|
+
<ToggleControl options={ options } />
|
|
62
|
+
</StylesFieldLayout>
|
|
66
63
|
</StylesField>
|
|
67
64
|
</UiProviders>
|
|
68
65
|
);
|
|
@@ -6,15 +6,17 @@ import {
|
|
|
6
6
|
LayoutAlignRightIcon,
|
|
7
7
|
LayoutDistributeVerticalIcon as JustifyIcon,
|
|
8
8
|
} from '@elementor/icons';
|
|
9
|
-
import {
|
|
9
|
+
import { type ToggleButtonProps, withDirection } from '@elementor/ui';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
|
|
12
12
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
13
13
|
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
14
|
-
import {
|
|
14
|
+
import { StylesFieldLayout } from '../../styles-field-layout';
|
|
15
15
|
import { type FlexDirection } from './flex-direction-field';
|
|
16
16
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
17
17
|
|
|
18
|
+
const ALIGN_SELF_LABEL = __( 'Align self', 'elementor' );
|
|
19
|
+
|
|
18
20
|
const ALIGN_SELF_CHILD_OFFSET_MAP: Record< FlexDirection, number > = {
|
|
19
21
|
row: 90,
|
|
20
22
|
'row-reverse': 90,
|
|
@@ -84,19 +86,12 @@ const getOptions = ( parentStyleDirection: FlexDirection ) => [
|
|
|
84
86
|
},
|
|
85
87
|
];
|
|
86
88
|
|
|
87
|
-
export const AlignSelfChild = ( { parentStyleDirection }: { parentStyleDirection: FlexDirection } ) =>
|
|
88
|
-
|
|
89
|
+
export const AlignSelfChild = ( { parentStyleDirection }: { parentStyleDirection: FlexDirection } ) => (
|
|
90
|
+
<StylesField bind="align-self" propDisplayName={ ALIGN_SELF_LABEL }>
|
|
89
91
|
<UiProviders>
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
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 ) } />
|
|
97
|
-
</Grid>
|
|
98
|
-
</Grid>
|
|
99
|
-
</StylesField>
|
|
92
|
+
<StylesFieldLayout label={ ALIGN_SELF_LABEL }>
|
|
93
|
+
<ToggleControl options={ getOptions( parentStyleDirection ) } />
|
|
94
|
+
</StylesFieldLayout>
|
|
100
95
|
</UiProviders>
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
</StylesField>
|
|
97
|
+
);
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { isExperimentActive } from '@elementor/editor-v1-adapters';
|
|
4
|
-
import { Stack } from '@elementor/ui';
|
|
5
4
|
import { __ } from '@wordpress/i18n';
|
|
6
5
|
|
|
7
6
|
import { useStylesInheritanceChain } from '../../../contexts/styles-inheritance-context';
|
|
8
7
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
9
8
|
import { EXPERIMENTAL_FEATURES } from '../../../sync/experiments-flags';
|
|
10
|
-
import {
|
|
9
|
+
import { StylesFieldLayout } from '../../styles-field-layout';
|
|
11
10
|
|
|
12
11
|
type Displays = 'block' | 'flex' | 'inline-block' | 'inline-flex' | 'none';
|
|
13
12
|
|
|
13
|
+
const DISPLAY_LABEL = __( 'Display', 'elementor' );
|
|
14
|
+
|
|
14
15
|
const displayFieldItems: ToggleButtonGroupItem< Displays >[] = [
|
|
15
16
|
{
|
|
16
17
|
value: 'block',
|
|
@@ -55,11 +56,10 @@ export const DisplayField = () => {
|
|
|
55
56
|
const placeholder = useDisplayPlaceholderValue();
|
|
56
57
|
|
|
57
58
|
return (
|
|
58
|
-
<StylesField bind="display" placeholder={ placeholder }>
|
|
59
|
-
<
|
|
60
|
-
<ControlLabel>{ __( 'Display', 'elementor' ) }</ControlLabel>
|
|
59
|
+
<StylesField bind="display" propDisplayName={ DISPLAY_LABEL } placeholder={ placeholder }>
|
|
60
|
+
<StylesFieldLayout label={ DISPLAY_LABEL } direction="column">
|
|
61
61
|
<ToggleControl options={ items } maxItems={ 4 } fullWidth={ true } />
|
|
62
|
-
</
|
|
62
|
+
</StylesFieldLayout>
|
|
63
63
|
</StylesField>
|
|
64
64
|
);
|
|
65
65
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
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 { withDirection } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
8
8
|
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
9
|
-
import {
|
|
9
|
+
import { StylesFieldLayout } from '../../styles-field-layout';
|
|
10
10
|
|
|
11
11
|
export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
12
12
|
|
|
13
|
+
const FLEX_DIRECTION_LABEL = __( 'Direction', 'elementor' );
|
|
14
|
+
|
|
13
15
|
const options: ToggleButtonGroupItem< FlexDirection >[] = [
|
|
14
16
|
{
|
|
15
17
|
value: 'row',
|
|
@@ -45,17 +47,12 @@ const options: ToggleButtonGroupItem< FlexDirection >[] = [
|
|
|
45
47
|
|
|
46
48
|
export const FlexDirectionField = () => {
|
|
47
49
|
return (
|
|
48
|
-
<
|
|
49
|
-
<
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<ToggleControl options={ options } />
|
|
56
|
-
</Grid>
|
|
57
|
-
</Grid>
|
|
58
|
-
</StylesField>
|
|
59
|
-
</UiProviders>
|
|
50
|
+
<StylesField bind="flex-direction" propDisplayName={ FLEX_DIRECTION_LABEL }>
|
|
51
|
+
<UiProviders>
|
|
52
|
+
<StylesFieldLayout label={ FLEX_DIRECTION_LABEL }>
|
|
53
|
+
<ToggleControl options={ options } />
|
|
54
|
+
</StylesFieldLayout>
|
|
55
|
+
</UiProviders>
|
|
56
|
+
</StylesField>
|
|
60
57
|
);
|
|
61
58
|
};
|
|
@@ -11,9 +11,12 @@ import { useStylesField } from '../../../hooks/use-styles-field';
|
|
|
11
11
|
import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
|
|
12
12
|
import { ControlLabel } from '../../control-label';
|
|
13
13
|
import { SectionContent } from '../../section-content';
|
|
14
|
+
import { StylesFieldLayout } from '../../styles-field-layout';
|
|
14
15
|
|
|
15
16
|
type GroupControlItemOption = 'first' | 'last' | 'custom';
|
|
16
17
|
|
|
18
|
+
const ORDER_LABEL = __( 'Order', 'elementor' );
|
|
19
|
+
|
|
17
20
|
export const FIRST_DEFAULT_VALUE = -99999;
|
|
18
21
|
export const LAST_DEFAULT_VALUE = 99999;
|
|
19
22
|
const FIRST = 'first';
|
|
@@ -64,41 +67,35 @@ export const FlexOrderField = () => {
|
|
|
64
67
|
};
|
|
65
68
|
|
|
66
69
|
return (
|
|
67
|
-
<
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
91
|
-
<NumberControl
|
|
92
|
-
min={ FIRST_DEFAULT_VALUE + 1 }
|
|
93
|
-
max={ LAST_DEFAULT_VALUE - 1 }
|
|
94
|
-
shouldForceInt={ true }
|
|
95
|
-
/>
|
|
70
|
+
<StylesField bind="order" propDisplayName={ ORDER_LABEL }>
|
|
71
|
+
<UiProviders>
|
|
72
|
+
<StylesFieldLayout label={ ORDER_LABEL }>
|
|
73
|
+
<SectionContent>
|
|
74
|
+
<ControlToggleButtonGroup
|
|
75
|
+
items={ items }
|
|
76
|
+
value={ groupControlValue }
|
|
77
|
+
onChange={ handleToggleButtonChange }
|
|
78
|
+
exclusive={ true }
|
|
79
|
+
disabled={ ! canEdit }
|
|
80
|
+
/>
|
|
81
|
+
{ CUSTOM === groupControlValue && (
|
|
82
|
+
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
83
|
+
<Grid item xs={ 6 }>
|
|
84
|
+
<ControlLabel>{ __( 'Custom order', 'elementor' ) }</ControlLabel>
|
|
85
|
+
</Grid>
|
|
86
|
+
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
87
|
+
<NumberControl
|
|
88
|
+
min={ FIRST_DEFAULT_VALUE + 1 }
|
|
89
|
+
max={ LAST_DEFAULT_VALUE - 1 }
|
|
90
|
+
shouldForceInt={ true }
|
|
91
|
+
/>
|
|
92
|
+
</Grid>
|
|
96
93
|
</Grid>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
</
|
|
100
|
-
</
|
|
101
|
-
</
|
|
94
|
+
) }
|
|
95
|
+
</SectionContent>
|
|
96
|
+
</StylesFieldLayout>
|
|
97
|
+
</UiProviders>
|
|
98
|
+
</StylesField>
|
|
102
99
|
);
|
|
103
100
|
};
|
|
104
101
|
|