@droppii-org/chat-mobile 0.2.70 → 0.2.72

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 (45) hide show
  1. package/lib/module/components/ThreadCard/ThreadCard.js +2 -2
  2. package/lib/module/components/ThreadCard/ThreadCard.js.map +1 -1
  3. package/lib/module/hooks/conversation/useGetConversationDetail.js +26 -4
  4. package/lib/module/hooks/conversation/useGetConversationDetail.js.map +1 -1
  5. package/lib/module/hooks/message/useSendMessage.js +8 -2
  6. package/lib/module/hooks/message/useSendMessage.js.map +1 -1
  7. package/lib/module/screens/chat-detail/ChatComposer.js +19 -2
  8. package/lib/module/screens/chat-detail/ChatComposer.js.map +1 -1
  9. package/lib/module/screens/chat-detail/ChatDetail.js +2 -1
  10. package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
  11. package/lib/module/screens/chat-detail/ChatDetailHeader.js +9 -3
  12. package/lib/module/screens/chat-detail/ChatDetailHeader.js.map +1 -1
  13. package/lib/module/screens/chat-detail/ChatListLegend.js +16 -20
  14. package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
  15. package/lib/module/screens/inbox/Inbox.js.map +1 -1
  16. package/lib/module/screens/inbox/MessagesTab.js.map +1 -1
  17. package/lib/module/store/message.js +1 -1
  18. package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts +2 -1
  19. package/lib/typescript/src/components/ThreadCard/ThreadCard.d.ts.map +1 -1
  20. package/lib/typescript/src/hooks/conversation/useGetConversationDetail.d.ts +8 -0
  21. package/lib/typescript/src/hooks/conversation/useGetConversationDetail.d.ts.map +1 -1
  22. package/lib/typescript/src/hooks/message/useSendMessage.d.ts.map +1 -1
  23. package/lib/typescript/src/screens/chat-detail/ChatComposer.d.ts.map +1 -1
  24. package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
  25. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts +1 -1
  26. package/lib/typescript/src/screens/chat-detail/ChatDetailHeader.d.ts.map +1 -1
  27. package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
  28. package/lib/typescript/src/screens/chat-detail/types.d.ts +1 -0
  29. package/lib/typescript/src/screens/chat-detail/types.d.ts.map +1 -1
  30. package/lib/typescript/src/screens/inbox/Inbox.d.ts +2 -1
  31. package/lib/typescript/src/screens/inbox/Inbox.d.ts.map +1 -1
  32. package/lib/typescript/src/screens/inbox/MessagesTab.d.ts +2 -1
  33. package/lib/typescript/src/screens/inbox/MessagesTab.d.ts.map +1 -1
  34. package/package.json +1 -1
  35. package/src/components/ThreadCard/ThreadCard.tsx +7 -3
  36. package/src/hooks/conversation/useGetConversationDetail.ts +30 -5
  37. package/src/hooks/message/useSendMessage.ts +16 -9
  38. package/src/screens/chat-detail/ChatComposer.tsx +17 -4
  39. package/src/screens/chat-detail/ChatDetail.tsx +1 -0
  40. package/src/screens/chat-detail/ChatDetailHeader.tsx +8 -2
  41. package/src/screens/chat-detail/ChatListLegend.tsx +25 -20
  42. package/src/screens/chat-detail/types.ts +1 -0
  43. package/src/screens/inbox/Inbox.tsx +2 -1
  44. package/src/screens/inbox/MessagesTab.tsx +3 -2
  45. package/src/store/message.ts +1 -1
@@ -18,12 +18,20 @@ import {
18
18
  import Animated, {
19
19
  useSharedValue,
20
20
  useAnimatedStyle,
21
- withSpring,
21
+ withTiming,
22
+ Easing,
22
23
  type SharedValue,
23
24
  } from 'react-native-reanimated';
24
25
  import { KeyboardAwareLegendList } from '@legendapp/list/keyboard';
25
26
  import { LegendList, type LegendListRef } from '@legendapp/list/react-native';
26
- import { KContainer, KColors, KSpacingValue, KLabel } from '@droppii/libs';
27
+ import {
28
+ KContainer,
29
+ KColors,
30
+ KSpacingValue,
31
+ KLabel,
32
+ KRadiusValue,
33
+ KImage,
34
+ } from '@droppii/libs';
27
35
  import { precomputeLegendListData } from '../../utils/legendListMessage';
28
36
  import type { ChatListProps } from './types';
29
37
  import { LegendChatMessage } from './legend/LegendChatMessage';
@@ -394,8 +402,9 @@ export const ChatListLegend = memo(
394
402
  scrollDebounceRef.current = setTimeout(() => {
395
403
  if (isAtBottomRef.current !== isAtBottom) {
396
404
  isAtBottomRef.current = isAtBottom;
397
- buttonOpacity.value = withSpring(isAtBottom ? 0 : 1, {
398
- duration: 300,
405
+ buttonOpacity.value = withTiming(isAtBottom ? 0 : 1, {
406
+ duration: 200,
407
+ easing: Easing.out(Easing.ease),
399
408
  });
400
409
  }
401
410
  if (isAtBottom) {
@@ -411,7 +420,10 @@ export const ChatListLegend = memo(
411
420
  onLoadMoreOld?.(false);
412
421
  } else {
413
422
  scrollMessageToEnd({ animated: true, closeKeyboard: false });
414
- buttonOpacity.value = withSpring(0, { duration: 300 });
423
+ buttonOpacity.value = withTiming(0, {
424
+ duration: 200,
425
+ easing: Easing.out(Easing.ease),
426
+ });
415
427
  isAtBottomRef.current = true;
416
428
  setShowBadge(false);
417
429
  }
@@ -543,12 +555,11 @@ export const ChatListLegend = memo(
543
555
  accessibilityLabel="Scroll to latest messages"
544
556
  accessibilityRole="button"
545
557
  >
546
- <KLabel.Text
547
- style={styles.scrollToBottomText}
548
- accessibilityLabel=""
549
- >
550
-
551
- </KLabel.Text>
558
+ <KImage.VectorIcons
559
+ name="arrow-down-o"
560
+ size={16}
561
+ color={KColors.black}
562
+ />
552
563
  {showBadge && <KContainer.View style={styles.badge} />}
553
564
  </KContainer.Touchable>
554
565
  </Animated.View>
@@ -575,9 +586,9 @@ const styles = StyleSheet.create({
575
586
  },
576
587
  buttonInner: {
577
588
  position: 'relative',
578
- width: 40,
579
- height: 40,
580
- borderRadius: 20,
589
+ width: 32,
590
+ height: 32,
591
+ borderRadius: KRadiusValue.round,
581
592
  backgroundColor: KColors.white,
582
593
  justifyContent: 'center',
583
594
  alignItems: 'center',
@@ -587,11 +598,6 @@ const styles = StyleSheet.create({
587
598
  shadowRadius: 8,
588
599
  elevation: 8,
589
600
  },
590
- scrollToBottomText: {
591
- fontSize: 20,
592
- fontWeight: 'bold',
593
- color: KColors.palette.primary.w400,
594
- },
595
601
  errorRow: {
596
602
  padding: 16,
597
603
  justifyContent: 'center',
@@ -606,6 +612,5 @@ const styles = StyleSheet.create({
606
612
  borderRadius: 6,
607
613
  backgroundColor: KColors.palette.primary.w400,
608
614
  borderWidth: 2,
609
- borderColor: KColors.white,
610
615
  },
611
616
  });
@@ -49,6 +49,7 @@ export interface ChatDetailHeaderProps {
49
49
  onPressAvatar?: () => void;
50
50
  conversationId: string;
51
51
  targetUserId?: string;
52
+ targetGroupId?: string;
52
53
  }
53
54
 
54
55
  export interface ChatQuickActionsRenderParams {
@@ -10,11 +10,12 @@ import {
10
10
  KSpacingValue,
11
11
  } from '@droppii/libs';
12
12
  import { MessagesTab } from './MessagesTab';
13
+ import type { ConversationItem } from '@droppii/openim-rn-client-sdk';
13
14
  import { trans } from '../../translation';
14
15
  import { CommunityTab } from './CommunityTab';
15
16
 
16
17
  interface InboxProps {
17
- onPressThread?: (item: string) => void;
18
+ onPressThread?: (item?: ConversationItem) => void;
18
19
  onPressSearch?: () => void;
19
20
  onPressEdit?: () => void;
20
21
  onPressContact?: () => void;
@@ -5,9 +5,10 @@ import { useConversationList } from '../../hooks/useConversationList';
5
5
  import { ThreadCard } from '../../components/ThreadCard';
6
6
  import { useConversationStore } from '../../store';
7
7
  import { useChatContext } from '../../context';
8
+ import type { ConversationItem } from '@droppii/openim-rn-client-sdk';
8
9
 
9
10
  interface MessagesTabProps {
10
- onPressThread?: (item: string) => void;
11
+ onPressThread?: (item?: ConversationItem) => void;
11
12
  }
12
13
 
13
14
  const Separator = () => <KDivider type="line" size="hairline" />;
@@ -23,7 +24,7 @@ export const MessagesTab = memo(({ onPressThread }: MessagesTabProps) => {
23
24
  });
24
25
 
25
26
  const handleThreadPress = useCallback(
26
- (params: { item: string; event: GestureResponderEvent }) => {
27
+ (params: { item?: ConversationItem; event: GestureResponderEvent }) => {
27
28
  onPressThread?.(params.item);
28
29
  },
29
30
  [onPressThread]
@@ -14,7 +14,7 @@ import type {
14
14
  import { mergeMessages } from '../utils/message';
15
15
  import { useConversationStore } from './conversation';
16
16
 
17
- const PAGE_SIZE = 10;
17
+ const PAGE_SIZE = 20;
18
18
 
19
19
  export const useMessageStore = create<MessageStore>()((set, get) => ({
20
20
  messages: [],