@v-tilt/browser 1.4.1 → 1.4.2
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/all-external-dependencies.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/extensions/chat/chat-wrapper.d.ts +25 -1
- package/dist/extensions/chat/chat.d.ts +30 -2
- package/dist/extensions/chat/types.d.ts +3 -1
- package/dist/external-scripts-loader.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +43 -0
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.no-external.d.ts +43 -0
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/recorder.js.map +1 -1
- package/dist/utils/globals.d.ts +29 -0
- package/dist/web-vitals.js.map +1 -1
- package/lib/extensions/chat/chat-wrapper.d.ts +25 -1
- package/lib/extensions/chat/chat-wrapper.js +42 -0
- package/lib/extensions/chat/chat.d.ts +30 -2
- package/lib/extensions/chat/chat.js +881 -243
- package/lib/extensions/chat/types.d.ts +3 -1
- package/lib/utils/globals.d.ts +29 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Type definitions for the chat widget extension.
|
|
5
5
|
* Core types are re-exported from globals.ts for consistency.
|
|
6
6
|
*/
|
|
7
|
-
export type { ChatMessage, ChatChannel, ChatConfig, ChatTheme, LazyLoadedChatInterface, } from "../../utils/globals";
|
|
7
|
+
export type { ChatMessage, ChatChannel, ChatChannelSummary, ChatConfig, ChatTheme, ChatWidgetView, LazyLoadedChatInterface, } from "../../utils/globals";
|
|
8
8
|
/**
|
|
9
9
|
* Sender types for chat messages
|
|
10
10
|
*/
|
|
@@ -106,6 +106,8 @@ export interface ChatWidgetState {
|
|
|
106
106
|
isConnected: boolean;
|
|
107
107
|
isLoading: boolean;
|
|
108
108
|
unreadCount: number;
|
|
109
|
+
currentView: import("../../utils/globals").ChatWidgetView;
|
|
110
|
+
channels: import("../../utils/globals").ChatChannelSummary[];
|
|
109
111
|
channel: import("../../utils/globals").ChatChannel | null;
|
|
110
112
|
messages: import("../../utils/globals").ChatMessage[];
|
|
111
113
|
isTyping: boolean;
|
package/lib/utils/globals.d.ts
CHANGED
|
@@ -76,6 +76,25 @@ export interface ChatChannel {
|
|
|
76
76
|
agent_last_read_at: string | null;
|
|
77
77
|
created_at: string;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Lightweight channel summary for channel list view
|
|
81
|
+
* Used to avoid loading full channel data until user selects one
|
|
82
|
+
*/
|
|
83
|
+
export interface ChatChannelSummary {
|
|
84
|
+
id: string;
|
|
85
|
+
status: "open" | "closed" | "snoozed";
|
|
86
|
+
ai_mode: boolean;
|
|
87
|
+
last_message_at: string | null;
|
|
88
|
+
last_message_preview: string | null;
|
|
89
|
+
last_message_sender: "user" | "agent" | "ai" | "system" | null;
|
|
90
|
+
unread_count: number;
|
|
91
|
+
user_last_read_at: string | null;
|
|
92
|
+
created_at: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Widget view state - determines what UI to show
|
|
96
|
+
*/
|
|
97
|
+
export type ChatWidgetView = "list" | "conversation";
|
|
79
98
|
/**
|
|
80
99
|
* Chat widget configuration
|
|
81
100
|
*
|
|
@@ -138,11 +157,21 @@ export interface LazyLoadedChatInterface {
|
|
|
138
157
|
readonly isLoading: boolean;
|
|
139
158
|
readonly unreadCount: number;
|
|
140
159
|
readonly channel: ChatChannel | null;
|
|
160
|
+
readonly channels: ChatChannelSummary[];
|
|
161
|
+
readonly currentView: ChatWidgetView;
|
|
141
162
|
open(): void;
|
|
142
163
|
close(): void;
|
|
143
164
|
toggle(): void;
|
|
144
165
|
show(): void;
|
|
145
166
|
hide(): void;
|
|
167
|
+
/** Fetch/refresh the list of user's channels */
|
|
168
|
+
getChannels(): Promise<void>;
|
|
169
|
+
/** Select a channel and load its messages */
|
|
170
|
+
selectChannel(channelId: string): Promise<void>;
|
|
171
|
+
/** Create a new channel and enter it */
|
|
172
|
+
createChannel(): Promise<void>;
|
|
173
|
+
/** Go back to channel list from conversation view */
|
|
174
|
+
goToChannelList(): void;
|
|
146
175
|
sendMessage(content: string): Promise<void>;
|
|
147
176
|
markAsRead(): void;
|
|
148
177
|
onMessage(callback: (message: ChatMessage) => void): () => void;
|