@elementor/editor-controls 4.1.0-810 → 4.1.0-812

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-controls",
3
3
  "description": "This package contains the controls model and utils for the Elementor editor",
4
- "version": "4.1.0-810",
4
+ "version": "4.1.0-812",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,22 +40,22 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-current-user": "4.1.0-810",
44
- "@elementor/editor-elements": "4.1.0-810",
45
- "@elementor/editor-props": "4.1.0-810",
46
- "@elementor/editor-responsive": "4.1.0-810",
47
- "@elementor/editor-ui": "4.1.0-810",
48
- "@elementor/editor-v1-adapters": "4.1.0-810",
49
- "@elementor/env": "4.1.0-810",
50
- "@elementor/events": "4.1.0-810",
51
- "@elementor/http-client": "4.1.0-810",
43
+ "@elementor/editor-current-user": "4.1.0-812",
44
+ "@elementor/editor-elements": "4.1.0-812",
45
+ "@elementor/editor-props": "4.1.0-812",
46
+ "@elementor/editor-responsive": "4.1.0-812",
47
+ "@elementor/editor-ui": "4.1.0-812",
48
+ "@elementor/editor-v1-adapters": "4.1.0-812",
49
+ "@elementor/env": "4.1.0-812",
50
+ "@elementor/events": "4.1.0-812",
51
+ "@elementor/http-client": "4.1.0-812",
52
52
  "@elementor/icons": "^1.68.0",
53
- "@elementor/locations": "4.1.0-810",
54
- "@elementor/query": "4.1.0-810",
55
- "@elementor/session": "4.1.0-810",
53
+ "@elementor/locations": "4.1.0-812",
54
+ "@elementor/query": "4.1.0-812",
55
+ "@elementor/session": "4.1.0-812",
56
56
  "@elementor/ui": "1.37.5",
57
- "@elementor/utils": "4.1.0-810",
58
- "@elementor/wp-media": "4.1.0-810",
57
+ "@elementor/utils": "4.1.0-812",
58
+ "@elementor/wp-media": "4.1.0-812",
59
59
  "@monaco-editor/react": "^4.7.0",
60
60
  "@tiptap/extension-bold": "^3.11.1",
61
61
  "@tiptap/extension-document": "^3.11.1",
@@ -7,6 +7,7 @@ import { __ } from '@wordpress/i18n';
7
7
 
8
8
  import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-context';
9
9
  import { ControlFormLabel } from '../components/control-form-label';
10
+ import { getSelectRenderValue } from './select-control';
10
11
  import { SizeControl } from './size-control';
11
12
 
12
13
  type Positions =
@@ -40,6 +41,8 @@ export const PositionControl = () => {
40
41
 
41
42
  const isCustom = !! positionContext.value;
42
43
 
44
+ const placeholder = positionContext.placeholder ? 'custom' : stringPropContext.placeholder ?? null;
45
+
43
46
  const handlePositionChange = ( event: SelectChangeEvent< Positions > ) => {
44
47
  const value = event.target.value || null;
45
48
 
@@ -60,9 +63,13 @@ export const PositionControl = () => {
60
63
  <Grid item xs={ 6 } sx={ { overflow: 'hidden' } }>
61
64
  <Select
62
65
  size="tiny"
66
+ displayEmpty
63
67
  disabled={ stringPropContext.disabled }
64
68
  value={ ( positionContext.value ? 'custom' : stringPropContext.value ) ?? '' }
65
69
  onChange={ handlePositionChange }
70
+ renderValue={ ( selectedValue: string | null ) =>
71
+ getSelectRenderValue( positionOptions, placeholder, selectedValue )
72
+ }
66
73
  fullWidth
67
74
  >
68
75
  { positionOptions.map( ( { label, value } ) => (
@@ -66,7 +66,7 @@ export const SelectControl = createControl(
66
66
  }
67
67
  );
68
68
 
69
- function getSelectRenderValue(
69
+ export function getSelectRenderValue(
70
70
  options: SelectOption[],
71
71
  placeholder: string | null | undefined,
72
72
  selectedValue: string | null