react-mail-inbox 2.0.3 → 2.0.5
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/README.md +7 -0
- package/dist/{index.mjs → index.js} +2 -2
- package/dist/{index.mjs.map → index.js.map} +1 -1
- package/package.json +3 -4
- package/dist/index.d.mts +0 -103
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-mail-inbox",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "A customizable Gmail-style inbox component with rich text editing",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "./dist/index.js",
|
|
6
|
-
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.
|
|
12
|
-
"require": "./dist/index.js"
|
|
11
|
+
"import": "./dist/index.js"
|
|
13
12
|
},
|
|
14
13
|
"./styles.css": {
|
|
15
14
|
"default": "./dist/index.css"
|
package/dist/index.d.mts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
type Theme = "light" | "dark";
|
|
5
|
-
interface ThemeContextType {
|
|
6
|
-
theme: Theme;
|
|
7
|
-
toggleTheme: () => void;
|
|
8
|
-
}
|
|
9
|
-
declare const useTheme: () => ThemeContextType;
|
|
10
|
-
|
|
11
|
-
interface EmailOption {
|
|
12
|
-
name: string;
|
|
13
|
-
email: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface EmailData {
|
|
17
|
-
to: EmailOption[];
|
|
18
|
-
cc: EmailOption[];
|
|
19
|
-
bcc: EmailOption[];
|
|
20
|
-
subject: string;
|
|
21
|
-
body: string;
|
|
22
|
-
attachments: File[];
|
|
23
|
-
isReply?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface GmailInboxProps {
|
|
27
|
-
/** Function to fetch recipient suggestions based on input. */
|
|
28
|
-
fetchEmailOptions: (currentEmail: string) => Promise<EmailOption[]>;
|
|
29
|
-
/** Callback triggered when the email is "sent" or updated. */
|
|
30
|
-
handleChange: (emailData: EmailData) => void;
|
|
31
|
-
/** Initial values for the email fields (to, subject, body, etc.). */
|
|
32
|
-
initialData?: Partial<EmailData>;
|
|
33
|
-
/** Default theme for the inbox component ('light' or 'dark'). Defaults to 'dark'. */
|
|
34
|
-
initialTheme?: Theme;
|
|
35
|
-
/** Callback triggered when the theme is toggled. */
|
|
36
|
-
onThemeChange?: (theme: Theme) => void;
|
|
37
|
-
/** Component to render on the left side of the toolbar. */
|
|
38
|
-
leftChildren?: ReactNode;
|
|
39
|
-
/** Component to render on the right side of the toolbar. */
|
|
40
|
-
rightChildren?: ReactNode;
|
|
41
|
-
/** Custom tool to render inside the plugin-wrapper. */
|
|
42
|
-
customTool?: ReactNode;
|
|
43
|
-
/** Placeholder text for the editor. */
|
|
44
|
-
placeholder?: string;
|
|
45
|
-
/** Minimum height of the editor. Defaults to '400px'. */
|
|
46
|
-
minHeight?: string;
|
|
47
|
-
/** If true, only the editor body is rendered, hiding the to/cc/bcc/subject fields. */
|
|
48
|
-
showOnlyBody?: boolean;
|
|
49
|
-
/** If true, the inbox is in reply mode, prefixing the subject with "Re: ". */
|
|
50
|
-
isReply?: boolean;
|
|
51
|
-
/** Optional: Configuration for Google Drive integration. */
|
|
52
|
-
googleDriveConfig?: {
|
|
53
|
-
/** The OAuth 2.0 Client ID for your Google Cloud project. */
|
|
54
|
-
clientId: string;
|
|
55
|
-
/** The API Key for your Google Cloud project. */
|
|
56
|
-
apiKey: string;
|
|
57
|
-
/** Optional: Scopes required for the Drive picker. */
|
|
58
|
-
scopes?: string;
|
|
59
|
-
/** Optional: Discovery doc URLs for Google APIs. */
|
|
60
|
-
discoveryDocs?: string[];
|
|
61
|
-
};
|
|
62
|
-
/** Custom AI preview component */
|
|
63
|
-
aiContentComponent?: ReactNode;
|
|
64
|
-
/** The AI-generated content */
|
|
65
|
-
aiContent?: string;
|
|
66
|
-
/** Control visibility of AI preview */
|
|
67
|
-
showAiPreview?: boolean;
|
|
68
|
-
/** Callback when AI content is inserted */
|
|
69
|
-
onAiInsert?: (content: string) => void;
|
|
70
|
-
/** Callback when AI content is discarded */
|
|
71
|
-
onAiDiscard?: () => void;
|
|
72
|
-
}
|
|
73
|
-
declare function GmailInbox({ fetchEmailOptions, handleChange, initialData, initialTheme, onThemeChange, leftChildren, rightChildren, customTool, showOnlyBody, isReply, googleDriveConfig, aiContentComponent, aiContent, showAiPreview, onAiInsert, onAiDiscard, placeholder, minHeight, }: GmailInboxProps): react_jsx_runtime.JSX.Element;
|
|
74
|
-
|
|
75
|
-
type AiInsertHandler = (content: string) => void;
|
|
76
|
-
type AiDiscardHandler = () => void;
|
|
77
|
-
interface ComposeBoxProps {
|
|
78
|
-
/** Custom AI preview component from consumer */
|
|
79
|
-
aiContentComponent?: ReactNode;
|
|
80
|
-
/** The AI-generated content from consumer */
|
|
81
|
-
aiContent?: string;
|
|
82
|
-
/** Control visibility from consumer */
|
|
83
|
-
showAiPreview?: boolean;
|
|
84
|
-
/** Callback provided BY library TO consumer when content is inserted */
|
|
85
|
-
onAiInsert?: (content: string) => void;
|
|
86
|
-
/** Callback provided BY library TO consumer when content is discarded */
|
|
87
|
-
onAiDiscard?: () => void;
|
|
88
|
-
placeholder?: string;
|
|
89
|
-
minHeight?: string;
|
|
90
|
-
initialHTML?: string;
|
|
91
|
-
onChange?: (html: string) => void;
|
|
92
|
-
leftChildren?: ReactNode;
|
|
93
|
-
rightChildren?: ReactNode;
|
|
94
|
-
customTool?: ReactNode;
|
|
95
|
-
isEditorVisible?: boolean;
|
|
96
|
-
editorChildren?: ReactNode;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
declare function ComposeBox({ aiContentComponent, aiContent, showAiPreview, onAiInsert, onAiDiscard, placeholder, initialHTML, rightChildren, leftChildren, customTool, minHeight, onChange, editorChildren, isEditorVisible, }: ComposeBoxProps): react_jsx_runtime.JSX.Element;
|
|
100
|
-
|
|
101
|
-
type Alignment = "left" | "center" | "right";
|
|
102
|
-
|
|
103
|
-
export { type AiDiscardHandler, type AiInsertHandler, type Alignment, ComposeBox, type ComposeBoxProps, type EmailData, type EmailOption, GmailInbox, type Theme, GmailInbox as default, useTheme };
|