@elementor/editor-controls 4.3.0-966 → 4.3.0-967

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.3.0-966",
4
+ "version": "4.3.0-967",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,23 +40,23 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-current-user": "4.3.0-966",
44
- "@elementor/editor-elements": "4.3.0-966",
45
- "@elementor/editor-props": "4.3.0-966",
46
- "@elementor/editor-responsive": "4.3.0-966",
47
- "@elementor/editor-ui": "4.3.0-966",
48
- "@elementor/editor-v1-adapters": "4.3.0-966",
49
- "@elementor/env": "4.3.0-966",
50
- "@elementor/events": "4.3.0-966",
51
- "@elementor/http-client": "4.3.0-966",
43
+ "@elementor/editor-current-user": "4.3.0-967",
44
+ "@elementor/editor-elements": "4.3.0-967",
45
+ "@elementor/editor-props": "4.3.0-967",
46
+ "@elementor/editor-responsive": "4.3.0-967",
47
+ "@elementor/editor-ui": "4.3.0-967",
48
+ "@elementor/editor-v1-adapters": "4.3.0-967",
49
+ "@elementor/env": "4.3.0-967",
50
+ "@elementor/events": "4.3.0-967",
51
+ "@elementor/http-client": "4.3.0-967",
52
52
  "@elementor/icons": "~1.75.1",
53
- "@elementor/locations": "4.3.0-966",
54
- "@elementor/query": "4.3.0-966",
55
- "@elementor/schema": "4.3.0-966",
56
- "@elementor/session": "4.3.0-966",
53
+ "@elementor/locations": "4.3.0-967",
54
+ "@elementor/query": "4.3.0-967",
55
+ "@elementor/schema": "4.3.0-967",
56
+ "@elementor/session": "4.3.0-967",
57
57
  "@elementor/ui": "1.37.5",
58
- "@elementor/utils": "4.3.0-966",
59
- "@elementor/wp-media": "4.3.0-966",
58
+ "@elementor/utils": "4.3.0-967",
59
+ "@elementor/wp-media": "4.3.0-967",
60
60
  "@monaco-editor/react": "^4.7.0",
61
61
  "@tiptap/extension-bold": "^3.11.1",
62
62
  "@tiptap/extension-document": "^3.11.1",
@@ -6,16 +6,15 @@ import { Autocomplete, Grid, TextField } from '@elementor/ui';
6
6
  import { useBoundProp } from '../../bound-prop-context';
7
7
  import { ChipsList } from '../../components/chips-list';
8
8
  import { ControlFormLabel } from '../../components/control-form-label';
9
+ import ControlActions from '../../control-actions/control-actions';
10
+ import { createControl } from '../../create-control';
9
11
  import { CHIP_TRIGGER_KEYS, isValidEmail } from './utils';
10
12
 
11
- // type EmailChip = { label: string; value: string };
12
-
13
- type EmailChipsFieldProps = {
14
- fieldLabel: string;
13
+ type EmailChipsControlProps = {
15
14
  placeholder?: string;
16
15
  };
17
16
 
18
- export const EmailChipsField = ( { fieldLabel, placeholder }: EmailChipsFieldProps ) => {
17
+ export const EmailChipsControl = createControl( ( { placeholder }: EmailChipsControlProps ) => {
19
18
  const { value, setValue, disabled } = useBoundProp( stringArrayPropTypeUtil );
20
19
  const [ inputValue, setInputValue ] = useState( '' );
21
20
 
@@ -68,37 +67,48 @@ export const EmailChipsField = ( { fieldLabel, placeholder }: EmailChipsFieldPro
68
67
  };
69
68
 
70
69
  return (
71
- <Grid container direction="column" gap={ 0.5 }>
72
- <Grid item>
73
- <ControlFormLabel>{ fieldLabel }</ControlFormLabel>
74
- </Grid>
75
- <Grid item>
76
- <Autocomplete
77
- fullWidth
78
- multiple
79
- freeSolo
80
- size="tiny"
81
- disabled={ disabled }
82
- inputValue={ inputValue }
83
- onInputChange={ ( _, val, reason ) => {
84
- if ( reason !== 'reset' ) {
85
- setInputValue( val );
86
- }
87
- } }
88
- value={ selectedValues }
89
- onChange={ handleChange }
90
- options={ [] }
91
- onBlur={ handleBlur }
92
- getOptionLabel={ ( option ) => option }
93
- isOptionEqualToValue={ ( option, val ) => option === val }
94
- renderInput={ ( params ) => (
95
- <TextField { ...params } placeholder={ placeholder } onKeyDown={ handleKeyDown } />
96
- ) }
97
- renderTags={ ( tagValues, getTagProps ) => (
98
- <ChipsList getLabel={ ( option ) => option } getTagProps={ getTagProps } values={ tagValues } />
99
- ) }
100
- />
101
- </Grid>
102
- </Grid>
70
+ <ControlActions>
71
+ <Autocomplete
72
+ fullWidth
73
+ multiple
74
+ freeSolo
75
+ size="tiny"
76
+ disabled={ disabled }
77
+ inputValue={ inputValue }
78
+ onInputChange={ ( _, val, reason ) => {
79
+ if ( reason !== 'reset' ) {
80
+ setInputValue( val );
81
+ }
82
+ } }
83
+ value={ selectedValues }
84
+ onChange={ handleChange }
85
+ options={ [] }
86
+ onBlur={ handleBlur }
87
+ getOptionLabel={ ( option ) => option }
88
+ isOptionEqualToValue={ ( option, val ) => option === val }
89
+ renderInput={ ( params ) => (
90
+ <TextField { ...params } placeholder={ placeholder } onKeyDown={ handleKeyDown } />
91
+ ) }
92
+ renderTags={ ( tagValues, getTagProps ) => (
93
+ <ChipsList getLabel={ ( option ) => option } getTagProps={ getTagProps } values={ tagValues } />
94
+ ) }
95
+ />
96
+ </ControlActions>
103
97
  );
98
+ } );
99
+
100
+ type EmailChipsFieldProps = {
101
+ fieldLabel: string;
102
+ placeholder?: string;
104
103
  };
104
+
105
+ export const EmailChipsField = ( { fieldLabel, placeholder }: EmailChipsFieldProps ) => (
106
+ <Grid container direction="column" gap={ 0.5 }>
107
+ <Grid item>
108
+ <ControlFormLabel>{ fieldLabel }</ControlFormLabel>
109
+ </Grid>
110
+ <Grid item>
111
+ <EmailChipsControl placeholder={ placeholder } />
112
+ </Grid>
113
+ </Grid>
114
+ );
@@ -14,7 +14,9 @@ import { EmailField } from './email-field';
14
14
  import { shouldShowMentionsInfo } from './utils';
15
15
 
16
16
  export const SendToField = ( { placeholder }: { placeholder?: string } ) => (
17
- <EmailChipsField fieldLabel={ __( 'Send to', 'elementor' ) } placeholder={ placeholder } />
17
+ <PropKeyProvider bind="to">
18
+ <EmailChipsField fieldLabel={ __( 'Send to', 'elementor' ) } placeholder={ placeholder } />
19
+ </PropKeyProvider>
18
20
  );
19
21
 
20
22
  export const SubjectField = () => (
@@ -4,7 +4,7 @@ import { CollapsibleContent } from '@elementor/editor-ui';
4
4
  import { Box, Divider, Stack } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
- import { PropKeyProvider, PropProvider, useBoundProp } from '../../bound-prop-context';
7
+ import { PropProvider, useBoundProp } from '../../bound-prop-context';
8
8
  import { ControlLabel } from '../../components/control-label';
9
9
  import { createControl } from '../../create-control';
10
10
  import {
@@ -30,9 +30,7 @@ export const EmailFormActionControl = createControl(
30
30
  <ControlLabel>
31
31
  { label ? label + ' ' + __( 'settings', 'elementor' ) : __( 'Email settings', 'elementor' ) }
32
32
  </ControlLabel>
33
- <PropKeyProvider bind="to">
34
- <SendToField placeholder={ toPlaceholder } />
35
- </PropKeyProvider>
33
+ <SendToField placeholder={ toPlaceholder } />
36
34
  <SubjectField />
37
35
  <MessageField />
38
36
  <FromEmailField />