@helpway/react 0.16.0 → 0.17.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/dist/index.d.ts +14 -6
- package/dist/index.js +39 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/themed/styles.css +30 -7
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,12 @@ interface HelpwayWidgetProps {
|
|
|
67
67
|
* Only used when `placement="docked"`.
|
|
68
68
|
*/
|
|
69
69
|
dockSuggestions?: readonly DockSuggestion[];
|
|
70
|
+
/**
|
|
71
|
+
* Render your own agent avatar (e.g. an animated mascot) wherever the
|
|
72
|
+
* widget shows the AI agent. Wins over the dashboard avatar image; an
|
|
73
|
+
* assigned human's photo still wins over it.
|
|
74
|
+
*/
|
|
75
|
+
agentAvatar?: ReactNode;
|
|
70
76
|
/**
|
|
71
77
|
* CSS selector for a custom trigger element (e.g. `"#support-btn"`).
|
|
72
78
|
* Clicking the matched element calls `Helpway.open()`. Combine with
|
|
@@ -103,7 +109,7 @@ type HelpwayPublicAPI = HelpwayMethods;
|
|
|
103
109
|
* `layout.tsx`, or `main.tsx`). Unmounting cleanly tears down the
|
|
104
110
|
* widget and its WebSocket connection — useful for route-scoped mounts.
|
|
105
111
|
*/
|
|
106
|
-
declare function HelpwayWidget({ apiKey, apiUrl, locale, initialConversationId, deepLinkToken, onReady, hideLauncher, placement, colorScheme, dockSuggestions, customLauncherSelector, onOpen, onClose, onUnreadChange, theme, src, }: HelpwayWidgetProps): react_jsx_runtime.JSX.Element;
|
|
112
|
+
declare function HelpwayWidget({ apiKey, apiUrl, locale, initialConversationId, deepLinkToken, onReady, hideLauncher, placement, colorScheme, dockSuggestions, agentAvatar, customLauncherSelector, onOpen, onClose, onUnreadChange, theme, src, }: HelpwayWidgetProps): react_jsx_runtime.JSX.Element;
|
|
107
113
|
|
|
108
114
|
interface IdentifyData {
|
|
109
115
|
externalId: string;
|
|
@@ -319,16 +325,18 @@ declare function useAwaitingReply(): number;
|
|
|
319
325
|
*/
|
|
320
326
|
declare function useRealtime(handler: (event: RealtimeEvent) => void): void;
|
|
321
327
|
|
|
328
|
+
declare const AgentAvatarProvider: react.Provider<ReactNode>;
|
|
322
329
|
/**
|
|
323
330
|
* WidgetLogo — chat-header avatar. Renders WHO is talking to the
|
|
324
331
|
* visitor right now. Resolution chain:
|
|
325
332
|
* 1. Active conversation's assigned support user (assigneeName +
|
|
326
333
|
* assigneeImage from the widget API). When a human takes over a
|
|
327
334
|
* conversation the visitor sees that human, not the AI agent.
|
|
328
|
-
* 2.
|
|
329
|
-
* 3. Agent
|
|
330
|
-
* 4.
|
|
331
|
-
* 5.
|
|
335
|
+
* 2. Host-rendered avatar (`agentAvatar` prop, via AgentAvatarContext)
|
|
336
|
+
* 3. Agent uploaded image (agentConfig.avatarUrl)
|
|
337
|
+
* 4. Agent icon preset (avatarPreset + brandColor)
|
|
338
|
+
* 5. Website logo (website.logoUrl)
|
|
339
|
+
* 6. Helpway brand mark (octagonal) as the true last-resort fallback
|
|
332
340
|
*
|
|
333
341
|
* The `forceAgent` escape hatch skips the assignee lookup — used by
|
|
334
342
|
* surfaces that mean "the agent" specifically (welcome card, conversation
|
|
@@ -578,4 +586,4 @@ declare function MarkdownContent({ bodyHtml, bodyMarkdown, className, }: {
|
|
|
578
586
|
className?: string;
|
|
579
587
|
}): react_jsx_runtime.JSX.Element | null;
|
|
580
588
|
|
|
581
|
-
export { type AnnouncementPreviewEntry, AnnouncementPreviews, type AnnouncementPreviewsPlacement, type AnnouncementPreviewsProps, Composer, DefaultWidget, type HelpwayPublicAPI, HelpwayWidget, type HelpwayWidgetProps, type IdentifyData, MarkdownContent, MessageBubble, MessageList, MessagePreview, type MessagePreviewPlacement, type MessagePreviewProps, SupportProvider, WidgetLogo, linkifyText, renderMarkdown, useAwaitingReply, useComposer, useConversations, useIdentify, usePresence, useRealtime, useTimeline, useUnread, useWidget, useWidgetStore };
|
|
589
|
+
export { AgentAvatarProvider, type AnnouncementPreviewEntry, AnnouncementPreviews, type AnnouncementPreviewsPlacement, type AnnouncementPreviewsProps, Composer, DefaultWidget, type HelpwayPublicAPI, HelpwayWidget, type HelpwayWidgetProps, type IdentifyData, MarkdownContent, MessageBubble, MessageList, MessagePreview, type MessagePreviewPlacement, type MessagePreviewProps, SupportProvider, WidgetLogo, linkifyText, renderMarkdown, useAwaitingReply, useComposer, useConversations, useIdentify, usePresence, useRealtime, useTimeline, useUnread, useWidget, useWidgetStore };
|