@snf/qa-bot-core 0.2.3-beta.4 → 0.2.3-beta.6
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/qa-bot-core.js +1 -1
- package/dist/qa-bot-core.js.map +1 -1
- package/dist/qa-bot-core.standalone.js +1 -1
- package/dist/qa-bot-core.standalone.js.map +1 -1
- package/dist/qa-bot-core.umd.cjs +1 -1
- package/dist/qa-bot-core.umd.cjs.map +1 -1
- package/dist/types/lib.d.ts +2 -0
- package/dist/types/utils/flow-settings.d.ts +35 -0
- package/package.json +1 -1
package/dist/types/lib.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export { useScreenshotCapture } from './hooks/useScreenshotCapture';
|
|
|
7
7
|
export type { ScreenshotCaptureResult } from './hooks/useScreenshotCapture';
|
|
8
8
|
export { fileToBase64, filesToBase64, validateFileSize, formatFileSize } from './utils/file-utils';
|
|
9
9
|
export type { ProcessedFile } from './utils/file-utils';
|
|
10
|
+
export { applyFlowSettings } from './utils/flow-settings';
|
|
11
|
+
export type { FlowSettingsOptions } from './utils/flow-settings';
|
|
10
12
|
export type { QABotProps, BotControllerHandle } from './config';
|
|
11
13
|
/**
|
|
12
14
|
* ===========================================
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flow Settings Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for processing flow configurations to handle
|
|
5
|
+
* common patterns and work around react-chatbotify quirks.
|
|
6
|
+
*/
|
|
7
|
+
import type { Flow } from 'react-chatbotify';
|
|
8
|
+
export interface FlowSettingsOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Automatically set chatDisabled based on step type:
|
|
11
|
+
* - Steps with options/checkboxes → chatDisabled: true
|
|
12
|
+
* - Steps without → chatDisabled: false
|
|
13
|
+
*
|
|
14
|
+
* Only applies to steps that don't already have chatDisabled explicitly set.
|
|
15
|
+
*
|
|
16
|
+
* This works around a react-chatbotify quirk where chatDisabled state
|
|
17
|
+
* persists across step transitions instead of falling back to settings.
|
|
18
|
+
*/
|
|
19
|
+
disableOnOptions?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Apply settings/transformations to a flow object.
|
|
23
|
+
*
|
|
24
|
+
* @param flow - The flow configuration to process
|
|
25
|
+
* @param options - Settings to apply
|
|
26
|
+
* @returns A new flow object with settings applied
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const processedFlow = applyFlowSettings(myFlow, {
|
|
31
|
+
* disableOnOptions: true
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyFlowSettings(flow: Flow, options: FlowSettingsOptions): Flow;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snf/qa-bot-core",
|
|
3
|
-
"version": "0.2.3-beta.
|
|
3
|
+
"version": "0.2.3-beta.6",
|
|
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",
|