react-mention-input 1.1.16 → 1.1.17

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/demo.tsx CHANGED
@@ -8,14 +8,14 @@ const Demo: React.FC = () => {
8
8
  name: 'John Doe',
9
9
  date: '2 hours ago',
10
10
  comment: 'Updated the status to Draft. Need <span class="mention-highlight">@team-leads</span> review before proceeding. <span class="hashtag-highlight">#urgent</span> <span class="hashtag-highlight">#review</span>',
11
- itemName: '26may_item001 (A)',
11
+ objectName: '26may_item001 (A)',
12
12
  },
13
13
  {
14
14
  id: 2,
15
15
  name: 'Mike Johnson',
16
16
  date: '1 day ago',
17
17
  comment: 'Revision A completed successfully. Ready for next phase. <span class="hashtag-highlight">#milestone</span>',
18
- itemName: '26may_item001 (A)',
18
+ objectName: '26may_item001 (A)',
19
19
  }
20
20
  ]);
21
21
 
@@ -48,7 +48,7 @@ const Demo: React.FC = () => {
48
48
  imageUrl: messageData.imageUrl,
49
49
  tags: messageData.tags,
50
50
  mentions: messageData.userSelectListName,
51
- itemName: 'new_item001 (A)', // You can customize this or make it dynamic
51
+ objectName: 'new_item001 (A)', // You can customize this or make it dynamic
52
52
  };
53
53
 
54
54
  setMessages([...messages, newMessage]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-mention-input",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -12,7 +12,7 @@ interface ShowMessageCardProps {
12
12
  commentKey?: string; // Custom key for comment
13
13
  imgSrcKey?: string; // Custom key for image source
14
14
  imageUrlKey?: string; // Custom key for attached image URL
15
- itemNameKey?: string; // Custom key for item identifier (top-right)
15
+ objectNameKey?: string; // Custom key for object identifier (top-right)
16
16
  containerClassName?: string; // Class for the outermost container
17
17
  containerStyle?: CSSProperties; // Style for the outermost container
18
18
  cardClassName?: string; // Class for the card
@@ -35,8 +35,8 @@ interface ShowMessageCardProps {
35
35
  attachedImageStyle?: CSSProperties; // Style for the attached image
36
36
  attachedImageContainerClassName?: string; // Class for the attached image container
37
37
  attachedImageContainerStyle?: CSSProperties; // Style for the attached image container
38
- itemNameClassName?: string; // Class for the item name (top-right)
39
- itemNameStyle?: CSSProperties; // Style for the item name (top-right)
38
+ objectNameClassName?: string; // Class for the object name (top-right)
39
+ objectNameStyle?: CSSProperties; // Style for the object name (top-right)
40
40
  renderItem?: (element: MessageCardProps) => ReactNode; // Custom render function
41
41
  }
42
42
 
@@ -47,7 +47,7 @@ export const ShowMessageCard: React.FC<ShowMessageCardProps> = ({
47
47
  commentKey = "comment",
48
48
  imgSrcKey = "imgSrc",
49
49
  imageUrlKey = "imageUrl", // Default key for attached image
50
- itemNameKey = "name", // Default key for item identifier
50
+ objectNameKey = "objectName", // Default key for object identifier
51
51
  containerClassName,
52
52
  containerStyle,
53
53
  cardClassName,
@@ -70,10 +70,12 @@ export const ShowMessageCard: React.FC<ShowMessageCardProps> = ({
70
70
  attachedImageStyle,
71
71
  attachedImageContainerClassName,
72
72
  attachedImageContainerStyle,
73
- itemNameClassName,
74
- itemNameStyle,
73
+ objectNameClassName,
74
+ objectNameStyle,
75
75
  renderItem, // Custom render function
76
76
  }) => {
77
+
78
+ console.log(data, "data==");
77
79
  // State to manage initials for images that fail to load
78
80
  const [initialsState, setInitialsState] = useState<{ [key: string]: boolean }>(
79
81
  {}
@@ -175,13 +177,13 @@ export const ShowMessageCard: React.FC<ShowMessageCardProps> = ({
175
177
  </div>
176
178
  </div>
177
179
 
178
- {/* Item identifier in top-right corner */}
179
- {item[itemNameKey] && (
180
+ {/* Object identifier in top-right corner */}
181
+ {item[objectNameKey] && (
180
182
  <div
181
- className={`message-card-item-name ${itemNameClassName || ""}`}
182
- style={itemNameStyle}
183
+ className={`message-card-item-name ${objectNameClassName || ""}`}
184
+ style={objectNameStyle}
183
185
  >
184
- {item[itemNameKey]}
186
+ {item[objectNameKey]}
185
187
  </div>
186
188
  )}
187
189
  </div>