@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/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/controls/email-form-action-control/email-chips-field.tsx +47 -37
- package/src/controls/email-form-action-control/fields.tsx +3 -1
- package/src/controls/email-form-action-control/index.tsx +2 -4
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-
|
|
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-
|
|
44
|
-
"@elementor/editor-elements": "4.3.0-
|
|
45
|
-
"@elementor/editor-props": "4.3.0-
|
|
46
|
-
"@elementor/editor-responsive": "4.3.0-
|
|
47
|
-
"@elementor/editor-ui": "4.3.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "4.3.0-
|
|
49
|
-
"@elementor/env": "4.3.0-
|
|
50
|
-
"@elementor/events": "4.3.0-
|
|
51
|
-
"@elementor/http-client": "4.3.0-
|
|
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-
|
|
54
|
-
"@elementor/query": "4.3.0-
|
|
55
|
-
"@elementor/schema": "4.3.0-
|
|
56
|
-
"@elementor/session": "4.3.0-
|
|
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-
|
|
59
|
-
"@elementor/wp-media": "4.3.0-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
type EmailChipsFieldProps = {
|
|
14
|
-
fieldLabel: string;
|
|
13
|
+
type EmailChipsControlProps = {
|
|
15
14
|
placeholder?: string;
|
|
16
15
|
};
|
|
17
16
|
|
|
18
|
-
export const
|
|
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
|
-
<
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
<
|
|
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 {
|
|
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
|
-
<
|
|
34
|
-
<SendToField placeholder={ toPlaceholder } />
|
|
35
|
-
</PropKeyProvider>
|
|
33
|
+
<SendToField placeholder={ toPlaceholder } />
|
|
36
34
|
<SubjectField />
|
|
37
35
|
<MessageField />
|
|
38
36
|
<FromEmailField />
|