@echothink-ui/inbox 0.1.0

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.
Files changed (52) hide show
  1. package/README.md +5 -0
  2. package/dist/components/AgentDraftReviewPanel.d.ts +18 -0
  3. package/dist/components/ApprovalToSendPanel.d.ts +11 -0
  4. package/dist/components/AttachmentList.d.ts +8 -0
  5. package/dist/components/AttachmentPreview.d.ts +7 -0
  6. package/dist/components/EmailAutomationRulePanel.d.ts +8 -0
  7. package/dist/components/InboxShell.d.ts +10 -0
  8. package/dist/components/LabelManager.d.ts +9 -0
  9. package/dist/components/MailboxFolderList.d.ts +8 -0
  10. package/dist/components/MessageComposer.d.ts +13 -0
  11. package/dist/components/MessageFilterBar.d.ts +13 -0
  12. package/dist/components/MessageList.d.ts +8 -0
  13. package/dist/components/MessagePreview.d.ts +9 -0
  14. package/dist/components/MessageSearch.d.ts +11 -0
  15. package/dist/components/MessageThread.d.ts +22 -0
  16. package/dist/components/PriorityInboxView.d.ts +14 -0
  17. package/dist/components/RecipientPicker.d.ts +10 -0
  18. package/dist/components/ThreadSummaryPanel.d.ts +9 -0
  19. package/dist/index.cjs +1699 -0
  20. package/dist/index.cjs.map +1 -0
  21. package/dist/index.css +2155 -0
  22. package/dist/index.css.map +1 -0
  23. package/dist/index.d.ts +21 -0
  24. package/dist/index.js +1645 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/types.d.ts +75 -0
  27. package/dist/utils.d.ts +5 -0
  28. package/package.json +44 -0
  29. package/src/components/AgentDraftReviewPanel.tsx +128 -0
  30. package/src/components/ApprovalToSendPanel.tsx +118 -0
  31. package/src/components/AttachmentList.tsx +85 -0
  32. package/src/components/AttachmentPreview.tsx +207 -0
  33. package/src/components/EmailAutomationRulePanel.tsx +100 -0
  34. package/src/components/InboxShell.tsx +62 -0
  35. package/src/components/LabelManager.tsx +147 -0
  36. package/src/components/MailboxFolderList.tsx +66 -0
  37. package/src/components/MessageComposer.tsx +160 -0
  38. package/src/components/MessageFilterBar.test.tsx +34 -0
  39. package/src/components/MessageFilterBar.tsx +69 -0
  40. package/src/components/MessageList.tsx +101 -0
  41. package/src/components/MessagePreview.test.tsx +48 -0
  42. package/src/components/MessagePreview.tsx +84 -0
  43. package/src/components/MessageSearch.tsx +96 -0
  44. package/src/components/MessageThread.tsx +173 -0
  45. package/src/components/PriorityInboxView.tsx +74 -0
  46. package/src/components/RecipientPicker.tsx +181 -0
  47. package/src/components/ThreadSummaryPanel.tsx +107 -0
  48. package/src/index.test.tsx +276 -0
  49. package/src/index.tsx +60 -0
  50. package/src/styles.css +2523 -0
  51. package/src/types.ts +85 -0
  52. package/src/utils.ts +33 -0
package/src/types.ts ADDED
@@ -0,0 +1,85 @@
1
+ import type * as React from "react";
2
+ import type { EthOperationalStatus } from "@echothink-ui/core";
3
+
4
+ export interface Attachment {
5
+ id: string;
6
+ name: string;
7
+ size: number;
8
+ mimeType: string;
9
+ src?: string;
10
+ previewUrl?: string;
11
+ }
12
+
13
+ export interface ThreadMessage {
14
+ id: string;
15
+ from: string;
16
+ to: string[];
17
+ cc?: string[];
18
+ bcc?: string[];
19
+ date: string;
20
+ subject?: string;
21
+ body: string;
22
+ attachments?: Attachment[];
23
+ }
24
+
25
+ export interface MessageThreadModel {
26
+ id: string;
27
+ subject: string;
28
+ messages: ThreadMessage[];
29
+ }
30
+
31
+ export interface InboxThread {
32
+ id: string;
33
+ subject: string;
34
+ preview: string;
35
+ from: string;
36
+ receivedAt: string;
37
+ unread?: boolean;
38
+ priority?: "high" | "normal" | "low";
39
+ labels?: string[];
40
+ status?: EthOperationalStatus;
41
+ }
42
+
43
+ export interface MailboxFolder {
44
+ id: string;
45
+ label: string;
46
+ icon?: React.ReactNode;
47
+ count?: number;
48
+ smart?: boolean;
49
+ }
50
+
51
+ export interface MessageDraft {
52
+ to?: string[];
53
+ cc?: string[];
54
+ bcc?: string[];
55
+ subject?: string;
56
+ body?: string;
57
+ attachments?: Attachment[];
58
+ }
59
+
60
+ export interface RecipientSuggestion {
61
+ id: string;
62
+ label: string;
63
+ email: string;
64
+ }
65
+
66
+ export interface MailLabel {
67
+ id: string;
68
+ label: string;
69
+ count?: number;
70
+ }
71
+
72
+ export interface AutomationRule {
73
+ id: string;
74
+ name: string;
75
+ conditions: React.ReactNode;
76
+ actions: React.ReactNode;
77
+ enabled: boolean;
78
+ }
79
+
80
+ export interface ThreadCitation {
81
+ id: string;
82
+ label: string;
83
+ href?: string;
84
+ messageRef?: string;
85
+ }
package/src/utils.ts ADDED
@@ -0,0 +1,33 @@
1
+ export function formatDateTime(value: string) {
2
+ const date = new Date(value);
3
+ if (Number.isNaN(date.getTime())) return value;
4
+ return new Intl.DateTimeFormat(undefined, {
5
+ month: "short",
6
+ day: "numeric",
7
+ hour: "numeric",
8
+ minute: "2-digit"
9
+ }).format(date);
10
+ }
11
+
12
+ export function formatBytes(size: number) {
13
+ if (size < 1024) return `${size} B`;
14
+ if (size < 1024 * 1024) return `${Math.round(size / 1024)} KB`;
15
+ return `${(size / (1024 * 1024)).toFixed(1)} MB`;
16
+ }
17
+
18
+ export function listToInput(value: string[] | undefined) {
19
+ return value?.join(", ") ?? "";
20
+ }
21
+
22
+ export function inputToList(value: string) {
23
+ return value
24
+ .split(",")
25
+ .map((item) => item.trim())
26
+ .filter(Boolean);
27
+ }
28
+
29
+ export function prioritySeverity(priority: "high" | "normal" | "low" | undefined) {
30
+ if (priority === "high") return "danger";
31
+ if (priority === "low") return "neutral";
32
+ return "info";
33
+ }