@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.
Files changed (74) hide show
  1. package/lib/commonjs/api/client.js +8 -0
  2. package/lib/commonjs/api/client.js.map +1 -1
  3. package/lib/commonjs/i18n.js +14 -0
  4. package/lib/commonjs/i18n.js.map +1 -1
  5. package/lib/commonjs/locales.js +13 -0
  6. package/lib/commonjs/locales.js.map +1 -1
  7. package/lib/commonjs/state/widget-store.js +25 -0
  8. package/lib/commonjs/state/widget-store.js.map +1 -1
  9. package/lib/commonjs/types.js +3 -0
  10. package/lib/commonjs/types.js.map +1 -1
  11. package/lib/commonjs/ui/WidgetProvider.js +13 -0
  12. package/lib/commonjs/ui/WidgetProvider.js.map +1 -1
  13. package/lib/commonjs/ui/components/RatingCard.js +347 -0
  14. package/lib/commonjs/ui/components/RatingCard.js.map +1 -0
  15. package/lib/commonjs/ui/screens/chat/ChatView.js +22 -1
  16. package/lib/commonjs/ui/screens/chat/ChatView.js.map +1 -1
  17. package/lib/module/api/client.js +8 -0
  18. package/lib/module/api/client.js.map +1 -1
  19. package/lib/module/i18n.js +14 -0
  20. package/lib/module/i18n.js.map +1 -1
  21. package/lib/module/locales.js +13 -0
  22. package/lib/module/locales.js.map +1 -1
  23. package/lib/module/state/widget-store.js +25 -0
  24. package/lib/module/state/widget-store.js.map +1 -1
  25. package/lib/module/types.js +3 -0
  26. package/lib/module/types.js.map +1 -1
  27. package/lib/module/ui/WidgetProvider.js +13 -0
  28. package/lib/module/ui/WidgetProvider.js.map +1 -1
  29. package/lib/module/ui/components/RatingCard.js +341 -0
  30. package/lib/module/ui/components/RatingCard.js.map +1 -0
  31. package/lib/module/ui/screens/chat/ChatView.js +22 -1
  32. package/lib/module/ui/screens/chat/ChatView.js.map +1 -1
  33. package/lib/typescript/commonjs/api/client.d.ts +7 -1
  34. package/lib/typescript/commonjs/api/client.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/i18n.d.ts +13 -0
  36. package/lib/typescript/commonjs/i18n.d.ts.map +1 -1
  37. package/lib/typescript/commonjs/locales.d.ts.map +1 -1
  38. package/lib/typescript/commonjs/state/widget-store.d.ts +11 -1
  39. package/lib/typescript/commonjs/state/widget-store.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/types.d.ts +17 -0
  41. package/lib/typescript/commonjs/types.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/ui/WidgetProvider.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/ui/components/RatingCard.d.ts +57 -0
  44. package/lib/typescript/commonjs/ui/components/RatingCard.d.ts.map +1 -0
  45. package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts +1 -1
  46. package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts +11 -1
  48. package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts.map +1 -1
  49. package/lib/typescript/module/api/client.d.ts +7 -1
  50. package/lib/typescript/module/api/client.d.ts.map +1 -1
  51. package/lib/typescript/module/i18n.d.ts +13 -0
  52. package/lib/typescript/module/i18n.d.ts.map +1 -1
  53. package/lib/typescript/module/locales.d.ts.map +1 -1
  54. package/lib/typescript/module/state/widget-store.d.ts +11 -1
  55. package/lib/typescript/module/state/widget-store.d.ts.map +1 -1
  56. package/lib/typescript/module/types.d.ts +17 -0
  57. package/lib/typescript/module/types.d.ts.map +1 -1
  58. package/lib/typescript/module/ui/WidgetProvider.d.ts.map +1 -1
  59. package/lib/typescript/module/ui/components/RatingCard.d.ts +57 -0
  60. package/lib/typescript/module/ui/components/RatingCard.d.ts.map +1 -0
  61. package/lib/typescript/module/ui/screens/chat/ChatView.d.ts +1 -1
  62. package/lib/typescript/module/ui/screens/chat/ChatView.d.ts.map +1 -1
  63. package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts +11 -1
  64. package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts.map +1 -1
  65. package/package.json +1 -1
  66. package/src/api/client.ts +13 -0
  67. package/src/i18n.ts +14 -0
  68. package/src/locales.ts +13 -0
  69. package/src/state/widget-store.ts +34 -0
  70. package/src/types.ts +19 -0
  71. package/src/ui/WidgetProvider.tsx +13 -0
  72. package/src/ui/components/RatingCard.tsx +355 -0
  73. package/src/ui/screens/chat/ChatView.tsx +26 -0
  74. 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;