@bigbinary/neeto-molecules 3.13.4 → 3.13.6
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/EmailForm.js +140 -11
- package/dist/EmailForm.js.map +1 -1
- package/dist/MoreDropdown.js +1 -0
- package/dist/MoreDropdown.js.map +1 -1
- package/dist/cjs/EmailForm.js +140 -8
- package/dist/cjs/EmailForm.js.map +1 -1
- package/dist/cjs/MoreDropdown.js +1 -0
- package/dist/cjs/MoreDropdown.js.map +1 -1
- package/package.json +1 -1
- package/types/EmailForm.d.ts +120 -41
- package/types/EmailFormProvider.d.ts +1 -1
- package/types/EmailPreview.d.ts +12 -11
- package/types/Header.d.ts +0 -1
package/types/EmailForm.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { HelpPopoverProps } from './HelpPopover.js';
|
|
3
|
-
import '
|
|
3
|
+
import { EmailPreviewProps } from './EmailPreview.js';
|
|
4
|
+
import { HeaderProps } from './Header.js';
|
|
5
|
+
import { TooltipProps, SwitchProps } from '@bigbinary/neetoui';
|
|
6
|
+
import 'components/Header/constants';
|
|
7
|
+
import 'neetoui';
|
|
8
|
+
import './MoreDropdown.js';
|
|
4
9
|
|
|
5
10
|
type ContentVariables = {
|
|
6
11
|
label: string;
|
|
@@ -17,6 +22,36 @@ type ReplyToFieldProps = {
|
|
|
17
22
|
type SendToFieldProps = {
|
|
18
23
|
options?: FieldOptions[];
|
|
19
24
|
};
|
|
25
|
+
type EmailFormProps = {
|
|
26
|
+
messageVariables?: ContentVariables[];
|
|
27
|
+
subjectVariables?: ContentVariables[];
|
|
28
|
+
handleCancel?: () => void;
|
|
29
|
+
isLoading?: boolean;
|
|
30
|
+
replyToOptions?: FieldOptions[];
|
|
31
|
+
sendToOptions?: FieldOptions[];
|
|
32
|
+
isUpdating?: boolean;
|
|
33
|
+
showFields?: boolean;
|
|
34
|
+
className?: string;
|
|
35
|
+
replyToFieldProps?: ReplyToFieldProps;
|
|
36
|
+
sendToFieldProps?: SendToFieldProps;
|
|
37
|
+
};
|
|
38
|
+
interface ExtendedEmailPreviewProps extends EmailPreviewProps {
|
|
39
|
+
formatBody?: () => void;
|
|
40
|
+
formatSubject?: () => void;
|
|
41
|
+
bodyVariables?: object;
|
|
42
|
+
subjectVariables?: object;
|
|
43
|
+
}
|
|
44
|
+
interface InitialValues {
|
|
45
|
+
sendTo?: string[];
|
|
46
|
+
sendToId?: string;
|
|
47
|
+
sendToCc?: string[];
|
|
48
|
+
sendToBcc?: string[];
|
|
49
|
+
replyTo?: string;
|
|
50
|
+
showCopyEmails?: boolean;
|
|
51
|
+
subject?: string;
|
|
52
|
+
message?: string;
|
|
53
|
+
isEnabled?: boolean;
|
|
54
|
+
}
|
|
20
55
|
/**
|
|
21
56
|
*
|
|
22
57
|
* This is a component used to create or edit an email template. It includes fields
|
|
@@ -25,43 +60,77 @@ type SendToFieldProps = {
|
|
|
25
60
|
*
|
|
26
61
|
* It also provides options to insert variables into the message and subject field,
|
|
27
62
|
*
|
|
28
|
-
* validate input, and handle save or cancel actions.
|
|
63
|
+
* validate input, and handle save or cancel actions.
|
|
64
|
+
*
|
|
65
|
+
* The component works with a preview feature that shows how the email will look in
|
|
29
66
|
*
|
|
30
|
-
*
|
|
67
|
+
* real time. As users add or change content in the template, the preview updates
|
|
68
|
+
*
|
|
69
|
+
* instantly, so they can see exactly how the email will appear before saving it.
|
|
70
|
+
*
|
|
71
|
+
* 
|
|
31
72
|
*
|
|
32
73
|
* @example
|
|
33
74
|
*
|
|
34
|
-
* import
|
|
75
|
+
* import EmailForm from "@bigbinary/neeto-molecules/EmailForm";
|
|
35
76
|
*
|
|
36
77
|
* const EmailComposer = () => {
|
|
37
78
|
* return (
|
|
38
|
-
* <
|
|
39
|
-
* {
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
79
|
+
* <EmailForm
|
|
80
|
+
* initialValues={{
|
|
81
|
+
* message: "Test Message",
|
|
82
|
+
* subject: "Test Subject",
|
|
83
|
+
* }}
|
|
84
|
+
* onSubmit={handleSubmit}
|
|
85
|
+
* showReplyToField={showReplyToField}
|
|
86
|
+
* showSendToField={showSendToField}
|
|
87
|
+
* showSendToAsRadio={showSendToAsRadio}
|
|
88
|
+
* formikProps={formikProps}
|
|
89
|
+
* validationSchema={validationSchema}
|
|
90
|
+
* switchProps={ name: "isEnabled", value: true }
|
|
91
|
+
* titleProps={ value: "Title" }
|
|
92
|
+
* headerProps={{
|
|
93
|
+
* size: "small",
|
|
94
|
+
* title: "Header",
|
|
95
|
+
* breadcrumbs: [
|
|
96
|
+
* { text: "First", link: "first-example" },
|
|
97
|
+
* { text: "Second", link: "second-example" },
|
|
98
|
+
* { text: "Third" },
|
|
99
|
+
* ],
|
|
100
|
+
* titleHelpPopoverProps: { title: "title help popover props" },
|
|
101
|
+
* }}
|
|
102
|
+
* mobilePreviewProps={{
|
|
103
|
+
* message: 'Preview Message',
|
|
104
|
+
* className: "neeto-ui-bg-gray-200 lg:hidden",
|
|
105
|
+
* }}
|
|
106
|
+
* emailFormProps={{
|
|
107
|
+
* messageVariables,
|
|
108
|
+
* subjectVariables,
|
|
109
|
+
* replyToFieldProps: {
|
|
110
|
+
* options: [
|
|
111
|
+
* {
|
|
112
|
+
* label: "Email Fugiat ratione nihil qui?",
|
|
113
|
+
* value: "no-reply@example.com",
|
|
114
|
+
* },
|
|
115
|
+
* ],
|
|
116
|
+
* popoverProps: {
|
|
117
|
+
* helpLinkProps: {
|
|
118
|
+
* label: "Help link",
|
|
119
|
+
* href: "https://help.neetoform.com/articles/reply-to-field-for-emails",
|
|
120
|
+
* },
|
|
121
|
+
* },
|
|
122
|
+
* },
|
|
123
|
+
* sendToFieldProps: { options: sendToOptions },
|
|
124
|
+
* sendToOptions,
|
|
125
|
+
* }}
|
|
126
|
+
* emailPreviewProps={{
|
|
127
|
+
* customContent: <Footer {...{ kind }} />,
|
|
128
|
+
* formatBody,
|
|
129
|
+
* formatSubject,
|
|
130
|
+
* bodyVariables,
|
|
131
|
+
* subjectVariables,
|
|
132
|
+
* }}
|
|
133
|
+
* />
|
|
65
134
|
* );
|
|
66
135
|
* };
|
|
67
136
|
*
|
|
@@ -69,17 +138,27 @@ type SendToFieldProps = {
|
|
|
69
138
|
* @endexample
|
|
70
139
|
*/
|
|
71
140
|
declare const EmailForm: React.FC<{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
isUpdating?: boolean;
|
|
141
|
+
onSubmit: FormikConfig<T>["onSubmit"];
|
|
142
|
+
initialValues: InitialValues;
|
|
143
|
+
formikProps?: {
|
|
144
|
+
[key: string]: any;
|
|
145
|
+
};
|
|
146
|
+
validationSchema?: ValidationMap;
|
|
79
147
|
showFields?: boolean;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
148
|
+
showSendToField?: boolean;
|
|
149
|
+
showReplyToField?: boolean;
|
|
150
|
+
showSendToAsRadio?: boolean;
|
|
151
|
+
showCcField?: boolean;
|
|
152
|
+
showBccField?: boolean;
|
|
153
|
+
isLoading?: boolean;
|
|
154
|
+
maxEmails?: number;
|
|
155
|
+
emailFormProps?: EmailFormProps;
|
|
156
|
+
emailPreviewProps?: Partial<ExtendedEmailPreviewProps>;
|
|
157
|
+
headerProps?: HeaderProps;
|
|
158
|
+
tooltipProps?: Partial<TooltipProps>;
|
|
159
|
+
switchProps?: SwitchProps;
|
|
160
|
+
mobilePreviewProps?: object;
|
|
161
|
+
children?: React.ReactNode;
|
|
83
162
|
}>;
|
|
84
163
|
|
|
85
164
|
export { EmailForm as default };
|
package/types/EmailPreview.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
interface EmailPreviewProps {
|
|
4
|
+
to?: string[];
|
|
5
|
+
subject?: string;
|
|
6
|
+
body?: string;
|
|
7
|
+
from?: string;
|
|
8
|
+
logo?: string;
|
|
9
|
+
actionButtonText?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
customContent?: React.ReactNode;
|
|
12
|
+
}
|
|
3
13
|
/**
|
|
4
14
|
*
|
|
5
15
|
* A common component to preview emails.
|
|
@@ -28,15 +38,6 @@ import React from 'react';
|
|
|
28
38
|
* export default EmailShare;
|
|
29
39
|
* @endexample
|
|
30
40
|
*/
|
|
31
|
-
declare const EmailPreview: React.FC<
|
|
32
|
-
to?: string[];
|
|
33
|
-
subject?: string;
|
|
34
|
-
body?: string;
|
|
35
|
-
from?: string;
|
|
36
|
-
logo?: string;
|
|
37
|
-
actionButtonText?: string;
|
|
38
|
-
className?: string;
|
|
39
|
-
customContent?: React.ReactNode;
|
|
40
|
-
}>;
|
|
41
|
+
declare const EmailPreview: React.FC<EmailPreviewProps>;
|
|
41
42
|
|
|
42
|
-
export { EmailPreview as default };
|
|
43
|
+
export { type EmailPreviewProps, EmailPreview as default };
|