@elementor/editor-editing-panel 1.32.0 → 1.33.1
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 +23 -0
- package/dist/index.js +165 -166
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/settings-tab.tsx +7 -3
- package/src/components/style-sections/position-section/position-section.tsx +9 -2
- package/src/controls-registry/control-type-container.tsx +2 -8
- package/src/controls-registry/control.tsx +2 -2
- package/src/controls-registry/controls-registry.tsx +3 -4
- package/src/dynamics/components/dynamic-selection-control.tsx +2 -2
- package/src/sync/types.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-editing-panel",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@elementor/editor": "0.19.1",
|
|
43
|
-
"@elementor/editor-canvas": "0.
|
|
44
|
-
"@elementor/editor-controls": "0.28.
|
|
45
|
-
"@elementor/editor-current-user": "0.3.
|
|
46
|
-
"@elementor/editor-elements": "0.8.
|
|
43
|
+
"@elementor/editor-canvas": "0.21.0",
|
|
44
|
+
"@elementor/editor-controls": "0.28.2",
|
|
45
|
+
"@elementor/editor-current-user": "0.3.2",
|
|
46
|
+
"@elementor/editor-elements": "0.8.2",
|
|
47
47
|
"@elementor/editor-panels": "0.15.1",
|
|
48
48
|
"@elementor/editor-props": "0.12.0",
|
|
49
49
|
"@elementor/editor-responsive": "0.13.4",
|
|
50
50
|
"@elementor/editor-styles": "0.6.6",
|
|
51
|
-
"@elementor/editor-styles-repository": "0.8.
|
|
51
|
+
"@elementor/editor-styles-repository": "0.8.6",
|
|
52
52
|
"@elementor/editor-ui": "0.8.1",
|
|
53
53
|
"@elementor/editor-v1-adapters": "0.11.0",
|
|
54
54
|
"@elementor/icons": "1.40.1",
|
|
@@ -2,11 +2,12 @@ import * as React from 'react';
|
|
|
2
2
|
import { ControlFormLabel } from '@elementor/editor-controls';
|
|
3
3
|
import { type Control } from '@elementor/editor-elements';
|
|
4
4
|
import { SessionStorageProvider } from '@elementor/session';
|
|
5
|
+
import { Divider } from '@elementor/ui';
|
|
5
6
|
|
|
6
7
|
import { useElement } from '../contexts/element-context';
|
|
7
8
|
import { Control as BaseControl } from '../controls-registry/control';
|
|
8
9
|
import { ControlTypeContainer } from '../controls-registry/control-type-container';
|
|
9
|
-
import { type ControlType,
|
|
10
|
+
import { type ControlType, getControl, getDefaultLayout } from '../controls-registry/controls-registry';
|
|
10
11
|
import { SettingsField } from '../controls-registry/settings-field';
|
|
11
12
|
import { Section } from './section';
|
|
12
13
|
import { SectionsList } from './sections-list';
|
|
@@ -45,13 +46,16 @@ export const SettingsTab = () => {
|
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
const Control = ( { control }: { control: Control[ 'value' ] } ) => {
|
|
48
|
-
if ( !
|
|
49
|
+
if ( ! getControl( control.type as ControlType ) ) {
|
|
49
50
|
return null;
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
const layout = control.meta?.layout || getDefaultLayout( control.type as ControlType );
|
|
54
|
+
|
|
52
55
|
return (
|
|
53
56
|
<SettingsField bind={ control.bind }>
|
|
54
|
-
|
|
57
|
+
{ control.meta?.topDivider && <Divider /> }
|
|
58
|
+
<ControlTypeContainer layout={ layout }>
|
|
55
59
|
{ control.label ? <ControlFormLabel>{ control.label }</ControlFormLabel> : null }
|
|
56
60
|
<BaseControl type={ control.type as ControlType } props={ control.props } />
|
|
57
61
|
</ControlTypeContainer>
|
|
@@ -5,6 +5,7 @@ import { useSessionStorage } from '@elementor/session';
|
|
|
5
5
|
import { useStyle } from '../../../contexts/style-context';
|
|
6
6
|
import { useStylesField } from '../../../hooks/use-styles-field';
|
|
7
7
|
import { useStylesFields } from '../../../hooks/use-styles-fields';
|
|
8
|
+
import { getExperimentsConfig } from '../../../sync/get-experiments-config';
|
|
8
9
|
import { PanelDivider } from '../../panel-divider';
|
|
9
10
|
import { SectionContent } from '../../section-content';
|
|
10
11
|
import { DimensionsField } from './dimensions-field';
|
|
@@ -37,6 +38,7 @@ export const PositionSection = () => {
|
|
|
37
38
|
] );
|
|
38
39
|
|
|
39
40
|
const [ dimensionsValuesFromHistory, updateDimensionsHistory, clearDimensionsHistory ] = usePersistDimensions();
|
|
41
|
+
const { e_css_id: eCssId } = getExperimentsConfig();
|
|
40
42
|
|
|
41
43
|
const onPositionChange = ( newPosition: string | null, previousPosition: string | null | undefined ) => {
|
|
42
44
|
if ( newPosition === 'static' ) {
|
|
@@ -68,8 +70,13 @@ export const PositionSection = () => {
|
|
|
68
70
|
<ZIndexField />
|
|
69
71
|
</>
|
|
70
72
|
) : null }
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
|
|
74
|
+
{ eCssId && (
|
|
75
|
+
<>
|
|
76
|
+
<PanelDivider />
|
|
77
|
+
<OffsetField />
|
|
78
|
+
</>
|
|
79
|
+
) }
|
|
73
80
|
</SectionContent>
|
|
74
81
|
);
|
|
75
82
|
};
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { type ControlLayout } from '@elementor/editor-elements';
|
|
2
3
|
import { Box, type BoxProps, styled } from '@elementor/ui';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export const ControlTypeContainer = ( {
|
|
7
|
-
controlType,
|
|
8
|
-
children,
|
|
9
|
-
}: React.PropsWithChildren< { controlType: ControlType } > ) => {
|
|
10
|
-
const layout = getLayoutByType( controlType );
|
|
11
|
-
|
|
5
|
+
export const ControlTypeContainer = ( { children, layout }: React.PropsWithChildren< { layout?: ControlLayout } > ) => {
|
|
12
6
|
return <StyledContainer layout={ layout }>{ children }</StyledContainer>;
|
|
13
7
|
};
|
|
14
8
|
|
|
@@ -3,7 +3,7 @@ import type { ComponentProps } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { useElement } from '../contexts/element-context';
|
|
5
5
|
import { ControlTypeNotFoundError } from '../errors';
|
|
6
|
-
import { type ControlType, type ControlTypes,
|
|
6
|
+
import { type ControlType, type ControlTypes, getControl } from './controls-registry';
|
|
7
7
|
|
|
8
8
|
type IsRequired< T, K extends keyof T > = object extends Pick< T, K > ? false : true;
|
|
9
9
|
|
|
@@ -24,7 +24,7 @@ type ControlProps< T extends ControlType > = AnyPropertyRequired< ComponentProps
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export const Control = < T extends ControlType >( { props, type }: ControlProps< T > ) => {
|
|
27
|
-
const ControlByType =
|
|
27
|
+
const ControlByType = getControl( type );
|
|
28
28
|
const { element } = useElement();
|
|
29
29
|
|
|
30
30
|
if ( ! ControlByType ) {
|
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
TextControl,
|
|
10
10
|
UrlControl,
|
|
11
11
|
} from '@elementor/editor-controls';
|
|
12
|
-
|
|
13
|
-
export type ControlLayout = 'full' | 'two-columns';
|
|
12
|
+
import { type ControlLayout } from '@elementor/editor-elements';
|
|
14
13
|
|
|
15
14
|
type ControlRegistry = Record< string, { component: ControlComponent; layout: ControlLayout } >;
|
|
16
15
|
|
|
@@ -31,6 +30,6 @@ export type ControlTypes = {
|
|
|
31
30
|
[ key in ControlType ]: ( typeof controlTypes )[ key ][ 'component' ];
|
|
32
31
|
};
|
|
33
32
|
|
|
34
|
-
export const
|
|
33
|
+
export const getControl = ( type: ControlType ) => controlTypes[ type ]?.component;
|
|
35
34
|
|
|
36
|
-
export const
|
|
35
|
+
export const getDefaultLayout = ( type: ControlType ) => controlTypes[ type ].layout;
|
|
@@ -24,7 +24,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
24
24
|
|
|
25
25
|
import { PopoverContent } from '../../components/popover-content';
|
|
26
26
|
import { Control as BaseControl } from '../../controls-registry/control';
|
|
27
|
-
import { type ControlType,
|
|
27
|
+
import { type ControlType, getControl } from '../../controls-registry/controls-registry';
|
|
28
28
|
import { usePersistDynamicValue } from '../../hooks/use-persist-dynamic-value';
|
|
29
29
|
import { DynamicControl } from '../dynamic-control';
|
|
30
30
|
import { useDynamicTag } from '../hooks/use-dynamic-tag';
|
|
@@ -167,7 +167,7 @@ const DynamicSettings = ( { controls }: { controls: DynamicTag[ 'atomic_controls
|
|
|
167
167
|
};
|
|
168
168
|
|
|
169
169
|
const Control = ( { control }: { control: Control[ 'value' ] } ) => {
|
|
170
|
-
if ( !
|
|
170
|
+
if ( ! getControl( control.type as ControlType ) ) {
|
|
171
171
|
return null;
|
|
172
172
|
}
|
|
173
173
|
|