@chayns-components/emoji-input 5.0.0-beta.98 → 5.0.0-beta.981

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.
Files changed (229) hide show
  1. package/README.md +4 -15
  2. package/lib/{api → cjs/api}/item-storage/get.js +4 -5
  3. package/lib/cjs/api/item-storage/get.js.map +1 -0
  4. package/lib/{api → cjs/api}/item-storage/put.js +5 -6
  5. package/lib/cjs/api/item-storage/put.js.map +1 -0
  6. package/lib/cjs/components/emoji-input/EmojiInput.js +510 -0
  7. package/lib/cjs/components/emoji-input/EmojiInput.js.map +1 -0
  8. package/lib/cjs/components/emoji-input/EmojiInput.styles.js +132 -0
  9. package/lib/cjs/components/emoji-input/EmojiInput.styles.js.map +1 -0
  10. package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.js +45 -0
  11. package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.js.map +1 -0
  12. package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.styles.js +65 -0
  13. package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.styles.js.map +1 -0
  14. package/lib/{components → cjs/components}/emoji-picker/EmojiPicker.js +9 -11
  15. package/lib/cjs/components/emoji-picker/EmojiPicker.js.map +1 -0
  16. package/lib/{components → cjs/components}/emoji-picker/EmojiPicker.styles.js +3 -5
  17. package/lib/cjs/components/emoji-picker/EmojiPicker.styles.js.map +1 -0
  18. package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +102 -0
  19. package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +1 -0
  20. package/lib/{components → cjs/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js +5 -6
  21. package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +1 -0
  22. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +240 -0
  23. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -0
  24. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +69 -0
  25. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +1 -0
  26. package/lib/{components → cjs/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.js +49 -21
  27. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +1 -0
  28. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +24 -0
  29. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +1 -0
  30. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +130 -0
  31. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +1 -0
  32. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +99 -0
  33. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +1 -0
  34. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js +52 -0
  35. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -0
  36. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js +15 -0
  37. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -0
  38. package/lib/{constants → cjs/constants}/alignment.js +6 -8
  39. package/lib/cjs/constants/alignment.js.map +1 -0
  40. package/lib/{constants → cjs/constants}/categories.js +1 -2
  41. package/lib/cjs/constants/categories.js.map +1 -0
  42. package/lib/{constants → cjs/constants}/emoji.js +4 -8
  43. package/lib/cjs/constants/emoji.js.map +1 -0
  44. package/lib/cjs/constants/externalServerUrl.js +8 -0
  45. package/lib/cjs/constants/externalServerUrl.js.map +1 -0
  46. package/lib/cjs/constants/regex.js +15 -0
  47. package/lib/cjs/constants/regex.js.map +1 -0
  48. package/lib/{hooks → cjs/hooks}/emojiHistory.js +13 -15
  49. package/lib/cjs/hooks/emojiHistory.js.map +1 -0
  50. package/lib/{index.js → cjs/index.js} +1 -1
  51. package/lib/cjs/index.js.map +1 -0
  52. package/lib/cjs/types/api.js +2 -0
  53. package/lib/cjs/types/api.js.map +1 -0
  54. package/lib/cjs/types/category.js +2 -0
  55. package/lib/cjs/types/category.js.map +1 -0
  56. package/lib/{utils → cjs/utils}/emoji.js +14 -6
  57. package/lib/cjs/utils/emoji.js.map +1 -0
  58. package/lib/{utils → cjs/utils}/environment.js +6 -4
  59. package/lib/cjs/utils/environment.js.map +1 -0
  60. package/lib/cjs/utils/font.js +17 -0
  61. package/lib/cjs/utils/font.js.map +1 -0
  62. package/lib/cjs/utils/insert.js +110 -0
  63. package/lib/cjs/utils/insert.js.map +1 -0
  64. package/lib/cjs/utils/number.js +17 -0
  65. package/lib/cjs/utils/number.js.map +1 -0
  66. package/lib/cjs/utils/selection.js +255 -0
  67. package/lib/cjs/utils/selection.js.map +1 -0
  68. package/lib/cjs/utils/text.js +57 -0
  69. package/lib/cjs/utils/text.js.map +1 -0
  70. package/lib/esm/api/item-storage/get.js +30 -0
  71. package/lib/esm/api/item-storage/get.js.map +1 -0
  72. package/lib/esm/api/item-storage/put.js +35 -0
  73. package/lib/esm/api/item-storage/put.js.map +1 -0
  74. package/lib/esm/components/emoji-input/EmojiInput.js +497 -0
  75. package/lib/esm/components/emoji-input/EmojiInput.js.map +1 -0
  76. package/lib/esm/components/emoji-input/EmojiInput.styles.js +151 -0
  77. package/lib/esm/components/emoji-input/EmojiInput.styles.js.map +1 -0
  78. package/lib/esm/components/emoji-input/prefix-element/PrefixElement.js +38 -0
  79. package/lib/esm/components/emoji-input/prefix-element/PrefixElement.js.map +1 -0
  80. package/lib/esm/components/emoji-input/prefix-element/PrefixElement.styles.js +69 -0
  81. package/lib/esm/components/emoji-input/prefix-element/PrefixElement.styles.js.map +1 -0
  82. package/lib/esm/components/emoji-picker/EmojiPicker.js +40 -0
  83. package/lib/esm/components/emoji-picker/EmojiPicker.js.map +1 -0
  84. package/lib/esm/components/emoji-picker/EmojiPicker.styles.js +16 -0
  85. package/lib/esm/components/emoji-picker/EmojiPicker.styles.js.map +1 -0
  86. package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +96 -0
  87. package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +1 -0
  88. package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js +18 -0
  89. package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +1 -0
  90. package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +240 -0
  91. package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -0
  92. package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +76 -0
  93. package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +1 -0
  94. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js +136 -0
  95. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +1 -0
  96. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +20 -0
  97. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +1 -0
  98. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +121 -0
  99. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +1 -0
  100. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +98 -0
  101. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +1 -0
  102. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.js +43 -0
  103. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -0
  104. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.styles.js +8 -0
  105. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -0
  106. package/lib/esm/constants/alignment.js +13 -0
  107. package/lib/esm/constants/alignment.js.map +1 -0
  108. package/lib/esm/constants/categories.js +13 -0
  109. package/lib/esm/constants/categories.js.map +1 -0
  110. package/lib/esm/constants/emoji-de-DE.json +3827 -0
  111. package/lib/esm/constants/emoji.js +3798 -0
  112. package/lib/esm/constants/emoji.js.map +1 -0
  113. package/lib/esm/constants/externalServerUrl.js +2 -0
  114. package/lib/esm/constants/externalServerUrl.js.map +1 -0
  115. package/lib/esm/constants/regex.js +9 -0
  116. package/lib/esm/constants/regex.js.map +1 -0
  117. package/lib/esm/hooks/emojiHistory.js +83 -0
  118. package/lib/esm/hooks/emojiHistory.js.map +1 -0
  119. package/lib/{index.d.ts → esm/index.js} +1 -0
  120. package/lib/esm/index.js.map +1 -0
  121. package/lib/esm/types/api.js +2 -0
  122. package/lib/esm/types/api.js.map +1 -0
  123. package/lib/esm/types/category.js +2 -0
  124. package/lib/esm/types/category.js.map +1 -0
  125. package/lib/esm/utils/emoji.js +92 -0
  126. package/lib/esm/utils/emoji.js.map +1 -0
  127. package/lib/esm/utils/environment.js +24 -0
  128. package/lib/esm/utils/environment.js.map +1 -0
  129. package/lib/esm/utils/font.js +10 -0
  130. package/lib/esm/utils/font.js.map +1 -0
  131. package/lib/esm/utils/insert.js +104 -0
  132. package/lib/esm/utils/insert.js.map +1 -0
  133. package/lib/esm/utils/number.js +10 -0
  134. package/lib/esm/utils/number.js.map +1 -0
  135. package/lib/esm/utils/selection.js +237 -0
  136. package/lib/esm/utils/selection.js.map +1 -0
  137. package/lib/esm/utils/text.js +48 -0
  138. package/lib/esm/utils/text.js.map +1 -0
  139. package/lib/types/components/emoji-input/EmojiInput.d.ts +94 -0
  140. package/lib/types/components/emoji-input/EmojiInput.styles.d.ts +549 -0
  141. package/lib/types/components/emoji-input/prefix-element/PrefixElement.d.ts +8 -0
  142. package/lib/types/components/emoji-input/prefix-element/PrefixElement.styles.d.ts +12 -0
  143. package/lib/types/components/emoji-picker/EmojiPicker.styles.d.ts +5 -0
  144. package/lib/types/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.d.ts +267 -0
  145. package/lib/types/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.d.ts +10 -0
  146. package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.d.ts +5 -0
  147. package/lib/types/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.d.ts +6 -0
  148. package/lib/types/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.d.ts +283 -0
  149. package/lib/{components → types/components}/emoji-picker-popup/EmojiPickerPopup.d.ts +0 -13
  150. package/lib/types/components/emoji-picker-popup/EmojiPickerPopup.styles.d.ts +1 -0
  151. package/lib/types/constants/regex.d.ts +8 -0
  152. package/lib/types/index.d.ts +6 -0
  153. package/lib/{utils → types/utils}/emoji.d.ts +2 -0
  154. package/lib/{utils → types/utils}/environment.d.ts +1 -0
  155. package/lib/types/utils/font.d.ts +1 -0
  156. package/lib/{utils → types/utils}/insert.d.ts +8 -1
  157. package/lib/types/utils/number.d.ts +1 -0
  158. package/lib/types/utils/selection.d.ts +23 -0
  159. package/lib/types/utils/text.d.ts +3 -0
  160. package/package.json +48 -30
  161. package/lib/api/item-storage/get.js.map +0 -1
  162. package/lib/api/item-storage/put.js.map +0 -1
  163. package/lib/components/emoji-input/EmojiInput.d.ts +0 -49
  164. package/lib/components/emoji-input/EmojiInput.js +0 -161
  165. package/lib/components/emoji-input/EmojiInput.js.map +0 -1
  166. package/lib/components/emoji-input/EmojiInput.styles.d.ts +0 -16
  167. package/lib/components/emoji-input/EmojiInput.styles.js +0 -158
  168. package/lib/components/emoji-input/EmojiInput.styles.js.map +0 -1
  169. package/lib/components/emoji-picker/EmojiPicker.js.map +0 -1
  170. package/lib/components/emoji-picker/EmojiPicker.styles.d.ts +0 -5
  171. package/lib/components/emoji-picker/EmojiPicker.styles.js.map +0 -1
  172. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +0 -51
  173. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +0 -1
  174. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.d.ts +0 -2
  175. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +0 -1
  176. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +0 -131
  177. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +0 -1
  178. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.d.ts +0 -7
  179. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +0 -99
  180. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +0 -1
  181. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +0 -1
  182. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.d.ts +0 -1
  183. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +0 -20
  184. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +0 -1
  185. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +0 -74
  186. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +0 -1
  187. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.d.ts +0 -11
  188. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +0 -104
  189. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +0 -1
  190. package/lib/components/emoji-picker-popup/EmojiPickerPopup.js +0 -150
  191. package/lib/components/emoji-picker-popup/EmojiPickerPopup.js.map +0 -1
  192. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.d.ts +0 -7
  193. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js +0 -97
  194. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +0 -1
  195. package/lib/constants/alignment.js.map +0 -1
  196. package/lib/constants/categories.js.map +0 -1
  197. package/lib/constants/emoji.js.map +0 -1
  198. package/lib/constants/externalServerUrl.js +0 -9
  199. package/lib/constants/externalServerUrl.js.map +0 -1
  200. package/lib/hooks/emojiHistory.js.map +0 -1
  201. package/lib/index.js.map +0 -1
  202. package/lib/types/api.js +0 -6
  203. package/lib/types/api.js.map +0 -1
  204. package/lib/types/category.js +0 -6
  205. package/lib/types/category.js.map +0 -1
  206. package/lib/utils/emoji.js.map +0 -1
  207. package/lib/utils/environment.js.map +0 -1
  208. package/lib/utils/font.d.ts +0 -1
  209. package/lib/utils/font.js +0 -15
  210. package/lib/utils/font.js.map +0 -1
  211. package/lib/utils/insert.js +0 -50
  212. package/lib/utils/insert.js.map +0 -1
  213. package/lib/utils/selection.d.ts +0 -2
  214. package/lib/utils/selection.js +0 -43
  215. package/lib/utils/selection.js.map +0 -1
  216. /package/lib/{constants → cjs/constants}/emoji-de-DE.json +0 -0
  217. /package/lib/{api → types/api}/item-storage/get.d.ts +0 -0
  218. /package/lib/{api → types/api}/item-storage/put.d.ts +0 -0
  219. /package/lib/{components → types/components}/emoji-picker/EmojiPicker.d.ts +0 -0
  220. /package/lib/{components → types/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.d.ts +0 -0
  221. /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.d.ts +0 -0
  222. /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.d.ts +0 -0
  223. /package/lib/{constants → types/constants}/alignment.d.ts +0 -0
  224. /package/lib/{constants → types/constants}/categories.d.ts +0 -0
  225. /package/lib/{constants → types/constants}/emoji.d.ts +0 -0
  226. /package/lib/{constants → types/constants}/externalServerUrl.d.ts +0 -0
  227. /package/lib/{hooks → types/hooks}/emojiHistory.d.ts +0 -0
  228. /package/lib/types/{api.d.ts → types/api.d.ts} +0 -0
  229. /package/lib/types/{category.d.ts → types/category.d.ts} +0 -0
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.StyledMotionEmojiPickerCategory = exports.StyledEmojiPickerCategories = void 0;
7
7
  var _framerMotion = require("framer-motion");
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- const StyledEmojiPickerCategories = _styledComponents.default.div`
9
+ var _font = require("../../../utils/font");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const StyledEmojiPickerCategories = exports.StyledEmojiPickerCategories = _styledComponents.default.div`
11
12
  align-items: center;
12
13
  border-top: 1px solid rgba(160, 160, 160, 0.3);
13
14
  display: flex;
@@ -16,11 +17,9 @@ const StyledEmojiPickerCategories = _styledComponents.default.div`
16
17
  padding-top: 10px;
17
18
  width: 100%;
18
19
  `;
19
- exports.StyledEmojiPickerCategories = StyledEmojiPickerCategories;
20
- const StyledMotionEmojiPickerCategory = (0, _styledComponents.default)(_framerMotion.motion.div)`
20
+ const StyledMotionEmojiPickerCategory = exports.StyledMotionEmojiPickerCategory = (0, _styledComponents.default)(_framerMotion.motion.div)`
21
21
  cursor: pointer;
22
- font-family: 'Noto Color Emoji', 'Roboto Regular', 'Tahoma', serif;
22
+ font-family: ${_font.getFontFamily};
23
23
  font-size: 20px;
24
24
  `;
25
- exports.StyledMotionEmojiPickerCategory = StyledMotionEmojiPickerCategory;
26
25
  //# sourceMappingURL=EmojiPickerCategories.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiPickerCategories.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","_font","e","__esModule","default","StyledEmojiPickerCategories","exports","styled","div","StyledMotionEmojiPickerCategory","motion","getFontFamily"],"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,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAAoD,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7C,MAAMG,2BAA2B,GAAAC,OAAA,CAAAD,2BAAA,GAAGE,yBAAM,CAACC,GAAG;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAEM,MAAMC,+BAA+B,GAAAH,OAAA,CAAAG,+BAAA,GAAG,IAAAF,yBAAM,EAACG,oBAAM,CAACF,GAAG,CAAqB;AACrF;AACA,mBAAmBG,mBAAa;AAChC;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,240 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _chaynsApi = require("chayns-api");
8
+ var _emojilib = _interopRequireDefault(require("emojilib"));
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _dataByEmoji = _interopRequireDefault(require("unicode-emoji-json/data-by-emoji.json"));
11
+ var _dataByGroup = _interopRequireDefault(require("unicode-emoji-json/data-by-group.json"));
12
+ var _emojiDeDE = _interopRequireDefault(require("../../../constants/emoji-de-DE.json"));
13
+ var _emojiHistory = require("../../../hooks/emojiHistory");
14
+ var _Emoji = _interopRequireDefault(require("./emoji/Emoji"));
15
+ var _EmojiPickerEmojis = require("./EmojiPickerEmojis.styles");
16
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ const EmojiPickerEmojis = ({
20
+ accessToken,
21
+ onSelect,
22
+ personId,
23
+ searchString,
24
+ selectedCategory
25
+ }) => {
26
+ const [shouldPreventScroll, setShouldPreventScroll] = (0, _react.useState)(false);
27
+ const [shouldShowSkinTonePopup, setShouldShowSkinTonePopup] = (0, _react.useState)(false);
28
+ const [focusedIndex, setFocusedIndex] = (0, _react.useState)(0);
29
+ const emojiRef = (0, _react.useRef)(null);
30
+ const shouldPreventEmojiControlsRef = (0, _react.useRef)(false);
31
+ const {
32
+ browser
33
+ } = (0, _chaynsApi.getDevice)();
34
+ const {
35
+ addOrUpdateEmojiInHistory,
36
+ historyEmojis
37
+ } = (0, _emojiHistory.useEmojiHistory)({
38
+ accessToken,
39
+ personId,
40
+ selectedCategory
41
+ });
42
+ const handlePopupVisibilityChange = (0, _react.useCallback)(isVisible => {
43
+ setShouldShowSkinTonePopup(isVisible);
44
+ shouldPreventEmojiControlsRef.current = isVisible;
45
+ setShouldPreventScroll(isVisible);
46
+ }, []);
47
+ const handleSelect = (0, _react.useCallback)(({
48
+ emoji,
49
+ name,
50
+ skin_tone_support,
51
+ index
52
+ }) => {
53
+ onSelect(emoji);
54
+ if (index) {
55
+ setFocusedIndex(index);
56
+ }
57
+ void addOrUpdateEmojiInHistory({
58
+ emoji,
59
+ name,
60
+ skin_tone_support
61
+ });
62
+ }, [addOrUpdateEmojiInHistory, onSelect]);
63
+ (0, _react.useEffect)(() => {
64
+ if (selectedCategory) {
65
+ setFocusedIndex(0);
66
+ const container = emojiRef.current;
67
+ if (!container) {
68
+ return;
69
+ }
70
+ container.scrollTop = 0;
71
+ }
72
+ }, [selectedCategory]);
73
+ (0, _react.useEffect)(() => {
74
+ const handleKeyDown = event => {
75
+ if (!shouldPreventEmojiControlsRef.current && (event.key === 'ArrowUp' || event.key === 'ArrowDown' || event.key === 'ArrowLeft' || event.key === 'ArrowRight')) {
76
+ var _emojiRef$current;
77
+ event.preventDefault();
78
+ const children = (_emojiRef$current = emojiRef.current) === null || _emojiRef$current === void 0 ? void 0 : _emojiRef$current.children;
79
+ if (children && children.length > 0) {
80
+ const container = emojiRef.current;
81
+ let newIndex = focusedIndex !== null ? focusedIndex : 0;
82
+ if (event.ctrlKey) {
83
+ return;
84
+ }
85
+ if (event.key === 'ArrowUp') {
86
+ newIndex = (newIndex - 6) % children.length;
87
+ } else if (event.key === 'ArrowDown') {
88
+ newIndex = (newIndex + 6) % children.length;
89
+ } else if (event.key === 'ArrowLeft') {
90
+ newIndex = (newIndex - 1) % children.length;
91
+ } else if (event.key === 'ArrowRight') {
92
+ newIndex = (newIndex + 1) % children.length;
93
+ }
94
+
95
+ // remove focus from the old element
96
+ if (focusedIndex !== null) {
97
+ const prevElement = children[focusedIndex];
98
+ prevElement.tabIndex = -1;
99
+ }
100
+ if (newIndex < 0) {
101
+ newIndex = children.length - 1;
102
+ } else if (newIndex > children.length - 1) {
103
+ newIndex = 0;
104
+ }
105
+ setFocusedIndex(newIndex);
106
+
107
+ // Set focus to the element
108
+ const newElement = children[newIndex];
109
+ newElement.tabIndex = 0;
110
+ const containerRect = container.getBoundingClientRect();
111
+ const elementRect = newElement.getBoundingClientRect();
112
+ if (elementRect.bottom > containerRect.bottom) {
113
+ container.scrollTop += elementRect.bottom - containerRect.bottom;
114
+ } else if (elementRect.top < containerRect.top) {
115
+ container.scrollTop -= containerRect.top - elementRect.top;
116
+ }
117
+ }
118
+ } else if (event.key === 'Enter' && !shouldPreventEmojiControlsRef.current && focusedIndex !== null) {
119
+ var _emojiRef$current2;
120
+ if (event.ctrlKey) {
121
+ setShouldShowSkinTonePopup(true);
122
+ return;
123
+ }
124
+ const {
125
+ dataset
126
+ } = (_emojiRef$current2 = emojiRef.current) === null || _emojiRef$current2 === void 0 ? void 0 : _emojiRef$current2.children[focusedIndex];
127
+ const {
128
+ emoji,
129
+ name,
130
+ skinToneSupport
131
+ } = dataset;
132
+ if (!emoji || !name || !skinToneSupport) {
133
+ return;
134
+ }
135
+ handleSelect({
136
+ emoji,
137
+ name,
138
+ skin_tone_support: skinToneSupport === 'true'
139
+ });
140
+ }
141
+ };
142
+ document.addEventListener('keydown', handleKeyDown);
143
+ return () => {
144
+ document.removeEventListener('keydown', handleKeyDown);
145
+ };
146
+ }, [focusedIndex, handleSelect]);
147
+ const handleRightClick = (0, _react.useCallback)(index => {
148
+ setFocusedIndex(index);
149
+ }, []);
150
+ const emojis = (0, _react.useMemo)(() => {
151
+ var _emojiCategories$find;
152
+ if (searchString.trim() !== '') {
153
+ const lowerSearchString = searchString.toLowerCase();
154
+ const searchResults = [];
155
+ Object.entries(_dataByEmoji.default).forEach(([emoji, {
156
+ name,
157
+ skin_tone_support
158
+ }], index) => {
159
+ const keywords = _emojilib.default[emoji];
160
+ const germanKeywords = _emojiDeDE.default[emoji];
161
+ if (name.includes(lowerSearchString) || keywords !== null && keywords !== void 0 && keywords.some(keyword => keyword.includes(lowerSearchString)) || germanKeywords !== null && germanKeywords !== void 0 && germanKeywords.some(keyword => keyword.includes(lowerSearchString))) {
162
+ searchResults.push(/*#__PURE__*/_react.default.createElement(_Emoji.default, {
163
+ shouldShowSkinTonePopup: index === focusedIndex && skin_tone_support && shouldShowSkinTonePopup,
164
+ isSelected: index === focusedIndex,
165
+ emoji: emoji,
166
+ index: index,
167
+ onRightClick: handleRightClick,
168
+ isSkinToneSupported: skin_tone_support,
169
+ key: name,
170
+ name: name,
171
+ onPopupVisibilityChange: handlePopupVisibilityChange,
172
+ onSelect: e => handleSelect({
173
+ emoji: e,
174
+ name,
175
+ skin_tone_support,
176
+ index
177
+ })
178
+ }));
179
+ }
180
+ });
181
+ return searchResults;
182
+ }
183
+ if (selectedCategory === 'history') {
184
+ return historyEmojis.map(({
185
+ emoji,
186
+ name,
187
+ skin_tone_support
188
+ }, index) => /*#__PURE__*/_react.default.createElement(_Emoji.default, {
189
+ isSelected: index === focusedIndex,
190
+ shouldShowSkinTonePopup: index === focusedIndex && skin_tone_support && shouldShowSkinTonePopup,
191
+ emoji: emoji,
192
+ name: name,
193
+ key: name,
194
+ index: index,
195
+ onRightClick: handleRightClick,
196
+ onPopupVisibilityChange: handlePopupVisibilityChange,
197
+ onSelect: e => handleSelect({
198
+ emoji: e,
199
+ name,
200
+ skin_tone_support,
201
+ index
202
+ }),
203
+ isSkinToneSupported: false
204
+ }));
205
+ }
206
+ return (_emojiCategories$find = _dataByGroup.default.find(({
207
+ slug
208
+ }) => slug === selectedCategory)) === null || _emojiCategories$find === void 0 ? void 0 : _emojiCategories$find.emojis.map(({
209
+ emoji,
210
+ name,
211
+ skin_tone_support
212
+ }, index) => /*#__PURE__*/_react.default.createElement(_Emoji.default, {
213
+ isSelected: index === focusedIndex,
214
+ shouldShowSkinTonePopup: index === focusedIndex && skin_tone_support && shouldShowSkinTonePopup,
215
+ emoji: emoji,
216
+ name: name,
217
+ index: index,
218
+ onRightClick: handleRightClick,
219
+ isSkinToneSupported: skin_tone_support,
220
+ key: name,
221
+ onPopupVisibilityChange: handlePopupVisibilityChange,
222
+ onSelect: e => handleSelect({
223
+ emoji: e,
224
+ name,
225
+ skin_tone_support,
226
+ index
227
+ })
228
+ }));
229
+ }, [searchString, selectedCategory, focusedIndex, shouldShowSkinTonePopup, handleRightClick, handlePopupVisibilityChange, handleSelect, historyEmojis]);
230
+ const shouldShowNoContentInfo = !emojis || emojis.length === 0;
231
+ return /*#__PURE__*/_react.default.createElement(_EmojiPickerEmojis.StyledEmojiPickerEmojis, {
232
+ $browser: browser === null || browser === void 0 ? void 0 : browser.name,
233
+ $shouldPreventScroll: shouldPreventScroll,
234
+ $shouldShowNoContentInfo: shouldShowNoContentInfo,
235
+ ref: emojiRef
236
+ }, emojis, shouldShowNoContentInfo && /*#__PURE__*/_react.default.createElement(_EmojiPickerEmojis.StyledEmojiPickerEmojisNoContentInfo, null, "Hier werden die zuletzt verwendeten Emojis angezeigt, die \xFCber diese Auswahl gew\xE4hlt wurden."));
237
+ };
238
+ EmojiPickerEmojis.displayName = 'EmojiPickerEmojis';
239
+ var _default = exports.default = EmojiPickerEmojis;
240
+ //# sourceMappingURL=EmojiPickerEmojis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiPickerEmojis.js","names":["_chaynsApi","require","_emojilib","_interopRequireDefault","_react","_interopRequireWildcard","_dataByEmoji","_dataByGroup","_emojiDeDE","_emojiHistory","_Emoji","_EmojiPickerEmojis","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","EmojiPickerEmojis","accessToken","onSelect","personId","searchString","selectedCategory","shouldPreventScroll","setShouldPreventScroll","useState","shouldShowSkinTonePopup","setShouldShowSkinTonePopup","focusedIndex","setFocusedIndex","emojiRef","useRef","shouldPreventEmojiControlsRef","browser","getDevice","addOrUpdateEmojiInHistory","historyEmojis","useEmojiHistory","handlePopupVisibilityChange","useCallback","isVisible","current","handleSelect","emoji","name","skin_tone_support","index","useEffect","container","scrollTop","handleKeyDown","event","key","_emojiRef$current","preventDefault","children","length","newIndex","ctrlKey","prevElement","tabIndex","newElement","containerRect","getBoundingClientRect","elementRect","bottom","top","_emojiRef$current2","dataset","skinToneSupport","document","addEventListener","removeEventListener","handleRightClick","emojis","useMemo","_emojiCategories$find","trim","lowerSearchString","toLowerCase","searchResults","entries","emojiList","forEach","keywords","emojiLib","germanKeywords","germanEmojiLib","includes","some","keyword","push","createElement","isSelected","onRightClick","isSkinToneSupported","onPopupVisibilityChange","map","emojiCategories","find","slug","shouldShowNoContentInfo","StyledEmojiPickerEmojis","$browser","$shouldPreventScroll","$shouldShowNoContentInfo","ref","StyledEmojiPickerEmojisNoContentInfo","displayName","_default","exports"],"sources":["../../../../../src/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.tsx"],"sourcesContent":["import { getDevice } from 'chayns-api';\nimport emojiLib from 'emojilib';\nimport React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport emojiList from 'unicode-emoji-json/data-by-emoji.json';\nimport emojiCategories from 'unicode-emoji-json/data-by-group.json';\nimport germanEmojiLib from '../../../constants/emoji-de-DE.json';\nimport { useEmojiHistory } from '../../../hooks/emojiHistory';\nimport type { Category } from '../../../types/category';\nimport Emoji from './emoji/Emoji';\nimport {\n StyledEmojiPickerEmojis,\n StyledEmojiPickerEmojisNoContentInfo,\n} from './EmojiPickerEmojis.styles';\n\nexport type EmojiPickerEmojisProps = {\n accessToken?: string;\n onSelect: (emoji: string) => void;\n personId?: string;\n searchString: string;\n selectedCategory: Category;\n};\n\nconst EmojiPickerEmojis: FC<EmojiPickerEmojisProps> = ({\n accessToken,\n onSelect,\n personId,\n searchString,\n selectedCategory,\n}) => {\n const [shouldPreventScroll, setShouldPreventScroll] = useState(false);\n const [shouldShowSkinTonePopup, setShouldShowSkinTonePopup] = useState(false);\n const [focusedIndex, setFocusedIndex] = useState<number>(0);\n\n const emojiRef = useRef<HTMLDivElement>(null);\n const shouldPreventEmojiControlsRef = useRef(false);\n\n const { browser } = getDevice();\n\n const { addOrUpdateEmojiInHistory, historyEmojis } = useEmojiHistory({\n accessToken,\n personId,\n selectedCategory,\n });\n\n const handlePopupVisibilityChange = useCallback((isVisible: boolean) => {\n setShouldShowSkinTonePopup(isVisible);\n shouldPreventEmojiControlsRef.current = isVisible;\n setShouldPreventScroll(isVisible);\n }, []);\n\n const handleSelect = useCallback(\n ({\n emoji,\n name,\n skin_tone_support,\n index,\n }: {\n emoji: string;\n name: string;\n skin_tone_support: boolean;\n index?: number;\n }) => {\n onSelect(emoji);\n\n if (index) {\n setFocusedIndex(index);\n }\n\n void addOrUpdateEmojiInHistory({ emoji, name, skin_tone_support });\n },\n [addOrUpdateEmojiInHistory, onSelect],\n );\n\n useEffect(() => {\n if (selectedCategory) {\n setFocusedIndex(0);\n\n const container = emojiRef.current;\n\n if (!container) {\n return;\n }\n\n container.scrollTop = 0;\n }\n }, [selectedCategory]);\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n !shouldPreventEmojiControlsRef.current &&\n (event.key === 'ArrowUp' ||\n event.key === 'ArrowDown' ||\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight')\n ) {\n event.preventDefault();\n const children = emojiRef.current?.children;\n if (children && children.length > 0) {\n const container = emojiRef.current;\n let newIndex = focusedIndex !== null ? focusedIndex : 0;\n\n if (event.ctrlKey) {\n return;\n }\n\n if (event.key === 'ArrowUp') {\n newIndex = (newIndex - 6) % children.length;\n } else if (event.key === 'ArrowDown') {\n newIndex = (newIndex + 6) % children.length;\n } else if (event.key === 'ArrowLeft') {\n newIndex = (newIndex - 1) % children.length;\n } else if (event.key === 'ArrowRight') {\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\n const containerRect = container.getBoundingClientRect();\n const elementRect = newElement.getBoundingClientRect();\n\n if (elementRect.bottom > containerRect.bottom) {\n container.scrollTop += elementRect.bottom - containerRect.bottom;\n } else if (elementRect.top < containerRect.top) {\n container.scrollTop -= containerRect.top - elementRect.top;\n }\n }\n } else if (\n event.key === 'Enter' &&\n !shouldPreventEmojiControlsRef.current &&\n focusedIndex !== null\n ) {\n if (event.ctrlKey) {\n setShouldShowSkinTonePopup(true);\n\n return;\n }\n\n const { dataset } = emojiRef.current?.children[focusedIndex] as HTMLDivElement;\n\n const { emoji, name, skinToneSupport } = dataset;\n\n if (!emoji || !name || !skinToneSupport) {\n return;\n }\n\n handleSelect({ emoji, name, skin_tone_support: skinToneSupport === 'true' });\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [focusedIndex, handleSelect]);\n\n const handleRightClick = useCallback((index: number) => {\n setFocusedIndex(index);\n }, []);\n\n const emojis = useMemo(() => {\n if (searchString.trim() !== '') {\n const lowerSearchString = searchString.toLowerCase();\n\n const searchResults: JSX.Element[] = [];\n\n Object.entries(emojiList).forEach(([emoji, { name, skin_tone_support }], index) => {\n const keywords = (emojiLib as { [key: string]: string[] })[emoji] as\n | string[]\n | undefined;\n\n const germanKeywords = (germanEmojiLib as { [key: string]: string[] })[emoji] as\n | string[]\n | undefined;\n\n if (\n name.includes(lowerSearchString) ||\n keywords?.some((keyword) => keyword.includes(lowerSearchString)) ||\n germanKeywords?.some((keyword) => keyword.includes(lowerSearchString))\n ) {\n searchResults.push(\n <Emoji\n shouldShowSkinTonePopup={\n index === focusedIndex &&\n skin_tone_support &&\n shouldShowSkinTonePopup\n }\n isSelected={index === focusedIndex}\n emoji={emoji}\n index={index}\n onRightClick={handleRightClick}\n isSkinToneSupported={skin_tone_support}\n key={name}\n name={name}\n onPopupVisibilityChange={handlePopupVisibilityChange}\n onSelect={(e) =>\n handleSelect({ emoji: e, name, skin_tone_support, index })\n }\n />,\n );\n }\n });\n\n return searchResults;\n }\n\n if (selectedCategory === 'history') {\n return historyEmojis.map(({ emoji, name, skin_tone_support }, index) => (\n <Emoji\n isSelected={index === focusedIndex}\n shouldShowSkinTonePopup={\n index === focusedIndex && skin_tone_support && shouldShowSkinTonePopup\n }\n emoji={emoji}\n name={name}\n key={name}\n index={index}\n onRightClick={handleRightClick}\n onPopupVisibilityChange={handlePopupVisibilityChange}\n onSelect={(e) => handleSelect({ emoji: e, name, skin_tone_support, index })}\n isSkinToneSupported={false}\n />\n ));\n }\n\n return emojiCategories\n .find(({ slug }) => slug === selectedCategory)\n ?.emojis.map(({ emoji, name, skin_tone_support }, index) => (\n <Emoji\n isSelected={index === focusedIndex}\n shouldShowSkinTonePopup={\n index === focusedIndex && skin_tone_support && shouldShowSkinTonePopup\n }\n emoji={emoji}\n name={name}\n index={index}\n onRightClick={handleRightClick}\n isSkinToneSupported={skin_tone_support}\n key={name}\n onPopupVisibilityChange={handlePopupVisibilityChange}\n onSelect={(e) => handleSelect({ emoji: e, name, skin_tone_support, index })}\n />\n ));\n }, [\n searchString,\n selectedCategory,\n focusedIndex,\n shouldShowSkinTonePopup,\n handleRightClick,\n handlePopupVisibilityChange,\n handleSelect,\n historyEmojis,\n ]);\n\n const shouldShowNoContentInfo = !emojis || emojis.length === 0;\n\n return (\n <StyledEmojiPickerEmojis\n $browser={browser?.name}\n $shouldPreventScroll={shouldPreventScroll}\n $shouldShowNoContentInfo={shouldShowNoContentInfo}\n ref={emojiRef}\n >\n {emojis}\n {shouldShowNoContentInfo && (\n <StyledEmojiPickerEmojisNoContentInfo>\n Hier werden die zuletzt verwendeten Emojis angezeigt, die über diese Auswahl\n gewählt wurden.\n </StyledEmojiPickerEmojisNoContentInfo>\n )}\n </StyledEmojiPickerEmojis>\n );\n};\n\nEmojiPickerEmojis.displayName = 'EmojiPickerEmojis';\n\nexport default EmojiPickerEmojis;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,YAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,UAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,aAAA,GAAAR,OAAA;AAEA,IAAAS,MAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,kBAAA,GAAAV,OAAA;AAGoC,SAAAW,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CA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AS,GAEb4C,MAAM,EACN2B,uBAAuB,iBACpBhH,MAAA,CAAAc,OAAA,CAAAyF,aAAA,CAAChG,kBAAA,CAAA+G,oCAAoC,QAAC,oGAGA,CAErB,CAAC;AAElC,CAAC;AAED1F,iBAAiB,CAAC2F,WAAW,GAAG,mBAAmB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3G,OAAA,GAErCc,iBAAiB","ignoreList":[]}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledEmojiPickerEmojisNoContentInfo = exports.StyledEmojiPickerEmojis = void 0;
7
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ const StyledEmojiPickerEmojis = exports.StyledEmojiPickerEmojis = _styledComponents.default.div`
11
+ display: ${({
12
+ $shouldShowNoContentInfo
13
+ }) => $shouldShowNoContentInfo ? 'flex' : 'grid'};
14
+ flex: 1 1 auto;
15
+ grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
16
+ grid-template-rows: min-content;
17
+ overflow-y: ${({
18
+ $shouldPreventScroll
19
+ }) => $shouldPreventScroll ? 'hidden' : 'scroll'};
20
+ padding: 5px 0 5px 5px;
21
+ position: relative;
22
+ width: 100%;
23
+
24
+ ${({
25
+ $shouldShowNoContentInfo
26
+ }) => $shouldShowNoContentInfo && (0, _styledComponents.css)`
27
+ align-items: center;
28
+ `}
29
+
30
+ ${({
31
+ $shouldPreventScroll
32
+ }) => $shouldPreventScroll && (0, _styledComponents.css)`
33
+ padding-right: 5px;
34
+ `}
35
+
36
+ // Styles for custom scrollbar
37
+ ${({
38
+ $browser,
39
+ theme
40
+ }) => $browser === 'firefox' ? (0, _styledComponents.css)`
41
+ scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;
42
+ scrollbar-width: thin;
43
+ ` : (0, _styledComponents.css)`
44
+ &::-webkit-scrollbar {
45
+ width: 5px;
46
+ }
47
+
48
+ &::-webkit-scrollbar-track {
49
+ background-color: transparent;
50
+ }
51
+
52
+ &::-webkit-scrollbar-button {
53
+ background-color: transparent;
54
+ height: 5px;
55
+ }
56
+
57
+ &::-webkit-scrollbar-thumb {
58
+ background-color: rgba(${theme['text-rgb']}, 0.15);
59
+ border-radius: 20px;
60
+ }
61
+ `}
62
+ `;
63
+ const StyledEmojiPickerEmojisNoContentInfo = exports.StyledEmojiPickerEmojisNoContentInfo = _styledComponents.default.div`
64
+ font-size: 85%;
65
+ opacity: 0.85;
66
+ padding: 0 12.5%;
67
+ text-align: center;
68
+ `;
69
+ //# sourceMappingURL=EmojiPickerEmojis.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiPickerEmojis.styles.js","names":["_styledComponents","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledEmojiPickerEmojis","exports","styled","div","$shouldShowNoContentInfo","$shouldPreventScroll","css","$browser","theme","StyledEmojiPickerEmojisNoContentInfo"],"sources":["../../../../../src/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport type { Browser } from 'detect-browser';\nimport styled, { css } from 'styled-components';\n\ntype StyledEmojiPickerEmojisProps = WithTheme<{\n $shouldPreventScroll: boolean;\n $shouldShowNoContentInfo: boolean;\n $browser: Browser | 'bot' | null | undefined;\n}>;\n\nexport const StyledEmojiPickerEmojis = styled.div<StyledEmojiPickerEmojisProps>`\n display: ${({ $shouldShowNoContentInfo }) => ($shouldShowNoContentInfo ? 'flex' : 'grid')};\n flex: 1 1 auto;\n grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));\n grid-template-rows: min-content;\n overflow-y: ${({ $shouldPreventScroll }) => ($shouldPreventScroll ? 'hidden' : 'scroll')};\n padding: 5px 0 5px 5px;\n position: relative;\n width: 100%;\n\n ${({ $shouldShowNoContentInfo }) =>\n $shouldShowNoContentInfo &&\n css`\n align-items: center;\n `}\n\n ${({ $shouldPreventScroll }) =>\n $shouldPreventScroll &&\n css`\n padding-right: 5px;\n `}\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledEmojiPickerEmojisProps) =>\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 StyledEmojiPickerEmojisNoContentInfo = styled.div`\n font-size: 85%;\n opacity: 0.85;\n padding: 0 12.5%;\n text-align: center;\n`;\n"],"mappings":";;;;;;AAEA,IAAAA,iBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAgD,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,G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3BA,wBAAwB,IACxB,IAAAE,qBAAG;AACX;AACA,SAAS;AACT;AACA,MAAM,CAAC;EAAED;AAAqB,CAAC,KACvBA,oBAAoB,IACpB,IAAAC,qBAAG;AACX;AACA,SAAS;AACT;AACA;AACA,MAAM,CAAC;EAAEC,QAAQ;EAAEC;AAAoC,CAAC,KAChDD,QAAQ,KAAK,SAAS,GAChB,IAAAD,qBAAG;AACjB,0CAA0CE,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACD,IAAAF,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CE,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC;AAEM,MAAMC,oCAAoC,GAAAR,OAAA,CAAAQ,oCAAA,GAAGP,yBAAM,CAACC,GAAG;AAC9D;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -10,16 +10,20 @@ var _alignment = require("../../../../constants/alignment");
10
10
  var _Emoji = require("./Emoji.styles");
11
11
  var _SkinTonePopup = _interopRequireDefault(require("./skin-tone-popup/SkinTonePopup"));
12
12
  var _SkinTonePopup2 = require("./skin-tone-popup/SkinTonePopup.styles");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
- const Emoji = _ref => {
17
- let {
18
- emoji,
19
- isSkinToneSupported,
20
- onPopupVisibilityChange,
21
- onSelect
22
- } = _ref;
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ const Emoji = ({
17
+ emoji,
18
+ isSelected,
19
+ name,
20
+ isSkinToneSupported,
21
+ onPopupVisibilityChange,
22
+ onSelect,
23
+ shouldShowSkinTonePopup,
24
+ onRightClick,
25
+ index
26
+ }) => {
23
27
  const [shouldShowPopup, setShouldShowPopup] = (0, _react.useState)(false);
24
28
  const [skinTonePopupAnchorAlignment, setSkinTonePopupAnchorAlignment] = (0, _react.useState)(_alignment.AnchorAlignment.Top);
25
29
  const [skinTonePopupAnchorOffset, setSkinTonePopupAnchorOffset] = (0, _react.useState)(0);
@@ -30,18 +34,18 @@ const Emoji = _ref => {
30
34
  left: 0,
31
35
  top: 0
32
36
  });
37
+ const emojiRef = (0, _react.useRef)(null);
33
38
  const handleClick = (0, _react.useCallback)(() => {
34
39
  onSelect(emoji);
35
40
  }, [emoji, onSelect]);
36
- const handleContextMenu = (0, _react.useCallback)(event => {
37
- event.preventDefault();
38
- event.stopPropagation();
41
+ const calculatePopupPosition = (0, _react.useCallback)(() => {
42
+ if (!emojiRef.current) {
43
+ return;
44
+ }
45
+ const element = emojiRef.current;
39
46
  const {
40
- currentTarget: element,
41
- currentTarget: {
42
- parentElement
43
- }
44
- } = event;
47
+ parentElement
48
+ } = emojiRef.current;
45
49
  if (parentElement) {
46
50
  const {
47
51
  height: elementHeight,
@@ -89,11 +93,36 @@ const Emoji = _ref => {
89
93
  }
90
94
  }
91
95
  }, [isSkinToneSupported]);
92
- const handleHidePopup = (0, _react.useCallback)(() => setShouldShowPopup(false), []);
96
+ const handleContextMenu = (0, _react.useCallback)(event => {
97
+ event.preventDefault();
98
+ event.stopPropagation();
99
+ if (isSkinToneSupported) {
100
+ onRightClick(index);
101
+ calculatePopupPosition();
102
+ }
103
+ }, [calculatePopupPosition, index, isSkinToneSupported, onRightClick]);
104
+ (0, _react.useEffect)(() => {
105
+ if (emojiRef.current && shouldShowSkinTonePopup && skinTonePopupPosition.top === 0 && skinTonePopupPosition.left === 0) {
106
+ calculatePopupPosition();
107
+ }
108
+ }, [calculatePopupPosition, index, isSkinToneSupported, shouldShowSkinTonePopup, skinTonePopupPosition]);
109
+ (0, _react.useEffect)(() => {
110
+ if (shouldShowSkinTonePopup) {
111
+ setShouldShowPopup(shouldShowSkinTonePopup);
112
+ }
113
+ }, [shouldShowSkinTonePopup]);
114
+ const handleHidePopup = (0, _react.useCallback)(() => {
115
+ setShouldShowPopup(false);
116
+ }, []);
93
117
  (0, _react.useEffect)(() => {
94
118
  onPopupVisibilityChange(shouldShowPopup);
95
119
  }, [onPopupVisibilityChange, shouldShowPopup]);
96
120
  return /*#__PURE__*/_react.default.createElement(_Emoji.StyledEmoji, {
121
+ ref: emojiRef,
122
+ $isSelected: isSelected,
123
+ "data-emoji": emoji,
124
+ "data-name": name,
125
+ "data-skin-tone-support": isSkinToneSupported,
97
126
  className: "prevent-lose-focus",
98
127
  onClick: handleClick,
99
128
  onContextMenu: handleContextMenu
@@ -111,6 +140,5 @@ const Emoji = _ref => {
111
140
  })));
112
141
  };
113
142
  Emoji.displayName = 'Emoji';
114
- var _default = Emoji;
115
- exports.default = _default;
143
+ var _default = exports.default = Emoji;
116
144
  //# sourceMappingURL=Emoji.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Emoji.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_alignment","_Emoji","_SkinTonePopup","_interopRequireDefault","_SkinTonePopup2","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Emoji","emoji","isSelected","name","isSkinToneSupported","onPopupVisibilityChange","onSelect","shouldShowSkinTonePopup","onRightClick","index","shouldShowPopup","setShouldShowPopup","useState","skinTonePopupAnchorAlignment","setSkinTonePopupAnchorAlignment","AnchorAlignment","Top","skinTonePopupAnchorOffset","setSkinTonePopupAnchorOffset","skinTonePopupOverlayPosition","setSkinTonePopupOverlayPosition","top","skinTonePopupPosition","setSkinTonePopupPosition","left","emojiRef","useRef","handleClick","useCallback","calculatePopupPosition","current","element","parentElement","height","elementHeight","elementLeft","elementTop","width","elementWidth","getBoundingClientRect","parentHeight","parentLeft","parentTop","parentWidth","scrollTop","anchorAlignment","anchorOffset","skinTonePopupContentSize","maxLeft","minLeft","Bottom","handleContextMenu","event","preventDefault","stopPropagation","useEffect","handleHidePopup","createElement","StyledEmoji","ref","$isSelected","className","onClick","onContextMenu","AnimatePresence","initial","key","onHidePopup","overlayPosition","position","displayName","_default","exports"],"sources":["../../../../../../src/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, { FC, MouseEvent, useCallback, useEffect, useRef, useState } from 'react';\nimport { AnchorAlignment } from '../../../../constants/alignment';\nimport { StyledEmoji } from './Emoji.styles';\nimport SkinTonePopup, { SkinTonePopupProps } from './skin-tone-popup/SkinTonePopup';\nimport { skinTonePopupContentSize } from './skin-tone-popup/SkinTonePopup.styles';\n\nexport type EmojiProps = {\n emoji: string;\n isSelected: boolean;\n name: string;\n index: number;\n isSkinToneSupported: boolean;\n onPopupVisibilityChange: (isVisible: boolean) => void;\n onSelect: (emoji: string) => void;\n onRightClick: (newIndex: number) => void;\n shouldShowSkinTonePopup: boolean;\n};\n\nconst Emoji: FC<EmojiProps> = ({\n emoji,\n isSelected,\n name,\n isSkinToneSupported,\n onPopupVisibilityChange,\n onSelect,\n shouldShowSkinTonePopup,\n onRightClick,\n index,\n}) => {\n const [shouldShowPopup, setShouldShowPopup] = useState(false);\n const [skinTonePopupAnchorAlignment, setSkinTonePopupAnchorAlignment] = useState(\n AnchorAlignment.Top,\n );\n const [skinTonePopupAnchorOffset, setSkinTonePopupAnchorOffset] = useState(0);\n const [skinTonePopupOverlayPosition, setSkinTonePopupOverlayPosition] = useState<\n SkinTonePopupProps['overlayPosition']\n >({ top: 0 });\n const [skinTonePopupPosition, setSkinTonePopupPosition] = useState<\n SkinTonePopupProps['position']\n >({ left: 0, top: 0 });\n\n const emojiRef = useRef<HTMLDivElement>(null);\n\n const handleClick = useCallback(() => {\n onSelect(emoji);\n }, [emoji, onSelect]);\n\n const calculatePopupPosition = useCallback(() => {\n if (!emojiRef.current) {\n return;\n }\n\n const element = emojiRef.current;\n const { parentElement } = emojiRef.current;\n\n if (parentElement) {\n const {\n height: elementHeight,\n left: elementLeft,\n top: elementTop,\n width: elementWidth,\n } = element.getBoundingClientRect();\n\n const {\n height: parentHeight,\n left: parentLeft,\n top: parentTop,\n width: parentWidth,\n } = parentElement.getBoundingClientRect();\n\n const { scrollTop } = parentElement;\n\n let anchorAlignment = AnchorAlignment.Top;\n let anchorOffset = 0;\n\n let left =\n elementLeft - parentLeft - skinTonePopupContentSize.width / 2 + elementWidth / 2;\n\n let top = elementTop - parentTop + elementHeight + scrollTop;\n\n const maxLeft = parentWidth - skinTonePopupContentSize.width - 12;\n const minLeft = 12;\n\n if (left < minLeft) {\n anchorOffset = left - minLeft;\n left = minLeft;\n } else if (left > maxLeft) {\n anchorOffset = left - maxLeft;\n left = maxLeft;\n }\n\n if (top + skinTonePopupContentSize.height > parentHeight + scrollTop) {\n anchorAlignment = AnchorAlignment.Bottom;\n top -= elementHeight + skinTonePopupContentSize.height;\n }\n\n if (isSkinToneSupported) {\n setSkinTonePopupAnchorAlignment(anchorAlignment);\n setSkinTonePopupAnchorOffset(anchorOffset);\n setSkinTonePopupPosition({ left, top });\n setSkinTonePopupOverlayPosition({ top: scrollTop });\n setShouldShowPopup(true);\n }\n }\n }, [isSkinToneSupported]);\n\n const handleContextMenu = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n\n if (isSkinToneSupported) {\n onRightClick(index);\n calculatePopupPosition();\n }\n },\n [calculatePopupPosition, index, isSkinToneSupported, onRightClick],\n );\n\n useEffect(() => {\n if (\n emojiRef.current &&\n shouldShowSkinTonePopup &&\n skinTonePopupPosition.top === 0 &&\n skinTonePopupPosition.left === 0\n ) {\n calculatePopupPosition();\n }\n }, [\n calculatePopupPosition,\n index,\n isSkinToneSupported,\n shouldShowSkinTonePopup,\n skinTonePopupPosition,\n ]);\n\n useEffect(() => {\n if (shouldShowSkinTonePopup) {\n setShouldShowPopup(shouldShowSkinTonePopup);\n }\n }, [shouldShowSkinTonePopup]);\n\n const handleHidePopup = useCallback(() => {\n setShouldShowPopup(false);\n }, []);\n\n useEffect(() => {\n onPopupVisibilityChange(shouldShowPopup);\n }, [onPopupVisibilityChange, shouldShowPopup]);\n\n return (\n <StyledEmoji\n ref={emojiRef}\n $isSelected={isSelected}\n data-emoji={emoji}\n data-name={name}\n data-skin-tone-support={isSkinToneSupported}\n className=\"prevent-lose-focus\"\n onClick={handleClick}\n onContextMenu={handleContextMenu}\n >\n {emoji}\n <AnimatePresence initial={false}>\n {shouldShowPopup && (\n <SkinTonePopup\n anchorAlignment={skinTonePopupAnchorAlignment}\n anchorOffset={skinTonePopupAnchorOffset}\n emoji={emoji}\n key={emoji}\n onHidePopup={handleHidePopup}\n onSelect={onSelect}\n overlayPosition={skinTonePopupOverlayPosition}\n position={skinTonePopupPosition}\n />\n )}\n </AnimatePresence>\n </StyledEmoji>\n );\n};\n\nEmoji.displayName = 'Emoji';\n\nexport default Emoji;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAAkF,SAAAM,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CA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IAAAC,QAAA,GAAAC,OAAA,CAAA1F,OAAA,GAEbkB,KAAK","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledEmoji = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ var _font = require("../../../../utils/font");
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const StyledEmoji = exports.StyledEmoji = _styledComponents.default.div`
11
+ align-items: center;
12
+ cursor: pointer;
13
+ display: flex;
14
+ font-family: ${_font.getFontFamily};
15
+ font-size: 32px;
16
+ justify-content: center;
17
+ width: 48px;
18
+ height: 48px;
19
+ background-color: ${({
20
+ theme,
21
+ $isSelected
22
+ }) => $isSelected ? theme['secondary-102'] : 'none'};
23
+ `;
24
+ //# sourceMappingURL=Emoji.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Emoji.styles.js","names":["_styledComponents","_interopRequireDefault","require","_font","e","__esModule","default","StyledEmoji","exports","styled","div","getFontFamily","theme","$isSelected"],"sources":["../../../../../../src/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport styled from 'styled-components';\nimport { getFontFamily } from '../../../../utils/font';\n\ntype StyledEmojiProps = WithTheme<{\n $isSelected: boolean;\n}>;\n\nexport const StyledEmoji = styled.div<StyledEmojiProps>`\n align-items: center;\n cursor: pointer;\n display: flex;\n font-family: ${getFontFamily};\n font-size: 32px;\n justify-content: center;\n width: 48px;\n height: 48px;\n background-color: ${({ theme, $isSelected }: StyledEmojiProps) =>\n $isSelected ? theme['secondary-102'] : 'none'};\n`;\n"],"mappings":";;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAuD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAMhD,MAAMG,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,yBAAM,CAACC,GAAqB;AACvD;AACA;AACA;AACA,mBAAmBC,mBAAa;AAChC;AACA;AACA;AACA;AACA,wBAAwB,CAAC;EAAEC,KAAK;EAAEC;AAA8B,CAAC,KACzDA,WAAW,GAAGD,KAAK,CAAC,eAAe,CAAC,GAAG,MAAM;AACrD,CAAC","ignoreList":[]}