@repzo/widget-react-native 1.0.5 → 1.0.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/lib/commonjs/api/client.js +8 -0
- package/lib/commonjs/api/client.js.map +1 -1
- package/lib/commonjs/i18n.js +14 -0
- package/lib/commonjs/i18n.js.map +1 -1
- package/lib/commonjs/locales.js +13 -0
- package/lib/commonjs/locales.js.map +1 -1
- package/lib/commonjs/state/widget-store.js +25 -0
- package/lib/commonjs/state/widget-store.js.map +1 -1
- package/lib/commonjs/types.js +3 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/ui/WidgetProvider.js +13 -0
- package/lib/commonjs/ui/WidgetProvider.js.map +1 -1
- package/lib/commonjs/ui/components/RatingCard.js +347 -0
- package/lib/commonjs/ui/components/RatingCard.js.map +1 -0
- package/lib/commonjs/ui/screens/chat/ChatView.js +22 -1
- package/lib/commonjs/ui/screens/chat/ChatView.js.map +1 -1
- package/lib/module/api/client.js +8 -0
- package/lib/module/api/client.js.map +1 -1
- package/lib/module/i18n.js +14 -0
- package/lib/module/i18n.js.map +1 -1
- package/lib/module/locales.js +13 -0
- package/lib/module/locales.js.map +1 -1
- package/lib/module/state/widget-store.js +25 -0
- package/lib/module/state/widget-store.js.map +1 -1
- package/lib/module/types.js +3 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/ui/WidgetProvider.js +13 -0
- package/lib/module/ui/WidgetProvider.js.map +1 -1
- package/lib/module/ui/components/RatingCard.js +341 -0
- package/lib/module/ui/components/RatingCard.js.map +1 -0
- package/lib/module/ui/screens/chat/ChatView.js +22 -1
- package/lib/module/ui/screens/chat/ChatView.js.map +1 -1
- package/lib/typescript/commonjs/api/client.d.ts +7 -1
- package/lib/typescript/commonjs/api/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/i18n.d.ts +13 -0
- package/lib/typescript/commonjs/i18n.d.ts.map +1 -1
- package/lib/typescript/commonjs/locales.d.ts.map +1 -1
- package/lib/typescript/commonjs/state/widget-store.d.ts +11 -1
- package/lib/typescript/commonjs/state/widget-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/types.d.ts +17 -0
- package/lib/typescript/commonjs/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/WidgetProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/RatingCard.d.ts +57 -0
- package/lib/typescript/commonjs/ui/components/RatingCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts +1 -1
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts +11 -1
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts.map +1 -1
- package/lib/typescript/module/api/client.d.ts +7 -1
- package/lib/typescript/module/api/client.d.ts.map +1 -1
- package/lib/typescript/module/i18n.d.ts +13 -0
- package/lib/typescript/module/i18n.d.ts.map +1 -1
- package/lib/typescript/module/locales.d.ts.map +1 -1
- package/lib/typescript/module/state/widget-store.d.ts +11 -1
- package/lib/typescript/module/state/widget-store.d.ts.map +1 -1
- package/lib/typescript/module/types.d.ts +17 -0
- package/lib/typescript/module/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/WidgetProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/RatingCard.d.ts +57 -0
- package/lib/typescript/module/ui/components/RatingCard.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/chat/ChatView.d.ts +1 -1
- package/lib/typescript/module/ui/screens/chat/ChatView.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts +11 -1
- package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/client.ts +13 -0
- package/src/i18n.ts +14 -0
- package/src/locales.ts +13 -0
- package/src/state/widget-store.ts +34 -0
- package/src/types.ts +19 -0
- package/src/ui/WidgetProvider.tsx +13 -0
- package/src/ui/components/RatingCard.tsx +355 -0
- package/src/ui/screens/chat/ChatView.tsx +26 -0
- package/src/ui/screens/chat/ChatView.types.ts +11 -0
|
@@ -5,11 +5,13 @@ import type { DraftAttachment, PickResult } from '../../../attachments/pickers';
|
|
|
5
5
|
import type {
|
|
6
6
|
AgentUiAction,
|
|
7
7
|
AttachmentSource,
|
|
8
|
+
ConversationRatingResult,
|
|
8
9
|
Message,
|
|
9
10
|
OutgoingAttachment,
|
|
10
11
|
} from '../../../types';
|
|
11
12
|
import type { AgentUiBlockLabels } from '../../components/AgentUiBlocks';
|
|
12
13
|
import type { ImageViewerLabels } from '../../components/ImageViewer';
|
|
14
|
+
import type { RatingCardLabels } from '../../components/RatingCard';
|
|
13
15
|
|
|
14
16
|
export interface ChatLabels {
|
|
15
17
|
back: string;
|
|
@@ -34,6 +36,7 @@ export interface ChatLabels {
|
|
|
34
36
|
procedureSend: string;
|
|
35
37
|
procedureSent: string;
|
|
36
38
|
blocks: AgentUiBlockLabels;
|
|
39
|
+
rating: RatingCardLabels;
|
|
37
40
|
attach: AttachLabels;
|
|
38
41
|
viewer: ImageViewerLabels;
|
|
39
42
|
}
|
|
@@ -88,6 +91,14 @@ export interface ChatViewProps {
|
|
|
88
91
|
action?: AgentUiAction
|
|
89
92
|
) => Promise<void>;
|
|
90
93
|
onIdentifyVisitor?: (data: { email?: string; name?: string; phone?: string }) => Promise<void>;
|
|
94
|
+
/** Answers a rating card; rejects with the server error (409 locked, 410 expired). */
|
|
95
|
+
onRateConversation?: (
|
|
96
|
+
messageId: string,
|
|
97
|
+
ratingId: string,
|
|
98
|
+
data: { rating: number; reason?: string; comment?: string }
|
|
99
|
+
) => Promise<ConversationRatingResult>;
|
|
100
|
+
/** The widget's default language — rating reasons fall back to it. */
|
|
101
|
+
defaultLocale?: string;
|
|
91
102
|
onLoadMore: () => void;
|
|
92
103
|
onTyping: (isTyping: boolean) => void;
|
|
93
104
|
onBack: () => void;
|