@elementor/editor-editing-panel 1.23.0 → 1.27.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 +84 -0
- package/dist/index.js +603 -455
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +568 -425
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -9
- 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 +18 -7
- package/src/components/css-classes/css-class-menu.tsx +55 -9
- package/src/components/css-classes/css-class-selector.tsx +9 -8
- package/src/components/editing-panel-tabs.tsx +1 -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-indicator.tsx +23 -0
- package/src/components/style-sections/border-section/border-color-field.tsx +2 -1
- package/src/components/style-sections/border-section/border-radius-field.tsx +4 -5
- package/src/components/style-sections/border-section/border-style-field.tsx +2 -1
- package/src/components/style-sections/border-section/border-width-field.tsx +2 -3
- 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 +31 -19
- 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 +7 -7
- 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/contexts/style-context.tsx +1 -1
- package/src/controls-registry/control-type-container.tsx +2 -2
- package/src/dynamics/components/dynamic-selection-control.tsx +2 -2
- package/src/dynamics/components/dynamic-selection.tsx +4 -4
- package/src/dynamics/dynamic-transformer.ts +61 -0
- package/src/dynamics/errors.ts +6 -0
- package/src/dynamics/init.ts +6 -0
- package/src/dynamics/types.ts +17 -0
- package/src/styles-inheritance/create-snapshots-manager.ts +8 -8
- package/src/styles-inheritance/create-styles-inheritance.ts +8 -4
- package/src/styles-inheritance/styles-inheritance-indicator.tsx +17 -34
- package/src/styles-inheritance/types.ts +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.27.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -39,16 +39,17 @@
|
|
|
39
39
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@elementor/editor": "0.18.
|
|
43
|
-
"@elementor/editor-
|
|
42
|
+
"@elementor/editor": "0.18.5",
|
|
43
|
+
"@elementor/editor-canvas": "0.17.0",
|
|
44
|
+
"@elementor/editor-controls": "0.24.0",
|
|
44
45
|
"@elementor/editor-current-user": "0.3.0",
|
|
45
|
-
"@elementor/editor-elements": "0.
|
|
46
|
-
"@elementor/editor-panels": "0.
|
|
46
|
+
"@elementor/editor-elements": "0.8.0",
|
|
47
|
+
"@elementor/editor-panels": "0.14.0",
|
|
47
48
|
"@elementor/editor-props": "0.11.1",
|
|
48
|
-
"@elementor/editor-responsive": "0.13.
|
|
49
|
-
"@elementor/editor-styles": "0.6.
|
|
50
|
-
"@elementor/editor-styles-repository": "0.8.
|
|
51
|
-
"@elementor/editor-ui": "0.
|
|
49
|
+
"@elementor/editor-responsive": "0.13.4",
|
|
50
|
+
"@elementor/editor-styles": "0.6.5",
|
|
51
|
+
"@elementor/editor-styles-repository": "0.8.3",
|
|
52
|
+
"@elementor/editor-ui": "0.7.0",
|
|
52
53
|
"@elementor/editor-v1-adapters": "0.11.0",
|
|
53
54
|
"@elementor/icons": "1.37.0",
|
|
54
55
|
"@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>
|
|
@@ -143,11 +154,11 @@ export function CssClassItem( {
|
|
|
143
154
|
|
|
144
155
|
const validateLabel = ( newLabel: string ) => {
|
|
145
156
|
if ( ! stylesRepository.isLabelValid( newLabel ) ) {
|
|
146
|
-
return __( '
|
|
157
|
+
return __( 'Invalid format', 'elementor' );
|
|
147
158
|
}
|
|
148
159
|
|
|
149
160
|
if ( stylesRepository.isLabelExist( newLabel ) ) {
|
|
150
|
-
return __( '
|
|
161
|
+
return __( 'Name exists', 'elementor' );
|
|
151
162
|
}
|
|
152
163
|
|
|
153
164
|
return null;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type StyleDefinitionState } from '@elementor/editor-styles';
|
|
3
|
-
import { stylesRepository } from '@elementor/editor-styles-repository';
|
|
3
|
+
import { ELEMENTS_STYLES_PROVIDER_KEY, stylesRepository } from '@elementor/editor-styles-repository';
|
|
4
4
|
import { MenuListItem } from '@elementor/editor-ui';
|
|
5
|
-
import { bindMenu, Divider, Menu, MenuSubheader, type PopupState } from '@elementor/ui';
|
|
5
|
+
import { bindMenu, Divider, Menu, MenuSubheader, type PopupState, Stack } from '@elementor/ui';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
|
|
8
8
|
import { useStyle } from '../../contexts/style-context';
|
|
9
9
|
import { useUnapplyClass } from '../../hooks/use-unapply-class';
|
|
10
|
+
import { type StyleDefinitionStateWithNormal } from '../../styles-inheritance/types';
|
|
11
|
+
import { StyleIndicator, type StyleIndicatorVariant } from '../style-indicator';
|
|
10
12
|
|
|
11
13
|
const STATES: NonNullable< StyleDefinitionState >[] = [ 'hover', 'focus', 'active' ];
|
|
12
14
|
|
|
@@ -19,13 +21,17 @@ type CssClassMenuProps = {
|
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
export function CssClassMenu( { styleId, provider, popupState, handleRename, anchorEl }: CssClassMenuProps ) {
|
|
24
|
+
const styledStates = useStyledStates( styleId );
|
|
25
|
+
|
|
26
|
+
const indicatorVariant = provider === ELEMENTS_STYLES_PROVIDER_KEY ? 'local' : 'global';
|
|
27
|
+
|
|
22
28
|
const handleKeyDown = ( e: React.KeyboardEvent< HTMLElement > ) => {
|
|
23
29
|
e.stopPropagation();
|
|
24
30
|
};
|
|
25
31
|
|
|
26
32
|
return (
|
|
27
33
|
<Menu
|
|
28
|
-
MenuListProps={ { dense: true } }
|
|
34
|
+
MenuListProps={ { dense: true, sx: { minWidth: '160px' } } }
|
|
29
35
|
{ ...bindMenu( popupState ) }
|
|
30
36
|
anchorEl={ anchorEl }
|
|
31
37
|
anchorOrigin={ {
|
|
@@ -41,18 +47,44 @@ export function CssClassMenu( { styleId, provider, popupState, handleRename, anc
|
|
|
41
47
|
{ /* It has to be an array since MUI menu doesn't accept a Fragment as a child, and wrapping the items with an HTML element disrupts keyboard navigation */ }
|
|
42
48
|
{ getMenuItemsByProvider( { provider, styleId, handleRename, closeMenu: popupState.close } ) }
|
|
43
49
|
<MenuSubheader sx={ { typography: 'caption', color: 'text.secondary', pb: 0.5, pt: 1 } }>
|
|
44
|
-
{ __( '
|
|
50
|
+
{ __( 'States', 'elementor' ) }
|
|
45
51
|
</MenuSubheader>
|
|
46
|
-
<StateMenuItem
|
|
52
|
+
<StateMenuItem
|
|
53
|
+
key="normal"
|
|
54
|
+
state={ null }
|
|
55
|
+
styleId={ styleId }
|
|
56
|
+
closeMenu={ popupState.close }
|
|
57
|
+
isStyled={ styledStates.normal }
|
|
58
|
+
indicatorVariant={ indicatorVariant }
|
|
59
|
+
/>
|
|
47
60
|
{ STATES.map( ( state ) => {
|
|
48
61
|
return (
|
|
49
|
-
<StateMenuItem
|
|
62
|
+
<StateMenuItem
|
|
63
|
+
key={ state }
|
|
64
|
+
state={ state }
|
|
65
|
+
styleId={ styleId }
|
|
66
|
+
closeMenu={ popupState.close }
|
|
67
|
+
isStyled={ styledStates[ state ] }
|
|
68
|
+
indicatorVariant={ indicatorVariant }
|
|
69
|
+
/>
|
|
50
70
|
);
|
|
51
71
|
} ) }
|
|
52
72
|
</Menu>
|
|
53
73
|
);
|
|
54
74
|
}
|
|
55
75
|
|
|
76
|
+
function useStyledStates( styleId: string | null ): Partial< Record< StyleDefinitionStateWithNormal, true > > {
|
|
77
|
+
const { meta } = useStyle();
|
|
78
|
+
|
|
79
|
+
const styleDef = stylesRepository.all().find( ( style ) => style.id === styleId );
|
|
80
|
+
|
|
81
|
+
return Object.fromEntries(
|
|
82
|
+
styleDef?.variants
|
|
83
|
+
.filter( ( variant ) => meta.breakpoint === variant.meta.breakpoint )
|
|
84
|
+
.map( ( variant ) => [ variant.meta.state ?? 'normal', true ] ) ?? []
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
56
88
|
function getMenuItemsByProvider( {
|
|
57
89
|
provider,
|
|
58
90
|
styleId,
|
|
@@ -82,7 +114,7 @@ function getMenuItemsByProvider( {
|
|
|
82
114
|
actions.unshift(
|
|
83
115
|
<MenuSubheader
|
|
84
116
|
key="provider-label"
|
|
85
|
-
sx={ { typography: 'caption', color: 'text.secondary', pb: 0.5, pt: 1 } }
|
|
117
|
+
sx={ { typography: 'caption', color: 'text.secondary', pb: 0.5, pt: 1, textTransform: 'capitalize' } }
|
|
86
118
|
>
|
|
87
119
|
{ providerInstance?.labels?.singular }
|
|
88
120
|
</MenuSubheader>
|
|
@@ -97,9 +129,18 @@ type StateMenuItemProps = {
|
|
|
97
129
|
state: StyleDefinitionState;
|
|
98
130
|
styleId: string | null;
|
|
99
131
|
closeMenu: () => void;
|
|
132
|
+
isStyled?: boolean;
|
|
133
|
+
indicatorVariant: StyleIndicatorVariant;
|
|
100
134
|
};
|
|
101
135
|
|
|
102
|
-
function StateMenuItem( {
|
|
136
|
+
function StateMenuItem( {
|
|
137
|
+
state,
|
|
138
|
+
styleId,
|
|
139
|
+
closeMenu,
|
|
140
|
+
isStyled = false,
|
|
141
|
+
indicatorVariant,
|
|
142
|
+
...props
|
|
143
|
+
}: StateMenuItemProps ) {
|
|
103
144
|
const { id: activeId, setId: setActiveId, setMetaState: setActiveMetaState, meta } = useStyle();
|
|
104
145
|
const { state: activeState } = meta;
|
|
105
146
|
|
|
@@ -121,7 +162,12 @@ function StateMenuItem( { state, styleId, closeMenu, ...props }: StateMenuItemPr
|
|
|
121
162
|
closeMenu();
|
|
122
163
|
} }
|
|
123
164
|
>
|
|
124
|
-
{
|
|
165
|
+
<Stack gap={ 0.75 } direction="row" alignItems="center">
|
|
166
|
+
{ isStyled && (
|
|
167
|
+
<StyleIndicator aria-label={ __( 'Has style', 'elementor' ) } variant={ indicatorVariant } />
|
|
168
|
+
) }
|
|
169
|
+
{ state ?? 'normal' }
|
|
170
|
+
</Stack>
|
|
125
171
|
</MenuListItem>
|
|
126
172
|
);
|
|
127
173
|
}
|
|
@@ -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;
|
|
@@ -64,7 +64,7 @@ export function CssClassSelector() {
|
|
|
64
64
|
<Stack gap={ 1 } p={ 2 }>
|
|
65
65
|
<Stack direction="row" gap={ 1 } alignItems="center" justifyContent="space-between">
|
|
66
66
|
<Typography component="label" variant="caption" htmlFor={ ID }>
|
|
67
|
-
{ __( '
|
|
67
|
+
{ __( 'Classes', 'elementor' ) }
|
|
68
68
|
</Typography>
|
|
69
69
|
<Stack direction="row" gap={ 1 }>
|
|
70
70
|
<ClassSelectorActionsSlot />
|
|
@@ -145,10 +145,11 @@ 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
|
+
// translators: %s is the plural label of the provider (e.g "Existing classes").
|
|
152
|
+
group: __( 'Existing %s', 'elementor' ).replace( '%s', provider.labels?.plural ?? '' ),
|
|
152
153
|
};
|
|
153
154
|
} );
|
|
154
155
|
} );
|
|
@@ -164,9 +165,9 @@ function useCreateActions( {
|
|
|
164
165
|
return useCreateActionsByProvider().map( ( [ provider, create ] ): Action< StyleDefOption > => {
|
|
165
166
|
return {
|
|
166
167
|
// translators: %s is the label of the new class.
|
|
167
|
-
label: ( value ) => __( 'Create
|
|
168
|
-
// translators: %s is the singular label of css class provider (e.g "
|
|
169
|
-
group: __( 'Create
|
|
168
|
+
label: ( value ) => __( 'Create "%s"', 'elementor' ).replace( '%s', value ),
|
|
169
|
+
// translators: %s is the singular label of css class provider (e.g "CSS Class").
|
|
170
|
+
group: __( 'Create a new %s', 'elementor' ).replace( '%s', provider.labels?.singular ?? '' ),
|
|
170
171
|
condition: ( _, inputValue ) => isLabelValid( inputValue ) && ! hasReachedLimit( provider ),
|
|
171
172
|
apply: ( label ) => {
|
|
172
173
|
const createdId = create( label );
|
|
@@ -19,7 +19,7 @@ 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 variant="fullWidth"
|
|
22
|
+
<Tabs variant="fullWidth" size="small" sx={ { mt: 0.5 } } { ...getTabsProps() }>
|
|
23
23
|
<Tab label={ __( 'General', 'elementor' ) } { ...getTabProps( 'settings' ) } />
|
|
24
24
|
<Tab label={ __( 'Style', 'elementor' ) } { ...getTabProps( 'style' ) } />
|
|
25
25
|
</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>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { styled } from '@elementor/ui';
|
|
2
|
+
|
|
3
|
+
export type StyleIndicatorVariant = 'overridden' | 'local' | 'global';
|
|
4
|
+
|
|
5
|
+
export const StyleIndicator = styled( 'div', {
|
|
6
|
+
shouldForwardProp: ( prop ) => prop !== 'variant',
|
|
7
|
+
} )< { variant?: StyleIndicatorVariant } >`
|
|
8
|
+
width: 5px;
|
|
9
|
+
height: 5px;
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
background-color: ${ ( { theme, variant } ) => {
|
|
12
|
+
switch ( variant ) {
|
|
13
|
+
case 'overridden':
|
|
14
|
+
return theme.palette.warning.light;
|
|
15
|
+
case 'global':
|
|
16
|
+
return theme.palette.global.dark;
|
|
17
|
+
case 'local':
|
|
18
|
+
return theme.palette.accent.main;
|
|
19
|
+
default:
|
|
20
|
+
return theme.palette.text.disabled;
|
|
21
|
+
}
|
|
22
|
+
} };
|
|
23
|
+
`;
|
|
@@ -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 (
|
|
@@ -13,7 +13,6 @@ 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 { RotatedIcon } from '../layout-section/utils/rotated-icon';
|
|
17
16
|
|
|
18
17
|
const StartStartIcon = withDirection( RadiusTopLeftIcon );
|
|
19
18
|
const StartEndIcon = withDirection( RadiusTopRightIcon );
|
|
@@ -32,22 +31,22 @@ const getEndEndLabel = ( isSiteRtl: boolean ) =>
|
|
|
32
31
|
const getCorners = ( isSiteRtl: boolean ): EqualUnequalItems => [
|
|
33
32
|
{
|
|
34
33
|
label: getStartStartLabel( isSiteRtl ),
|
|
35
|
-
icon: <
|
|
34
|
+
icon: <StartStartIcon fontSize={ 'tiny' } />,
|
|
36
35
|
bind: 'start-start',
|
|
37
36
|
},
|
|
38
37
|
{
|
|
39
38
|
label: getStartEndLabel( isSiteRtl ),
|
|
40
|
-
icon: <
|
|
39
|
+
icon: <StartEndIcon fontSize={ 'tiny' } />,
|
|
41
40
|
bind: 'start-end',
|
|
42
41
|
},
|
|
43
42
|
{
|
|
44
43
|
label: getEndStartLabel( isSiteRtl ),
|
|
45
|
-
icon: <
|
|
44
|
+
icon: <EndStartIcon fontSize={ 'tiny' } />,
|
|
46
45
|
bind: 'end-start',
|
|
47
46
|
},
|
|
48
47
|
{
|
|
49
48
|
label: getEndEndLabel( isSiteRtl ),
|
|
50
|
-
icon: <
|
|
49
|
+
icon: <EndEndIcon fontSize={ 'tiny' } />,
|
|
51
50
|
bind: 'end-end',
|
|
52
51
|
},
|
|
53
52
|
];
|
|
@@ -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' ) },
|
|
@@ -7,7 +7,6 @@ import { __ } from '@wordpress/i18n';
|
|
|
7
7
|
|
|
8
8
|
import { StylesField } from '../../../controls-registry/styles-field';
|
|
9
9
|
import { useDirection } from '../../../hooks/use-direction';
|
|
10
|
-
import { RotatedIcon } from '../layout-section/utils/rotated-icon';
|
|
11
10
|
|
|
12
11
|
const InlineStartIcon = withDirection( SideRightIcon );
|
|
13
12
|
const InlineEndIcon = withDirection( SideLeftIcon );
|
|
@@ -20,7 +19,7 @@ const getEdges = ( isSiteRtl: boolean ): EqualUnequalItems => [
|
|
|
20
19
|
},
|
|
21
20
|
{
|
|
22
21
|
label: isSiteRtl ? __( 'Left', 'elementor' ) : __( 'Right', 'elementor' ),
|
|
23
|
-
icon: <
|
|
22
|
+
icon: <InlineStartIcon fontSize={ 'tiny' } />,
|
|
24
23
|
bind: 'inline-end',
|
|
25
24
|
},
|
|
26
25
|
{
|
|
@@ -30,7 +29,7 @@ const getEdges = ( isSiteRtl: boolean ): EqualUnequalItems => [
|
|
|
30
29
|
},
|
|
31
30
|
{
|
|
32
31
|
label: isSiteRtl ? __( 'Right', 'elementor' ) : __( 'Left', 'elementor' ),
|
|
33
|
-
icon: <
|
|
32
|
+
icon: <InlineEndIcon fontSize={ 'tiny' } />,
|
|
34
33
|
bind: 'inline-start',
|
|
35
34
|
},
|
|
36
35
|
];
|
|
@@ -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
|
|