vpschatbotwidget 1.2.2 → 1.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpschatbotwidget",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "private": false,
5
5
  "description": "This is an Package for the chatbot widget ui for our customer portel . ",
6
6
  "homepage": "https://github.com/dhineshkumar-natobotics/VPS-Chatbot-Widget#readme",
@@ -10,12 +10,18 @@ import {
10
10
  import { useChatbot } from "../hooks/useChatbot";
11
11
  import { ChatEmptyState } from "./ChatEmptyState";
12
12
  import { ChatMessageBubble } from "./ChatMessage";
13
+ import { ChatSuggestions } from "./ChatSuggestions";
14
+ import type { Suggestion } from "../api/chatbot-types";
13
15
 
14
16
  export const ChatMessageList: React.FC<{ onEdit?: (text: string) => void }> = ({ onEdit }) => {
15
- const { messages, status } = useChatbot();
17
+ const { messages, status, suggestions, showSuggestions, sendMessage } = useChatbot();
16
18
  const isBusy = status === "awaiting" || status === "connecting";
17
19
  const visibleMessages = messages.filter((message) => message.status !== "error");
18
20
 
21
+ // const handleSuggestionSelect = (suggestion: Suggestion) => {
22
+ // void sendMessage(suggestion.query);
23
+ // };
24
+
19
25
  return (
20
26
  <MessageScrollerProvider
21
27
  autoScroll
@@ -403,8 +403,10 @@ export const ChatProvider: React.FC<ChatProviderProps> = ({
403
403
  suggestions,
404
404
  showSuggestions:
405
405
  !disableSuggestions &&
406
+ status === "idle" &&
406
407
  (messages.length === 0 ||
407
- (messages.length === 1 && messages[0].id === "welcome-default")),
408
+ (messages.length === 1 && messages[0].id === "welcome-default") ||
409
+ messages.some((m) => m.role === "assistant" && m.status === "complete" && !m.id.startsWith("welcome"))),
408
410
  suggestionBadgesEnabled: !disableSuggestions,
409
411
  userContext: effectiveUserContext,
410
412
  apiBaseUrl: client.apiBaseUrl,
package/src/index.css CHANGED
@@ -1637,6 +1637,32 @@ button {
1637
1637
  justify-content: flex-start;
1638
1638
  }
1639
1639
 
1640
+ /* Post-reply suggestion block shown after last assistant message */
1641
+ .chat-post-reply-suggestions {
1642
+ padding: 4px 0 8px;
1643
+ }
1644
+
1645
+ .chat-post-reply-suggestions .suggestions-list {
1646
+ margin-top: 4px;
1647
+ }
1648
+
1649
+ .chat-post-reply-suggestions .vps-ui-button {
1650
+ background-color: var(--card-bg);
1651
+ border-color: var(--border-light);
1652
+ color: var(--text-main);
1653
+ font-size: 12.5px;
1654
+ font-weight: 500;
1655
+ text-align: left;
1656
+ border-radius: 10px;
1657
+ transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
1658
+ }
1659
+
1660
+ .chat-post-reply-suggestions .vps-ui-button:hover:not(:disabled) {
1661
+ border-color: var(--primary);
1662
+ background-color: var(--orange-50);
1663
+ box-shadow: 0 1px 4px rgba(255, 71, 23, 0.1);
1664
+ }
1665
+
1640
1666
  /* ── Inline citations ─────────────────────────────────────────── */
1641
1667
  .inline-citation {
1642
1668
  display: inline-block;