@qwanyx/stack 0.2.24 → 0.2.26

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.
@@ -87,6 +87,7 @@ export declare class MailClient {
87
87
  listEmailsSorted(accountId: string, folder?: string, limit?: number): Promise<MailListResult>;
88
88
  /**
89
89
  * Get a single email by UID with full body content (server-side parsing)
90
+ * Returns attachments list from backend
90
91
  */
91
92
  getEmail(accountId: string, uid: number, folder?: string): Promise<{
92
93
  uid: number;
@@ -95,6 +96,11 @@ export declare class MailClient {
95
96
  date: string;
96
97
  body: string;
97
98
  seen: boolean;
99
+ attachments?: Array<{
100
+ filename: string;
101
+ content_type: string;
102
+ size: number;
103
+ }>;
98
104
  } | null>;
99
105
  /**
100
106
  * Get a specific attachment from an email
@@ -106,6 +112,25 @@ export declare class MailClient {
106
112
  size: number;
107
113
  data: string;
108
114
  } | null>;
115
+ /**
116
+ * Search emails by contact email address
117
+ * Searches INBOX for emails FROM the contact, and Sent folder for emails TO the contact
118
+ * Returns combined results sorted by date (newest first)
119
+ */
120
+ searchContactEmails(accountId: string, contactEmail: string, limit?: number): Promise<{
121
+ contact_email: string;
122
+ count: number;
123
+ messages: Array<{
124
+ uid: number;
125
+ message_id?: string;
126
+ subject: string;
127
+ from: string;
128
+ to: string;
129
+ date: string;
130
+ seen: boolean;
131
+ direction: 'inbound' | 'outbound';
132
+ }>;
133
+ }>;
109
134
  /**
110
135
  * Get email with client-side parsing using postal-mime
111
136
  * This handles CID embedded images by converting them to base64 data URIs
@@ -155,4 +180,27 @@ export declare class MailClient {
155
180
  timestamp?: string;
156
181
  error?: string;
157
182
  }>;
183
+ /**
184
+ * Send an email reply via SMTP
185
+ * Supports HTML, attachments, and reply threading
186
+ * Uses the email coprocessor which gets SMTP settings from user's email accounts
187
+ * @param accountId - The account to send from (used to look up SMTP settings)
188
+ * @param options - Email options
189
+ */
190
+ sendEmail(accountId: string, options: {
191
+ to: string | string[];
192
+ subject: string;
193
+ html: string;
194
+ text?: string;
195
+ in_reply_to?: string;
196
+ attachments?: Array<{
197
+ filename: string;
198
+ content_type: string;
199
+ data: string;
200
+ }>;
201
+ }): Promise<{
202
+ success: boolean;
203
+ message_id?: string;
204
+ error?: string;
205
+ }>;
158
206
  }
@@ -20,6 +20,10 @@ export interface ComboBoxProps {
20
20
  allowCreate?: boolean;
21
21
  /** Called when a new option is created (can be async) */
22
22
  onCreate?: (label: string) => ComboBoxOption | Promise<ComboBoxOption> | void;
23
+ /** Allow deleting options */
24
+ allowDelete?: boolean;
25
+ /** Called when an option is deleted */
26
+ onDelete?: (id: string) => void | Promise<void>;
23
27
  /** Label above the input */
24
28
  label?: string;
25
29
  /** Disabled state */
@@ -41,4 +45,4 @@ export interface ComboBoxTheme {
41
45
  chipText?: string;
42
46
  hoverBackground?: string;
43
47
  }
44
- export declare function ComboBox({ options, value, onChange, placeholder, allowCreate, onCreate, label, disabled, max, theme: themeProp, className, }: ComboBoxProps): import("react/jsx-runtime").JSX.Element;
48
+ export declare function ComboBox({ options, value, onChange, placeholder, allowCreate, onCreate, allowDelete, onDelete, label, disabled, max, theme: themeProp, className, }: ComboBoxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * KanbanBoard Component
3
+ * A generic, reusable Trello-like board with drag-and-drop
4
+ *
5
+ * Features:
6
+ * - Configurable columns (status, pipeline stages, etc.)
7
+ * - Drag-drop between columns (change state)
8
+ * - Drag-drop within columns (reorder)
9
+ * - Fully typed with generics
10
+ */
11
+ import React from 'react';
12
+ export interface ColumnConfig {
13
+ id: string;
14
+ label: string;
15
+ color?: string;
16
+ }
17
+ export interface KanbanBoardProps<T> {
18
+ /** Items to display */
19
+ items: T[];
20
+ /** Column configuration */
21
+ columns: ColumnConfig[];
22
+ /** Get unique ID from item */
23
+ getItemId: (item: T) => string;
24
+ /** Get column ID the item belongs to */
25
+ getItemColumn: (item: T) => string;
26
+ /** Get item order within column (for sorting) */
27
+ getItemOrder?: (item: T) => number;
28
+ /** Render the item content */
29
+ renderItem: (item: T, isDragging: boolean) => React.ReactNode;
30
+ /** Called when item is moved to different column */
31
+ onItemMove: (itemId: string, fromColumn: string, toColumn: string, newIndex: number) => void;
32
+ /** Called when item is reordered within same column */
33
+ onItemReorder?: (itemId: string, columnId: string, newIndex: number) => void;
34
+ /** Called when item is clicked */
35
+ onItemClick?: (item: T) => void;
36
+ /** Custom column header renderer */
37
+ renderColumnHeader?: (column: ColumnConfig, count: number) => React.ReactNode;
38
+ /** Custom column footer renderer (for add buttons) */
39
+ renderColumnFooter?: (column: ColumnConfig) => React.ReactNode;
40
+ /** Styling */
41
+ className?: string;
42
+ columnClassName?: string;
43
+ itemClassName?: string;
44
+ }
45
+ export declare function KanbanBoard<T>({ items, columns, getItemId, getItemColumn, getItemOrder, renderItem, onItemMove, onItemReorder, onItemClick, renderColumnHeader, renderColumnFooter, className, columnClassName, itemClassName, }: KanbanBoardProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -18,6 +18,9 @@ export interface MailProps {
18
18
  folder?: string;
19
19
  selectable?: boolean;
20
20
  showDetail?: boolean;
21
+ showSearch?: boolean;
22
+ searchQuery?: string;
23
+ onSearchChange?: (query: string) => void;
21
24
  emptyMessage?: string;
22
25
  autoLoad?: boolean;
23
26
  onSelect?: (email: EmailMessage) => void;
@@ -50,4 +53,4 @@ export interface MailActions {
50
53
  selectAll: () => void;
51
54
  clearSelection: () => void;
52
55
  }
53
- export declare function Mail({ baseUrl, systemId, accountId, limit, folder, selectable, showDetail, emptyMessage, autoLoad, onSelect, onSelectionChange, onDelete, onError, onLoad, renderItem, renderDetail, renderActions, renderEmpty, renderLoading, theme: themeProp, }: MailProps): import("react/jsx-runtime").JSX.Element;
56
+ export declare function Mail({ baseUrl, systemId, accountId, limit, folder, selectable, showDetail, showSearch, searchQuery: searchQueryProp, onSearchChange, emptyMessage, autoLoad, onSelect, onSelectionChange, onDelete, onError, onLoad, renderItem, renderDetail, renderActions, renderEmpty, renderLoading, theme: themeProp, }: MailProps): import("react/jsx-runtime").JSX.Element;
@@ -23,6 +23,8 @@ export interface MailEditorProps {
23
23
  className?: string;
24
24
  /** Minimum height */
25
25
  minHeight?: string;
26
+ /** Force external update (e.g., AI-generated content) - set to timestamp/id to trigger */
27
+ externalUpdate?: string | number;
26
28
  }
27
29
  export interface MailEditorTheme {
28
30
  background?: string;
@@ -34,4 +36,4 @@ export interface MailEditorTheme {
34
36
  quoteBorder?: string;
35
37
  quoteBackground?: string;
36
38
  }
37
- export declare function MailEditor({ value, onChange, placeholder, replyTo, theme: themeProp, disabled, className, minHeight, }: MailEditorProps): import("react/jsx-runtime").JSX.Element;
39
+ export declare function MailEditor({ value, onChange, placeholder, replyTo, theme: themeProp, disabled, className, minHeight, externalUpdate, }: MailEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Timeline Component
3
+ * Vertical timeline for calendar day/week views
4
+ *
5
+ * Features:
6
+ * - Configurable hour range
7
+ * - All-day section at top
8
+ * - Positioned items based on time
9
+ * - Click on time slots
10
+ */
11
+ import React from 'react';
12
+ export interface TimelineProps<T> {
13
+ /** Items to display */
14
+ items: T[];
15
+ /** Current date being displayed */
16
+ date: Date;
17
+ /** Start hour of the day (default: 7) */
18
+ startHour?: number;
19
+ /** End hour of the day (default: 22) */
20
+ endHour?: number;
21
+ /** Height per hour in pixels (default: 60) */
22
+ hourHeight?: number;
23
+ /** Get the scheduled time from item (HH:mm format, null for unscheduled) */
24
+ getItemTime: (item: T) => string | null;
25
+ /** Get duration in minutes (default: 30) */
26
+ getItemDuration: (item: T) => number;
27
+ /** Check if item is all-day */
28
+ getItemIsAllDay: (item: T) => boolean;
29
+ /** Get unique ID */
30
+ getItemId: (item: T) => string;
31
+ /** Render the item content */
32
+ renderItem: (item: T) => React.ReactNode;
33
+ /** Called when item is clicked */
34
+ onItemClick?: (item: T) => void;
35
+ /** Called when empty time slot is clicked */
36
+ onTimeSlotClick?: (time: string) => void;
37
+ /** Show current time indicator */
38
+ showCurrentTime?: boolean;
39
+ /** Custom styling */
40
+ className?: string;
41
+ /** Theme overrides */
42
+ theme?: Partial<TimelineTheme>;
43
+ }
44
+ export interface TimelineTheme {
45
+ background: string;
46
+ hourLineColor: string;
47
+ halfHourLineColor: string;
48
+ hourTextColor: string;
49
+ currentTimeColor: string;
50
+ allDayBackground: string;
51
+ allDayBorder: string;
52
+ }
53
+ export declare function Timeline<T>({ items, date, startHour, endHour, hourHeight, getItemTime, getItemDuration, getItemIsAllDay, getItemId, renderItem, onItemClick, onTimeSlotClick, showCurrentTime, className, theme: themeProp, }: TimelineProps<T>): import("react/jsx-runtime").JSX.Element;