@bigbinary/neeto-molecules 1.7.10 → 1.8.0
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/dist/EmojiPicker.js +134 -0
- package/dist/EmojiPicker.js.map +1 -0
- package/dist/EmojiReactions.js +123 -0
- package/dist/EmojiReactions.js.map +1 -0
- package/dist/ProductEmbed.js +57 -17
- package/dist/ProductEmbed.js.map +1 -1
- package/dist/Sidebar.js +21 -7
- package/dist/Sidebar.js.map +1 -1
- package/dist/cjs/EmojiPicker.js +142 -0
- package/dist/cjs/EmojiPicker.js.map +1 -0
- package/dist/cjs/EmojiReactions.js +130 -0
- package/dist/cjs/EmojiReactions.js.map +1 -0
- package/dist/cjs/ProductEmbed.js +56 -16
- package/dist/cjs/ProductEmbed.js.map +1 -1
- package/dist/cjs/Sidebar.js +20 -6
- package/dist/cjs/Sidebar.js.map +1 -1
- package/package.json +8 -1
- package/src/translations/en.json +5 -1
- package/types/EmojiPicker.d.ts +33 -0
- package/types/EmojiReactions.d.ts +60 -0
- package/types/ProductEmbed.d.ts +1 -0
- package/types/Sidebar.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-molecules",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "A package of reusable molecular components for neeto products.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-molecules.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
|
@@ -77,6 +77,8 @@
|
|
|
77
77
|
"@bigbinary/neeto-molecules": "^1.0.5",
|
|
78
78
|
"@bigbinary/neeto-time-zones": "^0.5.0",
|
|
79
79
|
"@bigbinary/neetoui": "^5.2.32",
|
|
80
|
+
"@emoji-mart/data": "^1.1.2",
|
|
81
|
+
"@emoji-mart/react": "^1.1.1",
|
|
80
82
|
"@faker-js/faker": "7.6.0",
|
|
81
83
|
"@fullcalendar/core": "^6.1.8",
|
|
82
84
|
"@fullcalendar/daygrid": "^6.1.8",
|
|
@@ -119,6 +121,7 @@
|
|
|
119
121
|
"classnames": "^2.3.2",
|
|
120
122
|
"css-loader": "4.3.0",
|
|
121
123
|
"dayjs": "1.11.1",
|
|
124
|
+
"emoji-mart": "^5.5.2",
|
|
122
125
|
"eslint": "8.14.0",
|
|
123
126
|
"eslint-config-prettier": "8.5.0",
|
|
124
127
|
"eslint-plugin-cypress": "2.12.1",
|
|
@@ -168,6 +171,7 @@
|
|
|
168
171
|
"rollup-plugin-styles": "^4.0.0",
|
|
169
172
|
"sass": "^1.58.1",
|
|
170
173
|
"sass-loader": "10.0.2",
|
|
174
|
+
"shadow-dom-testing-library": "^1.11.2",
|
|
171
175
|
"storybook": "^7.5.3",
|
|
172
176
|
"storybook-dark-mode": "^3.0.1",
|
|
173
177
|
"tailwindcss": "^3.4.1",
|
|
@@ -184,6 +188,8 @@
|
|
|
184
188
|
"@bigbinary/neeto-molecules": "latest",
|
|
185
189
|
"@bigbinary/neeto-time-zones": "latest",
|
|
186
190
|
"@bigbinary/neetoui": "latest",
|
|
191
|
+
"@emoji-mart/data": "^1.1.2",
|
|
192
|
+
"@emoji-mart/react": "^1.1.1",
|
|
187
193
|
"@fullcalendar/core": "^6.1.8",
|
|
188
194
|
"@fullcalendar/daygrid": "^6.1.8",
|
|
189
195
|
"@fullcalendar/interaction": "^6.1.8",
|
|
@@ -195,6 +201,7 @@
|
|
|
195
201
|
"axios": "^0.27.2",
|
|
196
202
|
"classnames": "^2.3.2",
|
|
197
203
|
"dayjs": "1.11.1",
|
|
204
|
+
"emoji-mart": "^5.5.2",
|
|
198
205
|
"formik": "2.4.5",
|
|
199
206
|
"i18next": "^22.5.1",
|
|
200
207
|
"js-logger": "^1.6.1",
|
package/src/translations/en.json
CHANGED
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"download": "Download",
|
|
38
38
|
"filter": "Filter",
|
|
39
|
-
"somethingWentWrong": "Something went wrong. Please try again."
|
|
39
|
+
"somethingWentWrong": "Something went wrong. Please try again.",
|
|
40
|
+
"emojiPicker": "Emoji picker"
|
|
40
41
|
},
|
|
41
42
|
"columns": {
|
|
42
43
|
"columns": "Columns",
|
|
@@ -711,6 +712,9 @@
|
|
|
711
712
|
"bottomRight": "Bottom Right",
|
|
712
713
|
"bottomLeft": "Bottom Left"
|
|
713
714
|
}
|
|
715
|
+
},
|
|
716
|
+
"reactions": {
|
|
717
|
+
"content": "{{groupedNames, anyCase}} reacted."
|
|
714
718
|
}
|
|
715
719
|
}
|
|
716
720
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DropdownProps } from "neetoui";
|
|
3
|
+
type Emoji = {
|
|
4
|
+
native: string;
|
|
5
|
+
unified: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* Used in neeto products to pick emojis.
|
|
10
|
+
*
|
|
11
|
+
* 
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
*
|
|
15
|
+
* import EmojiPicker from "@bigbinary/neeto-molecules/EmojiPicker";
|
|
16
|
+
*
|
|
17
|
+
* const EmojiPickerContainer = () => {
|
|
18
|
+
* const [emoji, setEmoji] = useState();
|
|
19
|
+
* return (
|
|
20
|
+
* <div>
|
|
21
|
+
* <div>Selected Emoji: {emoji}</div>
|
|
22
|
+
* <EmojiPicker onSelect={obj => setEmoji(obj.native)} />
|
|
23
|
+
* </div>
|
|
24
|
+
* );
|
|
25
|
+
* };
|
|
26
|
+
* @endexample
|
|
27
|
+
*/
|
|
28
|
+
const EmojiPicker: React.FC<{
|
|
29
|
+
onSelect?: (emoji: Emoji) => void;
|
|
30
|
+
open?: boolean;
|
|
31
|
+
dropdownProps?: DropdownProps;
|
|
32
|
+
}>;
|
|
33
|
+
export default EmojiPicker;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type Emoji = {
|
|
3
|
+
native: string;
|
|
4
|
+
unified: string;
|
|
5
|
+
};
|
|
6
|
+
type Reaction = {
|
|
7
|
+
native: string;
|
|
8
|
+
unified: string;
|
|
9
|
+
userName: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* Used in neeto products to group user selected emojis and display them.
|
|
14
|
+
*
|
|
15
|
+
* 
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* import EmojiReactions from "@bigbinary/neeto-molecules/EmojiReactions";
|
|
20
|
+
* const EmojiReactionsContainer = () => {
|
|
21
|
+
* const [reactions, setReactions] = useState([
|
|
22
|
+
* { native: "😃", unified: "1f603", userName: "User 1" },
|
|
23
|
+
* { native: "😄", unified: "1f604", userName: "User 1" },
|
|
24
|
+
* ]);
|
|
25
|
+
*
|
|
26
|
+
* const createReaction = emoji => ({
|
|
27
|
+
* native: emoji.native,
|
|
28
|
+
* unified: emoji.unified,
|
|
29
|
+
* userName: user.name,
|
|
30
|
+
* userId: user.id,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* const onReactionClick = emoji => {
|
|
34
|
+
* const reaction = findBy(
|
|
35
|
+
* { unified: emoji.unified, userId: user.id },
|
|
36
|
+
* reactions
|
|
37
|
+
* );
|
|
38
|
+
* if (reaction) {
|
|
39
|
+
* setReactions(reactions.filter(item => item.unified !== reaction.unified));
|
|
40
|
+
* } else {
|
|
41
|
+
* setReactions([...reactions, createReaction(emoji)]);
|
|
42
|
+
* }
|
|
43
|
+
* };
|
|
44
|
+
*
|
|
45
|
+
* return (
|
|
46
|
+
* <div>
|
|
47
|
+
* <EmojiReactions {...{ onReactionClick, reactions }} />
|
|
48
|
+
* </div>
|
|
49
|
+
* );
|
|
50
|
+
* };
|
|
51
|
+
* @endexample
|
|
52
|
+
*/
|
|
53
|
+
const EmojiReactions: React.FC<{
|
|
54
|
+
reactions: Reaction[];
|
|
55
|
+
onReactionClick?: (emoji: Emoji) => void;
|
|
56
|
+
emojiSize?: string;
|
|
57
|
+
emojiBoxStyle?: string;
|
|
58
|
+
isUpdating?: boolean;
|
|
59
|
+
}>;
|
|
60
|
+
export default EmojiReactions;
|
package/types/ProductEmbed.d.ts
CHANGED