@elementor/editor-components 3.35.0-478 → 3.35.0-479

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-components",
3
3
  "description": "Elementor editor components",
4
- "version": "3.35.0-478",
4
+ "version": "3.35.0-479",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,30 +40,30 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor": "3.35.0-478",
44
- "@elementor/editor-canvas": "3.35.0-478",
45
- "@elementor/editor-controls": "3.35.0-478",
46
- "@elementor/editor-documents": "3.35.0-478",
47
- "@elementor/editor-editing-panel": "3.35.0-478",
48
- "@elementor/editor-elements": "3.35.0-478",
49
- "@elementor/editor-elements-panel": "3.35.0-478",
50
- "@elementor/editor-mcp": "3.35.0-478",
51
- "@elementor/editor-panels": "3.35.0-478",
52
- "@elementor/editor-props": "3.35.0-478",
53
- "@elementor/editor-styles-repository": "3.35.0-478",
54
- "@elementor/editor-ui": "3.35.0-478",
55
- "@elementor/editor-v1-adapters": "3.35.0-478",
56
- "@elementor/http-client": "3.35.0-478",
43
+ "@elementor/editor": "3.35.0-479",
44
+ "@elementor/editor-canvas": "3.35.0-479",
45
+ "@elementor/editor-controls": "3.35.0-479",
46
+ "@elementor/editor-documents": "3.35.0-479",
47
+ "@elementor/editor-editing-panel": "3.35.0-479",
48
+ "@elementor/editor-elements": "3.35.0-479",
49
+ "@elementor/editor-elements-panel": "3.35.0-479",
50
+ "@elementor/editor-mcp": "3.35.0-479",
51
+ "@elementor/editor-panels": "3.35.0-479",
52
+ "@elementor/editor-props": "3.35.0-479",
53
+ "@elementor/editor-styles-repository": "3.35.0-479",
54
+ "@elementor/editor-ui": "3.35.0-479",
55
+ "@elementor/editor-v1-adapters": "3.35.0-479",
56
+ "@elementor/http-client": "3.35.0-479",
57
57
  "@elementor/icons": "^1.63.0",
58
- "@elementor/mixpanel": "3.35.0-478",
59
- "@elementor/query": "3.35.0-478",
60
- "@elementor/schema": "3.35.0-478",
61
- "@elementor/store": "3.35.0-478",
58
+ "@elementor/mixpanel": "3.35.0-479",
59
+ "@elementor/query": "3.35.0-479",
60
+ "@elementor/schema": "3.35.0-479",
61
+ "@elementor/store": "3.35.0-479",
62
62
  "@elementor/ui": "1.36.17",
63
- "@elementor/utils": "3.35.0-478",
63
+ "@elementor/utils": "3.35.0-479",
64
64
  "@wordpress/i18n": "^5.13.0",
65
- "@elementor/editor-notifications": "3.35.0-478",
66
- "@elementor/editor-current-user": "3.35.0-478"
65
+ "@elementor/editor-notifications": "3.35.0-479",
66
+ "@elementor/editor-current-user": "3.35.0-479"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "react": "^18.3.1",
@@ -20,8 +20,10 @@ type Props = {
20
20
  };
21
21
 
22
22
  export function OverridablePropForm( { onSubmit, groups, currentValue, existingLabels = [], sx }: Props ) {
23
+ const selectGroups = groups?.length ? groups : [ DEFAULT_GROUP ];
24
+
23
25
  const [ propLabel, setPropLabel ] = useState< string | null >( currentValue?.label ?? null );
24
- const [ group, setGroup ] = useState< string | null >( currentValue?.groupId ?? groups?.[ 0 ]?.value ?? null );
26
+ const [ group, setGroup ] = useState< string | null >( currentValue?.groupId ?? selectGroups[ 0 ]?.value ?? null );
25
27
  const [ error, setError ] = useState< string | null >( null );
26
28
 
27
29
  const name = __( 'Name', 'elementor' );
@@ -98,16 +100,17 @@ export function OverridablePropForm( { onSubmit, groups, currentValue, existingL
98
100
  }
99
101
  displayEmpty
100
102
  renderValue={ ( selectedValue: string | null ) => {
101
- if ( ! selectedValue || selectedValue === '' ) {
102
- const [ firstGroup = DEFAULT_GROUP ] = groups ?? [];
103
-
104
- return firstGroup.label;
103
+ if ( ! selectedValue ) {
104
+ return selectGroups[ 0 ].label;
105
105
  }
106
106
 
107
- return groups?.find( ( { value } ) => value === selectedValue )?.label ?? selectedValue;
107
+ return (
108
+ selectGroups.find( ( { value } ) => value === selectedValue )?.label ??
109
+ selectedValue
110
+ );
108
111
  } }
109
112
  >
110
- { ( groups ?? [ DEFAULT_GROUP ] ).map( ( { label: groupLabel, ...props } ) => (
113
+ { selectGroups.map( ( { label: groupLabel, ...props } ) => (
111
114
  <MenuListItem key={ props.value } { ...props } value={ props.value ?? '' }>
112
115
  { groupLabel }
113
116
  </MenuListItem>