@bikdotai/bik-component-library 0.0.777-beta.12 → 0.0.777-beta.16
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/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.d.ts +12 -4
- package/dist/cjs/components/WhatsAppTextEditor/WhatsAppTextEditor.js +2 -2
- package/dist/cjs/components/WhatsAppTextEditor/ai/aiTag.d.ts +17 -0
- package/dist/cjs/components/WhatsAppTextEditor/ai/aiTag.js +1 -1
- package/dist/cjs/helpers/BaseWhatsappContentLang.helper.js +1 -1
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.d.ts +12 -4
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditor.js +2 -2
- package/dist/esm/components/WhatsAppTextEditor/ai/aiTag.d.ts +17 -0
- package/dist/esm/components/WhatsAppTextEditor/ai/aiTag.js +1 -1
- package/dist/esm/helpers/BaseWhatsappContentLang.helper.js +1 -1
- package/package.json +1 -1
|
@@ -4,12 +4,18 @@ import type { APIAdapter } from '../bik-chatbot/types/ai';
|
|
|
4
4
|
import { AIActionPromptConfig, AIActionPromptRegistry, TemplateType } from './ai/actionRegistry';
|
|
5
5
|
import { AITagPayload } from './ai/aiTag';
|
|
6
6
|
import { AIActionToneOption, AIActionVariant, AIEditorActionType, AIEditorActionTypes, EditorActionTypes, WhatsAppEditorRightSlotProps } from './WhatsAppTextEditorHeader';
|
|
7
|
-
type AIEventName = 'ai_action_triggered' | 'ai_feedback_submitted' | 'ai_suggestion_accepted' | 'ai_suggestion_discarded';
|
|
7
|
+
type AIEventName = 'ai_action_triggered' | 'ai_feedback_submitted' | 'ai_suggestion_accepted' | 'ai_suggestion_discarded' | 'ai_suggestion_edited' | 'ai_instruction_used';
|
|
8
|
+
declare enum AIFeedbackRating {
|
|
9
|
+
LIKE = "like",
|
|
10
|
+
DISLIKE = "dislike"
|
|
11
|
+
}
|
|
8
12
|
type AIEventPayload = {
|
|
9
13
|
action_type: AIEditorActionType;
|
|
10
14
|
template_id?: string | number;
|
|
11
|
-
|
|
15
|
+
template_category?: TemplateType;
|
|
16
|
+
rating?: AIFeedbackRating;
|
|
12
17
|
candidate_index?: number;
|
|
18
|
+
instruction_text?: string;
|
|
13
19
|
};
|
|
14
20
|
type AIActionRequestPayload = {
|
|
15
21
|
actionType: AIEditorActionType;
|
|
@@ -45,6 +51,7 @@ export type CustomEditorProps = React.TextareaHTMLAttributes<HTMLTextAreaElement
|
|
|
45
51
|
onError?: (err: string) => void;
|
|
46
52
|
onClickVariable?: (variable: string) => void;
|
|
47
53
|
editorInstanceKey?: string;
|
|
54
|
+
editorSessionId?: string;
|
|
48
55
|
templateType?: TemplateType;
|
|
49
56
|
templateId?: string | number;
|
|
50
57
|
requestExecutor?: ApiRequestExecutor;
|
|
@@ -62,7 +69,7 @@ export type CustomEditorProps = React.TextareaHTMLAttributes<HTMLTextAreaElement
|
|
|
62
69
|
rephraseTones?: AIActionToneOption[];
|
|
63
70
|
aiActionMinChars?: Partial<Record<AIEditorActionType, number>>;
|
|
64
71
|
instructionSuggestions?: string[];
|
|
65
|
-
|
|
72
|
+
onAnalyticsEvent?: (name: AIEventName, payload: AIEventPayload) => void;
|
|
66
73
|
/**
|
|
67
74
|
* Fires when the user **Accepts** an AI suggestion. Persist `payload.isAiTagged` (or the
|
|
68
75
|
* full payload) in host state and send on template save — the editor ref `get()` only
|
|
@@ -112,6 +119,7 @@ export declare const WhatsAppTextEditor: React.ForwardRefExoticComponent<React.T
|
|
|
112
119
|
onError?: ((err: string) => void) | undefined;
|
|
113
120
|
onClickVariable?: ((variable: string) => void) | undefined;
|
|
114
121
|
editorInstanceKey?: string | undefined;
|
|
122
|
+
editorSessionId?: string | undefined;
|
|
115
123
|
templateType?: string | undefined;
|
|
116
124
|
templateId?: string | number | undefined;
|
|
117
125
|
requestExecutor?: ApiRequestExecutor | undefined;
|
|
@@ -129,7 +137,7 @@ export declare const WhatsAppTextEditor: React.ForwardRefExoticComponent<React.T
|
|
|
129
137
|
rephraseTones?: AIActionToneOption[] | undefined;
|
|
130
138
|
aiActionMinChars?: Partial<Record<AIEditorActionTypes, number>> | undefined;
|
|
131
139
|
instructionSuggestions?: string[] | undefined;
|
|
132
|
-
|
|
140
|
+
onAnalyticsEvent?: ((name: AIEventName, payload: AIEventPayload) => void) | undefined;
|
|
133
141
|
/**
|
|
134
142
|
* Fires when the user **Accepts** an AI suggestion. Persist `payload.isAiTagged` (or the
|
|
135
143
|
* full payload) in host state and send on template save — the editor ref `get()` only
|