@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/CHANGELOG.md +52 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +176 -155
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +172 -157
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
- package/src/components/add-or-remove-content.tsx +1 -0
- package/src/components/css-classes/css-class-item.tsx +8 -10
- package/src/components/css-classes/css-class-menu.tsx +7 -5
- package/src/components/css-classes/css-class-selector.tsx +22 -22
- package/src/components/multi-combobox.tsx +7 -42
- package/src/components/style-sections/layout-section/display-field.tsx +34 -28
- package/src/components/style-sections/layout-section/layout-section.tsx +14 -2
- package/src/components/style-tab.tsx +2 -19
- package/src/contexts/style-context.tsx +1 -1
- package/src/controls-registry/styles-field.tsx +9 -2
- package/src/hooks/use-active-style-def-id.ts +36 -0
- package/src/hooks/use-styles-fields.ts +7 -7
- package/src/index.ts +1 -3
- package/src/init.ts +1 -1
- package/src/styles-inheritance/create-snapshots-manager.ts +8 -1
- package/src/styles-inheritance/create-styles-inheritance.ts +1 -1
- package/src/styles-inheritance/styles-inheritance-indicator.tsx +2 -2
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
|
|
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 )?.
|
|
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,
|
|
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?.
|
|
38
|
+
variant={ isElementsStylesProvider( currentStyleProvider?.getKey() ) ? 'local' : 'global' }
|
|
39
39
|
/>
|
|
40
40
|
);
|
|
41
41
|
}
|