@snf/qa-bot-core 0.2.7 → 0.2.9

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.
@@ -10,6 +10,10 @@
10
10
  * the full message content in our own localStorage. The history dropdown
11
11
  * restores sessions directly from our storage, not RCB's.
12
12
  *
13
+ * Note: react-chatbotify wraps all messages (including plain strings) in JSX
14
+ * before firing events. We use extractTextFromJsx() to recover the text content
15
+ * from bot messages so they appear in restored sessions.
16
+ *
13
17
  * Deduplication is handled by session-utils (checks message ID).
14
18
  *
15
19
  * Must be rendered inside ChatBotProvider.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Extracts plain text content from a JSX element or any value.
3
+ *
4
+ * react-chatbotify wraps bot messages in JSX before firing events,
5
+ * even when the flow step defines a plain string like:
6
+ * message: "What is your help ticket related to?"
7
+ *
8
+ * This function recursively extracts the text so we can store it
9
+ * in session history. Without this, bot messages would be lost
10
+ * when restoring sessions.
11
+ *
12
+ * @param element - Any value (string, number, JSX element, array, etc.)
13
+ * @returns The extracted text content, or empty string if none found
14
+ */
15
+ export declare function extractTextFromJsx(element: unknown): string;
@@ -7,7 +7,7 @@
7
7
  * Usage for consumers:
8
8
  * localStorage.setItem('QA_BOT_DEBUG', 'true'); // Enable debug logs + version
9
9
  */
10
- export declare const LIB_VERSION = "0.2.7";
10
+ export declare const LIB_VERSION = "0.2.9";
11
11
  export declare const logger: {
12
12
  version: () => void;
13
13
  session: (action: string, ...args: unknown[]) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snf/qa-bot-core",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "A configurable chatbot setup for quick integration of RAG-powered Q&A and rating system",
5
5
  "main": "./dist/qa-bot-core.umd.cjs",
6
6
  "module": "./dist/qa-bot-core.js",