@elementor/editor-editing-panel 1.27.0 → 1.29.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/src/init.ts CHANGED
@@ -8,7 +8,7 @@ import { init as initDynamics } from './dynamics/init';
8
8
  import { panel } from './panel';
9
9
  import { isAtomicWidgetSelected } from './sync/is-atomic-widget-selected';
10
10
 
11
- export default function init() {
11
+ export function init() {
12
12
  registerPanel( panel );
13
13
  blockV1Panel();
14
14
 
@@ -1,3 +1,4 @@
1
+ import { filterEmptyValues } from '@elementor/editor-props';
1
2
  import { type BreakpointId, type BreakpointNode } from '@elementor/editor-responsive';
2
3
  import { type StyleDefinitionState } from '@elementor/editor-styles';
3
4
 
@@ -141,13 +142,19 @@ function buildInitialSnapshotFromStyles( styles: StyleVariantDetails[] ): Styles
141
142
  } = styleData;
142
143
 
143
144
  Object.entries( props ).forEach( ( [ key, value ] ) => {
145
+ const filteredValue = filterEmptyValues( value );
146
+
147
+ if ( filteredValue === null ) {
148
+ return;
149
+ }
150
+
144
151
  if ( ! snapshot[ key ] ) {
145
152
  snapshot[ key ] = [];
146
153
  }
147
154
 
148
155
  const snapshotPropValue: SnapshotPropValue = {
149
156
  ...styleData,
150
- value,
157
+ value: filteredValue,
151
158
  };
152
159
 
153
160
  snapshot[ key ].push( snapshotPropValue );
@@ -22,7 +22,7 @@ function buildStyleVariantsByMetaMapping( styleDefs: StyleDefinition[] ): Breakp
22
22
  const breakpointStateSlots: BreakpointsStatesStyles = {};
23
23
 
24
24
  styleDefs.forEach( ( styleDef ) => {
25
- const provider = getProviderByStyleId( styleDef.id )?.key ?? null;
25
+ const provider = getProviderByStyleId( styleDef.id )?.getKey() ?? null;
26
26
 
27
27
  // iterate over each style definition's variants and place them in the corresponding breakpoint's base or state styles
28
28
  styleDef.variants.forEach( ( variant ) => {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useBoundProp } from '@elementor/editor-controls';
3
- import { ELEMENTS_BASE_STYLES_PROVIDER_KEY, ELEMENTS_STYLES_PROVIDER_KEY } from '@elementor/editor-styles-repository';
3
+ import { ELEMENTS_BASE_STYLES_PROVIDER_KEY, isElementsStylesProvider } from '@elementor/editor-styles-repository';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
6
  import { StyleIndicator } from '../components/style-indicator';
@@ -35,7 +35,7 @@ export const StylesInheritanceIndicator = () => {
35
35
  return (
36
36
  <StyleIndicator
37
37
  aria-label={ __( 'This is the final value', 'elementor' ) }
38
- variant={ currentStyleProvider?.key === ELEMENTS_STYLES_PROVIDER_KEY ? 'local' : 'global' }
38
+ variant={ isElementsStylesProvider( currentStyleProvider?.getKey() ) ? 'local' : 'global' }
39
39
  />
40
40
  );
41
41
  }