@constructor-io/constructorio-ui-pia 2.11.0 → 2.13.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/constructorio-ui-pia-bundled.js +62 -62
- package/lib/cjs/components/CioPia/CioPiaQna.js +10 -4
- package/lib/cjs/components/CioPia/CioPiaStyles.css +5 -0
- package/lib/cjs/components/CioPia/PiaCustomCarousel.js +34 -29
- package/lib/cjs/components/ConversationHistory/ConversationHistory.js +10 -5
- package/lib/cjs/components/Error/ErrorBlock.js +7 -5
- package/lib/cjs/components/Feedback/Feedback.js +4 -4
- package/lib/cjs/components/Input/Input.js +2 -1
- package/lib/cjs/components/LoadingSkeleton/LoadingSkeleton.js +2 -1
- package/lib/cjs/components/PiaConversation/PiaModal.js +22 -4
- package/lib/cjs/components/StatusRegion/StatusRegion.js +34 -0
- package/lib/cjs/components/SuggestedQuestionsContainer/SuggestedQuestionsSkeleton.js +1 -1
- package/lib/cjs/components/icons/QuestionIcon.js +1 -1
- package/lib/cjs/components/icons/SendIcon.js +1 -1
- package/lib/cjs/components/icons/SparklesIcon.js +1 -1
- package/lib/cjs/hooks/useAnswerResults.js +4 -14
- package/lib/cjs/hooks/useCioPia.js +42 -4
- package/lib/cjs/hooks/useConversation.js +10 -8
- package/lib/cjs/hooks/usePiaClient.js +2 -7
- package/lib/cjs/hooks/useRecsPod.js +10 -5
- package/lib/cjs/hooks/useSuggestedQuestions.js +10 -26
- package/lib/cjs/types.js +0 -2
- package/lib/cjs/utils/translate.js +12 -0
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/components/CioPia/CioPiaQna.js +10 -4
- package/lib/mjs/components/CioPia/CioPiaStyles.css +5 -0
- package/lib/mjs/components/CioPia/PiaCustomCarousel.js +53 -30
- package/lib/mjs/components/ConversationHistory/ConversationHistory.js +10 -5
- package/lib/mjs/components/Error/ErrorBlock.js +7 -5
- package/lib/mjs/components/Feedback/Feedback.js +4 -4
- package/lib/mjs/components/Input/Input.js +2 -1
- package/lib/mjs/components/LoadingSkeleton/LoadingSkeleton.js +2 -1
- package/lib/mjs/components/PiaConversation/PiaModal.js +22 -4
- package/lib/mjs/components/StatusRegion/StatusRegion.js +28 -0
- package/lib/mjs/components/SuggestedQuestionsContainer/SuggestedQuestionsSkeleton.js +1 -1
- package/lib/mjs/components/icons/QuestionIcon.js +1 -1
- package/lib/mjs/components/icons/SendIcon.js +1 -1
- package/lib/mjs/components/icons/SparklesIcon.js +1 -1
- package/lib/mjs/hooks/useAnswerResults.js +4 -13
- package/lib/mjs/hooks/useCioPia.js +43 -4
- package/lib/mjs/hooks/useConversation.js +7 -5
- package/lib/mjs/hooks/usePiaClient.js +2 -7
- package/lib/mjs/hooks/useRecsPod.js +9 -5
- package/lib/mjs/hooks/useSuggestedQuestions.js +12 -24
- package/lib/mjs/types.js +0 -1
- package/lib/mjs/utils/translate.js +12 -0
- package/lib/mjs/version.js +1 -1
- package/lib/types/components/CioPia/types.d.ts +20 -5
- package/lib/types/components/ConversationHistory/ConversationHistory.d.ts +7 -1
- package/lib/types/components/Error/ErrorBlock.d.ts +9 -1
- package/lib/types/components/StatusRegion/StatusRegion.d.ts +13 -0
- package/lib/types/hooks/useAnswerResults.d.ts +4 -4
- package/lib/types/hooks/useCioPia.d.ts +20 -5
- package/lib/types/hooks/usePiaClient.d.ts +4 -9
- package/lib/types/hooks/useRecsPod.d.ts +2 -2
- package/lib/types/hooks/useSuggestedQuestions.d.ts +3 -4
- package/lib/types/types.d.ts +53 -6
- package/lib/types/utils/translate.d.ts +3 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/lib/cjs/hooks/mocks/MockConstructorIOClient.js +0 -24
- package/lib/cjs/hooks/mocks/agent.js +0 -183
- package/lib/cjs/hooks/mocks/types.js +0 -2
- package/lib/mjs/hooks/mocks/MockConstructorIOClient.js +0 -38
- package/lib/mjs/hooks/mocks/agent.js +0 -173
- package/lib/mjs/hooks/mocks/types.js +0 -1
- package/lib/types/hooks/mocks/MockConstructorIOClient.d.ts +0 -14
- package/lib/types/hooks/mocks/agent.d.ts +0 -23
- package/lib/types/hooks/mocks/types.d.ts +0 -77
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { ConstructorClientOptions, ItemData } from '@constructor-io/constructorio-client-javascript';
|
|
2
|
-
export type SuggestedQuestionsParameters = {
|
|
3
|
-
numResults?: number;
|
|
4
|
-
};
|
|
5
|
-
export type AgentUrlProps = {
|
|
6
|
-
itemId: string;
|
|
7
|
-
variationId?: string;
|
|
8
|
-
/** Thread ID for conversation context. Must be a valid UUID (e.g., "550e8400-e29b-41d4-a716-446655440000") */
|
|
9
|
-
threadId?: string;
|
|
10
|
-
question?: string;
|
|
11
|
-
isStreaming?: boolean;
|
|
12
|
-
options: ConstructorClientOptions;
|
|
13
|
-
parameters?: Record<string, string | number | boolean>;
|
|
14
|
-
};
|
|
15
|
-
export type GetSuggestedQuestionsProps = {
|
|
16
|
-
itemId: string;
|
|
17
|
-
variationId?: string;
|
|
18
|
-
/** Thread ID for conversation context. Must be a valid UUID (e.g., "550e8400-e29b-41d4-a716-446655440000") */
|
|
19
|
-
threadId?: string;
|
|
20
|
-
parameters?: SuggestedQuestionsParameters;
|
|
21
|
-
/** Extra query parameters appended verbatim to the request (e.g. `ef-*` test cell params). */
|
|
22
|
-
requestParameters?: Record<string, string | number | boolean>;
|
|
23
|
-
};
|
|
24
|
-
export interface Question {
|
|
25
|
-
value: string;
|
|
26
|
-
}
|
|
27
|
-
export interface QuestionResponse {
|
|
28
|
-
questions: Array<Question>;
|
|
29
|
-
}
|
|
30
|
-
export type GetAnswerResultsProps = {
|
|
31
|
-
itemId: string;
|
|
32
|
-
variationId?: string;
|
|
33
|
-
/** Thread ID for conversation context. Must be a valid UUID (e.g., "550e8400-e29b-41d4-a716-446655440000") */
|
|
34
|
-
threadId?: string;
|
|
35
|
-
question: string;
|
|
36
|
-
parameters?: Record<string, any>;
|
|
37
|
-
};
|
|
38
|
-
export type GetAnswerResultsStreamProps = GetAnswerResultsProps & {
|
|
39
|
-
onStart?: (event: StreamStartEvent) => void;
|
|
40
|
-
onMessage?: (event: StreamMessageEvent) => void;
|
|
41
|
-
onEnd?: (event: StreamEndEvent) => void;
|
|
42
|
-
};
|
|
43
|
-
/** Defines loose types for response-related types to account for future changes to API schema */
|
|
44
|
-
export interface ApiItemVariation extends Record<string, any> {
|
|
45
|
-
value: string;
|
|
46
|
-
data?: ItemData;
|
|
47
|
-
}
|
|
48
|
-
export interface ApiItem extends Record<string, any> {
|
|
49
|
-
value: string;
|
|
50
|
-
matched_terms: Array<string>;
|
|
51
|
-
data: ItemData;
|
|
52
|
-
variations?: Array<ApiItemVariation> | null;
|
|
53
|
-
variations_map?: Record<string, any> | Array<Record<string, any>> | null;
|
|
54
|
-
}
|
|
55
|
-
export interface AnswerItemResults {
|
|
56
|
-
request?: Record<string, any>;
|
|
57
|
-
response: {
|
|
58
|
-
results: Array<ApiItem>;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export interface GetAnswerResultsResponse {
|
|
62
|
-
qna_result_id: string;
|
|
63
|
-
value: string;
|
|
64
|
-
item_results?: AnswerItemResults;
|
|
65
|
-
follow_up_questions?: Array<Question>;
|
|
66
|
-
thread_id?: string;
|
|
67
|
-
}
|
|
68
|
-
export interface StreamStartEvent {
|
|
69
|
-
qna_result_id: string;
|
|
70
|
-
}
|
|
71
|
-
export interface StreamMessageEvent {
|
|
72
|
-
qna_result_id: string;
|
|
73
|
-
text: string;
|
|
74
|
-
}
|
|
75
|
-
export interface StreamEndEvent {
|
|
76
|
-
qna_result_id: string;
|
|
77
|
-
}
|