@chatcops/widget 0.4.3 → 0.5.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.
package/README.md CHANGED
@@ -116,11 +116,11 @@ ChatCops.init(config) // Initialize the widget
116
116
  ChatCops.open() // Open the chat panel (popup mode)
117
117
  ChatCops.close() // Close the chat panel
118
118
  ChatCops.destroy() // Remove widget and clean up
119
- ChatCops.on(event, handler) // Subscribe to events
119
+ ChatCops.on(event, handler) // Subscribe to events (returns unsubscribe function)
120
120
  ChatCops.off(event, handler) // Unsubscribe
121
121
  ```
122
122
 
123
- Events: `open`, `close`, `message`, `error`.
123
+ Events: `open`, `close`, `message`, `error`, `leadCaptured`, `preChatSubmit`.
124
124
 
125
125
  ## Script Tag Attributes
126
126
 
@@ -1,10 +1,12 @@
1
1
  import type { WidgetChatRequest, WidgetChatChunk } from './types.js';
2
2
  export interface ChatClientOptions {
3
3
  apiUrl: string;
4
+ /** Inactivity timeout in milliseconds. Defaults to 30000. */
4
5
  timeout?: number;
5
6
  }
6
7
  export interface SendMessageOptions {
7
8
  signal?: AbortSignal;
9
+ /** Override the client's inactivity timeout for this request, in milliseconds. */
8
10
  timeout?: number;
9
11
  }
10
12
  export declare class ChatClient {
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,EAAE,iBAAiB;IAK/B,WAAW,CAChB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,kBAAuB,GAC/B,cAAc,CAAC,eAAe,CAAC;CA8EnC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,EAAE,iBAAiB;IAK/B,WAAW,CAChB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,kBAAuB,GAC/B,cAAc,CAAC,eAAe,CAAC;CAmHnC"}