@elementor/editor-controls 4.4.0-1125 → 4.4.0-1127
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 +18 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/controls/email-form-action-control/fields.tsx +27 -2
- package/src/controls/notice-control.tsx +11 -1
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.4.0-
|
|
4
|
+
"version": "4.4.0-1127",
|
|
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.4.0-
|
|
44
|
-
"@elementor/editor-elements": "4.4.0-
|
|
45
|
-
"@elementor/editor-props": "4.4.0-
|
|
46
|
-
"@elementor/editor-responsive": "4.4.0-
|
|
47
|
-
"@elementor/editor-ui": "4.4.0-
|
|
48
|
-
"@elementor/editor-v1-adapters": "4.4.0-
|
|
49
|
-
"@elementor/env": "4.4.0-
|
|
50
|
-
"@elementor/events": "4.4.0-
|
|
51
|
-
"@elementor/http-client": "4.4.0-
|
|
43
|
+
"@elementor/editor-current-user": "4.4.0-1127",
|
|
44
|
+
"@elementor/editor-elements": "4.4.0-1127",
|
|
45
|
+
"@elementor/editor-props": "4.4.0-1127",
|
|
46
|
+
"@elementor/editor-responsive": "4.4.0-1127",
|
|
47
|
+
"@elementor/editor-ui": "4.4.0-1127",
|
|
48
|
+
"@elementor/editor-v1-adapters": "4.4.0-1127",
|
|
49
|
+
"@elementor/env": "4.4.0-1127",
|
|
50
|
+
"@elementor/events": "4.4.0-1127",
|
|
51
|
+
"@elementor/http-client": "4.4.0-1127",
|
|
52
52
|
"@elementor/icons": "~1.75.1",
|
|
53
|
-
"@elementor/locations": "4.4.0-
|
|
54
|
-
"@elementor/query": "4.4.0-
|
|
55
|
-
"@elementor/schema": "4.4.0-
|
|
56
|
-
"@elementor/session": "4.4.0-
|
|
53
|
+
"@elementor/locations": "4.4.0-1127",
|
|
54
|
+
"@elementor/query": "4.4.0-1127",
|
|
55
|
+
"@elementor/schema": "4.4.0-1127",
|
|
56
|
+
"@elementor/session": "4.4.0-1127",
|
|
57
57
|
"@elementor/ui": "1.37.5",
|
|
58
|
-
"@elementor/utils": "4.4.0-
|
|
59
|
-
"@elementor/wp-media": "4.4.0-
|
|
58
|
+
"@elementor/utils": "4.4.0-1127",
|
|
59
|
+
"@elementor/wp-media": "4.4.0-1127",
|
|
60
60
|
"@monaco-editor/react": "^4.7.0",
|
|
61
61
|
"@tanstack/react-virtual": "^3.13.3",
|
|
62
62
|
"@tiptap/extension-bold": "^3.11.1",
|
|
@@ -13,6 +13,31 @@ import { EmailChipsField } from './email-chips-field';
|
|
|
13
13
|
import { EmailField } from './email-field';
|
|
14
14
|
import { shouldShowMentionsInfo } from './utils';
|
|
15
15
|
|
|
16
|
+
const FieldValueMentionField = ( {
|
|
17
|
+
bind,
|
|
18
|
+
label,
|
|
19
|
+
placeholder,
|
|
20
|
+
}: {
|
|
21
|
+
bind: string;
|
|
22
|
+
label: string;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
} ) => {
|
|
25
|
+
const suggestions = useFormFieldSuggestions();
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<PropKeyProvider bind={ bind }>
|
|
29
|
+
<Grid container direction="column" gap={ 0.5 }>
|
|
30
|
+
<Grid item>
|
|
31
|
+
<ControlFormLabel>{ label }</ControlFormLabel>
|
|
32
|
+
</Grid>
|
|
33
|
+
<Grid item>
|
|
34
|
+
<MentionTextAreaControl suggestions={ suggestions } rows={ 1 } placeholder={ placeholder } />
|
|
35
|
+
</Grid>
|
|
36
|
+
</Grid>
|
|
37
|
+
</PropKeyProvider>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
16
41
|
export const SendToField = ( { placeholder }: { placeholder?: string } ) => {
|
|
17
42
|
const suggestions = useFormFieldSuggestions( { inputType: 'email' } );
|
|
18
43
|
|
|
@@ -35,7 +60,7 @@ export const SendToField = ( { placeholder }: { placeholder?: string } ) => {
|
|
|
35
60
|
};
|
|
36
61
|
|
|
37
62
|
export const SubjectField = () => (
|
|
38
|
-
<
|
|
63
|
+
<FieldValueMentionField
|
|
39
64
|
bind="subject"
|
|
40
65
|
label={ __( 'Email subject', 'elementor' ) }
|
|
41
66
|
placeholder={ __( 'New form submission', 'elementor' ) }
|
|
@@ -78,7 +103,7 @@ export const FromEmailField = () => (
|
|
|
78
103
|
);
|
|
79
104
|
|
|
80
105
|
export const FromNameField = () => (
|
|
81
|
-
<
|
|
106
|
+
<FieldValueMentionField
|
|
82
107
|
bind="from-name"
|
|
83
108
|
label={ __( 'From name', 'elementor' ) }
|
|
84
109
|
placeholder={ __( 'What name should appear as the sender?', 'elementor' ) }
|
|
@@ -45,9 +45,19 @@ const markNoticeAsDismissedInSession = ( dismissId: string ) => {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
const isNoticeDismissed = ( dismissId?: string ) => {
|
|
49
|
+
if ( ! dismissId ) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const dismissedNotices = ( window as ExtendedWindow ).elementor?.config?.user?.dismissed_editor_notices;
|
|
54
|
+
|
|
55
|
+
return !! dismissedNotices?.includes( dismissId );
|
|
56
|
+
};
|
|
57
|
+
|
|
48
58
|
export const NoticeControl = createControl(
|
|
49
59
|
( { noticeType = 'info', heading, content, dismissible, buttonText, buttonUrl }: NoticeControlProps ) => {
|
|
50
|
-
const [ isDismissed, setIsDismissed ] = useState(
|
|
60
|
+
const [ isDismissed, setIsDismissed ] = useState( () => isNoticeDismissed( dismissible ) );
|
|
51
61
|
|
|
52
62
|
if ( isDismissed || ! content ) {
|
|
53
63
|
return null;
|