@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-editing-panel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor": "0.18.
|
|
43
|
-
"@elementor/editor-controls": "0.
|
|
42
|
+
"@elementor/editor": "0.18.5",
|
|
43
|
+
"@elementor/editor-controls": "0.21.0",
|
|
44
44
|
"@elementor/editor-current-user": "0.3.0",
|
|
45
45
|
"@elementor/editor-elements": "0.7.0",
|
|
46
|
-
"@elementor/editor-panels": "0.
|
|
46
|
+
"@elementor/editor-panels": "0.14.0",
|
|
47
47
|
"@elementor/editor-props": "0.11.1",
|
|
48
48
|
"@elementor/editor-responsive": "0.13.3",
|
|
49
49
|
"@elementor/editor-styles": "0.6.4",
|
|
50
50
|
"@elementor/editor-styles-repository": "0.8.1",
|
|
51
|
-
"@elementor/editor-ui": "0.5.
|
|
51
|
+
"@elementor/editor-ui": "0.5.1",
|
|
52
52
|
"@elementor/editor-v1-adapters": "0.11.0",
|
|
53
53
|
"@elementor/icons": "1.37.0",
|
|
54
54
|
"@elementor/locations": "0.7.7",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type PropsWithChildren } from 'react';
|
|
3
|
-
import { ControlLabel } from '@elementor/editor-controls';
|
|
4
3
|
import { MinusIcon, PlusIcon } from '@elementor/icons';
|
|
5
4
|
import { Collapse, IconButton, Stack } from '@elementor/ui';
|
|
6
5
|
|
|
6
|
+
import { ControlLabel } from './control-label';
|
|
7
7
|
import { SectionContent } from './section-content';
|
|
8
8
|
|
|
9
9
|
const SIZE = 'tiny';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type PropsWithChildren } from 'react';
|
|
3
|
-
import { ControlAdornments,
|
|
3
|
+
import { ControlAdornments, ControlFormLabel } from '@elementor/editor-controls';
|
|
4
4
|
import { Stack } from '@elementor/ui';
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const ControlLabel = ( { children }: PropsWithChildren< object > ) => {
|
|
7
7
|
return (
|
|
8
8
|
<Stack direction="row" alignItems="center" justifyItems="start" gap={ 1 }>
|
|
9
|
-
<
|
|
9
|
+
<ControlFormLabel>{ children }</ControlFormLabel>
|
|
10
10
|
<ControlAdornments />
|
|
11
11
|
</Stack>
|
|
12
12
|
);
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Chip,
|
|
10
10
|
type ChipOwnProps,
|
|
11
11
|
Stack,
|
|
12
|
+
type Theme,
|
|
12
13
|
Typography,
|
|
13
14
|
UnstableChipGroup,
|
|
14
15
|
usePopupState,
|
|
@@ -70,7 +71,15 @@ export function CssClassItem( {
|
|
|
70
71
|
|
|
71
72
|
return (
|
|
72
73
|
<>
|
|
73
|
-
<UnstableChipGroup
|
|
74
|
+
<UnstableChipGroup
|
|
75
|
+
ref={ setChipRef }
|
|
76
|
+
{ ...chipGroupProps }
|
|
77
|
+
aria-label={ `Edit ${ label }` }
|
|
78
|
+
role="group"
|
|
79
|
+
sx={ ( theme: Theme ) => ( {
|
|
80
|
+
'&.MuiChipGroup-root.MuiAutocomplete-tag': { margin: theme.spacing( 0.125 ) },
|
|
81
|
+
} ) }
|
|
82
|
+
>
|
|
74
83
|
<Chip
|
|
75
84
|
size={ CHIP_SIZE }
|
|
76
85
|
label={
|
|
@@ -98,12 +107,13 @@ export function CssClassItem( {
|
|
|
98
107
|
onClickActive( id );
|
|
99
108
|
} }
|
|
100
109
|
aria-pressed={ isActive }
|
|
101
|
-
sx={ {
|
|
110
|
+
sx={ ( theme: Theme ) => ( {
|
|
102
111
|
cursor: isActive && allowRename && ! isShowingState ? 'text' : 'pointer',
|
|
112
|
+
borderRadius: `${ theme.shape.borderRadius * 0.75 }px`,
|
|
103
113
|
'&.Mui-focusVisible': {
|
|
104
114
|
boxShadow: 'none !important',
|
|
105
115
|
},
|
|
106
|
-
} }
|
|
116
|
+
} ) }
|
|
107
117
|
/>
|
|
108
118
|
{ ! isEditing && (
|
|
109
119
|
<Chip
|
|
@@ -122,11 +132,12 @@ export function CssClassItem( {
|
|
|
122
132
|
color={ color }
|
|
123
133
|
{ ...bindTrigger( popupState ) }
|
|
124
134
|
aria-label={ __( 'Open CSS Class Menu', 'elementor' ) }
|
|
125
|
-
sx={ {
|
|
135
|
+
sx={ ( theme: Theme ) => ( {
|
|
136
|
+
borderRadius: `${ theme.shape.borderRadius * 0.75 }px`,
|
|
126
137
|
paddingRight: 0,
|
|
127
138
|
...( ! isShowingState ? { paddingLeft: 0 } : {} ),
|
|
128
139
|
'.MuiChip-label': isShowingState ? { paddingRight: 0 } : { padding: 0 },
|
|
129
|
-
} }
|
|
140
|
+
} ) }
|
|
130
141
|
/>
|
|
131
142
|
) }
|
|
132
143
|
</UnstableChipGroup>
|
|
@@ -26,7 +26,7 @@ const ID = 'elementor-css-class-selector';
|
|
|
26
26
|
const TAGS_LIMIT = 50;
|
|
27
27
|
|
|
28
28
|
type StyleDefOption = Option & {
|
|
29
|
-
color: '
|
|
29
|
+
color: 'accent' | 'global';
|
|
30
30
|
icon: ReactElement | null;
|
|
31
31
|
provider: string;
|
|
32
32
|
};
|
|
@@ -35,7 +35,7 @@ const EMPTY_OPTION = {
|
|
|
35
35
|
label: __( 'local', 'elementor' ),
|
|
36
36
|
value: null,
|
|
37
37
|
fixed: true,
|
|
38
|
-
color: '
|
|
38
|
+
color: 'accent',
|
|
39
39
|
icon: <MapPinIcon />,
|
|
40
40
|
provider: ELEMENTS_STYLES_PROVIDER_KEY,
|
|
41
41
|
} satisfies StyleDefOption;
|
|
@@ -145,7 +145,7 @@ function useOptions() {
|
|
|
145
145
|
label: styleDef.label,
|
|
146
146
|
value: styleDef.id,
|
|
147
147
|
fixed: isElements,
|
|
148
|
-
color: isElements ? '
|
|
148
|
+
color: isElements ? 'accent' : 'global',
|
|
149
149
|
icon: isElements ? <MapPinIcon /> : null,
|
|
150
150
|
provider: provider.key,
|
|
151
151
|
group: provider.labels?.plural,
|
|
@@ -19,7 +19,14 @@ export const EditingPanelTabs = () => {
|
|
|
19
19
|
// Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
|
|
20
20
|
<Fragment key={ element.id }>
|
|
21
21
|
<Stack direction="column" sx={ { width: '100%' } }>
|
|
22
|
-
<Tabs
|
|
22
|
+
<Tabs
|
|
23
|
+
variant="fullWidth"
|
|
24
|
+
indicatorColor="secondary"
|
|
25
|
+
textColor="inherit"
|
|
26
|
+
size="small"
|
|
27
|
+
sx={ { mt: 0.5 } }
|
|
28
|
+
{ ...getTabsProps() }
|
|
29
|
+
>
|
|
23
30
|
<Tab label={ __( 'General', 'elementor' ) } { ...getTabProps( 'settings' ) } />
|
|
24
31
|
<Tab label={ __( 'Style', 'elementor' ) } { ...getTabProps( 'style' ) } />
|
|
25
32
|
</Tabs>
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ControlActionsProvider, ControlReplacementProvider } from '@elementor/editor-controls';
|
|
3
3
|
import { useSelectedElement } from '@elementor/editor-elements';
|
|
4
4
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from '@elementor/editor-panels';
|
|
5
|
+
import { ThemeProvider } from '@elementor/editor-ui';
|
|
5
6
|
import { AtomIcon } from '@elementor/icons';
|
|
6
7
|
import { SessionStorageProvider } from '@elementor/session';
|
|
7
8
|
import { ErrorBoundary } from '@elementor/ui';
|
|
@@ -30,21 +31,23 @@ export const EditingPanel = () => {
|
|
|
30
31
|
return (
|
|
31
32
|
<ErrorBoundary fallback={ <EditorPanelErrorFallback /> }>
|
|
32
33
|
<SessionStorageProvider prefix={ 'elementor' }>
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
<ThemeProvider>
|
|
35
|
+
<Panel>
|
|
36
|
+
<PanelHeader>
|
|
37
|
+
<PanelHeaderTitle>{ panelTitle }</PanelHeaderTitle>
|
|
38
|
+
<AtomIcon fontSize="small" sx={ { color: 'text.tertiary' } } />
|
|
39
|
+
</PanelHeader>
|
|
40
|
+
<PanelBody>
|
|
41
|
+
<ControlActionsProvider items={ menuItems }>
|
|
42
|
+
<ControlReplacementProvider { ...controlReplacement }>
|
|
43
|
+
<ElementProvider element={ element } elementType={ elementType }>
|
|
44
|
+
<EditingPanelTabs />
|
|
45
|
+
</ElementProvider>
|
|
46
|
+
</ControlReplacementProvider>
|
|
47
|
+
</ControlActionsProvider>
|
|
48
|
+
</PanelBody>
|
|
49
|
+
</Panel>
|
|
50
|
+
</ThemeProvider>
|
|
48
51
|
</SessionStorageProvider>
|
|
49
52
|
</ErrorBoundary>
|
|
50
53
|
);
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
createFilterOptions,
|
|
9
9
|
styled,
|
|
10
10
|
TextField,
|
|
11
|
+
type Theme,
|
|
11
12
|
} from '@elementor/ui';
|
|
12
13
|
|
|
13
14
|
export type Option = {
|
|
@@ -63,7 +64,17 @@ export function MultiCombobox< TOption extends Option >( {
|
|
|
63
64
|
value={ selected }
|
|
64
65
|
options={ options }
|
|
65
66
|
renderGroup={ ( params ) => <Group { ...params } /> }
|
|
66
|
-
renderInput={ ( params ) =>
|
|
67
|
+
renderInput={ ( params ) => (
|
|
68
|
+
<TextField
|
|
69
|
+
{ ...params }
|
|
70
|
+
sx={ ( theme: Theme ) => ( {
|
|
71
|
+
'.MuiAutocomplete-inputRoot.MuiInputBase-adornedStart': {
|
|
72
|
+
paddingLeft: theme.spacing( 0.25 ),
|
|
73
|
+
paddingRight: theme.spacing( 0.25 ),
|
|
74
|
+
},
|
|
75
|
+
} ) }
|
|
76
|
+
/>
|
|
77
|
+
) }
|
|
67
78
|
onChange={ ( _, selectedOrInputValue, reason ) => {
|
|
68
79
|
const inputValue = selectedOrInputValue.find( ( option ) => typeof option === 'string' );
|
|
69
80
|
const optionsAndActions = selectedOrInputValue.filter( ( option ) => typeof option !== 'string' );
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ControlFormLabel } from '@elementor/editor-controls';
|
|
3
3
|
import { type Control } from '@elementor/editor-elements';
|
|
4
4
|
import { SessionStorageProvider } from '@elementor/session';
|
|
5
5
|
|
|
@@ -52,7 +52,7 @@ const Control = ( { control }: { control: Control[ 'value' ] } ) => {
|
|
|
52
52
|
return (
|
|
53
53
|
<SettingsField bind={ control.bind }>
|
|
54
54
|
<ControlTypeContainer controlType={ control.type as ControlType }>
|
|
55
|
-
{ control.label ? <
|
|
55
|
+
{ control.label ? <ControlFormLabel>{ control.label }</ControlFormLabel> : null }
|
|
56
56
|
<BaseControl type={ control.type as ControlType } props={ control.props } />
|
|
57
57
|
</ControlTypeContainer>
|
|
58
58
|
</SettingsField>
|
|
@@ -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 BorderColorField = () => {
|
|
9
10
|
return (
|
|
@@ -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 borderStyles = [
|
|
9
10
|
{ value: 'none', label: __( 'None', 'elementor' ) },
|
|
@@ -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,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 { ControlLabel } from '../../control-label';
|
|
16
17
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
17
18
|
|
|
18
19
|
type AlignContent = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
@@ -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
|
LayoutAlignCenterIcon as CenterIcon,
|
|
5
5
|
LayoutAlignLeftIcon,
|
|
@@ -11,6 +11,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
11
11
|
|
|
12
12
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
13
13
|
import { useDirection } from '../../../hooks/use-direction';
|
|
14
|
+
import { ControlLabel } from '../../control-label';
|
|
14
15
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
15
16
|
|
|
16
17
|
type AlignItems = 'start' | 'center' | 'end' | 'stretch';
|
|
@@ -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
|
LayoutAlignCenterIcon as CenterIcon,
|
|
5
5
|
LayoutAlignLeftIcon,
|
|
@@ -11,6 +11,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
11
11
|
|
|
12
12
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
13
13
|
import { useDirection } from '../../../hooks/use-direction';
|
|
14
|
+
import { ControlLabel } from '../../control-label';
|
|
14
15
|
import { RotatedIcon } from './utils/rotated-icon';
|
|
15
16
|
|
|
16
17
|
type AlignItems = 'start' | 'center' | 'end' | 'stretch';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
|
|
3
3
|
import { Stack } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
7
|
+
import { ControlLabel } from '../../control-label';
|
|
7
8
|
|
|
8
9
|
type Displays = 'block' | 'flex' | 'inline-block' | 'inline-flex';
|
|
9
10
|
|
|
@@ -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 { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from '@elementor/icons';
|
|
4
4
|
import { DirectionProvider, Grid, ThemeProvider, 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
|
|
|
10
11
|
export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
11
12
|
|
|
@@ -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,7 +1,6 @@
|
|
|
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,
|
|
@@ -9,12 +8,13 @@ import {
|
|
|
9
8
|
} from '@elementor/editor-controls';
|
|
10
9
|
import type { NumberPropValue, SizePropValue } from '@elementor/editor-props';
|
|
11
10
|
import { ExpandIcon, PencilIcon, ShrinkIcon } from '@elementor/icons';
|
|
12
|
-
import { DirectionProvider, Grid, ThemeProvider } from '@elementor/ui';
|
|
11
|
+
import { DirectionProvider, Grid, ThemeProvider, Typography } 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
16
|
import { useStylesField } from '../../../hooks/use-styles-field';
|
|
17
|
+
import { ControlLabel } from '../../control-label';
|
|
18
18
|
import { SectionContent } from '../../section-content';
|
|
19
19
|
|
|
20
20
|
type GroupItem = 'flex-grow' | 'flex-shrink' | 'custom';
|
|
@@ -81,9 +81,12 @@ export const FlexSizeField = () => {
|
|
|
81
81
|
<DirectionProvider rtl={ isSiteRtl }>
|
|
82
82
|
<ThemeProvider>
|
|
83
83
|
<SectionContent>
|
|
84
|
+
<Typography fontSize="large">{ activeGroup }</Typography>
|
|
84
85
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
85
86
|
<Grid item xs={ 6 }>
|
|
86
|
-
<
|
|
87
|
+
<StylesField bind={ activeGroup ?? '' }>
|
|
88
|
+
<ControlLabel>{ __( 'Size', 'elementor' ) }</ControlLabel>
|
|
89
|
+
</StylesField>
|
|
87
90
|
</Grid>
|
|
88
91
|
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
|
|
89
92
|
<ControlToggleButtonGroup
|
|
@@ -94,7 +97,6 @@ export const FlexSizeField = () => {
|
|
|
94
97
|
/>
|
|
95
98
|
</Grid>
|
|
96
99
|
</Grid>
|
|
97
|
-
|
|
98
100
|
{ 'custom' === activeGroup && <FlexCustomField /> }
|
|
99
101
|
</SectionContent>
|
|
100
102
|
</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 (
|