@chayns-components/emoji-input 5.0.0-beta.96 → 5.0.0-beta.964
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 +4 -15
- package/lib/{api → cjs/api}/item-storage/get.js +4 -5
- package/lib/cjs/api/item-storage/get.js.map +1 -0
- package/lib/{api → cjs/api}/item-storage/put.js +5 -6
- package/lib/cjs/api/item-storage/put.js.map +1 -0
- package/lib/cjs/components/emoji-input/EmojiInput.js +510 -0
- package/lib/cjs/components/emoji-input/EmojiInput.js.map +1 -0
- package/lib/cjs/components/emoji-input/EmojiInput.styles.js +132 -0
- package/lib/cjs/components/emoji-input/EmojiInput.styles.js.map +1 -0
- package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.js +45 -0
- package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.js.map +1 -0
- package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.styles.js +65 -0
- package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.styles.js.map +1 -0
- package/lib/{components → cjs/components}/emoji-picker/EmojiPicker.js +9 -11
- package/lib/cjs/components/emoji-picker/EmojiPicker.js.map +1 -0
- package/lib/{components → cjs/components}/emoji-picker/EmojiPicker.styles.js +3 -5
- package/lib/cjs/components/emoji-picker/EmojiPicker.styles.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +102 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +1 -0
- package/lib/{components → cjs/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js +5 -6
- package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +240 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +69 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +1 -0
- package/lib/{components → cjs/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.js +49 -21
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +24 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +130 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +1 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +99 -0
- package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +1 -0
- package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js +52 -0
- package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -0
- package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js +15 -0
- package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -0
- package/lib/{constants → cjs/constants}/alignment.js +6 -8
- package/lib/cjs/constants/alignment.js.map +1 -0
- package/lib/{constants → cjs/constants}/categories.js +1 -2
- package/lib/cjs/constants/categories.js.map +1 -0
- package/lib/{constants → cjs/constants}/emoji.js +4 -8
- package/lib/cjs/constants/emoji.js.map +1 -0
- package/lib/cjs/constants/externalServerUrl.js +8 -0
- package/lib/cjs/constants/externalServerUrl.js.map +1 -0
- package/lib/cjs/constants/regex.js +15 -0
- package/lib/cjs/constants/regex.js.map +1 -0
- package/lib/{hooks → cjs/hooks}/emojiHistory.js +13 -15
- package/lib/cjs/hooks/emojiHistory.js.map +1 -0
- package/lib/{index.js → cjs/index.js} +1 -1
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/types/api.js +2 -0
- package/lib/cjs/types/api.js.map +1 -0
- package/lib/cjs/types/category.js +2 -0
- package/lib/cjs/types/category.js.map +1 -0
- package/lib/{utils → cjs/utils}/emoji.js +16 -6
- package/lib/cjs/utils/emoji.js.map +1 -0
- package/lib/{utils → cjs/utils}/environment.js +6 -4
- package/lib/cjs/utils/environment.js.map +1 -0
- package/lib/cjs/utils/font.js +17 -0
- package/lib/cjs/utils/font.js.map +1 -0
- package/lib/cjs/utils/insert.js +110 -0
- package/lib/cjs/utils/insert.js.map +1 -0
- package/lib/cjs/utils/number.js +17 -0
- package/lib/cjs/utils/number.js.map +1 -0
- package/lib/cjs/utils/selection.js +255 -0
- package/lib/cjs/utils/selection.js.map +1 -0
- package/lib/cjs/utils/text.js +57 -0
- package/lib/cjs/utils/text.js.map +1 -0
- package/lib/esm/api/item-storage/get.js +30 -0
- package/lib/esm/api/item-storage/get.js.map +1 -0
- package/lib/esm/api/item-storage/put.js +35 -0
- package/lib/esm/api/item-storage/put.js.map +1 -0
- package/lib/esm/components/emoji-input/EmojiInput.js +497 -0
- package/lib/esm/components/emoji-input/EmojiInput.js.map +1 -0
- package/lib/esm/components/emoji-input/EmojiInput.styles.js +151 -0
- package/lib/esm/components/emoji-input/EmojiInput.styles.js.map +1 -0
- package/lib/esm/components/emoji-input/prefix-element/PrefixElement.js +38 -0
- package/lib/esm/components/emoji-input/prefix-element/PrefixElement.js.map +1 -0
- package/lib/esm/components/emoji-input/prefix-element/PrefixElement.styles.js +69 -0
- package/lib/esm/components/emoji-input/prefix-element/PrefixElement.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/EmojiPicker.js +40 -0
- package/lib/esm/components/emoji-picker/EmojiPicker.js.map +1 -0
- package/lib/esm/components/emoji-picker/EmojiPicker.styles.js +16 -0
- package/lib/esm/components/emoji-picker/EmojiPicker.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +96 -0
- package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js +18 -0
- package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +240 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +76 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js +136 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +20 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +121 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +1 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +98 -0
- package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +1 -0
- package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.js +43 -0
- package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -0
- package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.styles.js +8 -0
- package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -0
- package/lib/esm/constants/alignment.js +13 -0
- package/lib/esm/constants/alignment.js.map +1 -0
- package/lib/esm/constants/categories.js +13 -0
- package/lib/esm/constants/categories.js.map +1 -0
- package/lib/esm/constants/emoji-de-DE.json +3827 -0
- package/lib/esm/constants/emoji.js +3798 -0
- package/lib/esm/constants/emoji.js.map +1 -0
- package/lib/esm/constants/externalServerUrl.js +2 -0
- package/lib/esm/constants/externalServerUrl.js.map +1 -0
- package/lib/esm/constants/regex.js +9 -0
- package/lib/esm/constants/regex.js.map +1 -0
- package/lib/esm/hooks/emojiHistory.js +83 -0
- package/lib/esm/hooks/emojiHistory.js.map +1 -0
- package/lib/{index.d.ts → esm/index.js} +1 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/types/api.js +2 -0
- package/lib/esm/types/api.js.map +1 -0
- package/lib/esm/types/category.js +2 -0
- package/lib/esm/types/category.js.map +1 -0
- package/lib/esm/utils/emoji.js +92 -0
- package/lib/esm/utils/emoji.js.map +1 -0
- package/lib/esm/utils/environment.js +24 -0
- package/lib/esm/utils/environment.js.map +1 -0
- package/lib/esm/utils/font.js +10 -0
- package/lib/esm/utils/font.js.map +1 -0
- package/lib/esm/utils/insert.js +104 -0
- package/lib/esm/utils/insert.js.map +1 -0
- package/lib/esm/utils/number.js +10 -0
- package/lib/esm/utils/number.js.map +1 -0
- package/lib/esm/utils/selection.js +237 -0
- package/lib/esm/utils/selection.js.map +1 -0
- package/lib/esm/utils/text.js +48 -0
- package/lib/esm/utils/text.js.map +1 -0
- package/lib/types/components/emoji-input/EmojiInput.d.ts +94 -0
- package/lib/types/components/emoji-input/EmojiInput.styles.d.ts +549 -0
- package/lib/types/components/emoji-input/prefix-element/PrefixElement.d.ts +8 -0
- package/lib/types/components/emoji-input/prefix-element/PrefixElement.styles.d.ts +12 -0
- package/lib/types/components/emoji-picker/EmojiPicker.styles.d.ts +5 -0
- package/lib/types/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.d.ts +267 -0
- package/lib/types/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.d.ts +10 -0
- package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.d.ts +5 -0
- package/lib/types/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.d.ts +6 -0
- package/lib/types/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.d.ts +283 -0
- package/lib/{components → types/components}/emoji-picker-popup/EmojiPickerPopup.d.ts +0 -13
- package/lib/types/components/emoji-picker-popup/EmojiPickerPopup.styles.d.ts +1 -0
- package/lib/types/constants/regex.d.ts +8 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/{utils → types/utils}/emoji.d.ts +2 -0
- package/lib/{utils → types/utils}/environment.d.ts +1 -0
- package/lib/types/utils/font.d.ts +1 -0
- package/lib/{utils → types/utils}/insert.d.ts +8 -1
- package/lib/types/utils/number.d.ts +1 -0
- package/lib/types/utils/selection.d.ts +23 -0
- package/lib/types/utils/text.d.ts +3 -0
- package/package.json +48 -30
- package/lib/api/item-storage/get.js.map +0 -1
- package/lib/api/item-storage/put.js.map +0 -1
- package/lib/components/emoji-input/EmojiInput.d.ts +0 -49
- package/lib/components/emoji-input/EmojiInput.js +0 -161
- package/lib/components/emoji-input/EmojiInput.js.map +0 -1
- package/lib/components/emoji-input/EmojiInput.styles.d.ts +0 -16
- package/lib/components/emoji-input/EmojiInput.styles.js +0 -153
- package/lib/components/emoji-input/EmojiInput.styles.js.map +0 -1
- package/lib/components/emoji-picker/EmojiPicker.js.map +0 -1
- package/lib/components/emoji-picker/EmojiPicker.styles.d.ts +0 -5
- package/lib/components/emoji-picker/EmojiPicker.styles.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +0 -51
- package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.d.ts +0 -2
- package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +0 -131
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.d.ts +0 -7
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +0 -99
- package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.d.ts +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +0 -20
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +0 -74
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +0 -1
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.d.ts +0 -11
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +0 -104
- package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +0 -1
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.js +0 -150
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.js.map +0 -1
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.d.ts +0 -7
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js +0 -97
- package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +0 -1
- package/lib/constants/alignment.js.map +0 -1
- package/lib/constants/categories.js.map +0 -1
- package/lib/constants/emoji.js.map +0 -1
- package/lib/constants/externalServerUrl.js +0 -9
- package/lib/constants/externalServerUrl.js.map +0 -1
- package/lib/hooks/emojiHistory.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/types/api.js +0 -6
- package/lib/types/api.js.map +0 -1
- package/lib/types/category.js +0 -6
- package/lib/types/category.js.map +0 -1
- package/lib/utils/emoji.js.map +0 -1
- package/lib/utils/environment.js.map +0 -1
- package/lib/utils/font.d.ts +0 -1
- package/lib/utils/font.js +0 -15
- package/lib/utils/font.js.map +0 -1
- package/lib/utils/insert.js +0 -50
- package/lib/utils/insert.js.map +0 -1
- package/lib/utils/selection.d.ts +0 -2
- package/lib/utils/selection.js +0 -43
- package/lib/utils/selection.js.map +0 -1
- /package/lib/{constants → cjs/constants}/emoji-de-DE.json +0 -0
- /package/lib/{api → types/api}/item-storage/get.d.ts +0 -0
- /package/lib/{api → types/api}/item-storage/put.d.ts +0 -0
- /package/lib/{components → types/components}/emoji-picker/EmojiPicker.d.ts +0 -0
- /package/lib/{components → types/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.d.ts +0 -0
- /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.d.ts +0 -0
- /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.d.ts +0 -0
- /package/lib/{constants → types/constants}/alignment.d.ts +0 -0
- /package/lib/{constants → types/constants}/categories.d.ts +0 -0
- /package/lib/{constants → types/constants}/emoji.d.ts +0 -0
- /package/lib/{constants → types/constants}/externalServerUrl.d.ts +0 -0
- /package/lib/{hooks → types/hooks}/emojiHistory.d.ts +0 -0
- /package/lib/types/{api.d.ts → types/api.d.ts} +0 -0
- /package/lib/types/{category.d.ts → types/category.d.ts} +0 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { getFontFamily } from '../../utils/font';
|
|
4
|
+
export const StyledEmojiInput = styled.div`
|
|
5
|
+
align-items: center;
|
|
6
|
+
background-color: ${_ref => {
|
|
7
|
+
let {
|
|
8
|
+
theme,
|
|
9
|
+
$shouldChangeColor
|
|
10
|
+
} = _ref;
|
|
11
|
+
return theme.colorMode === 'classic' || $shouldChangeColor ? theme['000'] : theme['100'];
|
|
12
|
+
}};
|
|
13
|
+
border-radius: 3px;
|
|
14
|
+
display: flex;
|
|
15
|
+
border: 1px solid rgba(160, 160, 160, 0.3);
|
|
16
|
+
min-height: 42px;
|
|
17
|
+
opacity: ${_ref2 => {
|
|
18
|
+
let {
|
|
19
|
+
$isDisabled
|
|
20
|
+
} = _ref2;
|
|
21
|
+
return $isDisabled ? 0.5 : 1;
|
|
22
|
+
}};
|
|
23
|
+
pointer-events: ${_ref3 => {
|
|
24
|
+
let {
|
|
25
|
+
$isDisabled
|
|
26
|
+
} = _ref3;
|
|
27
|
+
return $isDisabled ? 'none' : 'initial';
|
|
28
|
+
}};
|
|
29
|
+
position: relative;
|
|
30
|
+
transition: opacity 0.3s ease;
|
|
31
|
+
`;
|
|
32
|
+
export const StyledMotionEmojiInputProgress = styled(motion.div)`
|
|
33
|
+
background-color: ${_ref4 => {
|
|
34
|
+
let {
|
|
35
|
+
theme
|
|
36
|
+
} = _ref4;
|
|
37
|
+
return theme['402'];
|
|
38
|
+
}};
|
|
39
|
+
height: 100%;
|
|
40
|
+
position: absolute;
|
|
41
|
+
z-index: 2;
|
|
42
|
+
border-radius: 3px;
|
|
43
|
+
`;
|
|
44
|
+
export const StyledEmojiInputContent = styled.div`
|
|
45
|
+
align-items: end;
|
|
46
|
+
border-radius: 3px;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex: 1 1 auto;
|
|
49
|
+
gap: 10px;
|
|
50
|
+
padding: 8px 10px;
|
|
51
|
+
z-index: 3;
|
|
52
|
+
`;
|
|
53
|
+
export const StyledMotionEmojiInputEditor = styled(motion.div)`
|
|
54
|
+
color: ${_ref5 => {
|
|
55
|
+
let {
|
|
56
|
+
theme,
|
|
57
|
+
$shouldShowContent
|
|
58
|
+
} = _ref5;
|
|
59
|
+
return $shouldShowContent ? theme.text : theme['100'];
|
|
60
|
+
}};
|
|
61
|
+
flex: 1 1 auto;
|
|
62
|
+
font-family: ${getFontFamily};
|
|
63
|
+
overflow-y: scroll;
|
|
64
|
+
overflow-x: hidden;
|
|
65
|
+
word-break: break-word;
|
|
66
|
+
|
|
67
|
+
// This fixes a bug where the field is not editable in certain browsers.
|
|
68
|
+
// This is for example the case on iOS 15 or older.
|
|
69
|
+
-webkit-user-modify: read-write;
|
|
70
|
+
-webkit-user-select: text;
|
|
71
|
+
|
|
72
|
+
lc_mention,
|
|
73
|
+
nerIgnore,
|
|
74
|
+
nerReplace {
|
|
75
|
+
font-weight: bold;
|
|
76
|
+
|
|
77
|
+
span {
|
|
78
|
+
opacity: 0.5;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Styles for custom scrollbar
|
|
83
|
+
${_ref6 => {
|
|
84
|
+
let {
|
|
85
|
+
$browser,
|
|
86
|
+
theme
|
|
87
|
+
} = _ref6;
|
|
88
|
+
return $browser === 'firefox' ? css`
|
|
89
|
+
scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
|
|
90
|
+
scrollbar-width: thin;
|
|
91
|
+
` : css`
|
|
92
|
+
&::-webkit-scrollbar {
|
|
93
|
+
width: 5px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&::-webkit-scrollbar-track {
|
|
97
|
+
background-color: transparent;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&::-webkit-scrollbar-button {
|
|
101
|
+
background-color: transparent;
|
|
102
|
+
height: 5px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&::-webkit-scrollbar-thumb {
|
|
106
|
+
background-color: rgba(${theme['text-rgb']}, 0.15);
|
|
107
|
+
border-radius: 20px;
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
}}
|
|
111
|
+
`;
|
|
112
|
+
export const StyledEmojiInputRightWrapper = styled.div`
|
|
113
|
+
align-self: stretch;
|
|
114
|
+
border-bottom-right-radius: 3px;
|
|
115
|
+
border-top-right-radius: 3px;
|
|
116
|
+
flex: 0 0 auto;
|
|
117
|
+
overflow: hidden;
|
|
118
|
+
`;
|
|
119
|
+
export const StyledEmojiInputLabel = styled.label`
|
|
120
|
+
color: rgba(${_ref7 => {
|
|
121
|
+
let {
|
|
122
|
+
theme
|
|
123
|
+
} = _ref7;
|
|
124
|
+
return theme['text-rgb'];
|
|
125
|
+
}}, 0.45);
|
|
126
|
+
left: ${_ref8 => {
|
|
127
|
+
let {
|
|
128
|
+
$offsetWidth
|
|
129
|
+
} = _ref8;
|
|
130
|
+
return $offsetWidth ? `${$offsetWidth + 10}px` : '10px';
|
|
131
|
+
}};
|
|
132
|
+
top: 12px;
|
|
133
|
+
align-items: baseline;
|
|
134
|
+
display: flex;
|
|
135
|
+
flex: 0 0 auto;
|
|
136
|
+
gap: 4px;
|
|
137
|
+
line-height: 1.3;
|
|
138
|
+
pointer-events: none;
|
|
139
|
+
position: absolute;
|
|
140
|
+
user-select: none;
|
|
141
|
+
white-space: nowrap;
|
|
142
|
+
max-width: ${_ref9 => {
|
|
143
|
+
let {
|
|
144
|
+
$maxWidth,
|
|
145
|
+
$offsetWidth
|
|
146
|
+
} = _ref9;
|
|
147
|
+
return `${$maxWidth - ($offsetWidth ?? 0)}px`;
|
|
148
|
+
}};
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
`;
|
|
151
|
+
//# sourceMappingURL=EmojiInput.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmojiInput.styles.js","names":["motion","styled","css","getFontFamily","StyledEmojiInput","div","_ref","theme","$shouldChangeColor","colorMode","_ref2","$isDisabled","_ref3","StyledMotionEmojiInputProgress","_ref4","StyledEmojiInputContent","StyledMotionEmojiInputEditor","_ref5","$shouldShowContent","text","_ref6","$browser","StyledEmojiInputRightWrapper","StyledEmojiInputLabel","label","_ref7","_ref8","$offsetWidth","_ref9","$maxWidth"],"sources":["../../../../src/components/emoji-input/EmojiInput.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport type { Browser } from 'detect-browser';\nimport { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\nimport { getFontFamily } from '../../utils/font';\n\ntype StyledEmojiInputProps = WithTheme<{ $isDisabled?: boolean; $shouldChangeColor: boolean }>;\n\nexport const StyledEmojiInput = styled.div<StyledEmojiInputProps>`\n align-items: center;\n background-color: ${({ theme, $shouldChangeColor }: StyledEmojiInputProps) =>\n theme.colorMode === 'classic' || $shouldChangeColor ? theme['000'] : theme['100']};\n border-radius: 3px;\n display: flex;\n border: 1px solid rgba(160, 160, 160, 0.3);\n min-height: 42px;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n pointer-events: ${({ $isDisabled }) => ($isDisabled ? 'none' : 'initial')};\n position: relative;\n transition: opacity 0.3s ease;\n`;\n\ntype StyledMotionEmojiInputProgressProps = WithTheme<unknown>;\n\nexport const StyledMotionEmojiInputProgress = styled(\n motion.div,\n)<StyledMotionEmojiInputProgressProps>`\n background-color: ${({ theme }: StyledMotionEmojiInputProgressProps) => theme['402']};\n height: 100%;\n position: absolute;\n z-index: 2;\n border-radius: 3px;\n`;\n\nexport const StyledEmojiInputContent = styled.div`\n align-items: end;\n border-radius: 3px;\n display: flex;\n flex: 1 1 auto;\n gap: 10px;\n padding: 8px 10px;\n z-index: 3;\n`;\n\ntype StyledEmojiInputEditorProps = WithTheme<{\n $shouldShowContent: boolean;\n $browser: Browser | 'bot' | null | undefined;\n}>;\n\nexport const StyledMotionEmojiInputEditor = styled(motion.div)<StyledEmojiInputEditorProps>`\n color: ${({ theme, $shouldShowContent }: StyledEmojiInputEditorProps) =>\n $shouldShowContent ? theme.text : theme['100']};\n flex: 1 1 auto;\n font-family: ${getFontFamily};\n overflow-y: scroll;\n overflow-x: hidden;\n word-break: break-word;\n\n // This fixes a bug where the field is not editable in certain browsers.\n // This is for example the case on iOS 15 or older.\n -webkit-user-modify: read-write;\n -webkit-user-select: text;\n\n lc_mention,\n nerIgnore,\n nerReplace {\n font-weight: bold;\n\n span {\n opacity: 0.5;\n }\n }\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledEmojiInputEditorProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n }\n `}\n`;\n\nexport const StyledEmojiInputRightWrapper = styled.div`\n align-self: stretch;\n border-bottom-right-radius: 3px;\n border-top-right-radius: 3px;\n flex: 0 0 auto;\n overflow: hidden;\n`;\n\ntype StyledEmojiInputLabelProps = WithTheme<{\n $maxWidth: number;\n $offsetWidth?: number;\n}>;\n\nexport const StyledEmojiInputLabel = styled.label<StyledEmojiInputLabelProps>`\n color: rgba(${({ theme }: StyledEmojiInputLabelProps) => theme['text-rgb']}, 0.45);\n left: ${({ $offsetWidth }) => ($offsetWidth ? `${$offsetWidth + 10}px` : '10px')};\n top: 12px;\n align-items: baseline;\n display: flex;\n flex: 0 0 auto;\n gap: 4px;\n line-height: 1.3;\n pointer-events: none;\n position: absolute;\n user-select: none;\n white-space: nowrap;\n max-width: ${({ $maxWidth, $offsetWidth }) => `${$maxWidth - ($offsetWidth ?? 0)}px`};\n overflow: hidden;\n`;\n"],"mappings":"AAEA,SAASA,MAAM,QAAQ,eAAe;AACtC,OAAOC,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,aAAa,QAAQ,kBAAkB;AAIhD,OAAO,MAAMC,gBAAgB,GAAGH,MAAM,CAACI,GAA0B;AACjE;AACA,wBAAwBC,IAAA;EAAA,IAAC;I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AK,SAAS,GAChBnB,GAAG;AACjB,0CAA0CK,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACDL,GAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CK,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AAAA;AACf,CAAC;AAED,OAAO,MAAMe,4BAA4B,GAAGrB,MAAM,CAACI,GAAG;AACtD;AACA;AACA;AACA;AACA;AACA,CAAC;AAOD,OAAO,MAAMkB,qBAAqB,GAAGtB,MAAM,CAACuB,KAAiC;AAC7E,kBAAkBC,KAAA;EAAA,IAAC;IAAElB;EAAkC,CAAC,GAAAkB,KAAA;EAAA,OAAKlB,KAAK,CAAC,UAAU,CAAC;AAAA;AAC9E,YAAYmB,KAAA;EAAA,IAAC;IAAEC;EAAa,CAAC,GAAAD,KAAA;EAAA,OAAMC,YAAY,GAAG,GAAGA,YAAY,GAAG,EAAE,IAAI,GAAG,MAAM;AAAA,CAAC;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiBC,KAAA;EAAA,IAAC;IAAEC,SAAS;IAAEF;EAAa,CAAC,GAAAC,KAAA;EAAA,OAAK,GAAGC,SAAS,IAAIF,YAAY,IAAI,CAAC,CAAC,IAAI;AAAA;AACxF;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { convertTextToHTML } from '../../../utils/text';
|
|
3
|
+
import { StyledPrefixElement, StyledPrefixElementLetter, StyledPrefixElementLetterWrapper, StyledPrefixElementPseudo } from './PrefixElement.styles';
|
|
4
|
+
const PrefixElement = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
prefixElementRef,
|
|
7
|
+
element,
|
|
8
|
+
setIsPrefixAnimationFinished
|
|
9
|
+
} = _ref;
|
|
10
|
+
const [shouldShow, setShouldShow] = useState(true);
|
|
11
|
+
const [prefixText, setPrefixText] = useState('');
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (prefixElementRef.current) {
|
|
14
|
+
setPrefixText(prefixElementRef.current.textContent ?? '');
|
|
15
|
+
}
|
|
16
|
+
}, [prefixElementRef]);
|
|
17
|
+
const handleAnimationEnd = useCallback(index => {
|
|
18
|
+
if (index === prefixText.length - 1) {
|
|
19
|
+
setShouldShow(false);
|
|
20
|
+
setIsPrefixAnimationFinished(true);
|
|
21
|
+
}
|
|
22
|
+
}, [prefixText.length, setIsPrefixAnimationFinished]);
|
|
23
|
+
const content = useMemo(() => prefixText.split('').map((letter, index) => /*#__PURE__*/React.createElement(StyledPrefixElementLetter, {
|
|
24
|
+
onAnimationEnd: () => handleAnimationEnd(index),
|
|
25
|
+
$index: index
|
|
26
|
+
}, letter)), [handleAnimationEnd, prefixText]);
|
|
27
|
+
return /*#__PURE__*/React.createElement(StyledPrefixElement, {
|
|
28
|
+
$shouldShow: shouldShow
|
|
29
|
+
}, /*#__PURE__*/React.createElement(StyledPrefixElementPseudo, {
|
|
30
|
+
ref: prefixElementRef,
|
|
31
|
+
dangerouslySetInnerHTML: {
|
|
32
|
+
__html: convertTextToHTML(element)
|
|
33
|
+
}
|
|
34
|
+
}), shouldShow && /*#__PURE__*/React.createElement(StyledPrefixElementLetterWrapper, null, content));
|
|
35
|
+
};
|
|
36
|
+
PrefixElement.displayName = 'PrefixElement';
|
|
37
|
+
export default PrefixElement;
|
|
38
|
+
//# sourceMappingURL=PrefixElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrefixElement.js","names":["React","useCallback","useEffect","useMemo","useState","convertTextToHTML","StyledPrefixElement","StyledPrefixElementLetter","StyledPrefixElementLetterWrapper","StyledPrefixElementPseudo","PrefixElement","_ref","prefixElementRef","element","setIsPrefixAnimationFinished","shouldShow","setShouldShow","prefixText","setPrefixText","current","textContent","handleAnimationEnd","index","length","content","split","map","letter","createElement","onAnimationEnd","$index","$shouldShow","ref","dangerouslySetInnerHTML","__html","displayName"],"sources":["../../../../../src/components/emoji-input/prefix-element/PrefixElement.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useMemo,\n useState,\n type Dispatch,\n type FC,\n type RefObject,\n type SetStateAction,\n} from 'react';\nimport { convertTextToHTML } from '../../../utils/text';\nimport {\n StyledPrefixElement,\n StyledPrefixElementLetter,\n StyledPrefixElementLetterWrapper,\n StyledPrefixElementPseudo,\n} from './PrefixElement.styles';\n\nexport type PrefixElementProps = {\n prefixElementRef: RefObject<HTMLDivElement>;\n element: string;\n setIsPrefixAnimationFinished: Dispatch<SetStateAction<boolean>>;\n};\n\nconst PrefixElement: FC<PrefixElementProps> = ({\n prefixElementRef,\n element,\n setIsPrefixAnimationFinished,\n}) => {\n const [shouldShow, setShouldShow] = useState(true);\n const [prefixText, setPrefixText] = useState('');\n\n useEffect(() => {\n if (prefixElementRef.current) {\n setPrefixText(prefixElementRef.current.textContent ?? '');\n }\n }, [prefixElementRef]);\n\n const handleAnimationEnd = useCallback(\n (index: number) => {\n if (index === prefixText.length - 1) {\n setShouldShow(false);\n setIsPrefixAnimationFinished(true);\n }\n },\n [prefixText.length, setIsPrefixAnimationFinished],\n );\n\n const content = useMemo(\n () =>\n prefixText.split('').map((letter, index) => (\n <StyledPrefixElementLetter\n onAnimationEnd={() => handleAnimationEnd(index)}\n $index={index}\n >\n {letter}\n </StyledPrefixElementLetter>\n )),\n [handleAnimationEnd, prefixText],\n );\n\n return (\n <StyledPrefixElement $shouldShow={shouldShow}>\n <StyledPrefixElementPseudo\n ref={prefixElementRef}\n dangerouslySetInnerHTML={{ __html: convertTextToHTML(element) }}\n />\n {shouldShow && (\n <StyledPrefixElementLetterWrapper>{content}</StyledPrefixElementLetterWrapper>\n )}\n </StyledPrefixElement>\n );\n};\n\nPrefixElement.displayName = 'PrefixElement';\n\nexport default PrefixElement;\n"],"mappings":"AAAA,OAAOA,KAAK,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ACIjB,KAAA,CAAA4B,aAAA,CAACtB,mBAAmB;IAACyB,WAAW,EAAEhB;EAAW,gBACzCf,KAAA,CAAA4B,aAAA,CAACnB,yBAAyB;IACtBuB,GAAG,EAAEpB,gBAAiB;IACtBqB,uBAAuB,EAAE;MAAEC,MAAM,EAAE7B,iBAAiB,CAACQ,OAAO;IAAE;EAAE,CACnE,CAAC,EACDE,UAAU,iBACPf,KAAA,CAAA4B,aAAA,CAACpB,gCAAgC,QAAEgB,OAA0C,CAEhE,CAAC;AAE9B,CAAC;AAEDd,aAAa,CAACyB,WAAW,GAAG,eAAe;AAE3C,eAAezB,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import styled, { keyframes } from 'styled-components';
|
|
2
|
+
export const StyledPrefixElement = styled.div`
|
|
3
|
+
position: absolute;
|
|
4
|
+
`;
|
|
5
|
+
export const StyledPrefixElementPseudo = styled.div`
|
|
6
|
+
visibility: hidden;
|
|
7
|
+
`;
|
|
8
|
+
export const StyledPrefixElementLetterWrapper = styled.div`
|
|
9
|
+
transform: translateY(-2px);
|
|
10
|
+
`;
|
|
11
|
+
const waviy = keyframes`
|
|
12
|
+
0%, 40% {
|
|
13
|
+
background: linear-gradient(to right, rgb(15, 109, 126), rgb(15, 109, 126), rgb(115, 190, 204), rgb(15, 109, 126));
|
|
14
|
+
background-clip: text;
|
|
15
|
+
transform: translateY(0) scale(1);
|
|
16
|
+
opacity: 1;
|
|
17
|
+
}
|
|
18
|
+
20% {
|
|
19
|
+
transform: translateY(-2px) scale(1.2);
|
|
20
|
+
opacity: 1;
|
|
21
|
+
}
|
|
22
|
+
100% {
|
|
23
|
+
-webkit-text-fill-color: ${_ref => {
|
|
24
|
+
let {
|
|
25
|
+
theme
|
|
26
|
+
} = _ref;
|
|
27
|
+
return theme.text;
|
|
28
|
+
}};
|
|
29
|
+
transform: translateY(0) scale(1);
|
|
30
|
+
opacity: 1;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
const backgroundPan = keyframes`
|
|
34
|
+
0% {
|
|
35
|
+
background-position: 0 center;
|
|
36
|
+
}
|
|
37
|
+
100% {
|
|
38
|
+
background-position: -200% center;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
export const StyledPrefixElementLetter = styled.span`
|
|
42
|
+
background-clip: text;
|
|
43
|
+
-webkit-text-fill-color: transparent;
|
|
44
|
+
background-color: ${_ref2 => {
|
|
45
|
+
let {
|
|
46
|
+
theme
|
|
47
|
+
} = _ref2;
|
|
48
|
+
return theme.text;
|
|
49
|
+
}};
|
|
50
|
+
opacity: 0;
|
|
51
|
+
|
|
52
|
+
animation:
|
|
53
|
+
${waviy} 0.4s forwards,
|
|
54
|
+
${backgroundPan} 0.1s linear infinite;
|
|
55
|
+
animation-delay: calc(0.03s * ${_ref3 => {
|
|
56
|
+
let {
|
|
57
|
+
$index
|
|
58
|
+
} = _ref3;
|
|
59
|
+
return $index;
|
|
60
|
+
}});
|
|
61
|
+
|
|
62
|
+
font-weight: ${_ref4 => {
|
|
63
|
+
let {
|
|
64
|
+
$index
|
|
65
|
+
} = _ref4;
|
|
66
|
+
return $index > 0 ? 'bold' : 'normal';
|
|
67
|
+
}};
|
|
68
|
+
`;
|
|
69
|
+
//# sourceMappingURL=PrefixElement.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrefixElement.styles.js","names":["styled","keyframes","StyledPrefixElement","div","StyledPrefixElementPseudo","StyledPrefixElementLetterWrapper","waviy","_ref","theme","text","backgroundPan","StyledPrefixElementLetter","span","_ref2","_ref3","$index","_ref4"],"sources":["../../../../../src/components/emoji-input/prefix-element/PrefixElement.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport styled, { keyframes } from 'styled-components';\n\ntype StyledPrefixElementProps = WithTheme<{\n $shouldShow: boolean;\n}>;\n\nexport const StyledPrefixElement = styled.div<StyledPrefixElementProps>`\n position: absolute;\n`;\n\nexport const StyledPrefixElementPseudo = styled.div`\n visibility: hidden;\n`;\n\nexport const StyledPrefixElementLetterWrapper = styled.div`\n transform: translateY(-2px);\n`;\n\ntype StyledPrefixElementLetterProps = WithTheme<{\n $index: number;\n}>;\n\nconst waviy = keyframes`\n 0%, 40% {\n background: linear-gradient(to right, rgb(15, 109, 126), rgb(15, 109, 126), rgb(115, 190, 204), rgb(15, 109, 126));\n background-clip: text;\n transform: translateY(0) scale(1);\n opacity: 1;\n }\n 20% {\n transform: translateY(-2px) scale(1.2);\n opacity: 1;\n }\n 100% {\n -webkit-text-fill-color: ${({ theme }: WithTheme<unknown>) => theme.text};\n transform: translateY(0) scale(1);\n opacity: 1;\n }\n`;\n\nconst backgroundPan = keyframes`\n 0% {\n background-position: 0 center;\n }\n 100% {\n background-position: -200% center;\n }\n`;\n\nexport const StyledPrefixElementLetter = styled.span<StyledPrefixElementLetterProps>`\n background-clip: text;\n -webkit-text-fill-color: transparent;\n background-color: ${({ theme }: StyledPrefixElementLetterProps) => theme.text};\n opacity: 0;\n\n animation:\n ${waviy} 0.4s forwards,\n ${backgroundPan} 0.1s linear infinite;\n animation-delay: calc(0.03s * ${({ $index }) => $index});\n\n font-weight: ${({ $index }) => ($index > 0 ? 'bold' : 'normal')};\n`;\n"],"mappings":"AACA,OAAOA,MAAM,IAAIC,SAAS,QAAQ,mBAAmB;AAMrD,OAAO,MAAMC,mBAAmB,GAAGF,MAAM,CAACG,GAA6B;AACvE;AACA,CAAC;AAED,OAAO,MAAMC,yBAAyB,GAAGJ,MAAM,CAACG,GAAG;AACnD;AACA,CAAC;AAED,OAAO,MAAME,gCAAgC,GAAGL,MAAM,CAACG,GAAG;AAC1D;AACA,CAAC;AAMD,MAAMG,KAAK,GAAGL,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmCM,IAAA;EAAA,IAAC;IAAEC;EAA0B,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAACC,IAAI;AAAA;AAChF;AACA;AACA;AACA,CAAC;AAED,MAAMC,aAAa,GAAGT,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMU,yBAAyB,GAAGX,MAAM,CAACY,IAAoC;AACpF;AACA;AACA,wBAAwBC,KAAA;EAAA,IAAC;IAAEL;EAAsC,CAAC,GAAAK,KAAA;EAAA,OAAKL,KAAK,CAACC,IAAI;AAAA;AACjF;AACA;AACA;AACA,UAAUH,KAAK;AACf,UAAUI,aAAa;AACvB,oCAAoCI,KAAA;EAAA,IAAC;IAAEC;EAAO,CAAC,GAAAD,KAAA;EAAA,OAAKC,MAAM;AAAA;AAC1D;AACA,mBAAmBC,KAAA;EAAA,IAAC;IAAED;EAAO,CAAC,GAAAC,KAAA;EAAA,OAAMD,MAAM,GAAG,CAAC,GAAG,MAAM,GAAG,QAAQ;AAAA,CAAC;AACnE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Input } from '@chayns-components/core';
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import emojiCategories from 'unicode-emoji-json/data-by-group.json';
|
|
4
|
+
import EmojiPickerCategories from './emoji-picker-categories/EmojiPickerCategories';
|
|
5
|
+
import EmojiPickerEmojis from './emoji-picker-emojis/EmojiPickerEmojis';
|
|
6
|
+
import { StyledEmojiPicker } from './EmojiPicker.styles';
|
|
7
|
+
const EmojiPicker = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
accessToken,
|
|
10
|
+
onSelect,
|
|
11
|
+
personId
|
|
12
|
+
} = _ref;
|
|
13
|
+
const [searchString, setSearchString] = useState('');
|
|
14
|
+
const [selectedCategory, setSelectedCategory] = useState(emojiCategories[0]?.slug);
|
|
15
|
+
const handleCategorySelect = useCallback(category => {
|
|
16
|
+
setSearchString('');
|
|
17
|
+
setSelectedCategory(category);
|
|
18
|
+
}, []);
|
|
19
|
+
const handleSearchChange = useCallback(event => {
|
|
20
|
+
setSearchString(event.target.value);
|
|
21
|
+
}, []);
|
|
22
|
+
return /*#__PURE__*/React.createElement(StyledEmojiPicker, null, /*#__PURE__*/React.createElement(Input, {
|
|
23
|
+
onChange: handleSearchChange,
|
|
24
|
+
placeholder: "Suchen",
|
|
25
|
+
value: searchString
|
|
26
|
+
}), /*#__PURE__*/React.createElement(EmojiPickerEmojis, {
|
|
27
|
+
accessToken: accessToken,
|
|
28
|
+
onSelect: onSelect,
|
|
29
|
+
personId: personId,
|
|
30
|
+
searchString: searchString,
|
|
31
|
+
selectedCategory: selectedCategory
|
|
32
|
+
}), /*#__PURE__*/React.createElement(EmojiPickerCategories, {
|
|
33
|
+
onSelect: handleCategorySelect,
|
|
34
|
+
searchString: searchString,
|
|
35
|
+
selectedCategory: selectedCategory
|
|
36
|
+
}));
|
|
37
|
+
};
|
|
38
|
+
EmojiPicker.displayName = 'EmojiPicker';
|
|
39
|
+
export default EmojiPicker;
|
|
40
|
+
//# sourceMappingURL=EmojiPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmojiPicker.js","names":["Input","React","useCallback","useState","emojiCategories","EmojiPickerCategories","EmojiPickerEmojis","StyledEmojiPicker","EmojiPicker","_ref","accessToken","onSelect","personId","searchString","setSearchString","selectedCategory","setSelectedCategory","slug","handleCategorySelect","category","handleSearchChange","event","target","value","createElement","onChange","placeholder","displayName"],"sources":["../../../../src/components/emoji-picker/EmojiPicker.tsx"],"sourcesContent":["import { Input } from '@chayns-components/core';\nimport React, { ChangeEvent, FC, useCallback, useState } from 'react';\nimport emojiCategories from 'unicode-emoji-json/data-by-group.json';\nimport type { Category } from '../../types/category';\nimport EmojiPickerCategories from './emoji-picker-categories/EmojiPickerCategories';\nimport EmojiPickerEmojis from './emoji-picker-emojis/EmojiPickerEmojis';\nimport { StyledEmojiPicker } from './EmojiPicker.styles';\n\nexport type EmojiPickerProps = {\n /**\n * Access token of the logged-in user. Is needed to load and save the history of the emojis.\n */\n accessToken?: string;\n /**\n * Function executed when an emoji is selected in the popup\n * @param {string} emoji - Emoji that was selected\n */\n onSelect: (emoji: string) => void;\n /**\n * Person id of the logged-in user. Is needed to load and save the history of the emojis.\n */\n personId?: string;\n};\nconst EmojiPicker: FC<EmojiPickerProps> = ({ accessToken, onSelect, personId }) => {\n const [searchString, setSearchString] = useState('');\n const [selectedCategory, setSelectedCategory] = useState(emojiCategories[0]?.slug as Category);\n\n const handleCategorySelect = useCallback((category: Category) => {\n setSearchString('');\n setSelectedCategory(category);\n }, []);\n\n const handleSearchChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n setSearchString(event.target.value);\n }, []);\n\n return (\n <StyledEmojiPicker>\n <Input onChange={handleSearchChange} placeholder=\"Suchen\" value={searchString} />\n <EmojiPickerEmojis\n accessToken={accessToken}\n onSelect={onSelect}\n personId={personId}\n searchString={searchString}\n selectedCategory={selectedCategory}\n />\n <EmojiPickerCategories\n onSelect={handleCategorySelect}\n searchString={searchString}\n selectedCategory={selectedCategory}\n />\n </StyledEmojiPicker>\n );\n};\n\nEmojiPicker.displayName = 'EmojiPicker';\n\nexport default EmojiPicker;\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,yBAAyB;AAC/C,OAAOC,KAAK,IAAqBC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACrE,OAAOC,eAAe,MAAM,uCAAuC;AAEnE,OAAOC,qBAAqB,MAAM,iDAAiD;AACnF,OAAOC,iBAAiB,MAAM,yCAAyC;AACvE,SAASC,iBAAiB,QAAQ,sBAAsB;AAiBxD,MAAMC,WAAiC,GAAGC,IAAA,IAAyC;EAAA,IAAxC;IAAEC,WAAW;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAAH,IAAA;EAC1E,MAAM,CAACI,YAAY,EAAEC,eAAe,CAAC,GAAGX,QAAQ,CAAC,EAAE,CAAC;EACpD,MAAM,CAACY,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGb,QAAQ,CAACC,eAAe,CAAC,CAAC,CAAC,EAAEa,IAAgB,CAAC;EAE9F,MAAMC,oBAAoB,GAAGhB,WAAW,CAAEiB,QAAkB,IAAK;IAC7DL,eAAe,CAAC,EAAE,CAAC;IACnBE,mBAAmB,CAACG,QAAQ,CAAC;EACjC,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMC,kBAAkB,GAAGlB,WAAW,CAAEmB,KAAoC,IAAK;IAC7EP,eAAe,CAACO,KAAK,CAACC,MAAM,CAACC,KAAK,CAAC;EACvC,CAAC,EAAE,EAAE,CAAC;EAEN,oBACItB,KAAA,CAAAuB,aAAA,CAACjB,iBAAiB,qBACdN,KAAA,CAAAuB,aAAA,CAACxB,KAAK;IAACyB,QAAQ,EAAEL,kBAAmB;IAACM,WAAW,EAAC,QAAQ;IAACH,KAAK,EAAEV;EAAa,CAAE,CAAC,eACjFZ,KAAA,CAAAuB,aAAA,CAAClB,iBAAiB;IACdI,WAAW,EAAEA,WAAY;IACzBC,QAAQ,EAAEA,QAAS;IACnBC,QAAQ,EAAEA,QAAS;IACnBC,YAAY,EAAEA,YAAa;IAC3BE,gBAAgB,EAAEA;EAAiB,CACtC,CAAC,eACFd,KAAA,CAAAuB,aAAA,CAACnB,qBAAqB;IAClBM,QAAQ,EAAEO,oBAAqB;IAC/BL,YAAY,EAAEA,YAAa;IAC3BE,gBAAgB,EAAEA;EAAiB,CACtC,CACc,CAAC;AAE5B,CAAC;AAEDP,WAAW,CAACmB,WAAW,GAAG,aAAa;AAEvC,eAAenB,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export const emojiPickerSize = {
|
|
3
|
+
height: 285,
|
|
4
|
+
width: 350
|
|
5
|
+
};
|
|
6
|
+
export const StyledEmojiPicker = styled.div`
|
|
7
|
+
align-items: center;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
height: ${emojiPickerSize.height}px;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
padding: 10px 22px;
|
|
13
|
+
width: ${emojiPickerSize.width}px;
|
|
14
|
+
user-select: none;
|
|
15
|
+
`;
|
|
16
|
+
//# sourceMappingURL=EmojiPicker.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmojiPicker.styles.js","names":["styled","emojiPickerSize","height","width","StyledEmojiPicker","div"],"sources":["../../../../src/components/emoji-picker/EmojiPicker.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const emojiPickerSize = {\n height: 285,\n width: 350,\n};\n\nexport const StyledEmojiPicker = styled.div`\n align-items: center;\n display: flex;\n flex-direction: column;\n height: ${emojiPickerSize.height}px;\n justify-content: center;\n padding: 10px 22px;\n width: ${emojiPickerSize.width}px;\n user-select: none;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,MAAMC,eAAe,GAAG;EAC3BC,MAAM,EAAE,GAAG;EACXC,KAAK,EAAE;AACX,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAGJ,MAAM,CAACK,GAAG;AAC3C;AACA;AACA;AACA,cAAcJ,eAAe,CAACC,MAAM;AACpC;AACA;AACA,aAAaD,eAAe,CAACE,KAAK;AAClC;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import unicodeEmoji from 'unicode-emoji-json/data-by-group.json';
|
|
3
|
+
import { CATEGORY_EMOJIS } from '../../../constants/categories';
|
|
4
|
+
import { StyledEmojiPickerCategories, StyledMotionEmojiPickerCategory } from './EmojiPickerCategories.styles';
|
|
5
|
+
const EmojiPickerCategories = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
onSelect,
|
|
8
|
+
searchString,
|
|
9
|
+
selectedCategory
|
|
10
|
+
} = _ref;
|
|
11
|
+
const [focusedIndex, setFocusedIndex] = useState(1);
|
|
12
|
+
const categoryRef = useRef(null);
|
|
13
|
+
const isSearchStringGiven = searchString.trim() !== '';
|
|
14
|
+
const handleSelect = useCallback(slug => {
|
|
15
|
+
onSelect(slug);
|
|
16
|
+
}, [onSelect]);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const handleKeyDown = event => {
|
|
19
|
+
if (event.key === 'Tab' || event.key === 'Tab' && event.shiftKey) {
|
|
20
|
+
event.preventDefault();
|
|
21
|
+
const children = categoryRef.current?.children;
|
|
22
|
+
if (children && children.length > 0) {
|
|
23
|
+
let newIndex = focusedIndex !== null ? focusedIndex : 0;
|
|
24
|
+
if (event.key === 'Tab' && event.shiftKey) {
|
|
25
|
+
newIndex = (newIndex - 1) % children.length;
|
|
26
|
+
} else if (event.key === 'Tab') {
|
|
27
|
+
newIndex = (newIndex + 1) % children.length;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// remove focus from the old element
|
|
31
|
+
if (focusedIndex !== null) {
|
|
32
|
+
const prevElement = children[focusedIndex];
|
|
33
|
+
prevElement.tabIndex = -1;
|
|
34
|
+
}
|
|
35
|
+
if (newIndex < 0) {
|
|
36
|
+
newIndex = children.length - 1;
|
|
37
|
+
} else if (newIndex > children.length - 1) {
|
|
38
|
+
newIndex = 0;
|
|
39
|
+
}
|
|
40
|
+
setFocusedIndex(newIndex);
|
|
41
|
+
|
|
42
|
+
// Set focus to the element
|
|
43
|
+
const newElement = children[newIndex];
|
|
44
|
+
newElement.tabIndex = 0;
|
|
45
|
+
newElement.focus();
|
|
46
|
+
if (!newElement) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const {
|
|
50
|
+
id
|
|
51
|
+
} = newElement;
|
|
52
|
+
handleSelect(id);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
57
|
+
return () => {
|
|
58
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
59
|
+
};
|
|
60
|
+
}, [focusedIndex, handleSelect]);
|
|
61
|
+
const handleClick = useCallback(slug => {
|
|
62
|
+
handleSelect(slug);
|
|
63
|
+
}, [handleSelect]);
|
|
64
|
+
const categories = useMemo(() => {
|
|
65
|
+
const categorySlugs = unicodeEmoji.map(_ref2 => {
|
|
66
|
+
let {
|
|
67
|
+
slug
|
|
68
|
+
} = _ref2;
|
|
69
|
+
return slug;
|
|
70
|
+
});
|
|
71
|
+
categorySlugs.unshift('history');
|
|
72
|
+
return categorySlugs.map(slug => {
|
|
73
|
+
const isSelected = selectedCategory === slug && !isSearchStringGiven;
|
|
74
|
+
return /*#__PURE__*/React.createElement(StyledMotionEmojiPickerCategory, {
|
|
75
|
+
animate: {
|
|
76
|
+
filter: `grayscale(${isSelected ? 0 : 0.75})`,
|
|
77
|
+
opacity: isSelected ? 1 : 0.5
|
|
78
|
+
},
|
|
79
|
+
className: "prevent-lose-focus",
|
|
80
|
+
initial: false,
|
|
81
|
+
key: slug,
|
|
82
|
+
id: slug,
|
|
83
|
+
onClick: () => handleClick(slug),
|
|
84
|
+
transition: {
|
|
85
|
+
duration: 0.2
|
|
86
|
+
}
|
|
87
|
+
}, CATEGORY_EMOJIS[slug]);
|
|
88
|
+
});
|
|
89
|
+
}, [handleClick, isSearchStringGiven, selectedCategory]);
|
|
90
|
+
return /*#__PURE__*/React.createElement(StyledEmojiPickerCategories, {
|
|
91
|
+
ref: categoryRef
|
|
92
|
+
}, categories);
|
|
93
|
+
};
|
|
94
|
+
EmojiPickerCategories.displayName = 'EmojiPickerCategories';
|
|
95
|
+
export default EmojiPickerCategories;
|
|
96
|
+
//# sourceMappingURL=EmojiPickerCategories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmojiPickerCategories.js","names":["React","useCallback","useEffect","useMemo","useRef","useState","unicodeEmoji","CATEGORY_EMOJIS","StyledEmojiPickerCategories","StyledMotionEmojiPickerCategory","EmojiPickerCategories","_ref","onSelect","searchString","selectedCategory","focusedIndex","setFocusedIndex","categoryRef","isSearchStringGiven","trim","handleSelect","slug","handleKeyDown","event","key","shiftKey","preventDefault","children","current","length","newIndex","prevElement","tabIndex","newElement","focus","id","document","addEventListener","removeEventListener","handleClick","categories","categorySlugs","map","_ref2","unshift","isSelected","createElement","animate","filter","opacity","className","initial","onClick","transition","duration","ref","displayName"],"sources":["../../../../../src/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.tsx"],"sourcesContent":["import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport unicodeEmoji from 'unicode-emoji-json/data-by-group.json';\nimport { CATEGORY_EMOJIS } from '../../../constants/categories';\nimport type { Category } from '../../../types/category';\nimport {\n StyledEmojiPickerCategories,\n StyledMotionEmojiPickerCategory,\n} from './EmojiPickerCategories.styles';\n\nexport type EmojiPickerCategoriesProps = {\n onSelect: (category: Category) => void;\n searchString: string;\n selectedCategory: Category;\n};\n\nconst EmojiPickerCategories: FC<EmojiPickerCategoriesProps> = ({\n onSelect,\n searchString,\n selectedCategory,\n}) => {\n const [focusedIndex, setFocusedIndex] = useState(1);\n\n const categoryRef = useRef<HTMLDivElement>(null);\n\n const isSearchStringGiven = searchString.trim() !== '';\n\n const handleSelect = useCallback(\n (slug: Category) => {\n onSelect(slug);\n },\n [onSelect],\n );\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab' || (event.key === 'Tab' && event.shiftKey)) {\n event.preventDefault();\n\n const children = categoryRef.current?.children;\n if (children && children.length > 0) {\n let newIndex = focusedIndex !== null ? focusedIndex : 0;\n\n if (event.key === 'Tab' && event.shiftKey) {\n newIndex = (newIndex - 1) % children.length;\n } else if (event.key === 'Tab') {\n newIndex = (newIndex + 1) % children.length;\n }\n\n // remove focus from the old element\n if (focusedIndex !== null) {\n const prevElement = children[focusedIndex] as HTMLDivElement;\n prevElement.tabIndex = -1;\n }\n\n if (newIndex < 0) {\n newIndex = children.length - 1;\n } else if (newIndex > children.length - 1) {\n newIndex = 0;\n }\n\n setFocusedIndex(newIndex);\n\n // Set focus to the element\n const newElement = children[newIndex] as HTMLDivElement;\n newElement.tabIndex = 0;\n newElement.focus();\n\n if (!newElement) {\n return;\n }\n\n const { id } = newElement;\n\n handleSelect(id as Category);\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [focusedIndex, handleSelect]);\n\n const handleClick = useCallback(\n (slug: Category) => {\n handleSelect(slug);\n },\n [handleSelect],\n );\n\n const categories = useMemo(() => {\n const categorySlugs = unicodeEmoji.map(({ slug }) => slug);\n\n categorySlugs.unshift('history');\n\n return categorySlugs.map((slug) => {\n const isSelected = selectedCategory === slug && !isSearchStringGiven;\n\n return (\n <StyledMotionEmojiPickerCategory\n animate={{\n filter: `grayscale(${isSelected ? 0 : 0.75})`,\n opacity: isSelected ? 1 : 0.5,\n }}\n className=\"prevent-lose-focus\"\n initial={false}\n key={slug}\n id={slug}\n onClick={() => handleClick(slug as Category)}\n transition={{ duration: 0.2 }}\n >\n {CATEGORY_EMOJIS[slug as Category]}\n </StyledMotionEmojiPickerCategory>\n );\n });\n }, [handleClick, isSearchStringGiven, selectedCategory]);\n\n return (\n <StyledEmojiPickerCategories ref={categoryRef}>{categories}</StyledEmojiPickerCategories>\n );\n};\n\nEmojiPickerCategories.displayName = 'EmojiPickerCategories';\n\nexport default EmojiPickerCategories;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACpF,OAAOC,YAAY,MAAM,uCAAuC;AAChE,SAASC,eAAe,QAAQ,+BAA+B;AAE/D,SACIC,2BAA2B,EAC3BC,+BAA+B,QAC5B,gCAAgC;AAQvC,MAAMC,qBAAqD,GAAGC,IAAA,IAIxD;EAAA,IAJyD;IAC3DC,QAAQ;IACRC,YAAY;IACZC;EACJ,CAAC,GAAAH,IAAA;EACG,MAAM,CAACI,YAAY,EAAEC,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U,GAAG,CAAC,GAAG,IAAI,GAAG;UAC7CI,OAAO,EAAEJ,UAAU,GAAG,CAAC,GAAG;QAC9B,CAAE;QACFK,SAAS,EAAC,oBAAoB;QAC9BC,OAAO,EAAE,KAAM;QACf3B,GAAG,EAAEH,IAAK;QACVc,EAAE,EAAEd,IAAK;QACT+B,OAAO,EAAEA,CAAA,KAAMb,WAAW,CAAClB,IAAgB,CAAE;QAC7CgC,UAAU,EAAE;UAAEC,QAAQ,EAAE;QAAI;MAAE,GAE7B/C,eAAe,CAACc,IAAI,CACQ,CAAC;IAE1C,CAAC,CAAC;EACN,CAAC,EAAE,CAACkB,WAAW,EAAErB,mBAAmB,EAAEJ,gBAAgB,CAAC,CAAC;EAExD,oBACId,KAAA,CAAA8C,aAAA,CAACtC,2BAA2B;IAAC+C,GAAG,EAAEtC;EAAY,GAAEuB,UAAwC,CAAC;AAEjG,CAAC;AAED9B,qBAAqB,CAAC8C,WAAW,GAAG,uBAAuB;AAE3D,eAAe9C,qBAAqB","ignoreList":[]}
|
package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { motion } from 'framer-motion';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { getFontFamily } from '../../../utils/font';
|
|
4
|
+
export const StyledEmojiPickerCategories = styled.div`
|
|
5
|
+
align-items: center;
|
|
6
|
+
border-top: 1px solid rgba(160, 160, 160, 0.3);
|
|
7
|
+
display: flex;
|
|
8
|
+
flex: 0 0 auto;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
padding-top: 10px;
|
|
11
|
+
width: 100%;
|
|
12
|
+
`;
|
|
13
|
+
export const StyledMotionEmojiPickerCategory = styled(motion.div)`
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
font-family: ${getFontFamily};
|
|
16
|
+
font-size: 20px;
|
|
17
|
+
`;
|
|
18
|
+
//# sourceMappingURL=EmojiPickerCategories.styles.js.map
|
package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmojiPickerCategories.styles.js","names":["motion","styled","getFontFamily","StyledEmojiPickerCategories","div","StyledMotionEmojiPickerCategory"],"sources":["../../../../../src/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.ts"],"sourcesContent":["import type { FramerMotionBugFix } from '@chayns-components/core';\nimport { motion } from 'framer-motion';\nimport styled from 'styled-components';\nimport { getFontFamily } from '../../../utils/font';\n\nexport const StyledEmojiPickerCategories = styled.div`\n align-items: center;\n border-top: 1px solid rgba(160, 160, 160, 0.3);\n display: flex;\n flex: 0 0 auto;\n justify-content: space-between;\n padding-top: 10px;\n width: 100%;\n`;\n\nexport const StyledMotionEmojiPickerCategory = styled(motion.div)<FramerMotionBugFix>`\n cursor: pointer;\n font-family: ${getFontFamily};\n font-size: 20px;\n`;\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,eAAe;AACtC,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,aAAa,QAAQ,qBAAqB;AAEnD,OAAO,MAAMC,2BAA2B,GAAGF,MAAM,CAACG,GAAG;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,+BAA+B,GAAGJ,MAAM,CAACD,MAAM,CAACI,GAAG,CAAqB;AACrF;AACA,mBAAmBF,aAAa;AAChC;AACA,CAAC","ignoreList":[]}
|