@chayns-components/emoji-input 5.0.0-beta.92 → 5.0.0-beta.921

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 (230) 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/cjs/constants/emoji.js +3804 -0
  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} +3 -3
  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/cjs/utils/emoji.js +104 -0
  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} +2 -1
  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/emoji.d.ts +8 -0
  152. package/lib/types/constants/regex.d.ts +8 -0
  153. package/lib/types/index.d.ts +6 -0
  154. package/lib/types/utils/emoji.d.ts +4 -0
  155. package/lib/{utils → types/utils}/environment.d.ts +1 -0
  156. package/lib/types/utils/font.d.ts +1 -0
  157. package/lib/{utils → types/utils}/insert.d.ts +8 -1
  158. package/lib/types/utils/number.d.ts +1 -0
  159. package/lib/types/utils/selection.d.ts +23 -0
  160. package/lib/types/utils/text.d.ts +3 -0
  161. package/package.json +48 -30
  162. package/lib/api/item-storage/get.js.map +0 -1
  163. package/lib/api/item-storage/put.js.map +0 -1
  164. package/lib/components/emoji-input/EmojiInput.d.ts +0 -49
  165. package/lib/components/emoji-input/EmojiInput.js +0 -160
  166. package/lib/components/emoji-input/EmojiInput.js.map +0 -1
  167. package/lib/components/emoji-input/EmojiInput.styles.d.ts +0 -16
  168. package/lib/components/emoji-input/EmojiInput.styles.js +0 -153
  169. package/lib/components/emoji-input/EmojiInput.styles.js.map +0 -1
  170. package/lib/components/emoji-picker/EmojiPicker.js.map +0 -1
  171. package/lib/components/emoji-picker/EmojiPicker.styles.d.ts +0 -5
  172. package/lib/components/emoji-picker/EmojiPicker.styles.js.map +0 -1
  173. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +0 -51
  174. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +0 -1
  175. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.d.ts +0 -2
  176. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +0 -1
  177. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +0 -131
  178. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +0 -1
  179. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.d.ts +0 -7
  180. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +0 -99
  181. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +0 -1
  182. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +0 -1
  183. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.d.ts +0 -1
  184. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +0 -20
  185. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +0 -1
  186. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +0 -74
  187. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +0 -1
  188. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.d.ts +0 -11
  189. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +0 -104
  190. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +0 -1
  191. package/lib/components/emoji-picker-popup/EmojiPickerPopup.js +0 -150
  192. package/lib/components/emoji-picker-popup/EmojiPickerPopup.js.map +0 -1
  193. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.d.ts +0 -7
  194. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js +0 -97
  195. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +0 -1
  196. package/lib/constants/alignment.js.map +0 -1
  197. package/lib/constants/categories.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.d.ts +0 -2
  207. package/lib/utils/emoji.js +0 -205
  208. package/lib/utils/emoji.js.map +0 -1
  209. package/lib/utils/environment.js.map +0 -1
  210. package/lib/utils/font.d.ts +0 -1
  211. package/lib/utils/font.js +0 -15
  212. package/lib/utils/font.js.map +0 -1
  213. package/lib/utils/insert.js +0 -57
  214. package/lib/utils/insert.js.map +0 -1
  215. package/lib/utils/selection.d.ts +0 -2
  216. package/lib/utils/selection.js +0 -43
  217. package/lib/utils/selection.js.map +0 -1
  218. /package/lib/{constants → cjs/constants}/emoji-de-DE.json +0 -0
  219. /package/lib/{api → types/api}/item-storage/get.d.ts +0 -0
  220. /package/lib/{api → types/api}/item-storage/put.d.ts +0 -0
  221. /package/lib/{components → types/components}/emoji-picker/EmojiPicker.d.ts +0 -0
  222. /package/lib/{components → types/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.d.ts +0 -0
  223. /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.d.ts +0 -0
  224. /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.d.ts +0 -0
  225. /package/lib/{constants → types/constants}/alignment.d.ts +0 -0
  226. /package/lib/{constants → types/constants}/categories.d.ts +0 -0
  227. /package/lib/{constants → types/constants}/externalServerUrl.d.ts +0 -0
  228. /package/lib/{hooks → types/hooks}/emojiHistory.d.ts +0 -0
  229. /package/lib/types/{api.d.ts → types/api.d.ts} +0 -0
  230. /package/lib/types/{category.d.ts → types/category.d.ts} +0 -0
@@ -0,0 +1,497 @@
1
+ import { AreaContext, getIsTouch } from '@chayns-components/core';
2
+ import { getDevice } from 'chayns-api';
3
+ import { AnimatePresence } from 'framer-motion';
4
+ import React, { forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
5
+ import { convertEmojisToUnicode } from '../../utils/emoji';
6
+ import { insertTextAtCursorPosition, replaceText } from '../../utils/insert';
7
+ import { getCharCodeThatWillBeDeleted, insertInvisibleCursorMarker, restoreSelection, saveSelection } from '../../utils/selection';
8
+ import { convertHTMLToText, convertTextToHTML } from '../../utils/text';
9
+ import EmojiPickerPopup from '../emoji-picker-popup/EmojiPickerPopup';
10
+ import { StyledEmojiInput, StyledEmojiInputContent, StyledEmojiInputLabel, StyledEmojiInputRightWrapper, StyledMotionEmojiInputEditor, StyledMotionEmojiInputProgress } from './EmojiInput.styles';
11
+ import PrefixElement from './prefix-element/PrefixElement';
12
+ const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
13
+ const EmojiInput = /*#__PURE__*/forwardRef((_ref, ref) => {
14
+ let {
15
+ accessToken,
16
+ height,
17
+ inputId,
18
+ isDisabled,
19
+ maxHeight = '190px',
20
+ onBlur,
21
+ onFocus,
22
+ onInput,
23
+ onKeyDown,
24
+ onPrefixElementRemove,
25
+ onPopupVisibilityChange,
26
+ personId,
27
+ placeholder,
28
+ popupAlignment,
29
+ prefixElement,
30
+ rightElement,
31
+ shouldHidePlaceholderOnFocus = true,
32
+ shouldPreventEmojiPicker,
33
+ value
34
+ } = _ref;
35
+ const [isTouch] = useState(getIsTouch());
36
+ const [plainTextValue, setPlainTextValue] = useState(value);
37
+ const [hasFocus, setHasFocus] = useState(false);
38
+ const [progressDuration, setProgressDuration] = useState(0);
39
+ const [labelWidth, setLabelWidth] = useState(0);
40
+ const [isPopupVisible, setIsPopupVisible] = useState(false);
41
+ const [isPrefixAnimationFinished, setIsPrefixAnimationFinished] = useState(!prefixElement);
42
+ const [prefixElementWidth, setPrefixElementWidth] = useState();
43
+ const [textLength, setTextLength] = useState(0);
44
+ const areaProvider = useContext(AreaContext);
45
+ const editorRef = useRef(null);
46
+ const prefixElementRef = useRef(null);
47
+ const hasPrefixRendered = useRef(false);
48
+ const hasPrefixChanged = useRef(false);
49
+ const shouldDeleteOneMoreBackwards = useRef(false);
50
+ const shouldDeleteOneMoreForwards = useRef(false);
51
+ const valueRef = useRef(value);
52
+ const {
53
+ browser
54
+ } = getDevice();
55
+ const shouldChangeColor = useMemo(() => areaProvider.shouldChangeColor ?? false, [areaProvider.shouldChangeColor]);
56
+
57
+ /**
58
+ * This function updates the content of the 'contentEditable' element if the new text is
59
+ * different from the previous content. So this is only true if, for example, a text like ":-)"
60
+ * has been replaced to the corresponding emoji.
61
+ *
62
+ * When updating the HTML, the current cursor position is saved before replacing the content, so
63
+ * that it can be set again afterward.
64
+ */
65
+ const handleUpdateHTML = useCallback(html => {
66
+ if (!editorRef.current) {
67
+ return;
68
+ }
69
+ let newInnerHTML = convertEmojisToUnicode(html);
70
+ newInnerHTML = convertTextToHTML(newInnerHTML);
71
+ if (newInnerHTML !== editorRef.current.innerHTML) {
72
+ saveSelection(editorRef.current, {
73
+ shouldIgnoreEmptyTextNodes: true
74
+ });
75
+ editorRef.current.innerHTML = newInnerHTML;
76
+ restoreSelection(editorRef.current);
77
+ }
78
+ }, []);
79
+ const handleBeforeInput = useCallback(event => {
80
+ if (!editorRef.current) {
81
+ return;
82
+ }
83
+ if (isDisabled) {
84
+ event.preventDefault();
85
+ event.stopPropagation();
86
+ return;
87
+ }
88
+ const {
89
+ data,
90
+ type
91
+ } = event.nativeEvent;
92
+ if (type === 'textInput' && data && data.includes('\n')) {
93
+ event.preventDefault();
94
+ event.stopPropagation();
95
+ const text = convertEmojisToUnicode(data);
96
+ insertTextAtCursorPosition({
97
+ editorElement: editorRef.current,
98
+ text
99
+ });
100
+ const newEvent = new Event('input', {
101
+ bubbles: true
102
+ });
103
+ editorRef.current.dispatchEvent(newEvent);
104
+ }
105
+ }, [isDisabled]);
106
+
107
+ /**
108
+ * This function handles the 'input' events of the 'contentEditable' element and also passes the
109
+ * respective event up accordingly if the 'onInput' property is a function.
110
+ */
111
+ const handleInput = useCallback(event => {
112
+ if (!editorRef.current) {
113
+ return;
114
+ }
115
+ if (isDisabled) {
116
+ event.stopPropagation();
117
+ event.preventDefault();
118
+ }
119
+ if (shouldDeleteOneMoreBackwards.current) {
120
+ shouldDeleteOneMoreBackwards.current = false;
121
+ shouldDeleteOneMoreForwards.current = false;
122
+ event.preventDefault();
123
+ event.stopPropagation();
124
+
125
+ // Remove content and set cursor to the right position
126
+ insertInvisibleCursorMarker();
127
+ return;
128
+ }
129
+ if (shouldDeleteOneMoreForwards.current) {
130
+ shouldDeleteOneMoreBackwards.current = false;
131
+ shouldDeleteOneMoreForwards.current = false;
132
+ event.preventDefault();
133
+ event.stopPropagation();
134
+
135
+ // noinspection JSDeprecatedSymbols
136
+ document.execCommand('forwardDelete', false);
137
+ return;
138
+ }
139
+ handleUpdateHTML(editorRef.current.innerHTML);
140
+ const text = convertHTMLToText(editorRef.current.innerHTML);
141
+ setPlainTextValue(text);
142
+ if (typeof onInput === 'function') {
143
+ onInput(event, text);
144
+ }
145
+ }, [handleUpdateHTML, isDisabled, onInput]);
146
+ const handleKeyDown = useCallback(event => {
147
+ if (isDisabled) {
148
+ event.preventDefault();
149
+ event.stopPropagation();
150
+ return;
151
+ }
152
+ if (event.key === 'Enter' && isPopupVisible) {
153
+ event.preventDefault();
154
+ return;
155
+ }
156
+ if (typeof onKeyDown === 'function') {
157
+ onKeyDown(event);
158
+ }
159
+ if (event.key === 'Enter' && !event.isPropagationStopped() && editorRef.current) {
160
+ event.preventDefault();
161
+
162
+ // noinspection JSDeprecatedSymbols
163
+ document.execCommand('insertLineBreak', false);
164
+ }
165
+ if (event.key === 'Backspace' || event.key === 'Delete' || event.key === 'Unidentified') {
166
+ const charCodeThatWillBeDeleted = getCharCodeThatWillBeDeleted(event);
167
+ if (charCodeThatWillBeDeleted === 8203) {
168
+ if (event.key === 'Backspace' || event.key === 'Unidentified') {
169
+ shouldDeleteOneMoreBackwards.current = true;
170
+ } else {
171
+ shouldDeleteOneMoreForwards.current = true;
172
+ }
173
+ }
174
+ }
175
+ }, [isDisabled, isPopupVisible, onKeyDown]);
176
+ const handlePopupVisibility = useCallback(isVisible => {
177
+ setIsPopupVisible(isVisible);
178
+ if (editorRef.current && isVisible) {
179
+ saveSelection(editorRef.current);
180
+ }
181
+ if (typeof onPopupVisibilityChange === 'function') {
182
+ onPopupVisibilityChange(isVisible);
183
+ }
184
+ }, [onPopupVisibilityChange]);
185
+
186
+ /**
187
+ * This function prevents formatting from being adopted when texts are inserted. To do this, the
188
+ * plain text is read from the event after the default behavior has been prevented. The plain
189
+ * text is then inserted at the correct position in the input field using document.execCommand('insertHTML')
190
+ */
191
+ const handlePaste = useCallback(event => {
192
+ if (editorRef.current) {
193
+ event.preventDefault();
194
+ if (isDisabled) {
195
+ event.stopPropagation();
196
+ return;
197
+ }
198
+ let text = event.clipboardData.getData('text/plain');
199
+ text = convertEmojisToUnicode(text);
200
+
201
+ // This deprecated function is used, because it causes the inserted content to be added to the undo stack.
202
+ // If the text were to be inserted directly into the 'innerHTML' of the editor element, the undo stack would not be updated.
203
+ // In that case on CTRL+Z the inserted text would not be removed.
204
+ document.execCommand('insertHTML', false, text);
205
+ const newEvent = new Event('input', {
206
+ bubbles: true
207
+ });
208
+ editorRef.current.dispatchEvent(newEvent);
209
+ }
210
+ }, [isDisabled]);
211
+
212
+ /**
213
+ * This function prevents formatting from being adopted when texts are dropped. To do this, the
214
+ * plain text is read from the event after the default behavior has been prevented. The plain
215
+ * text is then inserted at the correct position in the input field using document.execCommand('insertHTML')
216
+ */
217
+ const handleDrop = useCallback(event => {
218
+ if (editorRef.current) {
219
+ event.preventDefault();
220
+ if (isDisabled) {
221
+ event.stopPropagation();
222
+ return;
223
+ }
224
+ let text = event.dataTransfer?.getData('text');
225
+ if (!text) {
226
+ return;
227
+ }
228
+ text = convertEmojisToUnicode(text);
229
+
230
+ // This deprecated function is used, because it causes the inserted content to be added to the undo stack.
231
+ // If the text were to be inserted directly into the 'innerHTML' of the editor element, the undo stack would not be updated.
232
+ // In that case on CTRL+Z the inserted text would not be removed.
233
+ document.execCommand('insertHTML', false, text);
234
+ const newEvent = new Event('input', {
235
+ bubbles: true
236
+ });
237
+ editorRef.current.dispatchEvent(newEvent);
238
+ }
239
+ }, [isDisabled]);
240
+
241
+ /**
242
+ * This function uses the 'insertTextAtCursorPosition' function to insert the emoji at the
243
+ * correct position in the editor element.
244
+ *
245
+ * At the end an 'input' event is dispatched, so that the function 'handleInput' is triggered,
246
+ * which in turn executes the 'onInput' function from the props. So this serves to ensure that
247
+ * the event is also passed through to the top when inserting via the popup.
248
+ */
249
+ const handlePopupSelect = useCallback(emoji => {
250
+ if (editorRef.current) {
251
+ insertTextAtCursorPosition({
252
+ editorElement: editorRef.current,
253
+ text: emoji,
254
+ shouldUseSavedSelection: true
255
+ });
256
+ const event = new Event('input', {
257
+ bubbles: true
258
+ });
259
+ editorRef.current.dispatchEvent(event);
260
+ }
261
+ }, []);
262
+ useEffect(() => {
263
+ if (typeof onPrefixElementRemove !== 'function') {
264
+ return;
265
+ }
266
+ if (!hasPrefixRendered.current) {
267
+ return;
268
+ }
269
+ const convertedText = convertHTMLToText(editorRef.current?.innerHTML ?? '').replace(' ', ' ');
270
+ const convertedPrefix = prefixElement && prefixElement.replace(' ', ' ');
271
+ if (convertedPrefix && convertedText.includes(convertedPrefix) && convertedText.length > convertedPrefix.length || convertedPrefix === convertedText) {
272
+ return;
273
+ }
274
+ if (hasPrefixChanged.current) {
275
+ hasPrefixChanged.current = false;
276
+ return;
277
+ }
278
+ onPrefixElementRemove();
279
+ hasPrefixRendered.current = false;
280
+ }, [onPrefixElementRemove, plainTextValue.length, prefixElement]);
281
+ useEffect(() => {
282
+ if (typeof prefixElement === 'string') {
283
+ hasPrefixChanged.current = true;
284
+ }
285
+ }, [prefixElement]);
286
+ useEffect(() => {
287
+ if (value !== plainTextValue) {
288
+ setPlainTextValue(value);
289
+ handleUpdateHTML(value);
290
+ }
291
+ }, [handleUpdateHTML, plainTextValue, value]);
292
+
293
+ // This effect is used to call the 'handleUpdateHTML' function once after the component has been
294
+ // rendered. This is necessary because the 'contentEditable' element otherwise does not display
295
+ // the HTML content correctly when the component is rendered for the first time.
296
+ useIsomorphicLayoutEffect(() => {
297
+ handleUpdateHTML(valueRef.current);
298
+ }, [handleUpdateHTML]);
299
+ const handleInsertTextAtCursorPosition = useCallback(text => {
300
+ if (editorRef.current) {
301
+ insertTextAtCursorPosition({
302
+ editorElement: editorRef.current,
303
+ text
304
+ });
305
+ const newEvent = new Event('input', {
306
+ bubbles: true
307
+ });
308
+ editorRef.current.dispatchEvent(newEvent);
309
+ }
310
+ }, []);
311
+ const handleReplaceText = useCallback((searchText, pasteText) => {
312
+ if (editorRef.current) {
313
+ replaceText({
314
+ editorElement: editorRef.current,
315
+ searchText,
316
+ pasteText
317
+ });
318
+ const newEvent = new Event('input', {
319
+ bubbles: true
320
+ });
321
+ editorRef.current.dispatchEvent(newEvent);
322
+ }
323
+ }, []);
324
+ const handleStartProgress = useCallback(duration => {
325
+ setProgressDuration(duration);
326
+ }, []);
327
+ const handleStopProgress = useCallback(() => {
328
+ setProgressDuration(0);
329
+ }, []);
330
+ useImperativeHandle(ref, () => ({
331
+ insertTextAtCursorPosition: handleInsertTextAtCursorPosition,
332
+ replaceText: handleReplaceText,
333
+ startProgress: handleStartProgress,
334
+ stopProgress: handleStopProgress
335
+ }), [handleInsertTextAtCursorPosition, handleReplaceText, handleStartProgress, handleStopProgress]);
336
+ useEffect(() => {
337
+ /**
338
+ * This function ensures that the input field does not lose focus when the popup is opened
339
+ * or an emoji is selected in it. For this purpose the corresponding elements get the class
340
+ * 'prevent-lose-focus'.
341
+ *
342
+ * The class can also be set to any other elements that should also not cause the input
343
+ * field to lose focus.
344
+ */
345
+ const handlePreventLoseFocus = event => {
346
+ const element = event.target;
347
+ if (element.classList.contains('prevent-lose-focus') || element.parentElement?.classList.contains('prevent-lose-focus') || element.parentElement?.parentElement?.classList.contains('prevent-lose-focus')) {
348
+ event.preventDefault();
349
+ event.stopPropagation();
350
+ }
351
+ };
352
+ document.body.addEventListener('mousedown', handlePreventLoseFocus);
353
+ return () => {
354
+ document.body.removeEventListener('mousedown', handlePreventLoseFocus);
355
+ };
356
+ }, []);
357
+ const shouldShowPlaceholder = useMemo(() => {
358
+ if (!isPrefixAnimationFinished) {
359
+ return false;
360
+ }
361
+ const isJustPrefixElement = prefixElement && convertTextToHTML(prefixElement) === editorRef.current?.innerHTML;
362
+ const shouldRenderPlaceholder = prefixElement && !plainTextValue || (prefixElement ? prefixElementWidth && prefixElementWidth > 0 : true);
363
+ switch (true) {
364
+ case (!plainTextValue || isJustPrefixElement) && shouldHidePlaceholderOnFocus && !hasFocus:
365
+ case (!plainTextValue || isJustPrefixElement) && !shouldHidePlaceholderOnFocus:
366
+ return shouldRenderPlaceholder;
367
+ case (!plainTextValue || isJustPrefixElement) && shouldHidePlaceholderOnFocus && hasFocus:
368
+ return false;
369
+ default:
370
+ return false;
371
+ }
372
+ }, [isPrefixAnimationFinished, hasFocus, plainTextValue, prefixElement, shouldHidePlaceholderOnFocus, prefixElementWidth]);
373
+ useEffect(() => {
374
+ if (prefixElement) {
375
+ setIsPrefixAnimationFinished(false);
376
+ }
377
+ }, [prefixElement]);
378
+ const handleFocus = event => {
379
+ if (typeof onFocus === 'function' && !isDisabled) {
380
+ onFocus(event);
381
+ }
382
+ setHasFocus(true);
383
+ };
384
+ const handleBlur = event => {
385
+ if (typeof onBlur === 'function' && !isDisabled) {
386
+ onBlur(event);
387
+ }
388
+ setHasFocus(false);
389
+ };
390
+ useEffect(() => {
391
+ if (editorRef.current && prefixElement) {
392
+ const text = convertEmojisToUnicode(prefixElement);
393
+ insertTextAtCursorPosition({
394
+ editorElement: editorRef.current,
395
+ text
396
+ });
397
+ handleUpdateHTML(prefixElement);
398
+ hasPrefixRendered.current = true;
399
+ }
400
+ }, [handleUpdateHTML, prefixElement]);
401
+ useEffect(() => {
402
+ if (prefixElementRef.current && prefixElement && convertTextToHTML(prefixElement) === editorRef.current?.innerHTML) {
403
+ setPrefixElementWidth(prefixElementRef.current.offsetWidth + 2);
404
+ } else {
405
+ setPrefixElementWidth(undefined);
406
+ }
407
+ }, [plainTextValue, prefixElement]);
408
+ useEffect(() => {
409
+ const handleResize = () => {
410
+ if (editorRef.current) {
411
+ setLabelWidth(editorRef.current.offsetWidth);
412
+ }
413
+ };
414
+ const resizeObserver = new ResizeObserver(handleResize);
415
+ if (editorRef.current) {
416
+ resizeObserver.observe(editorRef.current);
417
+ }
418
+ return () => {
419
+ resizeObserver.disconnect();
420
+ };
421
+ }, []);
422
+ useEffect(() => {
423
+ const blurElement = () => {
424
+ if (editorRef.current && document.activeElement === editorRef.current && isDisabled) {
425
+ editorRef.current.blur();
426
+ }
427
+ };
428
+ document.addEventListener('focus', blurElement, true);
429
+ return () => {
430
+ document.removeEventListener('focus', blurElement, true);
431
+ };
432
+ }, [isDisabled]);
433
+ return /*#__PURE__*/React.createElement(StyledEmojiInput, {
434
+ $isDisabled: isDisabled,
435
+ $shouldChangeColor: shouldChangeColor
436
+ }, /*#__PURE__*/React.createElement(AnimatePresence, {
437
+ initial: true
438
+ }, progressDuration > 0 && /*#__PURE__*/React.createElement(StyledMotionEmojiInputProgress, {
439
+ animate: {
440
+ width: '100%'
441
+ },
442
+ exit: {
443
+ opacity: 0
444
+ },
445
+ initial: {
446
+ opacity: 1,
447
+ width: '0%'
448
+ },
449
+ transition: {
450
+ width: {
451
+ ease: 'linear',
452
+ duration: progressDuration
453
+ },
454
+ opacity: {
455
+ type: 'tween',
456
+ duration: 0.3
457
+ }
458
+ }
459
+ })), /*#__PURE__*/React.createElement(StyledEmojiInputContent, null, prefixElement && /*#__PURE__*/React.createElement(PrefixElement, {
460
+ key: prefixElement,
461
+ element: prefixElement,
462
+ prefixElementRef: prefixElementRef,
463
+ setIsPrefixAnimationFinished: setIsPrefixAnimationFinished
464
+ }), /*#__PURE__*/React.createElement(StyledMotionEmojiInputEditor, {
465
+ $browser: browser?.name,
466
+ animate: {
467
+ maxHeight: height ?? maxHeight,
468
+ minHeight: height ?? '26px'
469
+ },
470
+ contentEditable: !isDisabled,
471
+ id: inputId,
472
+ onBeforeInput: handleBeforeInput,
473
+ onBlur: handleBlur,
474
+ onFocus: handleFocus,
475
+ onInput: handleInput,
476
+ onKeyDown: handleKeyDown,
477
+ onPaste: handlePaste,
478
+ onDrop: handleDrop,
479
+ ref: editorRef,
480
+ $shouldShowContent: isPrefixAnimationFinished,
481
+ transition: {
482
+ type: 'tween',
483
+ duration: 0.2
484
+ }
485
+ }), shouldShowPlaceholder && /*#__PURE__*/React.createElement(StyledEmojiInputLabel, {
486
+ $maxWidth: labelWidth,
487
+ $offsetWidth: prefixElementWidth
488
+ }, placeholder), !isTouch && !shouldPreventEmojiPicker && /*#__PURE__*/React.createElement(EmojiPickerPopup, {
489
+ accessToken: accessToken,
490
+ onSelect: handlePopupSelect,
491
+ onPopupVisibilityChange: handlePopupVisibility,
492
+ personId: personId
493
+ })), rightElement && /*#__PURE__*/React.createElement(StyledEmojiInputRightWrapper, null, rightElement));
494
+ });
495
+ EmojiInput.displayName = 'EmojiInput';
496
+ export default EmojiInput;
497
+ //# sourceMappingURL=EmojiInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiInput.js","names":["AreaContext","getIsTouch","getDevice","AnimatePresence","React","forwardRef","useCallback","useContext","useEffect","useImperativeHandle","useLayoutEffect","useMemo","useRef","useState","convertEmojisToUnicode","insertTextAtCursorPosition","replaceText","getCharCodeThatWillBeDeleted","insertInvisibleCursorMarker","restoreSelection","saveSelection","convertHTMLToText","convertTextToHTML","EmojiPickerPopup","StyledEmojiInput","StyledEmojiInputContent","StyledEmojiInputLabel","StyledEmojiInputRightWrapper","StyledMotionEmojiInputEditor","StyledMotionEmojiInputProgress","PrefixElement","useIsomorphicLayoutEffect","window","EmojiInput","_ref","ref","accessToken","height","inputId","isDisabled","maxHeight","onBlur","onFocus","onInput","onKeyDown","onPrefixElementRemove","onPopupVisibilityChange","personId","placeholder","popupAlignment","prefixElement","rightElement","shouldHidePlaceholderOnFocus","shouldPreventEmojiPicker","value","isTouch","plainTextValue","setPlainTextValue","hasFocus","setHasFocus","progressDuration","setProgressDuration","labelWidth","setLabelWidth","isPopupVisible","setIsPopupVisible","isPrefixAnimationFinished","setIsPrefixAnimationFinished","prefixElementWidth","setPrefixElementWidth","textLength","setTextLength","areaProvider","editorRef","prefixElementRef","hasPrefixRendered","hasPrefixChanged","shouldDeleteOneMoreBackwards","shouldDeleteOneMoreForwards","valueRef","browser","shouldChangeColor","handleUpdateHTML","html","current","newInnerHTML","innerHTML","shouldIgnoreEmptyTextNodes","handleBeforeInput","event","preventDefault","stopPropagation","data","type","nativeEvent","includes","text","editorElement","newEvent","Event","bubbles","dispatchEvent","handleInput","document","execCommand","handleKeyDown","key","isPropagationStopped","charCodeThatWillBeDeleted","handlePopupVisibility","isVisible","handlePaste","clipboardData","getData","handleDrop","dataTransfer","handlePopupSelect","emoji","shouldUseSavedSelection","convertedText","replace","convertedPrefix","length","handleInsertTextAtCursorPosition","handleReplaceText","searchText","pasteText","handleStartProgress","duration","handleStopProgress","startProgress","stopProgress","handlePreventLoseFocus","element","target","classList","contains","parentElement","body","addEventListener","removeEventListener","shouldShowPlaceholder","isJustPrefixElement","shouldRenderPlaceholder","handleFocus","handleBlur","offsetWidth","undefined","handleResize","resizeObserver","ResizeObserver","observe","disconnect","blurElement","activeElement","blur","createElement","$isDisabled","$shouldChangeColor","initial","animate","width","exit","opacity","transition","ease","$browser","name","minHeight","contentEditable","id","onBeforeInput","onPaste","onDrop","$shouldShowContent","$maxWidth","$offsetWidth","onSelect","displayName"],"sources":["../../../../src/components/emoji-input/EmojiInput.tsx"],"sourcesContent":["import { AreaContext, getIsTouch } from '@chayns-components/core';\nimport { getDevice } from 'chayns-api';\nimport { AnimatePresence } from 'framer-motion';\nimport React, {\n ChangeEvent,\n ClipboardEvent,\n CSSProperties,\n FocusEvent,\n FocusEventHandler,\n forwardRef,\n KeyboardEvent as TmpKeyboardEvent,\n KeyboardEventHandler,\n ReactElement,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type FormEvent,\n} from 'react';\nimport type { PopupAlignment } from '../../constants/alignment';\nimport { convertEmojisToUnicode } from '../../utils/emoji';\nimport { insertTextAtCursorPosition, replaceText } from '../../utils/insert';\nimport {\n getCharCodeThatWillBeDeleted,\n insertInvisibleCursorMarker,\n restoreSelection,\n saveSelection,\n} from '../../utils/selection';\nimport { convertHTMLToText, convertTextToHTML } from '../../utils/text';\nimport EmojiPickerPopup from '../emoji-picker-popup/EmojiPickerPopup';\nimport {\n StyledEmojiInput,\n StyledEmojiInputContent,\n StyledEmojiInputLabel,\n StyledEmojiInputRightWrapper,\n StyledMotionEmojiInputEditor,\n StyledMotionEmojiInputProgress,\n} from './EmojiInput.styles';\nimport PrefixElement from './prefix-element/PrefixElement';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\nexport type EmojiInputProps = {\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 * Sets the height of the input field to a fixed value. If this value is not set, the component will use the needed height until the maximum height is reached.\n */\n height?: CSSProperties['height'];\n /**\n * HTML id of the input element\n */\n inputId?: string;\n /**\n * Disables the input so that it cannot be changed anymore\n */\n isDisabled?: boolean;\n /**\n * Sets the maximum height of the input field.\n */\n maxHeight?: CSSProperties['maxHeight'];\n /**\n * Function that is executed when the input field loses focus.\n */\n onBlur?: FocusEventHandler<HTMLDivElement>;\n /**\n * Function that is executed when the input field gets the focus.\n */\n onFocus?: FocusEventHandler<HTMLDivElement>;\n /**\n * Function that is executed when the text of the input changes. In addition to the original\n * event, the original text is returned as second parameter, in which the internally used HTML\n * elements have been converted back to BB codes.\n */\n onInput?: (event: ChangeEvent<HTMLDivElement>, originalText: string) => void;\n /**\n * Function that is executed when a key is pressed down.\n */\n onKeyDown?: KeyboardEventHandler<HTMLDivElement>;\n /**\n * Function to be executed if the prefixElement is removed.\n */\n onPrefixElementRemove?: () => void;\n /**\n * Function that is executed when the visibility of the popup changes.\n * @param {boolean} isVisible - Whether the popup is visible or not\n */\n onPopupVisibilityChange?: (isVisible: boolean) => 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 /**\n * Placeholder for the input field\n */\n placeholder?: string | ReactElement;\n /**\n * Sets the alignment of the popup to a fixed value. If this value is not set, the component\n * calculates the best position on its own. Use the imported 'PopupAlignment' enum to set this\n * value.\n */\n popupAlignment?: PopupAlignment;\n /**\n * Element that is rendered before the input field but the placeholder is still visible.\n */\n prefixElement?: string;\n /**\n * Element that is rendered inside the EmojiInput on the right side.\n */\n rightElement?: ReactNode;\n /**\n * Whether the placeholder should be shown after the input has focus.\n */\n shouldHidePlaceholderOnFocus?: boolean;\n /**\n * Prevents the EmojiPickerPopup icon from being displayed\n */\n shouldPreventEmojiPicker?: boolean;\n /**\n * The plain text value of the input field. Instead of HTML elements BB codes must be used at\n * this point. These are then converted by the input field into corresponding HTML elements.\n */\n value: string;\n};\n\nexport type EmojiInputRef = {\n insertTextAtCursorPosition: (text: string) => void;\n replaceText: (searchText: string, replaceText: string) => void;\n startProgress: (durationInSeconds: number) => void;\n stopProgress: () => void;\n};\n\nconst EmojiInput = forwardRef<EmojiInputRef, EmojiInputProps>(\n (\n {\n accessToken,\n height,\n inputId,\n isDisabled,\n maxHeight = '190px',\n onBlur,\n onFocus,\n onInput,\n onKeyDown,\n onPrefixElementRemove,\n onPopupVisibilityChange,\n personId,\n placeholder,\n popupAlignment,\n prefixElement,\n rightElement,\n shouldHidePlaceholderOnFocus = true,\n shouldPreventEmojiPicker,\n value,\n },\n ref,\n ) => {\n const [isTouch] = useState(getIsTouch());\n const [plainTextValue, setPlainTextValue] = useState(value);\n const [hasFocus, setHasFocus] = useState(false);\n const [progressDuration, setProgressDuration] = useState(0);\n const [labelWidth, setLabelWidth] = useState(0);\n const [isPopupVisible, setIsPopupVisible] = useState(false);\n const [isPrefixAnimationFinished, setIsPrefixAnimationFinished] = useState(!prefixElement);\n const [prefixElementWidth, setPrefixElementWidth] = useState<number | undefined>();\n const [textLength, setTextLength] = useState(0);\n\n const areaProvider = useContext(AreaContext);\n\n const editorRef = useRef<HTMLDivElement>(null);\n const prefixElementRef = useRef<HTMLDivElement>(null);\n const hasPrefixRendered = useRef(false);\n const hasPrefixChanged = useRef(false);\n const shouldDeleteOneMoreBackwards = useRef(false);\n const shouldDeleteOneMoreForwards = useRef(false);\n\n const valueRef = useRef(value);\n\n const { browser } = getDevice();\n\n const shouldChangeColor = useMemo(\n () => areaProvider.shouldChangeColor ?? false,\n [areaProvider.shouldChangeColor],\n );\n\n /**\n * This function updates the content of the 'contentEditable' element if the new text is\n * different from the previous content. So this is only true if, for example, a text like \":-)\"\n * has been replaced to the corresponding emoji.\n *\n * When updating the HTML, the current cursor position is saved before replacing the content, so\n * that it can be set again afterward.\n */\n const handleUpdateHTML = useCallback((html: string) => {\n if (!editorRef.current) {\n return;\n }\n\n let newInnerHTML = convertEmojisToUnicode(html);\n\n newInnerHTML = convertTextToHTML(newInnerHTML);\n\n if (newInnerHTML !== editorRef.current.innerHTML) {\n saveSelection(editorRef.current, { shouldIgnoreEmptyTextNodes: true });\n\n editorRef.current.innerHTML = newInnerHTML;\n\n restoreSelection(editorRef.current);\n }\n }, []);\n\n const handleBeforeInput = useCallback(\n (event: FormEvent<HTMLDivElement>) => {\n if (!editorRef.current) {\n return;\n }\n\n if (isDisabled) {\n event.preventDefault();\n event.stopPropagation();\n\n return;\n }\n\n const { data, type } = event.nativeEvent as InputEvent;\n\n if (type === 'textInput' && data && data.includes('\\n')) {\n event.preventDefault();\n event.stopPropagation();\n\n const text = convertEmojisToUnicode(data);\n\n insertTextAtCursorPosition({ editorElement: editorRef.current, text });\n\n const newEvent = new Event('input', { bubbles: true });\n\n editorRef.current.dispatchEvent(newEvent);\n }\n },\n [isDisabled],\n );\n\n /**\n * This function handles the 'input' events of the 'contentEditable' element and also passes the\n * respective event up accordingly if the 'onInput' property is a function.\n */\n const handleInput = useCallback(\n (event: ChangeEvent<HTMLDivElement>) => {\n if (!editorRef.current) {\n return;\n }\n\n if (isDisabled) {\n event.stopPropagation();\n event.preventDefault();\n }\n\n if (shouldDeleteOneMoreBackwards.current) {\n shouldDeleteOneMoreBackwards.current = false;\n shouldDeleteOneMoreForwards.current = false;\n\n event.preventDefault();\n event.stopPropagation();\n\n // Remove content and set cursor to the right position\n insertInvisibleCursorMarker();\n\n return;\n }\n\n if (shouldDeleteOneMoreForwards.current) {\n shouldDeleteOneMoreBackwards.current = false;\n shouldDeleteOneMoreForwards.current = false;\n\n event.preventDefault();\n event.stopPropagation();\n\n // noinspection JSDeprecatedSymbols\n document.execCommand('forwardDelete', false);\n\n return;\n }\n\n handleUpdateHTML(editorRef.current.innerHTML);\n\n const text = convertHTMLToText(editorRef.current.innerHTML);\n\n setPlainTextValue(text);\n\n if (typeof onInput === 'function') {\n onInput(event, text);\n }\n },\n [handleUpdateHTML, isDisabled, onInput],\n );\n\n const handleKeyDown = useCallback(\n (event: TmpKeyboardEvent<HTMLDivElement>) => {\n if (isDisabled) {\n event.preventDefault();\n event.stopPropagation();\n\n return;\n }\n\n if (event.key === 'Enter' && isPopupVisible) {\n event.preventDefault();\n\n return;\n }\n\n if (typeof onKeyDown === 'function') {\n onKeyDown(event);\n }\n\n if (event.key === 'Enter' && !event.isPropagationStopped() && editorRef.current) {\n event.preventDefault();\n\n // noinspection JSDeprecatedSymbols\n document.execCommand('insertLineBreak', false);\n }\n\n if (\n event.key === 'Backspace' ||\n event.key === 'Delete' ||\n event.key === 'Unidentified'\n ) {\n const charCodeThatWillBeDeleted = getCharCodeThatWillBeDeleted(event);\n\n if (charCodeThatWillBeDeleted === 8203) {\n if (event.key === 'Backspace' || event.key === 'Unidentified') {\n shouldDeleteOneMoreBackwards.current = true;\n } else {\n shouldDeleteOneMoreForwards.current = true;\n }\n }\n }\n },\n [isDisabled, isPopupVisible, onKeyDown],\n );\n\n const handlePopupVisibility = useCallback(\n (isVisible: boolean) => {\n setIsPopupVisible(isVisible);\n\n if (editorRef.current && isVisible) {\n saveSelection(editorRef.current);\n }\n\n if (typeof onPopupVisibilityChange === 'function') {\n onPopupVisibilityChange(isVisible);\n }\n },\n [onPopupVisibilityChange],\n );\n\n /**\n * This function prevents formatting from being adopted when texts are inserted. To do this, the\n * plain text is read from the event after the default behavior has been prevented. The plain\n * text is then inserted at the correct position in the input field using document.execCommand('insertHTML')\n */\n const handlePaste = useCallback(\n (event: ClipboardEvent<HTMLDivElement>) => {\n if (editorRef.current) {\n event.preventDefault();\n\n if (isDisabled) {\n event.stopPropagation();\n\n return;\n }\n\n let text = event.clipboardData.getData('text/plain');\n\n text = convertEmojisToUnicode(text);\n\n // This deprecated function is used, because it causes the inserted content to be added to the undo stack.\n // If the text were to be inserted directly into the 'innerHTML' of the editor element, the undo stack would not be updated.\n // In that case on CTRL+Z the inserted text would not be removed.\n document.execCommand('insertHTML', false, text);\n\n const newEvent = new Event('input', { bubbles: true });\n\n editorRef.current.dispatchEvent(newEvent);\n }\n },\n [isDisabled],\n );\n\n /**\n * This function prevents formatting from being adopted when texts are dropped. To do this, the\n * plain text is read from the event after the default behavior has been prevented. The plain\n * text is then inserted at the correct position in the input field using document.execCommand('insertHTML')\n */\n const handleDrop = useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n if (editorRef.current) {\n event.preventDefault();\n\n if (isDisabled) {\n event.stopPropagation();\n\n return;\n }\n\n let text = event.dataTransfer?.getData('text');\n\n if (!text) {\n return;\n }\n\n text = convertEmojisToUnicode(text);\n\n // This deprecated function is used, because it causes the inserted content to be added to the undo stack.\n // If the text were to be inserted directly into the 'innerHTML' of the editor element, the undo stack would not be updated.\n // In that case on CTRL+Z the inserted text would not be removed.\n document.execCommand('insertHTML', false, text);\n\n const newEvent = new Event('input', { bubbles: true });\n\n editorRef.current.dispatchEvent(newEvent);\n }\n },\n [isDisabled],\n );\n\n /**\n * This function uses the 'insertTextAtCursorPosition' function to insert the emoji at the\n * correct position in the editor element.\n *\n * At the end an 'input' event is dispatched, so that the function 'handleInput' is triggered,\n * which in turn executes the 'onInput' function from the props. So this serves to ensure that\n * the event is also passed through to the top when inserting via the popup.\n */\n const handlePopupSelect = useCallback((emoji: string) => {\n if (editorRef.current) {\n insertTextAtCursorPosition({\n editorElement: editorRef.current,\n text: emoji,\n shouldUseSavedSelection: true,\n });\n\n const event = new Event('input', { bubbles: true });\n\n editorRef.current.dispatchEvent(event);\n }\n }, []);\n\n useEffect(() => {\n if (typeof onPrefixElementRemove !== 'function') {\n return;\n }\n\n if (!hasPrefixRendered.current) {\n return;\n }\n\n const convertedText = convertHTMLToText(editorRef.current?.innerHTML ?? '').replace(\n '&nbsp;',\n ' ',\n );\n const convertedPrefix = prefixElement && prefixElement.replace('&nbsp;', ' ');\n\n if (\n (convertedPrefix &&\n convertedText.includes(convertedPrefix) &&\n convertedText.length > convertedPrefix.length) ||\n convertedPrefix === convertedText\n ) {\n return;\n }\n\n if (hasPrefixChanged.current) {\n hasPrefixChanged.current = false;\n\n return;\n }\n\n onPrefixElementRemove();\n hasPrefixRendered.current = false;\n }, [onPrefixElementRemove, plainTextValue.length, prefixElement]);\n\n useEffect(() => {\n if (typeof prefixElement === 'string') {\n hasPrefixChanged.current = true;\n }\n }, [prefixElement]);\n\n useEffect(() => {\n if (value !== plainTextValue) {\n setPlainTextValue(value);\n\n handleUpdateHTML(value);\n }\n }, [handleUpdateHTML, plainTextValue, value]);\n\n // This effect is used to call the 'handleUpdateHTML' function once after the component has been\n // rendered. This is necessary because the 'contentEditable' element otherwise does not display\n // the HTML content correctly when the component is rendered for the first time.\n useIsomorphicLayoutEffect(() => {\n handleUpdateHTML(valueRef.current);\n }, [handleUpdateHTML]);\n\n const handleInsertTextAtCursorPosition = useCallback((text: string) => {\n if (editorRef.current) {\n insertTextAtCursorPosition({ editorElement: editorRef.current, text });\n\n const newEvent = new Event('input', { bubbles: true });\n\n editorRef.current.dispatchEvent(newEvent);\n }\n }, []);\n\n const handleReplaceText = useCallback((searchText: string, pasteText: string) => {\n if (editorRef.current) {\n replaceText({ editorElement: editorRef.current, searchText, pasteText });\n\n const newEvent = new Event('input', { bubbles: true });\n\n editorRef.current.dispatchEvent(newEvent);\n }\n }, []);\n\n const handleStartProgress = useCallback((duration: number) => {\n setProgressDuration(duration);\n }, []);\n\n const handleStopProgress = useCallback(() => {\n setProgressDuration(0);\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n insertTextAtCursorPosition: handleInsertTextAtCursorPosition,\n replaceText: handleReplaceText,\n startProgress: handleStartProgress,\n stopProgress: handleStopProgress,\n }),\n [\n handleInsertTextAtCursorPosition,\n handleReplaceText,\n handleStartProgress,\n handleStopProgress,\n ],\n );\n\n useEffect(() => {\n /**\n * This function ensures that the input field does not lose focus when the popup is opened\n * or an emoji is selected in it. For this purpose the corresponding elements get the class\n * 'prevent-lose-focus'.\n *\n * The class can also be set to any other elements that should also not cause the input\n * field to lose focus.\n */\n const handlePreventLoseFocus = (event: MouseEvent) => {\n const element = event.target as Element;\n\n if (\n element.classList.contains('prevent-lose-focus') ||\n element.parentElement?.classList.contains('prevent-lose-focus') ||\n element.parentElement?.parentElement?.classList.contains('prevent-lose-focus')\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n document.body.addEventListener('mousedown', handlePreventLoseFocus);\n\n return () => {\n document.body.removeEventListener('mousedown', handlePreventLoseFocus);\n };\n }, []);\n\n const shouldShowPlaceholder = useMemo(() => {\n if (!isPrefixAnimationFinished) {\n return false;\n }\n\n const isJustPrefixElement =\n prefixElement && convertTextToHTML(prefixElement) === editorRef.current?.innerHTML;\n\n const shouldRenderPlaceholder =\n (prefixElement && !plainTextValue) ||\n (prefixElement ? prefixElementWidth && prefixElementWidth > 0 : true);\n\n switch (true) {\n case (!plainTextValue || isJustPrefixElement) &&\n shouldHidePlaceholderOnFocus &&\n !hasFocus:\n case (!plainTextValue || isJustPrefixElement) && !shouldHidePlaceholderOnFocus:\n return shouldRenderPlaceholder;\n case (!plainTextValue || isJustPrefixElement) &&\n shouldHidePlaceholderOnFocus &&\n hasFocus:\n return false;\n default:\n return false;\n }\n }, [\n isPrefixAnimationFinished,\n hasFocus,\n plainTextValue,\n prefixElement,\n shouldHidePlaceholderOnFocus,\n prefixElementWidth,\n ]);\n\n useEffect(() => {\n if (prefixElement) {\n setIsPrefixAnimationFinished(false);\n }\n }, [prefixElement]);\n\n const handleFocus = (event: FocusEvent<HTMLDivElement>) => {\n if (typeof onFocus === 'function' && !isDisabled) {\n onFocus(event);\n }\n\n setHasFocus(true);\n };\n\n const handleBlur = (event: FocusEvent<HTMLDivElement>) => {\n if (typeof onBlur === 'function' && !isDisabled) {\n onBlur(event);\n }\n\n setHasFocus(false);\n };\n\n useEffect(() => {\n if (editorRef.current && prefixElement) {\n const text = convertEmojisToUnicode(prefixElement);\n\n insertTextAtCursorPosition({ editorElement: editorRef.current, text });\n\n handleUpdateHTML(prefixElement);\n hasPrefixRendered.current = true;\n }\n }, [handleUpdateHTML, prefixElement]);\n\n useEffect(() => {\n if (\n prefixElementRef.current &&\n prefixElement &&\n convertTextToHTML(prefixElement) === editorRef.current?.innerHTML\n ) {\n setPrefixElementWidth(prefixElementRef.current.offsetWidth + 2);\n } else {\n setPrefixElementWidth(undefined);\n }\n }, [plainTextValue, prefixElement]);\n\n useEffect(() => {\n const handleResize = () => {\n if (editorRef.current) {\n setLabelWidth(editorRef.current.offsetWidth);\n }\n };\n\n const resizeObserver = new ResizeObserver(handleResize);\n\n if (editorRef.current) {\n resizeObserver.observe(editorRef.current);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, []);\n\n useEffect(() => {\n const blurElement = () => {\n if (\n editorRef.current &&\n document.activeElement === editorRef.current &&\n isDisabled\n ) {\n editorRef.current.blur();\n }\n };\n\n document.addEventListener('focus', blurElement, true);\n\n return () => {\n document.removeEventListener('focus', blurElement, true);\n };\n }, [isDisabled]);\n\n return (\n <StyledEmojiInput $isDisabled={isDisabled} $shouldChangeColor={shouldChangeColor}>\n <AnimatePresence initial>\n {progressDuration > 0 && (\n <StyledMotionEmojiInputProgress\n animate={{ width: '100%' }}\n exit={{ opacity: 0 }}\n initial={{ opacity: 1, width: '0%' }}\n transition={{\n width: {\n ease: 'linear',\n duration: progressDuration,\n },\n opacity: {\n type: 'tween',\n duration: 0.3,\n },\n }}\n />\n )}\n </AnimatePresence>\n <StyledEmojiInputContent>\n {prefixElement && (\n <PrefixElement\n key={prefixElement}\n element={prefixElement}\n prefixElementRef={prefixElementRef}\n setIsPrefixAnimationFinished={setIsPrefixAnimationFinished}\n />\n )}\n <StyledMotionEmojiInputEditor\n $browser={browser?.name}\n animate={{ maxHeight: height ?? maxHeight, minHeight: height ?? '26px' }}\n contentEditable={!isDisabled}\n id={inputId}\n onBeforeInput={handleBeforeInput}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onInput={handleInput}\n onKeyDown={handleKeyDown}\n onPaste={handlePaste}\n onDrop={handleDrop}\n ref={editorRef}\n $shouldShowContent={isPrefixAnimationFinished}\n transition={{ type: 'tween', duration: 0.2 }}\n />\n\n {shouldShowPlaceholder && (\n <StyledEmojiInputLabel\n $maxWidth={labelWidth}\n $offsetWidth={prefixElementWidth}\n >\n {placeholder}\n </StyledEmojiInputLabel>\n )}\n {!isTouch && !shouldPreventEmojiPicker && (\n <EmojiPickerPopup\n accessToken={accessToken}\n onSelect={handlePopupSelect}\n onPopupVisibilityChange={handlePopupVisibility}\n personId={personId}\n />\n )}\n </StyledEmojiInputContent>\n {rightElement && (\n <StyledEmojiInputRightWrapper>{rightElement}</StyledEmojiInputRightWrapper>\n )}\n </StyledEmojiInput>\n );\n },\n);\n\nEmojiInput.displayName = 'EmojiInput';\n\nexport default EmojiInput;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,UAAU,QAAQ,yBAAyB;AACjE,SAASC,SAAS,QAAQ,YAAY;AACtC,SAASC,eAAe,QAAQ,eAAe;AAC/C,OAAOC,KAAK,IAMRC,UAAU,EAKVC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,mBAAmB,EACnBC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAEL,OAAO;AAEd,SAASC,sBAAsB,QAAQ,mBAAmB;AAC1D,SAASC,0BAA0B,EAAEC,WAAW,QAAQ,oBAAoB;AAC5E,SACIC,4BAA4B,EAC5BC,2BAA2B,EAC3BC,gBAAgB,EAChBC,aAAa,QACV,uBAAuB;AAC9B,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,kBAAkB;AACvE,OAAOC,gBAAgB,MAAM,wCAAwC;AACrE,SACIC,gBAAgB,EAChBC,uBAAuB,EACvBC,qBAAqB,EACrBC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,8BAA8B,QAC3B,qBAAqB;AAC5B,OAAOC,aAAa,MAAM,gCAAgC;AAE1D,MAAMC,yBAAyB,GAAG,OAAOC,MAAM,KAAK,WAAW,GAAGtB,eAAe,GAAGF,SAAS;AA8F7F,M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