react-native-gifted-chat 3.2.0 โ†’ 3.2.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.0] - 2025-11-25
4
+
5
+ ### โœจ Features
6
+ - **Custom Link Parser**: Replaced `react-native-autolink` dependency with custom link parser implementation for better control and performance
7
+ - Removed external dependency on `react-native-autolink`
8
+ - Improved link parsing with custom implementation in `linkParser.tsx`
9
+ - Updated `MessageText` component to use new parser
10
+ - Enhanced links example in example app
11
+
12
+ ### ๐Ÿ› Bug Fixes
13
+ - Adjusted message bubble styles for better rendering
14
+ - Updated test snapshots to reflect parser changes
15
+
16
+ ## [3.1.5] - 2025-11-25
17
+
18
+ ### โœจ Features
19
+ - **Color Scheme Support**: Added `colorScheme` prop to `GiftedChat` component
20
+ - New `useColorScheme` hook for consistent color scheme handling
21
+ - Automatically adapts UI elements (Composer, InputToolbar, Send) based on color scheme
22
+ - Added comprehensive tests for color scheme functionality
23
+
24
+ ### ๐Ÿ“ Documentation
25
+ - Updated README with `colorScheme` prop documentation
26
+
27
+ ## [3.1.4] - 2025-11-25
28
+
29
+ ### ๐Ÿ› Bug Fixes
30
+ - Added left padding to `TextInput` when no accessory is present for better visual alignment
31
+ - Adjusted input toolbar styles for improved layout
32
+
33
+ ## [3.1.3] - 2025-11-25
34
+
35
+ ### ๐Ÿ”ง Improvements
36
+ - Removed unused imports for cleaner codebase
37
+
38
+ ## [3.1.2] - 2025-11-24
39
+
40
+ ### ๐Ÿ› Bug Fixes
41
+ - Fixed message bubble styles for small messages
42
+ - Improved rendering of compact message content
43
+
44
+ ### ๐Ÿงช Testing
45
+ - Updated test snapshots
46
+
47
+ ## [3.1.1] - 2025-11-24
48
+
49
+ ### ๐Ÿ› Bug Fixes
50
+ - Fixed Bubble component styles for better message rendering
51
+ - Corrected style inconsistencies in message bubbles
52
+
53
+ ### ๐Ÿงช Testing
54
+ - Updated test snapshots to reflect style fixes
55
+
56
+ ## [3.1.0] - 2025-11-24
57
+
58
+ ### ๐Ÿ”ง Improvements
59
+ - Refactored component styles for better maintainability
60
+ - Updated Expo Snack example with latest changes
61
+
62
+ ### ๐Ÿงช Testing
63
+ - Updated test snapshots
64
+
65
+ ## [3.0.1] - 2025-11-24
66
+
67
+ ### ๐Ÿ› Bug Fixes
68
+ - Fixed Composer auto-resize height behavior on web platform
69
+
70
+ ### ๐Ÿงช Testing
71
+ - Updated test snapshots
72
+
3
73
  ## [3.0.0] - 2025-11-23
4
74
 
5
75
  This is a major release with significant breaking changes, new features, and improvements. The library has been completely rewritten in TypeScript with improved type safety, better keyboard handling, and enhanced customization options.
package/README.md CHANGED
@@ -277,8 +277,8 @@ Messages, system messages, quick replies etc.: [data structure](src/Models.ts)
277
277
  - `url` - Enable/disable URL parsing (default: true)
278
278
  - `hashtag` - Enable/disable hashtag parsing (default: false)
279
279
  - `mention` - Enable/disable mention parsing (default: false)
280
- - `hashtagUrl` - Base URL for hashtags (e.g., 'https://twitter.com/hashtag')
281
- - `mentionUrl` - Base URL for mentions (e.g., 'https://twitter.com')
280
+ - `hashtagUrl` - Base URL for hashtags (e.g., 'https://x.com/hashtag')
281
+ - `mentionUrl` - Base URL for mentions (e.g., 'https://x.com')
282
282
  - `stripPrefix` - Strip 'http://' or 'https://' from URL display (default: false)
283
283
  - `TextComponent` - Custom Text component to use (e.g., from react-native-gesture-handler)
284
284
 
@@ -507,10 +507,12 @@ Looking for a React Native freelance expert with more than 14 years of experienc
507
507
 
508
508
  ## Author
509
509
 
510
- Feel free to ask me questions on Twitter [@FaridSafi](https://www.twitter.com/FaridSafi) or [@xcapetir](https://www.twitter.com/xcapetir)
510
+ Feel free to ask me questions on Twitter [@FaridSafi](https://www.x.com/FaridSafi) or [@xcapetir](https://www.x.com/xcapetir)
511
511
 
512
512
  ## Maintainer
513
513
 
514
514
  Have any questions? Reach out to [Kesha Antonov](https://github.com/kesha-antonov)
515
515
 
516
516
  Please note that I'm maintaining this project in my free time for free. If you find any issues, feel free to open them, and I'll do my best to address them as time permits.
517
+
518
+ If you consider my work helpful please consider [become a backer](https://github.com/sponsors/kesha-antonov), I'll have more time to work on open source. Thanks!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gifted-chat",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "The most complete chat UI for React Native",
5
5
  "keywords": [
6
6
  "android",
@@ -7,7 +7,7 @@ import {
7
7
  TextStyle,
8
8
  } from 'react-native'
9
9
  import { Color } from './Color'
10
- import { MessageText } from './MessageText'
10
+ import { MessageText, MessageTextProps } from './MessageText'
11
11
  import { IMessage } from './Models'
12
12
  import stylesCommon from './styles'
13
13
 
@@ -16,6 +16,7 @@ export interface SystemMessageProps<TMessage extends IMessage> {
16
16
  containerStyle?: StyleProp<ViewStyle>
17
17
  messageContainerStyle?: StyleProp<ViewStyle>
18
18
  textStyle?: StyleProp<TextStyle>
19
+ messageTextProps?: Partial<MessageTextProps<TMessage>>
19
20
  children?: React.ReactNode
20
21
  }
21
22
 
@@ -24,6 +25,7 @@ export function SystemMessage<TMessage extends IMessage> ({
24
25
  containerStyle,
25
26
  messageContainerStyle,
26
27
  textStyle,
28
+ messageTextProps,
27
29
  children,
28
30
  }: SystemMessageProps<TMessage>) {
29
31
  if (currentMessage == null)
@@ -38,6 +40,7 @@ export function SystemMessage<TMessage extends IMessage> ({
38
40
  customTextStyle={[styles.text, textStyle]}
39
41
  position='left'
40
42
  containerStyle={{ left: [styles.messageContainer, messageContainerStyle] }}
43
+ {...messageTextProps}
41
44
  />
42
45
  )
43
46
  }
@@ -42,7 +42,7 @@ interface LinkParserProps {
42
42
  const DEFAULT_MATCHERS: LinkMatcher[] = [
43
43
  {
44
44
  type: 'url',
45
- pattern: /(?:(?:https?:\/\/)|(?:www\.))[^\s]+|[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,}(?:\/[^\s]*)?/gi,
45
+ pattern: /(?:https?:\/\/(?:www\.)?|www\.)[^\s]+|(?<![A-Za-z0-9_.@])(?![A-Za-z0-9._%+-]*@)[a-zA-Z0-9][a-zA-Z0-9-]*\.(?!@)[a-zA-Z]{2,}(?![A-Za-z0-9._%+-]*@)(?:\/[^\s]*)?/gi,
46
46
  getLinkUrl: (text: string) => {
47
47
  if (!/^https?:\/\//i.test(text))
48
48
  return `http://${text}`
@@ -52,12 +52,12 @@ const DEFAULT_MATCHERS: LinkMatcher[] = [
52
52
  },
53
53
  {
54
54
  type: 'email',
55
- pattern: /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/gi,
55
+ pattern: /(?<![A-Za-z0-9])([a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/gi,
56
56
  getLinkUrl: (text: string) => `mailto:${text}`,
57
57
  },
58
58
  {
59
59
  type: 'phone',
60
- pattern: /(?:\+?\d{1,3}[\s.\-]?)?\(?\d{1,4}\)?[\s.\-]?\d{1,4}[\s.\-]?\d{1,9}/g,
60
+ pattern: /(?<![A-Za-z0-9_])(?:\+?\d{1,3}[\s.\-]?)?\(?\d{1,4}\)?[\s.\-]?\d{1,4}[\s.\-]?\d{1,9}(?![A-Za-z0-9_]|\.[a-z]{2,4})/gi,
61
61
  getLinkUrl: (text: string) => {
62
62
  const cleaned = text.replace(/[\s.()\-]/g, '')
63
63
  return `tel:${cleaned}`
@@ -71,7 +71,7 @@ const DEFAULT_MATCHERS: LinkMatcher[] = [
71
71
  },
72
72
  {
73
73
  type: 'mention',
74
- pattern: /@[\w-]+/g,
74
+ pattern: /(?<![a-zA-Z0-9._%+-])@[\w-]+/g,
75
75
  getLinkUrl: (text: string) => text,
76
76
  baseUrl: undefined,
77
77
  },