@elementor/editor-editing-panel 1.33.0 → 1.34.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "1.33.0",
3
+ "version": "1.34.0",
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.1",
44
- "@elementor/editor-controls": "0.28.2",
43
+ "@elementor/editor-canvas": "0.21.1",
44
+ "@elementor/editor-controls": "0.29.0",
45
45
  "@elementor/editor-current-user": "0.3.2",
46
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.6",
51
+ "@elementor/editor-styles-repository": "0.8.7",
52
52
  "@elementor/editor-ui": "0.8.1",
53
53
  "@elementor/editor-v1-adapters": "0.11.0",
54
54
  "@elementor/icons": "1.40.1",
@@ -5,11 +5,12 @@ import { __ } from '@wordpress/i18n';
5
5
 
6
6
  import { useStylesInheritanceField } from '../../../contexts/styles-inheritance-context';
7
7
  import { StylesField } from '../../../controls-registry/styles-field';
8
+ import { isExperimentActive } from '../../../sync/is-experiment-active';
8
9
  import { ControlLabel } from '../../control-label';
9
10
 
10
- type Displays = 'block' | 'flex' | 'inline-block' | 'inline-flex';
11
+ type Displays = 'block' | 'flex' | 'inline-block' | 'inline-flex' | 'none';
11
12
 
12
- const displayFieldOptions: ToggleButtonGroupItem< Displays >[] = [
13
+ const displayFieldItems: ToggleButtonGroupItem< Displays >[] = [
13
14
  {
14
15
  value: 'block',
15
16
  renderContent: () => __( 'Block', 'elementor' ),
@@ -28,22 +29,35 @@ const displayFieldOptions: ToggleButtonGroupItem< Displays >[] = [
28
29
  label: __( 'Inline-block', 'elementor' ),
29
30
  showTooltip: true,
30
31
  },
31
- {
32
+ ];
33
+
34
+ export const DisplayField = () => {
35
+ const isDisplayNoneFeatureActive = isExperimentActive( 'e_v_3_30' );
36
+ const items = [ ...displayFieldItems ];
37
+
38
+ if ( isDisplayNoneFeatureActive ) {
39
+ items.push( {
40
+ value: 'none',
41
+ renderContent: () => __( 'None', 'elementor' ),
42
+ label: __( 'None', 'elementor' ),
43
+ showTooltip: true,
44
+ } );
45
+ }
46
+
47
+ items.push( {
32
48
  value: 'inline-flex',
33
49
  renderContent: () => __( 'In-flx', 'elementor' ),
34
50
  label: __( 'Inline-flex', 'elementor' ),
35
51
  showTooltip: true,
36
- },
37
- ];
52
+ } );
38
53
 
39
- export const DisplayField = () => {
40
54
  const placeholder = useDisplayPlaceholderValue();
41
55
 
42
56
  return (
43
57
  <StylesField bind="display" placeholder={ placeholder }>
44
58
  <Stack gap={ 0.75 }>
45
59
  <ControlLabel>{ __( 'Display', 'elementor' ) }</ControlLabel>
46
- <ToggleControl options={ displayFieldOptions } fullWidth={ true } />
60
+ <ToggleControl options={ items } maxItems={ 4 } fullWidth={ true } />
47
61
  </Stack>
48
62
  </StylesField>
49
63
  );
@@ -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 { isExperimentActive } from '../../../sync/is-experiment-active';
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 isCssIdFeatureActive = isExperimentActive( 'e_v_3_30' );
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
+ { isCssIdFeatureActive && (
75
+ <>
76
+ <PanelDivider />
77
+ <OffsetField />
78
+ </>
79
+ ) }
73
80
  </SectionContent>
74
81
  );
75
82
  };
@@ -20,7 +20,7 @@ export const FontFamilyField = () => {
20
20
  <Grid item xs={ 6 }>
21
21
  <ControlLabel>{ __( 'Font family', 'elementor' ) }</ControlLabel>
22
22
  </Grid>
23
- <Grid item xs={ 6 } sx={ { overflow: 'hidden' } }>
23
+ <Grid item xs={ 6 } sx={ { minWidth: 0 } }>
24
24
  <FontFamilyControl fontFamilies={ fontFamilies } />
25
25
  </Grid>
26
26
  </Grid>
@@ -2,7 +2,7 @@ import { useMemo } from 'react';
2
2
  import { type FontCategory } from '@elementor/editor-controls';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
- import { getElementorConfig } from '../../../../sync/get-elementor-config';
5
+ import { getElementorConfig } from '../../../../sync/get-elementor-globals';
6
6
 
7
7
  const supportedCategories: Record< string, string > = {
8
8
  system: __( 'System', 'elementor' ),
@@ -1,13 +1,12 @@
1
1
  import { useTheme } from '@elementor/ui';
2
2
 
3
- import { type ExtendedWindow } from '../sync/types';
3
+ import { getElementorFrontendConfig } from '../sync/get-elementor-globals';
4
4
 
5
5
  export function useDirection() {
6
- const theme = useTheme(),
7
- extendedWindow: ExtendedWindow = window;
6
+ const theme = useTheme();
8
7
 
9
8
  const isUiRtl = 'rtl' === theme.direction,
10
- isSiteRtl = !! extendedWindow.elementorFrontend?.config?.is_rtl;
9
+ isSiteRtl = !! getElementorFrontendConfig()?.is_rtl;
11
10
 
12
11
  return { isSiteRtl, isUiRtl };
13
12
  }
@@ -8,7 +8,7 @@ import { __ } from '@wordpress/i18n';
8
8
  import { StyleIndicator } from '../components/style-indicator';
9
9
  import { useStyle } from '../contexts/style-context';
10
10
  import { useStylesInheritanceField } from '../contexts/styles-inheritance-context';
11
- import { getExperimentsConfig } from '../sync/get-experiments-config';
11
+ import { isExperimentActive } from '../sync/is-experiment-active';
12
12
  import { StyleIndicatorInfotip } from './styles-inheritance-infotip';
13
13
 
14
14
  export const StylesInheritanceIndicator = () => {
@@ -41,7 +41,7 @@ export const StylesInheritanceIndicator = () => {
41
41
  const label: string = getLabel( { isFinalValue, hasValue } );
42
42
  const variantType = getVariant( { isFinalValue, hasValue, currentStyleProvider } );
43
43
 
44
- const { e_indications_popover: eIndicationsPopover } = getExperimentsConfig();
44
+ const eIndicationsPopover = isExperimentActive( 'e_indications_popover' );
45
45
 
46
46
  if ( ! eIndicationsPopover ) {
47
47
  return <StyleIndicator variant={ variantType } aria-label={ label } />;
@@ -0,0 +1,19 @@
1
+ import { type ExtendedWindow } from './types';
2
+
3
+ export const getElementorConfig = () => {
4
+ const extendedWindow = window as unknown as ExtendedWindow;
5
+
6
+ return extendedWindow.elementor?.config ?? {};
7
+ };
8
+
9
+ export const getElementorFrontendConfig = () => {
10
+ const extendedWindow = window as unknown as ExtendedWindow;
11
+
12
+ return extendedWindow.elementorFrontend?.config ?? {};
13
+ };
14
+
15
+ export const getElementorCommonConfig = () => {
16
+ const extendedWindow = window as unknown as ExtendedWindow;
17
+
18
+ return extendedWindow.elementorCommon?.config ?? {};
19
+ };
@@ -0,0 +1,7 @@
1
+ import { getElementorCommonConfig } from './get-elementor-globals';
2
+
3
+ export const isExperimentActive = ( experiment: string ) => {
4
+ const allFeatures = getElementorCommonConfig()?.experimentalFeatures ?? {};
5
+
6
+ return !! allFeatures?.[ experiment ];
7
+ };
package/src/sync/types.ts CHANGED
@@ -33,9 +33,7 @@ export type ExtendedWindow = Window & {
33
33
  };
34
34
  elementorCommon?: {
35
35
  config?: {
36
- experimentalFeatures?: {
37
- e_indications_popover?: boolean;
38
- };
36
+ experimentalFeatures?: Record< string, boolean >;
39
37
  };
40
38
  };
41
39
  elementorFrontend?: {
@@ -1,7 +0,0 @@
1
- import { type ExtendedWindow } from './types';
2
-
3
- export const getElementorConfig = () => {
4
- const extendedWindow = window as unknown as ExtendedWindow;
5
-
6
- return extendedWindow.elementor?.config ?? {};
7
- };
@@ -1,7 +0,0 @@
1
- import { type ExtendedWindow } from './types';
2
-
3
- export const getExperimentsConfig = () => {
4
- const extendedWindow = window as unknown as ExtendedWindow;
5
-
6
- return extendedWindow.elementorCommon?.config?.experimentalFeatures ?? {};
7
- };