@elementor/editor-controls 0.20.0 → 0.21.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 +12 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +294 -260
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +225 -191
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/control-form-label.tsx +6 -0
- package/src/components/control-label.tsx +12 -3
- package/src/components/repeater.tsx +9 -2
- package/src/controls/background-control/background-control.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +2 -2
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +18 -4
- package/src/controls/color-control.tsx +1 -1
- package/src/controls/equal-unequal-sizes-control.tsx +2 -1
- package/src/controls/gap-control.tsx +3 -2
- package/src/controls/image-control.tsx +3 -3
- package/src/controls/link-control.tsx +4 -4
- package/src/controls/linked-dimensions-control.tsx +7 -6
- package/src/controls/stroke-control.tsx +2 -2
- package/src/controls/svg-media-control.tsx +2 -2
- package/src/index.ts +2 -1
- package/src/control-adornments/control-label-with-adornments.tsx +0 -15
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-controls",
|
|
3
3
|
"description": "This package contains the controls model and utils for the Elementor editor",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.21.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@elementor/editor-current-user": "0.3.0",
|
|
44
44
|
"@elementor/editor-elements": "0.7.0",
|
|
45
45
|
"@elementor/editor-props": "0.11.1",
|
|
46
|
-
"@elementor/editor-ui": "0.5.
|
|
46
|
+
"@elementor/editor-ui": "0.5.1",
|
|
47
47
|
"@elementor/env": "0.3.5",
|
|
48
48
|
"@elementor/http": "0.1.4",
|
|
49
49
|
"@elementor/icons": "1.37.0",
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type PropsWithChildren } from 'react';
|
|
3
|
+
import { Stack } from '@elementor/ui';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import { ControlAdornments } from '../control-adornments/control-adornments';
|
|
6
|
+
import { ControlFormLabel } from './control-form-label';
|
|
7
|
+
|
|
8
|
+
export const ControlLabel = ( { children }: PropsWithChildren< object > ) => {
|
|
9
|
+
return (
|
|
10
|
+
<Stack direction="row" alignItems="center" justifyItems="start" gap={ 1 }>
|
|
11
|
+
<ControlFormLabel>{ children }</ControlFormLabel>
|
|
12
|
+
<ControlAdornments />
|
|
13
|
+
</Stack>
|
|
14
|
+
);
|
|
6
15
|
};
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from '@elementor/ui';
|
|
18
18
|
import { __ } from '@wordpress/i18n';
|
|
19
19
|
|
|
20
|
+
import { ControlAdornments } from '../control-adornments/control-adornments';
|
|
20
21
|
import { useSyncExternalState } from '../hooks/use-sync-external-state';
|
|
21
22
|
import { SectionContent } from './section-content';
|
|
22
23
|
import { SortableItem, SortableProvider } from './sortable';
|
|
@@ -139,11 +140,17 @@ export const Repeater = < T, >( {
|
|
|
139
140
|
|
|
140
141
|
return (
|
|
141
142
|
<SectionContent>
|
|
142
|
-
<Stack direction="row" justifyContent="
|
|
143
|
+
<Stack direction="row" justifyContent="start" alignItems="center" gap={ 1 }>
|
|
143
144
|
<Typography component="label" variant="caption" color="text.secondary">
|
|
144
145
|
{ label }
|
|
145
146
|
</Typography>
|
|
146
|
-
<
|
|
147
|
+
<ControlAdornments />
|
|
148
|
+
<IconButton
|
|
149
|
+
sx={ { ml: 'auto' } }
|
|
150
|
+
size={ SIZE }
|
|
151
|
+
onClick={ addRepeaterItem }
|
|
152
|
+
aria-label={ __( 'Add item', 'elementor' ) }
|
|
153
|
+
>
|
|
147
154
|
<PlusIcon fontSize={ SIZE } />
|
|
148
155
|
</IconButton>
|
|
149
156
|
</Stack>
|
|
@@ -4,7 +4,7 @@ import { Grid } from '@elementor/ui';
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../../bound-prop-context';
|
|
7
|
-
import {
|
|
7
|
+
import { ControlFormLabel } from '../../components/control-form-label';
|
|
8
8
|
import { SectionContent } from '../../components/section-content';
|
|
9
9
|
import { createControl } from '../../create-control';
|
|
10
10
|
import { ColorControl } from '../color-control';
|
|
@@ -22,7 +22,7 @@ export const BackgroundControl = createControl( () => {
|
|
|
22
22
|
<PropKeyProvider bind="color">
|
|
23
23
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
24
24
|
<Grid item xs={ 6 }>
|
|
25
|
-
<
|
|
25
|
+
<ControlFormLabel>{ __( 'Color', 'elementor' ) }</ControlFormLabel>
|
|
26
26
|
</Grid>
|
|
27
27
|
<Grid item xs={ 6 }>
|
|
28
28
|
<ColorControl />
|
|
@@ -3,7 +3,7 @@ import { PinIcon, PinnedOffIcon } from '@elementor/icons';
|
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { ControlFormLabel } from '../../../../components/control-form-label';
|
|
7
7
|
import { type ToggleButtonGroupItem } from '../../../../components/control-toggle-button-group';
|
|
8
8
|
import { PopoverGridContainer } from '../../../../components/popover-grid-container';
|
|
9
9
|
import { ToggleControl } from '../../../toggle-control';
|
|
@@ -29,7 +29,7 @@ export const BackgroundImageOverlayAttachment = () => {
|
|
|
29
29
|
return (
|
|
30
30
|
<PopoverGridContainer>
|
|
31
31
|
<Grid item xs={ 6 }>
|
|
32
|
-
<
|
|
32
|
+
<ControlFormLabel>{ __( 'Attachment', 'elementor' ) }</ControlFormLabel>
|
|
33
33
|
</Grid>
|
|
34
34
|
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'flex-end', overflow: 'hidden' } }>
|
|
35
35
|
<ToggleControl options={ attachmentControlOptions } />
|
|
@@ -6,7 +6,7 @@ import { Grid, Select, type SelectChangeEvent } from '@elementor/ui';
|
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
|
|
8
8
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../../../../bound-prop-context';
|
|
9
|
-
import {
|
|
9
|
+
import { ControlFormLabel } from '../../../../components/control-form-label';
|
|
10
10
|
import { PopoverGridContainer } from '../../../../components/popover-grid-container';
|
|
11
11
|
import { SizeControl } from '../../../size-control';
|
|
12
12
|
|
|
@@ -56,7 +56,7 @@ export const BackgroundImageOverlayPosition = () => {
|
|
|
56
56
|
<Grid item xs={ 12 }>
|
|
57
57
|
<PopoverGridContainer>
|
|
58
58
|
<Grid item xs={ 6 }>
|
|
59
|
-
<
|
|
59
|
+
<ControlFormLabel>{ __( 'Position', 'elementor' ) }</ControlFormLabel>
|
|
60
60
|
</Grid>
|
|
61
61
|
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'flex-end', overflow: 'hidden' } }>
|
|
62
62
|
<Select
|
|
@@ -3,7 +3,7 @@ import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon } from '@elem
|
|
|
3
3
|
import { Grid } from '@elementor/ui';
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { ControlFormLabel } from '../../../../components/control-form-label';
|
|
7
7
|
import { type ToggleButtonGroupItem } from '../../../../components/control-toggle-button-group';
|
|
8
8
|
import { PopoverGridContainer } from '../../../../components/popover-grid-container';
|
|
9
9
|
import { ToggleControl } from '../../../toggle-control';
|
|
@@ -41,7 +41,7 @@ export const BackgroundImageOverlayRepeat = () => {
|
|
|
41
41
|
return (
|
|
42
42
|
<PopoverGridContainer>
|
|
43
43
|
<Grid item xs={ 6 }>
|
|
44
|
-
<
|
|
44
|
+
<ControlFormLabel>{ __( 'Repeat', 'elementor' ) }</ControlFormLabel>
|
|
45
45
|
</Grid>
|
|
46
46
|
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'flex-end' } }>
|
|
47
47
|
<ToggleControl options={ repeatControlOptions } />
|
|
@@ -12,7 +12,7 @@ import { Grid } from '@elementor/ui';
|
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
|
|
14
14
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../../../../bound-prop-context';
|
|
15
|
-
import {
|
|
15
|
+
import { ControlFormLabel } from '../../../../components/control-form-label';
|
|
16
16
|
import {
|
|
17
17
|
ControlToggleButtonGroup,
|
|
18
18
|
type ToggleButtonGroupItem,
|
|
@@ -68,7 +68,7 @@ export const BackgroundImageOverlaySize = () => {
|
|
|
68
68
|
<Grid item xs={ 12 }>
|
|
69
69
|
<PopoverGridContainer>
|
|
70
70
|
<Grid item xs={ 6 }>
|
|
71
|
-
<
|
|
71
|
+
<ControlFormLabel>{ __( 'Size', 'elementor' ) }</ControlFormLabel>
|
|
72
72
|
</Grid>
|
|
73
73
|
<Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'flex-end' } }>
|
|
74
74
|
<ControlToggleButtonGroup
|
package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
colorPropTypeUtil,
|
|
8
8
|
type PropKey,
|
|
9
9
|
} from '@elementor/editor-props';
|
|
10
|
-
import { Box, CardMedia, Grid, Tab, TabPanel, Tabs, UnstableColorIndicator } from '@elementor/ui';
|
|
10
|
+
import { Box, CardMedia, Grid, styled, Tab, TabPanel, Tabs, type Theme, UnstableColorIndicator } from '@elementor/ui';
|
|
11
11
|
import { useWpMediaAttachment } from '@elementor/wp-media';
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
|
|
@@ -160,19 +160,29 @@ const extractColorFrom = ( prop: BackgroundOverlayItemPropValue ) => {
|
|
|
160
160
|
|
|
161
161
|
const ItemIconColor = ( { value: prop }: { value: BackgroundOverlayItemPropValue } ) => {
|
|
162
162
|
const color = extractColorFrom( prop );
|
|
163
|
-
return <
|
|
163
|
+
return <StyledUnstableColorIndicator size="inherit" component="span" value={ color } />;
|
|
164
164
|
};
|
|
165
165
|
|
|
166
166
|
const ItemIconImage = ( { value }: { value: BackgroundImageOverlay } ) => {
|
|
167
167
|
const { imageUrl } = useImage( value );
|
|
168
168
|
|
|
169
|
-
return
|
|
169
|
+
return (
|
|
170
|
+
<CardMedia
|
|
171
|
+
image={ imageUrl }
|
|
172
|
+
sx={ ( theme: Theme ) => ( {
|
|
173
|
+
height: '1em',
|
|
174
|
+
width: '1em',
|
|
175
|
+
borderRadius: `${ theme.shape.borderRadius / 2 }px`,
|
|
176
|
+
outline: `1px solid ${ theme.palette.action.disabled }`,
|
|
177
|
+
} ) }
|
|
178
|
+
/>
|
|
179
|
+
);
|
|
170
180
|
};
|
|
171
181
|
|
|
172
182
|
const ItemIconGradient = ( { value }: { value: BackgroundOverlayItemPropValue } ) => {
|
|
173
183
|
const gradient = getGradientValue( value );
|
|
174
184
|
|
|
175
|
-
return <
|
|
185
|
+
return <StyledUnstableColorIndicator size="inherit" component="span" value={ gradient } />;
|
|
176
186
|
};
|
|
177
187
|
|
|
178
188
|
const ItemLabel = ( { value }: { value: BackgroundOverlayItemPropValue } ) => {
|
|
@@ -249,6 +259,10 @@ const ImageOverlayContent = () => {
|
|
|
249
259
|
);
|
|
250
260
|
};
|
|
251
261
|
|
|
262
|
+
const StyledUnstableColorIndicator = styled( UnstableColorIndicator )( ( { theme } ) => ( {
|
|
263
|
+
borderRadius: `${ theme.shape.borderRadius / 2 }px`,
|
|
264
|
+
} ) );
|
|
265
|
+
|
|
252
266
|
const useImage = ( image: BackgroundImageOverlay ) => {
|
|
253
267
|
let imageTitle,
|
|
254
268
|
imageUrl: string | null = null;
|
|
@@ -14,7 +14,7 @@ export const ColorControl = createControl( ( { propTypeUtil = colorPropTypeUtil,
|
|
|
14
14
|
const { value, setValue } = useBoundProp( propTypeUtil );
|
|
15
15
|
|
|
16
16
|
const handleChange = ( selectedColor: string ) => {
|
|
17
|
-
setValue( selectedColor );
|
|
17
|
+
setValue( selectedColor || null );
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
return (
|
|
@@ -5,6 +5,7 @@ import { bindPopover, bindToggle, Grid, Popover, Stack, ToggleButton, Tooltip, u
|
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-context';
|
|
8
|
+
import { ControlFormLabel } from '../components/control-form-label';
|
|
8
9
|
import { ControlLabel } from '../components/control-label';
|
|
9
10
|
import { PopoverContent } from '../components/popover-content';
|
|
10
11
|
import { PopoverGridContainer } from '../components/popover-grid-container';
|
|
@@ -160,7 +161,7 @@ const MultiSizeValueControl = ( { item }: { item: Item } ) => (
|
|
|
160
161
|
<Grid item xs={ 6 }>
|
|
161
162
|
<Grid container gap={ 0.75 } alignItems="center">
|
|
162
163
|
<Grid item xs={ 12 }>
|
|
163
|
-
<
|
|
164
|
+
<ControlFormLabel>{ item.label }</ControlFormLabel>
|
|
164
165
|
</Grid>
|
|
165
166
|
<Grid item xs={ 12 }>
|
|
166
167
|
<SizeControl startIcon={ item.icon } />
|
|
@@ -5,6 +5,7 @@ import { Grid, Stack, ToggleButton, Tooltip } from '@elementor/ui';
|
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-context';
|
|
8
|
+
import { ControlFormLabel } from '../components/control-form-label';
|
|
8
9
|
import { ControlLabel } from '../components/control-label';
|
|
9
10
|
import { createControl } from '../create-control';
|
|
10
11
|
import { SizeControl } from './size-control';
|
|
@@ -61,7 +62,7 @@ export const GapControl = createControl( ( { label }: { label: string } ) => {
|
|
|
61
62
|
<Stack direction="row" gap={ 2 } flexWrap="nowrap">
|
|
62
63
|
<Grid container gap={ 0.75 } alignItems="center">
|
|
63
64
|
<Grid item xs={ 12 }>
|
|
64
|
-
<
|
|
65
|
+
<ControlFormLabel>{ __( 'Column', 'elementor' ) }</ControlFormLabel>
|
|
65
66
|
</Grid>
|
|
66
67
|
<Grid item xs={ 12 }>
|
|
67
68
|
<Control bind={ 'column' } isLinked={ isLinked } />
|
|
@@ -69,7 +70,7 @@ export const GapControl = createControl( ( { label }: { label: string } ) => {
|
|
|
69
70
|
</Grid>
|
|
70
71
|
<Grid container gap={ 0.75 } alignItems="center">
|
|
71
72
|
<Grid item xs={ 12 }>
|
|
72
|
-
<
|
|
73
|
+
<ControlFormLabel>{ __( 'Row', 'elementor' ) }</ControlFormLabel>
|
|
73
74
|
</Grid>
|
|
74
75
|
<Grid item xs={ 12 }>
|
|
75
76
|
<Control bind={ 'row' } isLinked={ isLinked } />
|
|
@@ -5,7 +5,7 @@ import { type MediaType } from '@elementor/wp-media';
|
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-context';
|
|
8
|
-
import {
|
|
8
|
+
import { ControlFormLabel } from '../components/control-form-label';
|
|
9
9
|
import { createControl } from '../create-control';
|
|
10
10
|
import { useUnfilteredFilesUpload } from '../hooks/use-unfiltered-files-upload';
|
|
11
11
|
import { ImageMediaControl } from './image-media-control';
|
|
@@ -27,13 +27,13 @@ export const ImageControl = createControl(
|
|
|
27
27
|
<PropProvider { ...propContext }>
|
|
28
28
|
<Stack gap={ 1.5 }>
|
|
29
29
|
<PropKeyProvider bind={ 'src' }>
|
|
30
|
-
<
|
|
30
|
+
<ControlFormLabel> { __( 'Image', 'elementor' ) } </ControlFormLabel>
|
|
31
31
|
<ImageMediaControl mediaTypes={ mediaTypes } />
|
|
32
32
|
</PropKeyProvider>
|
|
33
33
|
<PropKeyProvider bind={ 'size' }>
|
|
34
34
|
<Grid container gap={ 1.5 } alignItems="center" flexWrap="nowrap">
|
|
35
35
|
<Grid item xs={ 6 }>
|
|
36
|
-
<
|
|
36
|
+
<ControlFormLabel> { resolutionLabel } </ControlFormLabel>
|
|
37
37
|
</Grid>
|
|
38
38
|
<Grid item xs={ 6 } sx={ { overflow: 'hidden' } }>
|
|
39
39
|
<SelectControl options={ sizes } />
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
type FlatOption,
|
|
25
25
|
isCategorizedOptionPool,
|
|
26
26
|
} from '../components/autocomplete';
|
|
27
|
-
import {
|
|
27
|
+
import { ControlFormLabel } from '../components/control-form-label';
|
|
28
28
|
import ControlActions from '../control-actions/control-actions';
|
|
29
29
|
import { createControl } from '../create-control';
|
|
30
30
|
import { type ControlProps } from '../utils/types';
|
|
@@ -144,7 +144,7 @@ export const LinkControl = createControl( ( props: Props ) => {
|
|
|
144
144
|
alignItems: 'center',
|
|
145
145
|
} }
|
|
146
146
|
>
|
|
147
|
-
<
|
|
147
|
+
<ControlFormLabel>{ __( 'Link', 'elementor' ) }</ControlFormLabel>
|
|
148
148
|
<ToggleIconControl
|
|
149
149
|
enabled={ isEnabled }
|
|
150
150
|
onIconClick={ onEnabledChange }
|
|
@@ -159,7 +159,7 @@ export const LinkControl = createControl( ( props: Props ) => {
|
|
|
159
159
|
options={ options }
|
|
160
160
|
allowCustomValues={ allowCustomValues }
|
|
161
161
|
placeholder={ placeholder }
|
|
162
|
-
value={ value?.destination?.value }
|
|
162
|
+
value={ value?.destination?.value?.settings?.label || value?.destination?.value }
|
|
163
163
|
onOptionChange={ onOptionChange }
|
|
164
164
|
onTextChange={ onTextChange }
|
|
165
165
|
minInputLength={ minInputLength }
|
|
@@ -201,7 +201,7 @@ const SwitchControl = () => {
|
|
|
201
201
|
return (
|
|
202
202
|
<Grid container alignItems="center" flexWrap="nowrap" justifyContent="space-between">
|
|
203
203
|
<Grid item>
|
|
204
|
-
<
|
|
204
|
+
<ControlFormLabel>{ __( 'Open in a new tab', 'elementor' ) }</ControlFormLabel>
|
|
205
205
|
</Grid>
|
|
206
206
|
<Grid item>
|
|
207
207
|
<Switch checked={ value } onClick={ onClick } />
|
|
@@ -5,6 +5,7 @@ import { Grid, Stack, ToggleButton, Tooltip } from '@elementor/ui';
|
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-context';
|
|
8
|
+
import { ControlFormLabel } from '../components/control-form-label';
|
|
8
9
|
import { ControlLabel } from '../components/control-label';
|
|
9
10
|
import { createControl } from '../create-control';
|
|
10
11
|
import { type ExtendedValue, SizeControl } from './size-control';
|
|
@@ -72,7 +73,7 @@ export const LinkedDimensionsControl = createControl(
|
|
|
72
73
|
<Stack direction="row" gap={ 2 } flexWrap="nowrap">
|
|
73
74
|
<Grid container gap={ 0.75 } alignItems="center">
|
|
74
75
|
<Grid item xs={ 12 }>
|
|
75
|
-
<
|
|
76
|
+
<ControlFormLabel>{ __( 'Top', 'elementor' ) }</ControlFormLabel>
|
|
76
77
|
</Grid>
|
|
77
78
|
<Grid item xs={ 12 }>
|
|
78
79
|
<Control
|
|
@@ -85,9 +86,9 @@ export const LinkedDimensionsControl = createControl(
|
|
|
85
86
|
</Grid>
|
|
86
87
|
<Grid container gap={ 0.75 } alignItems="center">
|
|
87
88
|
<Grid item xs={ 12 }>
|
|
88
|
-
<
|
|
89
|
+
<ControlFormLabel>
|
|
89
90
|
{ isSiteRtl ? __( 'Left', 'elementor' ) : __( 'Right', 'elementor' ) }
|
|
90
|
-
</
|
|
91
|
+
</ControlFormLabel>
|
|
91
92
|
</Grid>
|
|
92
93
|
<Grid item xs={ 12 }>
|
|
93
94
|
<Control
|
|
@@ -108,7 +109,7 @@ export const LinkedDimensionsControl = createControl(
|
|
|
108
109
|
<Stack direction="row" gap={ 2 } flexWrap="nowrap">
|
|
109
110
|
<Grid container gap={ 0.75 } alignItems="center">
|
|
110
111
|
<Grid item xs={ 12 }>
|
|
111
|
-
<
|
|
112
|
+
<ControlFormLabel>{ __( 'Bottom', 'elementor' ) }</ControlFormLabel>
|
|
112
113
|
</Grid>
|
|
113
114
|
<Grid item xs={ 12 }>
|
|
114
115
|
<Control
|
|
@@ -121,9 +122,9 @@ export const LinkedDimensionsControl = createControl(
|
|
|
121
122
|
</Grid>
|
|
122
123
|
<Grid container gap={ 0.75 } alignItems="center">
|
|
123
124
|
<Grid item xs={ 12 }>
|
|
124
|
-
<
|
|
125
|
+
<ControlFormLabel>
|
|
125
126
|
{ isSiteRtl ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' ) }
|
|
126
|
-
</
|
|
127
|
+
</ControlFormLabel>
|
|
127
128
|
</Grid>
|
|
128
129
|
<Grid item xs={ 12 }>
|
|
129
130
|
<Control
|
|
@@ -4,7 +4,7 @@ import { Grid } from '@elementor/ui';
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
6
|
import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-context';
|
|
7
|
-
import {
|
|
7
|
+
import { ControlFormLabel } from '../components/control-form-label';
|
|
8
8
|
import { SectionContent } from '../components/section-content';
|
|
9
9
|
import { createControl } from '../create-control';
|
|
10
10
|
import { ColorControl } from './color-control';
|
|
@@ -39,7 +39,7 @@ const Control = ( { bind, label, children }: StrokeProps ) => (
|
|
|
39
39
|
<PropKeyProvider bind={ bind }>
|
|
40
40
|
<Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
|
|
41
41
|
<Grid item xs={ 6 }>
|
|
42
|
-
<
|
|
42
|
+
<ControlFormLabel>{ label }</ControlFormLabel>
|
|
43
43
|
</Grid>
|
|
44
44
|
<Grid item xs={ 6 }>
|
|
45
45
|
{ children }
|
|
@@ -7,7 +7,7 @@ import { type OpenOptions, useWpMediaAttachment, useWpMediaFrame } from '@elemen
|
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
|
|
9
9
|
import { useBoundProp } from '../bound-prop-context';
|
|
10
|
-
import {
|
|
10
|
+
import { ControlFormLabel } from '../components/control-form-label';
|
|
11
11
|
import { EnableUnfilteredModal } from '../components/enable-unfiltered-modal';
|
|
12
12
|
import ControlActions from '../control-actions/control-actions';
|
|
13
13
|
import { createControl } from '../create-control';
|
|
@@ -83,7 +83,7 @@ export const SvgMediaControl = createControl( () => {
|
|
|
83
83
|
return (
|
|
84
84
|
<Stack gap={ 1 }>
|
|
85
85
|
<EnableUnfilteredModal open={ unfilteredModalOpenState } onClose={ onCloseUnfilteredModal } />
|
|
86
|
-
<
|
|
86
|
+
<ControlFormLabel> { __( 'SVG', 'elementor' ) } </ControlFormLabel>
|
|
87
87
|
<ControlActions>
|
|
88
88
|
<StyledCard variant="outlined">
|
|
89
89
|
<StyledCardMediaContainer>
|
package/src/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { SvgMediaControl } from './controls/svg-media-control';
|
|
|
19
19
|
export { BackgroundControl } from './controls/background-control/background-control';
|
|
20
20
|
|
|
21
21
|
// components
|
|
22
|
-
export {
|
|
22
|
+
export { ControlFormLabel } from './components/control-form-label';
|
|
23
23
|
export { ControlToggleButtonGroup } from './components/control-toggle-button-group';
|
|
24
24
|
|
|
25
25
|
// types
|
|
@@ -39,5 +39,6 @@ export { ControlActionsProvider, useControlActions } from './control-actions/con
|
|
|
39
39
|
export { useBoundProp, PropProvider, PropKeyProvider } from './bound-prop-context';
|
|
40
40
|
export { ControlAdornmentsProvider } from './control-adornments/control-adornments-context';
|
|
41
41
|
export { ControlAdornments } from './control-adornments/control-adornments';
|
|
42
|
+
|
|
42
43
|
// hooks
|
|
43
44
|
export { useSyncExternalState } from './hooks/use-sync-external-state';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type PropsWithChildren } from 'react';
|
|
3
|
-
import { Stack } from '@elementor/ui';
|
|
4
|
-
|
|
5
|
-
import { ControlLabel } from '../components/control-label';
|
|
6
|
-
import { ControlAdornments } from './control-adornments';
|
|
7
|
-
|
|
8
|
-
export const ControlLabelWithAdornments = ( { children }: PropsWithChildren< object > ) => {
|
|
9
|
-
return (
|
|
10
|
-
<Stack direction="row" alignItems="center" justifyItems="start" gap={ 1 }>
|
|
11
|
-
<ControlLabel>{ children }</ControlLabel>
|
|
12
|
-
<ControlAdornments />
|
|
13
|
-
</Stack>
|
|
14
|
-
);
|
|
15
|
-
};
|