@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "1.32.0",
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.20.0",
44
- "@elementor/editor-controls": "0.28.1",
45
- "@elementor/editor-current-user": "0.3.1",
46
- "@elementor/editor-elements": "0.8.1",
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.5",
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, getControlByType } from '../controls-registry/controls-registry';
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 ( ! getControlByType( control.type as ControlType ) ) {
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
- <ControlTypeContainer controlType={ control.type as ControlType }>
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
- <PanelDivider />
72
- <OffsetField />
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
- import { type ControlLayout, type ControlType, getLayoutByType } from './controls-registry';
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, getControlByType } from './controls-registry';
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 = getControlByType( type );
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 getControlByType = ( type: ControlType ) => controlTypes[ type ]?.component;
33
+ export const getControl = ( type: ControlType ) => controlTypes[ type ]?.component;
35
34
 
36
- export const getLayoutByType = ( type: ControlType ) => controlTypes[ type ].layout;
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, getControlByType } from '../../controls-registry/controls-registry';
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 ( ! getControlByType( control.type as ControlType ) ) {
170
+ if ( ! getControl( control.type as ControlType ) ) {
171
171
  return null;
172
172
  }
173
173
 
package/src/sync/types.ts CHANGED
@@ -35,6 +35,7 @@ export type ExtendedWindow = Window & {
35
35
  config?: {
36
36
  experimentalFeatures?: {
37
37
  e_indications_popover?: boolean;
38
+ e_css_id?: boolean;
38
39
  };
39
40
  };
40
41
  };