react-mention-input 1.0.10 → 1.0.12

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/README.md CHANGED
@@ -43,7 +43,7 @@ A customizable input component with @mention functionality.
43
43
 
44
44
  ```tsx
45
45
  import React from 'react';
46
- import MentionInput from 'react-mention-input';
46
+ import {MentionInput} from 'react-mention-input';
47
47
 
48
48
  const users = [
49
49
  { id: 1, name: 'John Doe' },
@@ -97,7 +97,7 @@ interface MessageCardProps {
97
97
 
98
98
  ```tsx
99
99
  import React from 'react';
100
- import ShowMessageCard from 'react-mention-input';
100
+ import {ShowMessageCard} from 'react-mention-input';
101
101
 
102
102
  const messageData = [
103
103
  {
@@ -130,52 +130,5 @@ function App() {
130
130
 
131
131
  export default App;
132
132
  ```
133
-
134
- ## Package Configuration
135
-
136
- Ensure that your `package.json` has the following structure:
137
-
138
- ```json
139
- {
140
- "name": "react-mention-input",
141
- "version": "1.0.9",
142
- "main": "dist/index.js",
143
- "types": "dist/index.d.ts",
144
- "scripts": {
145
- "test": "echo "Error: no test specified" && exit 1",
146
- "build": "tsc && npm run copy-css",
147
- "copy-css": "copyfiles -u 1 src/**/*.css dist"
148
- },
149
- "keywords": [
150
- "mention",
151
- "input",
152
- "autocomplete",
153
- "user suggestions",
154
- "react",
155
- "typescript"
156
- ],
157
- "author": "Your Name",
158
- "license": "ISC",
159
- "description": "A React component for input with @mention functionality.",
160
- "repository": {
161
- "type": "git",
162
- "url": "https://github.com/yourusername/react-mention-input.git"
163
- },
164
- "devDependencies": {
165
- "@types/node": "^22.9.0",
166
- "@types/react": "^18.3.12",
167
- "@types/react-dom": "^18.3.1",
168
- "copyfiles": "^2.4.1",
169
- "csstype": "^3.1.3",
170
- "sass": "^1.81.0",
171
- "typescript": "^5.6.3"
172
- },
173
- "peerDependencies": {
174
- "react": "^17.0.0 || ^18.0.0",
175
- "react-dom": "^17.0.0 || ^18.0.0"
176
- }
177
- }
178
- ```
179
-
180
133
  ### License
181
134
  This project is licensed under the ISC License.
@@ -16,5 +16,5 @@ interface MentionInputProps {
16
16
  sendButtonIcon?: ReactNode;
17
17
  onSendMessage?: (message: string) => void;
18
18
  }
19
- declare const MentionInput: React.FC<MentionInputProps>;
20
- export default MentionInput;
19
+ export declare const MentionInput: React.FC<MentionInputProps>;
20
+ export {};
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react';
2
2
  import './MentionInput.css'; // Import the SCSS file
3
- var MentionInput = function (_a) {
3
+ export var MentionInput = function (_a) {
4
4
  var users = _a.users, placeholder = _a.placeholder, containerClassName = _a.containerClassName, inputContainerClassName = _a.inputContainerClassName, inputClassName = _a.inputClassName, sendBtnClassName = _a.sendBtnClassName, suggestionListClassName = _a.suggestionListClassName, suggestionItemClassName = _a.suggestionItemClassName, sendButtonIcon = _a.sendButtonIcon, onSendMessage = _a.onSendMessage;
5
5
  var _b = useState(''), inputValue = _b[0], setInputValue = _b[1];
6
6
  var _c = useState([]), suggestions = _c[0], setSuggestions = _c[1];
@@ -45,4 +45,3 @@ var MentionInput = function (_a) {
45
45
  React.createElement("button", { onClick: handleSendMessage, className: "send-button ".concat(sendBtnClassName || '') }, sendButtonIcon ? (typeof sendButtonIcon === 'string' ? (React.createElement("img", { src: sendButtonIcon, alt: "Send Icon", style: { width: '20px', height: '20px' } })) : (sendButtonIcon)) : ('➤'))),
46
46
  showSuggestions && (React.createElement("ul", { className: "suggestion-list ".concat(suggestionListClassName || '') }, suggestions.map(function (user) { return (React.createElement("li", { key: user.id, onClick: function () { return handleSuggestionClick(user); }, className: "suggestion-item ".concat(suggestionItemClassName || '') }, user.name)); })))));
47
47
  };
48
- export default MentionInput;
@@ -14,5 +14,5 @@ interface ShowMessageCardProps {
14
14
  imgClassName?: string;
15
15
  imgStyle?: CSSProperties;
16
16
  }
17
- declare const ShowMessageCard: React.FC<ShowMessageCardProps>;
18
- export default ShowMessageCard;
17
+ export declare const ShowMessageCard: React.FC<ShowMessageCardProps>;
18
+ export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import './ShowMessageCard.css'; // Import the CSS file
3
- var ShowMessageCard = function (_a) {
3
+ export var ShowMessageCard = function (_a) {
4
4
  var data = _a.data, cardClassName = _a.cardClassName, cardStyle = _a.cardStyle, imgClassName = _a.imgClassName, imgStyle = _a.imgStyle;
5
5
  return (React.createElement("div", { className: "message-card-container" }, data.map(function (item) { return (React.createElement("div", { key: item.id, className: "message-card ".concat(cardClassName || ''), style: cardStyle },
6
6
  React.createElement("div", { className: "message-card-header" },
@@ -11,4 +11,3 @@ var ShowMessageCard = function (_a) {
11
11
  React.createElement("div", { className: "message-card-body" },
12
12
  React.createElement("p", { className: "message-card-comment" }, item.comment)))); })));
13
13
  };
14
- export default ShowMessageCard;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { default as MentionInput } from './MentionInput';
2
- export { default as ShowMessageCard } from './ShowMessageCard';
1
+ export { MentionInput } from './MentionInput';
2
+ export { ShowMessageCard } from './ShowMessageCard';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default as MentionInput } from './MentionInput';
2
- export { default as ShowMessageCard } from './ShowMessageCard';
1
+ export { MentionInput } from './MentionInput';
2
+ export { ShowMessageCard } from './ShowMessageCard';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-mention-input",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -19,7 +19,7 @@ interface MentionInputProps {
19
19
  onSendMessage?: (message: string) => void;
20
20
  }
21
21
 
22
- const MentionInput: React.FC<MentionInputProps> = ({
22
+ export const MentionInput: React.FC<MentionInputProps> = ({
23
23
  users,
24
24
  placeholder,
25
25
  containerClassName,
@@ -118,4 +118,4 @@ const MentionInput: React.FC<MentionInputProps> = ({
118
118
  );
119
119
  };
120
120
 
121
- export default MentionInput;
121
+
@@ -17,7 +17,7 @@ interface ShowMessageCardProps {
17
17
  imgStyle?: CSSProperties; // Custom inline style for image
18
18
  }
19
19
 
20
- const ShowMessageCard: React.FC<ShowMessageCardProps> = ({
20
+ export const ShowMessageCard: React.FC<ShowMessageCardProps> = ({
21
21
  data,
22
22
  cardClassName,
23
23
  cardStyle,
@@ -53,4 +53,3 @@ const ShowMessageCard: React.FC<ShowMessageCardProps> = ({
53
53
  );
54
54
  };
55
55
 
56
- export default ShowMessageCard;
package/src/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { default as MentionInput } from './MentionInput';
2
- export { default as ShowMessageCard } from './ShowMessageCard';
1
+ export { MentionInput } from './MentionInput';
2
+ export { ShowMessageCard } from './ShowMessageCard';