@developer_tribe/react-native-comnyx 0.3.6 → 0.3.7

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 (104) hide show
  1. package/lib/commonjs/assets/arrow-right.png +0 -0
  2. package/lib/commonjs/assets/down.png +0 -0
  3. package/lib/commonjs/assets/info-circle.png +0 -0
  4. package/lib/commonjs/components/ChatList.js +97 -35
  5. package/lib/commonjs/components/ChatList.js.map +1 -1
  6. package/lib/commonjs/components/CustomAlert.js +15 -5
  7. package/lib/commonjs/components/CustomAlert.js.map +1 -1
  8. package/lib/commonjs/components/CustomerForm.js +13 -10
  9. package/lib/commonjs/components/CustomerForm.js.map +1 -1
  10. package/lib/commonjs/components/InitFailed.js +2 -0
  11. package/lib/commonjs/components/InitFailed.js.map +1 -1
  12. package/lib/commonjs/components/MessageInput.js +14 -14
  13. package/lib/commonjs/components/MessageInput.js.map +1 -1
  14. package/lib/commonjs/components/MessageItem.js +6 -14
  15. package/lib/commonjs/components/MessageItem.js.map +1 -1
  16. package/lib/commonjs/constants/activeOpacity.js +8 -0
  17. package/lib/commonjs/constants/activeOpacity.js.map +1 -0
  18. package/lib/commonjs/constants/translations.js +65 -45
  19. package/lib/commonjs/constants/translations.js.map +1 -1
  20. package/lib/commonjs/data/fake/messages.js +2 -0
  21. package/lib/commonjs/data/fake/messages.js.map +1 -1
  22. package/lib/commonjs/hooks/useThemeColors.js +1 -7
  23. package/lib/commonjs/hooks/useThemeColors.js.map +1 -1
  24. package/lib/commonjs/types/Theme.js +4 -2
  25. package/lib/commonjs/types/Theme.js.map +1 -1
  26. package/lib/module/assets/arrow-right.png +0 -0
  27. package/lib/module/assets/down.png +0 -0
  28. package/lib/module/assets/info-circle.png +0 -0
  29. package/lib/module/components/ChatList.js +98 -36
  30. package/lib/module/components/ChatList.js.map +1 -1
  31. package/lib/module/components/CustomAlert.js +15 -5
  32. package/lib/module/components/CustomAlert.js.map +1 -1
  33. package/lib/module/components/CustomerForm.js +13 -10
  34. package/lib/module/components/CustomerForm.js.map +1 -1
  35. package/lib/module/components/InitFailed.js +2 -0
  36. package/lib/module/components/InitFailed.js.map +1 -1
  37. package/lib/module/components/MessageInput.js +14 -14
  38. package/lib/module/components/MessageInput.js.map +1 -1
  39. package/lib/module/components/MessageItem.js +6 -14
  40. package/lib/module/components/MessageItem.js.map +1 -1
  41. package/lib/module/constants/activeOpacity.js +4 -0
  42. package/lib/module/constants/activeOpacity.js.map +1 -0
  43. package/lib/module/constants/translations.js +65 -45
  44. package/lib/module/constants/translations.js.map +1 -1
  45. package/lib/module/data/fake/messages.js +2 -0
  46. package/lib/module/data/fake/messages.js.map +1 -1
  47. package/lib/module/hooks/useThemeColors.js +2 -8
  48. package/lib/module/hooks/useThemeColors.js.map +1 -1
  49. package/lib/module/types/Theme.js +4 -2
  50. package/lib/module/types/Theme.js.map +1 -1
  51. package/lib/typescript/commonjs/src/components/ChatList.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/src/components/CustomAlert.d.ts.map +1 -1
  53. package/lib/typescript/commonjs/src/components/CustomerForm.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/src/components/InitFailed.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/src/components/MessageInput.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/src/constants/activeOpacity.d.ts +2 -0
  57. package/lib/typescript/commonjs/src/constants/activeOpacity.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/src/constants/translations.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/src/data/fake/messages.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/src/hooks/useThemeColors.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/src/types/Conversation.d.ts +6 -1
  62. package/lib/typescript/commonjs/src/types/Conversation.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/src/types/LocalizationKeys.d.ts +2 -0
  64. package/lib/typescript/commonjs/src/types/LocalizationKeys.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/src/types/MessageResponse.d.ts +2 -0
  66. package/lib/typescript/commonjs/src/types/MessageResponse.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/types/Theme.d.ts +1 -0
  68. package/lib/typescript/commonjs/src/types/Theme.d.ts.map +1 -1
  69. package/lib/typescript/module/src/components/ChatList.d.ts.map +1 -1
  70. package/lib/typescript/module/src/components/CustomAlert.d.ts.map +1 -1
  71. package/lib/typescript/module/src/components/CustomerForm.d.ts.map +1 -1
  72. package/lib/typescript/module/src/components/InitFailed.d.ts.map +1 -1
  73. package/lib/typescript/module/src/components/MessageInput.d.ts.map +1 -1
  74. package/lib/typescript/module/src/constants/activeOpacity.d.ts +2 -0
  75. package/lib/typescript/module/src/constants/activeOpacity.d.ts.map +1 -0
  76. package/lib/typescript/module/src/constants/translations.d.ts.map +1 -1
  77. package/lib/typescript/module/src/data/fake/messages.d.ts.map +1 -1
  78. package/lib/typescript/module/src/hooks/useThemeColors.d.ts.map +1 -1
  79. package/lib/typescript/module/src/types/Conversation.d.ts +6 -1
  80. package/lib/typescript/module/src/types/Conversation.d.ts.map +1 -1
  81. package/lib/typescript/module/src/types/LocalizationKeys.d.ts +2 -0
  82. package/lib/typescript/module/src/types/LocalizationKeys.d.ts.map +1 -1
  83. package/lib/typescript/module/src/types/MessageResponse.d.ts +2 -0
  84. package/lib/typescript/module/src/types/MessageResponse.d.ts.map +1 -1
  85. package/lib/typescript/module/src/types/Theme.d.ts +1 -0
  86. package/lib/typescript/module/src/types/Theme.d.ts.map +1 -1
  87. package/package.json +1 -1
  88. package/src/assets/arrow-right.png +0 -0
  89. package/src/assets/down.png +0 -0
  90. package/src/assets/info-circle.png +0 -0
  91. package/src/components/ChatList.tsx +114 -40
  92. package/src/components/CustomAlert.tsx +24 -6
  93. package/src/components/CustomerForm.tsx +13 -9
  94. package/src/components/InitFailed.tsx +2 -0
  95. package/src/components/MessageInput.tsx +15 -16
  96. package/src/components/MessageItem.tsx +4 -12
  97. package/src/constants/activeOpacity.ts +1 -0
  98. package/src/constants/translations.ts +70 -44
  99. package/src/data/fake/messages.ts +2 -0
  100. package/src/hooks/useThemeColors.ts +2 -7
  101. package/src/types/Conversation.ts +3 -1
  102. package/src/types/LocalizationKeys.ts +2 -0
  103. package/src/types/MessageResponse.ts +2 -0
  104. package/src/types/Theme.ts +3 -0
@@ -1 +1 @@
1
- {"version":3,"file":"MessageInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/MessageInput.tsx"],"names":[],"mappings":"AASA,wBAAgB,YAAY,CAAC,EAC3B,cAAc,GACf,EAAE;IACD,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,2CA0HA"}
1
+ {"version":3,"file":"MessageInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/MessageInput.tsx"],"names":[],"mappings":"AAWA,wBAAgB,YAAY,CAAC,EAC3B,cAAc,GACf,EAAE;IACD,cAAc,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,2CAuHA"}
@@ -0,0 +1,2 @@
1
+ export declare const activeOpacity = 0.8;
2
+ //# sourceMappingURL=activeOpacity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activeOpacity.d.ts","sourceRoot":"","sources":["../../../../../src/constants/activeOpacity.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../../src/constants/translations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAuc1D,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../../src/constants/translations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAie1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/data/fake/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CA6DvE"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../src/data/fake/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CA+DvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"useThemeColors.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useThemeColors.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEzE,wBAAgB,cAAc,IAAI,WAAW,CAM5C"}
1
+ {"version":3,"file":"useThemeColors.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useThemeColors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE9D,wBAAgB,cAAc,IAAI,WAAW,CAE5C"}
@@ -2,7 +2,12 @@ export interface ConversationMessage {
2
2
  id: number;
3
3
  content: string;
4
4
  created_at: string;
5
- user: any | null;
5
+ user?: any | null;
6
+ bot?: any | null;
7
+ customer?: {
8
+ name: string;
9
+ profile_photo_url: null;
10
+ } | null;
6
11
  }
7
12
  export interface AppConversationMessage extends Omit<ConversationMessage, 'id' | 'created_at'> {
8
13
  id: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"Conversation.d.ts","sourceRoot":"","sources":["../../../../../src/types/Conversation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,CAAC;IACtD,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,gBAAgB,CAAC;CACxB"}
1
+ {"version":3,"file":"Conversation.d.ts","sourceRoot":"","sources":["../../../../../src/types/Conversation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAClB,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACjB,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CAC7D;AAED,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,CAAC;IACtD,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,gBAAgB,CAAC;CACxB"}
@@ -36,5 +36,7 @@ export type LocalizationKeys = {
36
36
  'customer.form.failed.email.desc': string;
37
37
  'customer.form.failed.phone': string;
38
38
  'customer.form.failed.phone.desc': string;
39
+ 'customer.form.name': string;
40
+ 'customer.form.cancel': string;
39
41
  };
40
42
  //# sourceMappingURL=LocalizationKeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocalizationKeys.d.ts","sourceRoot":"","sources":["../../../../../src/types/LocalizationKeys.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,qBAAqB,EAAE,MAAM,CAA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AAM,CAAC;IAC1C,4BAA4B,EAAE,MAAM,CAAC;IACrC,iCAAiC,EAAE,MAAM,CAAC;IAC1C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC"}
@@ -7,6 +7,8 @@ export interface MessageResponse {
7
7
  created_at: string;
8
8
  id: number;
9
9
  user: null | any;
10
+ customer: null | any;
11
+ bot: null | any;
10
12
  conversation: {
11
13
  id: number;
12
14
  project_id: number;
@@ -1 +1 @@
1
- {"version":3,"file":"MessageResponse.d.ts","sourceRoot":"","sources":["../../../../../src/types/MessageResponse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,IAAI,GAAG,GAAG,CAAC;QACjB,YAAY,EAAE;YACZ,EAAE,EAAE,MAAM,CAAC;YACX,UAAU,EAAE,MAAM,CAAC;YACnB,WAAW,EAAE,MAAM,CAAC;YACpB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,MAAM,CAAC;YACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;YAC1B,QAAQ,EAAE,MAAM,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC;YACvB,OAAO,EAAE;gBACP,EAAE,EAAE,MAAM,CAAC;gBACX,IAAI,EAAE,MAAM,CAAC;gBACb,eAAe,EAAE,MAAM,CAAC;gBACxB,UAAU,EAAE,MAAM,CAAC;gBACnB,UAAU,EAAE,MAAM,CAAC;gBACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;gBAC1B,IAAI,EAAE,MAAM,CAAC;gBACb,YAAY,EAAE;oBACZ,EAAE,EAAE,MAAM,CAAC;oBACX,IAAI,EAAE,MAAM,CAAC;oBACb,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,MAAM,CAAC;oBACnB,UAAU,EAAE,IAAI,GAAG,MAAM,CAAC;oBAC1B,KAAK,EAAE,KAAK,CAAC;wBACX,EAAE,EAAE,MAAM,CAAC;wBACX,IAAI,EAAE,MAAM,CAAC;wBACb,KAAK,EAAE,MAAM,CAAC;wBACd,iBAAiB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACjC,UAAU,EAAE,MAAM,CAAC;wBACnB,UAAU,EAAE,MAAM,CAAC;wBACnB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;wBACtB,iBAAiB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACjC,yBAAyB,EAAE,IAAI,GAAG,MAAM,CAAC;wBACzC,MAAM,EAAE,OAAO,CAAC;wBAChB,iBAAiB,EAAE,MAAM,CAAC;wBAC1B,KAAK,EAAE;4BACL,eAAe,EAAE,MAAM,CAAC;4BACxB,OAAO,EAAE,MAAM,CAAC;4BAChB,IAAI,EAAE,MAAM,CAAC;4BACb,UAAU,EAAE,MAAM,CAAC;4BACnB,UAAU,EAAE,MAAM,CAAC;yBACpB,CAAC;qBACH,CAAC,CAAC;iBACJ,CAAC;aACH,CAAC;SACH,CAAC;QACF,MAAM,EAAE,GAAG,EAAE,CAAC;KACf,CAAC;CACH"}
1
+ {"version":3,"file":"MessageResponse.d.ts","sourceRoot":"","sources":["../../../../../src/types/MessageResponse.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,IAAI,GAAG,GAAG,CAAC;QACjB,QAAQ,EAAE,IAAI,GAA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,CAAC;4BACxB,OAAO,EAAE,MAAM,CAAC;4BAChB,IAAI,EAAE,MAAM,CAAC;4BACb,UAAU,EAAE,MAAM,CAAC;4BACnB,UAAU,EAAE,MAAM,CAAC;yBACpB,CAAC;qBACH,CAAC,CAAC;iBACJ,CAAC;aACH,CAAC;SACH,CAAC;QACF,MAAM,EAAE,GAAG,EAAE,CAAC;KACf,CAAC;CACH"}
@@ -17,6 +17,7 @@ export interface ThemeColors {
17
17
  ghost: string;
18
18
  navy: string;
19
19
  lavender: string;
20
+ silver: string;
20
21
  }
21
22
  export declare const lightTheme: ThemeColors;
22
23
  export declare const darkTheme: ThemeColors;
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../../../src/types/Theme.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,EAAE,WAmBxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,WAmBvB,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB"}
1
+ {"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../../../../src/types/Theme.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,EAAE,WAoBxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,WAoBvB,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@developer_tribe/react-native-comnyx",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "React Native chat component with integrated support panel, enabling real-time customer communication and efficient agent workflow management.",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
Binary file
Binary file
Binary file
@@ -7,6 +7,7 @@ import {
7
7
  ActivityIndicator,
8
8
  Image,
9
9
  TouchableOpacity,
10
+ Keyboard,
10
11
  } from 'react-native';
11
12
  import { getCustomerConversation, sendCustomerMessage } from '../api';
12
13
  import type { AppConversationMessage } from '../types/Conversation';
@@ -21,6 +22,7 @@ import type { LocalizationKeys } from '../types/LocalizationKeys';
21
22
  import { ScaledSheet } from './ScaledSheet';
22
23
  import { formatDate } from '../utils/formatDate';
23
24
  import { viewabilityConfig } from '../viewabilityConfig';
25
+ import { activeOpacity } from '../constants/activeOpacity';
24
26
 
25
27
  const headphonesIcon = require('../assets/headphones-01.png');
26
28
  const closeIcon = require('../assets/x-close.png');
@@ -56,6 +58,7 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
56
58
  const [nexPageFailed, setNexPageFailed] = useState(false);
57
59
  const [initFailed, setInitFailed] = useState(false);
58
60
  const [isScrollingUp, setIsScrollingUp] = useState(false);
61
+ const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
59
62
  const listChangedRef = useRef(false);
60
63
  const [popupVisible, setPopupVisible] = useState(false);
61
64
  const [selectedMessage, setSelectedMessage] = useState<string>('');
@@ -75,6 +78,10 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
75
78
  messagesByDate[dateKey].push(message);
76
79
  });
77
80
 
81
+ // Check if there are any messages before accessing firstKey
82
+ const dateKeys = Object.keys(messagesByDate);
83
+ if (dateKeys.length === 0) return [];
84
+
78
85
  return Object.entries(messagesByDate).map(([title, messages]) => ({
79
86
  title,
80
87
  data: messages.sort(
@@ -126,7 +133,7 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
126
133
  ...existingMessage,
127
134
  id: res.message.id,
128
135
  content: res.message.content,
129
- user: res.message.user || existingMessage.user,
136
+ customer: res.message.customer || existingMessage.customer,
130
137
  approved: true,
131
138
  error: false,
132
139
  created_at: new Date(res.message.created_at),
@@ -190,24 +197,41 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
190
197
  .then((newData) => {
191
198
  listChangedRef.current = true;
192
199
  setData((prevData) => {
193
- //TODO: backend sorulablir
194
200
  const newMessages = newData?.page?.data ?? [];
195
- const existingIds = new Set(prevData?.map((msg) => msg.id));
196
- const uniqueNewMessages = newMessages.filter(
197
- (msg) => !existingIds.has(msg.id)
198
- );
199
-
200
- const processedMessages = uniqueNewMessages.map((u) => ({
201
- ...u,
202
- created_at: new Date(u.created_at),
203
- approved: true,
204
- }));
205
- if (processedMessages.length === 0) {
206
- nextPageStatus.current = 'empty';
207
- } else {
201
+ // Only filter if we have both previous data and new messages
202
+ if (prevData && prevData.length > 0 && newMessages.length > 0) {
203
+ const existingIds = new Set(prevData.map((msg) => msg.id));
204
+ const uniqueNewMessages = newMessages.filter(
205
+ (msg) => !existingIds.has(msg.id)
206
+ );
207
+
208
+ const processedMessages = uniqueNewMessages.map((u) => ({
209
+ ...u,
210
+ created_at: new Date(u.created_at),
211
+ approved: true,
212
+ }));
213
+
214
+ if (processedMessages.length === 0) {
215
+ nextPageStatus.current = 'empty';
216
+ return prevData; // Return existing data unchanged
217
+ } else {
218
+ nextPageStatus.current = undefined;
219
+ return [...prevData, ...processedMessages];
220
+ }
221
+ } else if (newMessages.length > 0) {
222
+ // Only new messages, no previous data
223
+ const processedMessages = newMessages.map((u) => ({
224
+ ...u,
225
+ created_at: new Date(u.created_at),
226
+ approved: true,
227
+ }));
208
228
  nextPageStatus.current = undefined;
229
+ return processedMessages;
230
+ } else {
231
+ // No new messages
232
+ nextPageStatus.current = 'empty';
233
+ return prevData || []; // Return existing data or empty array
209
234
  }
210
- return [...(prevData ?? []), ...processedMessages];
211
235
  });
212
236
  })
213
237
  .catch((_) => {
@@ -267,7 +291,7 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
267
291
  const contentHeight = event.nativeEvent.contentSize.height;
268
292
  const scrollViewHeight = event.nativeEvent.layoutMeasurement.height;
269
293
 
270
- setIsScrollingUp(currentScrollY > 100);
294
+ setIsScrollingUp(currentScrollY > 300);
271
295
 
272
296
  // Only proceed if we have sections and the list is scrolled enough
273
297
  if (sections && sections.length > 0 && currentScrollY > 0) {
@@ -347,22 +371,39 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
347
371
  .then((newData) => {
348
372
  setData((prevData) => {
349
373
  const newMessages = newData?.page?.data ?? [];
350
- const existingIds = new Set(prevData?.map((msg) => msg.id));
351
- const uniqueNewMessages = newMessages?.filter(
352
- (msg) => !existingIds?.has(msg.id)
353
- );
354
- const processedMessages = uniqueNewMessages?.map((u) => ({
355
- ...u,
356
- created_at: new Date(u.created_at),
357
- approved: true,
358
- }));
359
- useAppStore.setState({
360
- firstMessage: processedMessages?.[0],
361
- });
362
- if (processedMessages?.length === 0) {
363
- setLoading(false);
374
+ // Only proceed with filtering if we have previous data
375
+ if (prevData && prevData.length > 0) {
376
+ const existingIds = new Set(prevData.map((msg) => msg.id));
377
+ const uniqueNewMessages = newMessages.filter(
378
+ (msg) => !existingIds.has(msg.id)
379
+ );
380
+ const processedMessages = uniqueNewMessages.map((u) => ({
381
+ ...u,
382
+ created_at: new Date(u.created_at),
383
+ approved: true,
384
+ }));
385
+ useAppStore.setState({
386
+ firstMessage: processedMessages[0] || prevData[0],
387
+ });
388
+ if (processedMessages.length === 0) {
389
+ setLoading(false);
390
+ }
391
+ return [...prevData, ...processedMessages];
392
+ } else {
393
+ // Handle the case where there's no previous data
394
+ const processedMessages = newMessages.map((u) => ({
395
+ ...u,
396
+ created_at: new Date(u.created_at),
397
+ approved: true,
398
+ }));
399
+ useAppStore.setState({
400
+ firstMessage: processedMessages[0],
401
+ });
402
+ if (processedMessages.length === 0) {
403
+ setLoading(false);
404
+ }
405
+ return processedMessages;
364
406
  }
365
- return processedMessages;
366
407
  });
367
408
  })
368
409
  .catch((e) => {
@@ -382,6 +423,28 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
382
423
  }
383
424
  }, [sections]);
384
425
 
426
+ // Add keyboard listeners
427
+ useEffect(() => {
428
+ const keyboardDidShowListener = Keyboard.addListener(
429
+ 'keyboardDidShow',
430
+ () => {
431
+ setIsKeyboardVisible(true);
432
+ }
433
+ );
434
+ const keyboardDidHideListener = Keyboard.addListener(
435
+ 'keyboardDidHide',
436
+ () => {
437
+ setIsKeyboardVisible(false);
438
+ }
439
+ );
440
+
441
+ // Cleanup function
442
+ return () => {
443
+ keyboardDidShowListener.remove();
444
+ keyboardDidHideListener.remove();
445
+ };
446
+ }, []);
447
+
385
448
  if (nexPageFailed) {
386
449
  return (
387
450
  <View
@@ -397,6 +460,7 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
397
460
  nextPageStatus.current = undefined;
398
461
  nextPage();
399
462
  }}
463
+ activeOpacity={activeOpacity}
400
464
  >
401
465
  <AppText
402
466
  localization="chat.load.error"
@@ -415,7 +479,11 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
415
479
  <View
416
480
  style={[styles.container, { backgroundColor: themeColors.background }]}
417
481
  >
418
- <TouchableOpacity style={[styles.iconContainer]} onPress={onBack}>
482
+ <TouchableOpacity
483
+ style={[styles.iconContainer]}
484
+ onPress={onBack}
485
+ activeOpacity={activeOpacity}
486
+ >
419
487
  <Image
420
488
  source={closeIcon}
421
489
  style={[styles.closeIcon, { tintColor: themeColors.text }]}
@@ -500,9 +568,11 @@ export function ChatList({ onBack }: { onBack?: () => void }) {
500
568
  </View>
501
569
  {isScrollingUp && (
502
570
  <TouchableOpacity
571
+ activeOpacity={activeOpacity}
503
572
  style={[
504
573
  styles.scrollDownButton,
505
- { backgroundColor: themeColors.background },
574
+ { backgroundColor: themeColors.ghost },
575
+ isKeyboardVisible && styles.scrollDownButtonWithKeyboard,
506
576
  ]}
507
577
  onPress={() => scrollToBottom(true)}
508
578
  >
@@ -556,11 +626,12 @@ const styles = ScaledSheet.create({
556
626
  },
557
627
  scrollDownButton: {
558
628
  position: 'absolute',
559
- right: '20@s',
629
+ right: 0,
560
630
  bottom: '15%',
561
- borderRadius: '25@s',
562
- paddingHorizontal: '10@s',
563
- paddingVertical: '10@vs',
631
+ borderTopLeftRadius: '4@s',
632
+ borderBottomLeftRadius: '4@s',
633
+ paddingHorizontal: '14@s',
634
+ paddingVertical: '14@vs',
564
635
  shadowColor: '#000',
565
636
  shadowOffset: {
566
637
  width: 0,
@@ -570,9 +641,12 @@ const styles = ScaledSheet.create({
570
641
  shadowRadius: 3.84,
571
642
  elevation: 5,
572
643
  },
644
+ scrollDownButtonWithKeyboard: {
645
+ bottom: '30%',
646
+ },
573
647
  scrollUpIcon: {
574
- width: '24@s',
575
- height: '24@vs',
648
+ width: '18@vs',
649
+ height: '18@vs',
576
650
  },
577
651
  retryContainer: {
578
652
  flex: 1,
@@ -4,6 +4,8 @@ import { useThemeColors } from '../hooks/useThemeColors';
4
4
  import { AppText } from './AppText';
5
5
  import type { LocalizationKeys } from '../types/LocalizationKeys';
6
6
  import { ScaledSheet } from './ScaledSheet';
7
+ import { activeOpacity } from '../constants/activeOpacity';
8
+ import { vs } from '../utils/scalingUtils';
7
9
 
8
10
  interface CustomPopupProps {
9
11
  isVisible: boolean;
@@ -34,13 +36,23 @@ function CustomPopup({
34
36
  <View
35
37
  style={[styles.popup, { backgroundColor: themeColors.background }]}
36
38
  >
37
- <Image source={infoIcon} height={64} width={64} />
38
- <AppText style={styles.title}>{title}</AppText>
39
- <AppText style={[styles.description, { color: themeColors.navy }]}>
40
- {description}
41
- </AppText>
39
+ <Image
40
+ source={infoIcon}
41
+ height={vs(53)}
42
+ width={vs(53)}
43
+ style={styles.image}
44
+ />
45
+ <AppText
46
+ style={styles.title}
47
+ localization={title as keyof LocalizationKeys}
48
+ />
49
+ <AppText
50
+ style={[styles.description, { color: themeColors.navy }]}
51
+ localization={description as keyof LocalizationKeys}
52
+ />
42
53
  {onResendButton && (
43
54
  <TouchableOpacity
55
+ activeOpacity={activeOpacity}
44
56
  style={[
45
57
  styles.buttonUp,
46
58
  { backgroundColor: themeColors.dark_background },
@@ -54,6 +66,7 @@ function CustomPopup({
54
66
  </TouchableOpacity>
55
67
  )}
56
68
  <TouchableOpacity
69
+ activeOpacity={activeOpacity}
57
70
  style={[
58
71
  styles.buttonDown,
59
72
  { borderColor: themeColors.dark_background },
@@ -83,7 +96,8 @@ const styles = ScaledSheet.create({
83
96
  borderRadius: '20@s',
84
97
  overflow: 'hidden',
85
98
  alignItems: 'center',
86
- paddingVertical: '20@vs',
99
+ paddingTop: '40@vs',
100
+ paddingBottom: '20@vs',
87
101
  },
88
102
  title: {
89
103
  marginVertical: '16@vs',
@@ -127,6 +141,10 @@ const styles = ScaledSheet.create({
127
141
  marginBottom: '12@vs',
128
142
  borderWidth: 1,
129
143
  },
144
+ image: {
145
+ width: '53@s',
146
+ height: '53@s',
147
+ },
130
148
  });
131
149
 
132
150
  export default React.memo(CustomPopup);
@@ -16,6 +16,8 @@ import { useThemeColors } from '../hooks/useThemeColors';
16
16
  import CustomPopup from './CustomAlert';
17
17
  import { useState } from 'react';
18
18
  import { ScaledSheet } from './ScaledSheet';
19
+ import type { LocalizationKeys } from '../types/LocalizationKeys';
20
+ import { activeOpacity } from '../constants/activeOpacity';
19
21
 
20
22
  interface CustomerFormData {
21
23
  name: string;
@@ -109,6 +111,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
109
111
  ]}
110
112
  >
111
113
  <TouchableOpacity
114
+ activeOpacity={activeOpacity}
112
115
  style={[
113
116
  styles.iconContainer,
114
117
  { backgroundColor: themeColors.dark_background },
@@ -144,7 +147,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
144
147
  },
145
148
  ]}
146
149
  >
147
- {localize('customer.form.title')}
150
+ {localize('customer.form.name')}
148
151
  </AppText>
149
152
  <Controller
150
153
  control={control}
@@ -158,7 +161,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
158
161
  <View
159
162
  style={[
160
163
  styles.inputContainer,
161
- { borderBottomColor: themeColors.gainsboro },
164
+ { borderBottomColor: themeColors.ghost },
162
165
  ]}
163
166
  >
164
167
  <TextInput
@@ -200,7 +203,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
200
203
  <View
201
204
  style={[
202
205
  styles.inputContainer,
203
- { borderBottomColor: themeColors.gainsboro },
206
+ { borderBottomColor: themeColors.ghost },
204
207
  ]}
205
208
  >
206
209
  <TextInput
@@ -246,7 +249,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
246
249
  <View
247
250
  style={[
248
251
  styles.inputContainer,
249
- { borderBottomColor: themeColors.gainsboro },
252
+ { borderBottomColor: themeColors.ghost },
250
253
  ]}
251
254
  >
252
255
  <TextInput
@@ -269,6 +272,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
269
272
  />
270
273
  </View>
271
274
  <TouchableOpacity
275
+ activeOpacity={activeOpacity}
272
276
  style={[
273
277
  styles.button,
274
278
  { backgroundColor: themeColors.dark_background },
@@ -291,9 +295,7 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
291
295
  setPopupVisible(false);
292
296
  setPopupContent({ title: '', description: '' });
293
297
  }}
294
- onResendButton={() => {
295
- setPopupVisible(false);
296
- }}
298
+ buttonText={'customer.form.cancel' as keyof LocalizationKeys}
297
299
  />
298
300
  </Pressable>
299
301
  );
@@ -301,7 +303,8 @@ export function CustomerForm({ onBack }: { onBack: () => void }) {
301
303
 
302
304
  const styles = ScaledSheet.create({
303
305
  container: {
304
- paddingBottom: '24@vs',
306
+ paddingBottom: '20@vs',
307
+ paddingTop: '40@vs',
305
308
  flex: 1,
306
309
  justifyContent: 'space-between',
307
310
  },
@@ -359,10 +362,11 @@ const styles = ScaledSheet.create({
359
362
  },
360
363
  title: {
361
364
  fontSize: '16@vs',
365
+ fontWeight: '500',
362
366
  },
363
367
  iconContainer: {
364
368
  paddingHorizontal: '20@s',
365
- paddingVertical: '10@vs',
369
+ paddingVertical: '30@vs',
366
370
  },
367
371
  inputContainer: {
368
372
  flexDirection: 'row',
@@ -2,6 +2,7 @@ import { TouchableOpacity, View } from 'react-native';
2
2
  import { useThemeColors } from '../hooks/useThemeColors';
3
3
  import { AppText } from './AppText';
4
4
  import { ScaledSheet } from './ScaledSheet';
5
+ import { activeOpacity } from '../constants/activeOpacity';
5
6
 
6
7
  interface InitFailedProps {
7
8
  setInitFailed: (value: boolean) => void;
@@ -15,6 +16,7 @@ export function InitFailed({ setInitFailed }: InitFailedProps) {
15
16
  style={[styles.container, { backgroundColor: themeColors.background }]}
16
17
  >
17
18
  <TouchableOpacity
19
+ activeOpacity={activeOpacity}
18
20
  style={[styles.retryButton, { backgroundColor: themeColors.primary }]}
19
21
  onPress={() => setInitFailed(false)}
20
22
  >
@@ -4,6 +4,8 @@ import { useState } from 'react';
4
4
  import { sendCustomerMessage } from '../api';
5
5
  import { useThemeColors } from '../hooks/useThemeColors';
6
6
  import { ScaledSheet } from './ScaledSheet';
7
+ import { useLocalize } from '../hooks/useLocalize';
8
+ import { activeOpacity } from '../constants/activeOpacity';
7
9
 
8
10
  const sendDark = require('../assets/arrow-right.png');
9
11
 
@@ -16,6 +18,7 @@ export function MessageInput({
16
18
  const [value, setValue] = useState('');
17
19
  const customer = useAppStore((s) => s.customer!);
18
20
  const themeColors = useThemeColors();
21
+ const localize = useLocalize();
19
22
 
20
23
  const sendMessage = () => {
21
24
  if (value.trim()) {
@@ -26,7 +29,7 @@ export function MessageInput({
26
29
  approved: false,
27
30
  content: value,
28
31
  created_at: date,
29
- user: {
32
+ customer: {
30
33
  name: customer.name,
31
34
  profile_photo_url: null,
32
35
  },
@@ -51,7 +54,8 @@ export function MessageInput({
51
54
  alteredData[itemIndex] = {
52
55
  id: res.message.id,
53
56
  content: res.message.content,
54
- user: res.message.user ?? alteredData[itemIndex]?.user,
57
+ customer:
58
+ res.message.customer ?? alteredData[itemIndex]?.customer,
55
59
  created_at: new Date(res.message.created_at),
56
60
  approved: true,
57
61
  };
@@ -82,7 +86,7 @@ export function MessageInput({
82
86
  content: alteredData[itemIndex]?.content ?? '',
83
87
  created_at: alteredData[itemIndex]?.created_at ?? new Date(),
84
88
  approved: alteredData[itemIndex]?.approved ?? false,
85
- user: alteredData[itemIndex]?.user ?? null,
89
+ customer: alteredData[itemIndex]?.customer ?? null,
86
90
  error: true,
87
91
  };
88
92
  useAppStore.setState({
@@ -114,23 +118,18 @@ export function MessageInput({
114
118
  {
115
119
  backgroundColor: themeColors.background,
116
120
  color: themeColors.text,
117
- borderColor: themeColors.border,
121
+ borderColor: themeColors.silver,
118
122
  },
119
123
  ]}
120
- placeholder="Type a message..."
124
+ placeholder={localize('chat.messageInput.placeholder')}
121
125
  placeholderTextColor={themeColors.text + '80'}
122
126
  />
123
127
  <TouchableOpacity
124
- style={[
125
- styles.sendButton,
126
- { backgroundColor: themeColors.dark_background },
127
- ]}
128
+ style={[styles.sendButton]}
128
129
  onPress={sendMessage}
130
+ activeOpacity={activeOpacity}
129
131
  >
130
- <Image
131
- style={[styles.sendIcon, { tintColor: themeColors.light_text }]}
132
- source={sendDark}
133
- />
132
+ <Image style={[styles.sendIcon]} source={sendDark} />
134
133
  </TouchableOpacity>
135
134
  </View>
136
135
  );
@@ -157,14 +156,14 @@ const styles = ScaledSheet.create({
157
156
  maxHeight: 190,
158
157
  },
159
158
  sendButton: {
160
- width: '40@s',
159
+ width: '40@vs',
161
160
  height: '40@vs',
162
161
  borderRadius: '20@vs',
163
162
  justifyContent: 'center',
164
163
  alignItems: 'center',
165
164
  },
166
165
  sendIcon: {
167
- width: '20@vs',
168
- height: '20@vs',
166
+ width: '40@vs',
167
+ height: '40@vs',
169
168
  },
170
169
  });