@chayns-components/emoji-input 5.0.0-beta.576 → 5.0.0-beta.578

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 (206) hide show
  1. package/lib/cjs/api/item-storage/get.js +36 -0
  2. package/lib/cjs/api/item-storage/get.js.map +1 -0
  3. package/lib/cjs/api/item-storage/put.js +41 -0
  4. package/lib/cjs/api/item-storage/put.js.map +1 -0
  5. package/lib/cjs/components/emoji-input/EmojiInput.js +466 -0
  6. package/lib/cjs/components/emoji-input/EmojiInput.js.map +1 -0
  7. package/lib/cjs/components/emoji-input/EmojiInput.styles.js +141 -0
  8. package/lib/cjs/components/emoji-input/EmojiInput.styles.js.map +1 -0
  9. package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.js +45 -0
  10. package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.js.map +1 -0
  11. package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.styles.js +65 -0
  12. package/lib/cjs/components/emoji-input/prefix-element/PrefixElement.styles.js.map +1 -0
  13. package/lib/cjs/components/emoji-picker/EmojiPicker.js +49 -0
  14. package/lib/cjs/components/emoji-picker/EmojiPicker.js.map +1 -0
  15. package/lib/cjs/components/emoji-picker/EmojiPicker.styles.js +23 -0
  16. package/lib/cjs/components/emoji-picker/EmojiPicker.styles.js.map +1 -0
  17. package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +102 -0
  18. package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +1 -0
  19. package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js +25 -0
  20. package/lib/cjs/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +1 -0
  21. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +241 -0
  22. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -0
  23. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +69 -0
  24. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +1 -0
  25. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js +144 -0
  26. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +1 -0
  27. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +24 -0
  28. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +1 -0
  29. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +130 -0
  30. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +1 -0
  31. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +99 -0
  32. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +1 -0
  33. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js +157 -0
  34. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -0
  35. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js +92 -0
  36. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -0
  37. package/lib/cjs/constants/alignment.js +19 -0
  38. package/lib/cjs/constants/alignment.js.map +1 -0
  39. package/lib/cjs/constants/categories.js +19 -0
  40. package/lib/cjs/constants/categories.js.map +1 -0
  41. package/lib/cjs/constants/emoji.js +3804 -0
  42. package/lib/cjs/constants/emoji.js.map +1 -0
  43. package/lib/cjs/constants/externalServerUrl.js +8 -0
  44. package/lib/cjs/constants/externalServerUrl.js.map +1 -0
  45. package/lib/cjs/constants/regex.js +14 -0
  46. package/lib/cjs/constants/regex.js.map +1 -0
  47. package/lib/cjs/hooks/emojiHistory.js +89 -0
  48. package/lib/cjs/hooks/emojiHistory.js.map +1 -0
  49. package/lib/cjs/index.js +42 -0
  50. package/lib/cjs/index.js.map +1 -0
  51. package/lib/cjs/types/api.js.map +1 -0
  52. package/lib/cjs/types/category.js.map +1 -0
  53. package/lib/cjs/utils/emoji.js +105 -0
  54. package/lib/cjs/utils/emoji.js.map +1 -0
  55. package/lib/cjs/utils/environment.js +33 -0
  56. package/lib/cjs/utils/environment.js.map +1 -0
  57. package/lib/cjs/utils/font.js +17 -0
  58. package/lib/cjs/utils/font.js.map +1 -0
  59. package/lib/cjs/utils/insert.js +98 -0
  60. package/lib/cjs/utils/insert.js.map +1 -0
  61. package/lib/cjs/utils/number.js +17 -0
  62. package/lib/cjs/utils/number.js.map +1 -0
  63. package/lib/cjs/utils/selection.js +214 -0
  64. package/lib/cjs/utils/selection.js.map +1 -0
  65. package/lib/cjs/utils/text.js +57 -0
  66. package/lib/cjs/utils/text.js.map +1 -0
  67. package/lib/esm/api/item-storage/get.js.map +1 -0
  68. package/lib/esm/api/item-storage/put.js.map +1 -0
  69. package/lib/esm/components/emoji-input/EmojiInput.js.map +1 -0
  70. package/lib/esm/components/emoji-input/EmojiInput.styles.js.map +1 -0
  71. package/lib/esm/components/emoji-input/prefix-element/PrefixElement.js.map +1 -0
  72. package/lib/esm/components/emoji-input/prefix-element/PrefixElement.styles.js.map +1 -0
  73. package/lib/esm/components/emoji-picker/EmojiPicker.js.map +1 -0
  74. package/lib/esm/components/emoji-picker/EmojiPicker.styles.js.map +1 -0
  75. package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +1 -0
  76. package/lib/esm/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +1 -0
  77. package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -0
  78. package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +1 -0
  79. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +1 -0
  80. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +1 -0
  81. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +1 -0
  82. package/lib/esm/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +1 -0
  83. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -0
  84. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -0
  85. package/lib/esm/constants/alignment.js.map +1 -0
  86. package/lib/esm/constants/categories.js.map +1 -0
  87. package/lib/esm/constants/emoji.js.map +1 -0
  88. package/lib/esm/constants/externalServerUrl.js.map +1 -0
  89. package/lib/esm/constants/regex.js.map +1 -0
  90. package/lib/esm/hooks/emojiHistory.js.map +1 -0
  91. package/lib/esm/index.js.map +1 -0
  92. package/lib/esm/types/api.js +2 -0
  93. package/lib/esm/types/api.js.map +1 -0
  94. package/lib/esm/types/category.js +2 -0
  95. package/lib/esm/types/category.js.map +1 -0
  96. package/lib/esm/utils/emoji.js.map +1 -0
  97. package/lib/esm/utils/environment.js.map +1 -0
  98. package/lib/esm/utils/font.js.map +1 -0
  99. package/lib/esm/utils/insert.js.map +1 -0
  100. package/lib/esm/utils/number.js.map +1 -0
  101. package/lib/esm/utils/selection.js.map +1 -0
  102. package/lib/esm/utils/text.js.map +1 -0
  103. package/lib/{components → types/components}/emoji-input/EmojiInput.styles.d.ts +1 -1
  104. package/lib/{components → types/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.d.ts +1 -1
  105. package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.d.ts +1 -1
  106. package/package.json +17 -7
  107. package/lib/api/item-storage/get.js.map +0 -1
  108. package/lib/api/item-storage/put.js.map +0 -1
  109. package/lib/components/emoji-input/EmojiInput.js.map +0 -1
  110. package/lib/components/emoji-input/EmojiInput.styles.js.map +0 -1
  111. package/lib/components/emoji-input/prefix-element/PrefixElement.js.map +0 -1
  112. package/lib/components/emoji-input/prefix-element/PrefixElement.styles.js.map +0 -1
  113. package/lib/components/emoji-picker/EmojiPicker.js.map +0 -1
  114. package/lib/components/emoji-picker/EmojiPicker.styles.js.map +0 -1
  115. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +0 -1
  116. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +0 -1
  117. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +0 -1
  118. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +0 -1
  119. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +0 -1
  120. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +0 -1
  121. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +0 -1
  122. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +0 -1
  123. package/lib/components/emoji-picker-popup/EmojiPickerPopup.js.map +0 -1
  124. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +0 -1
  125. package/lib/constants/alignment.js.map +0 -1
  126. package/lib/constants/categories.js.map +0 -1
  127. package/lib/constants/emoji-de-DE.json +0 -3827
  128. package/lib/constants/emoji.js.map +0 -1
  129. package/lib/constants/externalServerUrl.js.map +0 -1
  130. package/lib/constants/regex.js.map +0 -1
  131. package/lib/hooks/emojiHistory.js.map +0 -1
  132. package/lib/index.js.map +0 -1
  133. package/lib/types/api.js.map +0 -1
  134. package/lib/types/category.js.map +0 -1
  135. package/lib/utils/emoji.js.map +0 -1
  136. package/lib/utils/environment.js.map +0 -1
  137. package/lib/utils/font.js.map +0 -1
  138. package/lib/utils/insert.js.map +0 -1
  139. package/lib/utils/number.js.map +0 -1
  140. package/lib/utils/selection.js.map +0 -1
  141. package/lib/utils/text.js.map +0 -1
  142. /package/lib/{types → cjs/types}/api.js +0 -0
  143. /package/lib/{types → cjs/types}/category.js +0 -0
  144. /package/lib/{api → esm/api}/item-storage/get.js +0 -0
  145. /package/lib/{api → esm/api}/item-storage/put.js +0 -0
  146. /package/lib/{components → esm/components}/emoji-input/EmojiInput.js +0 -0
  147. /package/lib/{components → esm/components}/emoji-input/EmojiInput.styles.js +0 -0
  148. /package/lib/{components → esm/components}/emoji-input/prefix-element/PrefixElement.js +0 -0
  149. /package/lib/{components → esm/components}/emoji-input/prefix-element/PrefixElement.styles.js +0 -0
  150. /package/lib/{components → esm/components}/emoji-picker/EmojiPicker.js +0 -0
  151. /package/lib/{components → esm/components}/emoji-picker/EmojiPicker.styles.js +0 -0
  152. /package/lib/{components → esm/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +0 -0
  153. /package/lib/{components → esm/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js +0 -0
  154. /package/lib/{components → esm/components}/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +0 -0
  155. /package/lib/{components → esm/components}/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +0 -0
  156. /package/lib/{components → esm/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.js +0 -0
  157. /package/lib/{components → esm/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +0 -0
  158. /package/lib/{components → esm/components}/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +0 -0
  159. /package/lib/{components → esm/components}/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +0 -0
  160. /package/lib/{components → esm/components}/emoji-picker-popup/EmojiPickerPopup.js +0 -0
  161. /package/lib/{components → esm/components}/emoji-picker-popup/EmojiPickerPopup.styles.js +0 -0
  162. /package/lib/{constants → esm/constants}/alignment.js +0 -0
  163. /package/lib/{constants → esm/constants}/categories.js +0 -0
  164. /package/lib/{constants → esm/constants}/emoji.js +0 -0
  165. /package/lib/{constants → esm/constants}/externalServerUrl.js +0 -0
  166. /package/lib/{constants → esm/constants}/regex.js +0 -0
  167. /package/lib/{hooks → esm/hooks}/emojiHistory.js +0 -0
  168. /package/lib/{index.js → esm/index.js} +0 -0
  169. /package/lib/{utils → esm/utils}/emoji.js +0 -0
  170. /package/lib/{utils → esm/utils}/environment.js +0 -0
  171. /package/lib/{utils → esm/utils}/font.js +0 -0
  172. /package/lib/{utils → esm/utils}/insert.js +0 -0
  173. /package/lib/{utils → esm/utils}/number.js +0 -0
  174. /package/lib/{utils → esm/utils}/selection.js +0 -0
  175. /package/lib/{utils → esm/utils}/text.js +0 -0
  176. /package/lib/{api → types/api}/item-storage/get.d.ts +0 -0
  177. /package/lib/{api → types/api}/item-storage/put.d.ts +0 -0
  178. /package/lib/{components → types/components}/emoji-input/EmojiInput.d.ts +0 -0
  179. /package/lib/{components → types/components}/emoji-input/prefix-element/PrefixElement.d.ts +0 -0
  180. /package/lib/{components → types/components}/emoji-input/prefix-element/PrefixElement.styles.d.ts +0 -0
  181. /package/lib/{components → types/components}/emoji-picker/EmojiPicker.d.ts +0 -0
  182. /package/lib/{components → types/components}/emoji-picker/EmojiPicker.styles.d.ts +0 -0
  183. /package/lib/{components → types/components}/emoji-picker/emoji-picker-categories/EmojiPickerCategories.d.ts +0 -0
  184. /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.d.ts +0 -0
  185. /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.d.ts +0 -0
  186. /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.d.ts +0 -0
  187. /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.d.ts +0 -0
  188. /package/lib/{components → types/components}/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.d.ts +0 -0
  189. /package/lib/{components → types/components}/emoji-picker-popup/EmojiPickerPopup.d.ts +0 -0
  190. /package/lib/{components → types/components}/emoji-picker-popup/EmojiPickerPopup.styles.d.ts +0 -0
  191. /package/lib/{constants → types/constants}/alignment.d.ts +0 -0
  192. /package/lib/{constants → types/constants}/categories.d.ts +0 -0
  193. /package/lib/{constants → types/constants}/emoji.d.ts +0 -0
  194. /package/lib/{constants → types/constants}/externalServerUrl.d.ts +0 -0
  195. /package/lib/{constants → types/constants}/regex.d.ts +0 -0
  196. /package/lib/{hooks → types/hooks}/emojiHistory.d.ts +0 -0
  197. /package/lib/{index.d.ts → types/index.d.ts} +0 -0
  198. /package/lib/types/{api.d.ts → types/api.d.ts} +0 -0
  199. /package/lib/types/{category.d.ts → types/category.d.ts} +0 -0
  200. /package/lib/{utils → types/utils}/emoji.d.ts +0 -0
  201. /package/lib/{utils → types/utils}/environment.d.ts +0 -0
  202. /package/lib/{utils → types/utils}/font.d.ts +0 -0
  203. /package/lib/{utils → types/utils}/insert.d.ts +0 -0
  204. /package/lib/{utils → types/utils}/number.d.ts +0 -0
  205. /package/lib/{utils → types/utils}/selection.d.ts +0 -0
  206. /package/lib/{utils → types/utils}/text.d.ts +0 -0
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getEmojiHistory = void 0;
7
+ var _externalServerUrl = require("../../constants/externalServerUrl");
8
+ const getEmojiHistory = async ({
9
+ accessToken,
10
+ personId
11
+ }) => {
12
+ const requestInit = {
13
+ headers: {
14
+ Authorization: `Bearer ${accessToken}`
15
+ },
16
+ method: 'GET'
17
+ };
18
+ const url = `${_externalServerUrl.ITEM_STORAGE_BASE_URL}/7/users/${personId}/keys/emojis`;
19
+ const response = await fetch(url, requestInit);
20
+ if (response.status === 200) {
21
+ try {
22
+ const data = await response.json();
23
+ return {
24
+ data: data.value,
25
+ status: 200
26
+ };
27
+ } catch (e) {
28
+ // Do nothing
29
+ }
30
+ }
31
+ return {
32
+ status: response.status
33
+ };
34
+ };
35
+ exports.getEmojiHistory = getEmojiHistory;
36
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","names":["_externalServerUrl","require","getEmojiHistory","accessToken","personId","requestInit","headers","Authorization","method","url","ITEM_STORAGE_BASE_URL","response","fetch","status","data","json","value","e","exports"],"sources":["../../../../src/api/item-storage/get.ts"],"sourcesContent":["import { ITEM_STORAGE_BASE_URL } from '../../constants/externalServerUrl';\nimport type { HistoryItem } from '../../hooks/emojiHistory';\nimport type { ApiFunctionResult } from '../../types/api';\n\ninterface GetEmojiHistoryOptions {\n accessToken: string;\n personId: string;\n}\n\ninterface GetEmojiHistoryResponseData {\n key: string;\n personId: string;\n schemeId: string;\n value: HistoryItem[];\n}\n\nexport const getEmojiHistory = async ({\n accessToken,\n personId,\n}: GetEmojiHistoryOptions): Promise<ApiFunctionResult<HistoryItem[]>> => {\n const requestInit: RequestInit = {\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n method: 'GET',\n };\n\n const url = `${ITEM_STORAGE_BASE_URL}/7/users/${personId}/keys/emojis`;\n\n const response = await fetch(url, requestInit);\n\n if (response.status === 200) {\n try {\n const data = (await response.json()) as GetEmojiHistoryResponseData;\n\n return { data: data.value, status: 200 };\n } catch (e) {\n // Do nothing\n }\n }\n\n return { status: response.status };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAgBO,MAAMC,eAAe,GAAG,MAAAA,CAAO;EAClCC,WAAW;EACXC;AACoB,CAAC,KAAgD;EACrE,MAAMC,WAAwB,GAAG;IAC7BC,OAAO,EAAE;MACLC,aAAa,EAAG,UAASJ,WAAY;IACzC,CAAC;IACDK,MAAM,EAAE;EACZ,CAAC;EAED,MAAMC,GAAG,GAAI,GAAEC,wCAAsB,YAAWN,QAAS,cAAa;EAEtE,MAAMO,QAAQ,GAAG,MAAMC,KAAK,CAACH,GAAG,EAAEJ,WAAW,CAAC;EAE9C,IAAIM,QAAQ,CAACE,MAAM,KAAK,GAAG,EAAE;IACzB,IAAI;MACA,MAAMC,IAAI,GAAI,MAAMH,QAAQ,CAACI,IAAI,CAAC,CAAiC;MAEnE,OAAO;QAAED,IAAI,EAAEA,IAAI,CAACE,KAAK;QAAEH,MAAM,EAAE;MAAI,CAAC;IAC5C,CAAC,CAAC,OAAOI,CAAC,EAAE;MACR;IAAA;EAER;EAEA,OAAO;IAAEJ,MAAM,EAAEF,QAAQ,CAACE;EAAO,CAAC;AACtC,CAAC;AAACK,OAAA,CAAAhB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.putEmojiHistory = void 0;
7
+ var _externalServerUrl = require("../../constants/externalServerUrl");
8
+ const putEmojiHistory = async ({
9
+ accessToken,
10
+ personId,
11
+ value
12
+ }) => {
13
+ const requestInit = {
14
+ body: JSON.stringify({
15
+ value
16
+ }),
17
+ headers: {
18
+ Authorization: `Bearer ${accessToken}`,
19
+ 'Content-Type': 'application/json'
20
+ },
21
+ method: 'PUT'
22
+ };
23
+ const url = `${_externalServerUrl.ITEM_STORAGE_BASE_URL}/7/users/${personId}/keys/emojis`;
24
+ const response = await fetch(url, requestInit);
25
+ if (response.status === 201) {
26
+ try {
27
+ const data = await response.json();
28
+ return {
29
+ data: data.value,
30
+ status: 200
31
+ };
32
+ } catch (e) {
33
+ // Do nothing
34
+ }
35
+ }
36
+ return {
37
+ status: response.status
38
+ };
39
+ };
40
+ exports.putEmojiHistory = putEmojiHistory;
41
+ //# sourceMappingURL=put.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"put.js","names":["_externalServerUrl","require","putEmojiHistory","accessToken","personId","value","requestInit","body","JSON","stringify","headers","Authorization","method","url","ITEM_STORAGE_BASE_URL","response","fetch","status","data","json","e","exports"],"sources":["../../../../src/api/item-storage/put.ts"],"sourcesContent":["import { ITEM_STORAGE_BASE_URL } from '../../constants/externalServerUrl';\nimport type { HistoryItem } from '../../hooks/emojiHistory';\nimport type { ApiFunctionResult } from '../../types/api';\n\ninterface PutEmojiHistoryOptions {\n accessToken: string;\n personId: string;\n value: HistoryItem[];\n}\n\ninterface PutEmojiHistoryResponseData {\n key: string;\n personId: string;\n schemeId: string;\n value: HistoryItem[];\n}\n\nexport const putEmojiHistory = async ({\n accessToken,\n personId,\n value,\n}: PutEmojiHistoryOptions): Promise<ApiFunctionResult<HistoryItem[]>> => {\n const requestInit: RequestInit = {\n body: JSON.stringify({ value }),\n headers: {\n Authorization: `Bearer ${accessToken}`,\n 'Content-Type': 'application/json',\n },\n method: 'PUT',\n };\n\n const url = `${ITEM_STORAGE_BASE_URL}/7/users/${personId}/keys/emojis`;\n\n const response = await fetch(url, requestInit);\n\n if (response.status === 201) {\n try {\n const data = (await response.json()) as PutEmojiHistoryResponseData;\n\n return { data: data.value, status: 200 };\n } catch (e) {\n // Do nothing\n }\n }\n\n return { status: response.status };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAiBO,MAAMC,eAAe,GAAG,MAAAA,CAAO;EAClCC,WAAW;EACXC,QAAQ;EACRC;AACoB,CAAC,KAAgD;EACrE,MAAMC,WAAwB,GAAG;IAC7BC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;MAAEJ;IAAM,CAAC,CAAC;IAC/BK,OAAO,EAAE;MACLC,aAAa,EAAG,UAASR,WAAY,EAAC;MACtC,cAAc,EAAE;IACpB,CAAC;IACDS,MAAM,EAAE;EACZ,CAAC;EAED,MAAMC,GAAG,GAAI,GAAEC,wCAAsB,YAAWV,QAAS,cAAa;EAEtE,MAAMW,QAAQ,GAAG,MAAMC,KAAK,CAACH,GAAG,EAAEP,WAAW,CAAC;EAE9C,IAAIS,QAAQ,CAACE,MAAM,KAAK,GAAG,EAAE;IACzB,IAAI;MACA,MAAMC,IAAI,GAAI,MAAMH,QAAQ,CAACI,IAAI,CAAC,CAAiC;MAEnE,OAAO;QAAED,IAAI,EAAEA,IAAI,CAACb,KAAK;QAAEY,MAAM,EAAE;MAAI,CAAC;IAC5C,CAAC,CAAC,OAAOG,CAAC,EAAE;MACR;IAAA;EAER;EAEA,OAAO;IAAEH,MAAM,EAAEF,QAAQ,CAACE;EAAO,CAAC;AACtC,CAAC;AAACI,OAAA,CAAAnB,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,466 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _core = require("@chayns-components/core");
8
+ var _chaynsApi = require("chayns-api");
9
+ var _framerMotion = require("framer-motion");
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ var _emoji = require("../../utils/emoji");
12
+ var _environment = require("../../utils/environment");
13
+ var _insert = require("../../utils/insert");
14
+ var _selection = require("../../utils/selection");
15
+ var _text = require("../../utils/text");
16
+ var _EmojiPickerPopup = _interopRequireDefault(require("../emoji-picker-popup/EmojiPickerPopup"));
17
+ var _EmojiInput = require("./EmojiInput.styles");
18
+ var _PrefixElement = _interopRequireDefault(require("./prefix-element/PrefixElement"));
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
+ 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); }
21
+ 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; }
22
+ const EmojiInput = /*#__PURE__*/(0, _react.forwardRef)(({
23
+ accessToken,
24
+ height,
25
+ inputId,
26
+ isDisabled,
27
+ maxHeight = '190px',
28
+ onBlur,
29
+ onFocus,
30
+ onInput,
31
+ onKeyDown,
32
+ onPrefixElementRemove,
33
+ onPopupVisibilityChange,
34
+ personId,
35
+ placeholder,
36
+ popupAlignment,
37
+ prefixElement,
38
+ rightElement,
39
+ shouldHidePlaceholderOnFocus = true,
40
+ shouldPreventEmojiPicker,
41
+ value
42
+ }, ref) => {
43
+ const [isMobile] = (0, _react.useState)((0, _environment.getIsMobile)());
44
+ const [plainTextValue, setPlainTextValue] = (0, _react.useState)(value);
45
+ const [hasFocus, setHasFocus] = (0, _react.useState)(false);
46
+ const [progressDuration, setProgressDuration] = (0, _react.useState)(0);
47
+ const [labelWidth, setLabelWidth] = (0, _react.useState)(0);
48
+ const [isPopupVisible, setIsPopupVisible] = (0, _react.useState)(false);
49
+ const [isPrefixAnimationFinished, setIsPrefixAnimationFinished] = (0, _react.useState)(!prefixElement);
50
+ const [prefixElementWidth, setPrefixElementWidth] = (0, _react.useState)();
51
+ const areaProvider = (0, _react.useContext)(_core.AreaContext);
52
+ const editorRef = (0, _react.useRef)(null);
53
+ const prefixElementRef = (0, _react.useRef)(null);
54
+ const hasPrefixRendered = (0, _react.useRef)(false);
55
+ const shouldDeleteOneMoreBackwards = (0, _react.useRef)(false);
56
+ const shouldDeleteOneMoreForwards = (0, _react.useRef)(false);
57
+ const valueRef = (0, _react.useRef)(value);
58
+ const {
59
+ browser
60
+ } = (0, _chaynsApi.getDevice)();
61
+ const shouldChangeColor = (0, _react.useMemo)(() => areaProvider.shouldChangeColor ?? false, [areaProvider.shouldChangeColor]);
62
+
63
+ /**
64
+ * This function updates the content of the 'contentEditable' element if the new text is
65
+ * different from the previous content. So this is only true if, for example, a text like ":-)"
66
+ * has been replaced to the corresponding emoji.
67
+ *
68
+ * When updating the HTML, the current cursor position is saved before replacing the content, so
69
+ * that it can be set again afterward.
70
+ */
71
+ const handleUpdateHTML = (0, _react.useCallback)(html => {
72
+ if (!editorRef.current) {
73
+ return;
74
+ }
75
+ let newInnerHTML = (0, _emoji.convertEmojisToUnicode)(html);
76
+ newInnerHTML = (0, _text.convertTextToHTML)(newInnerHTML);
77
+ if (newInnerHTML !== editorRef.current.innerHTML) {
78
+ (0, _selection.saveSelection)(editorRef.current, {
79
+ shouldIgnoreEmptyTextNodes: true
80
+ });
81
+ editorRef.current.innerHTML = newInnerHTML;
82
+ (0, _selection.restoreSelection)(editorRef.current);
83
+ }
84
+ }, []);
85
+ const handleBeforeInput = (0, _react.useCallback)(event => {
86
+ if (!editorRef.current) {
87
+ return;
88
+ }
89
+ if (isDisabled) {
90
+ event.preventDefault();
91
+ event.stopPropagation();
92
+ return;
93
+ }
94
+ const {
95
+ data,
96
+ type
97
+ } = event.nativeEvent;
98
+ if (type === 'textInput' && data && data.includes('\n')) {
99
+ event.preventDefault();
100
+ event.stopPropagation();
101
+ const text = (0, _emoji.convertEmojisToUnicode)(data);
102
+ (0, _insert.insertTextAtCursorPosition)({
103
+ editorElement: editorRef.current,
104
+ text
105
+ });
106
+ const newEvent = new Event('input', {
107
+ bubbles: true
108
+ });
109
+ editorRef.current.dispatchEvent(newEvent);
110
+ }
111
+ }, [isDisabled]);
112
+
113
+ /**
114
+ * This function handles the 'input' events of the 'contentEditable' element and also passes the
115
+ * respective event up accordingly if the 'onInput' property is a function.
116
+ */
117
+ const handleInput = (0, _react.useCallback)(event => {
118
+ if (!editorRef.current) {
119
+ return;
120
+ }
121
+ if (isDisabled) {
122
+ event.stopPropagation();
123
+ event.preventDefault();
124
+ }
125
+ if (shouldDeleteOneMoreBackwards.current) {
126
+ shouldDeleteOneMoreBackwards.current = false;
127
+ shouldDeleteOneMoreForwards.current = false;
128
+ event.preventDefault();
129
+ event.stopPropagation();
130
+
131
+ // noinspection JSDeprecatedSymbols
132
+ document.execCommand('delete', false);
133
+ return;
134
+ }
135
+ if (shouldDeleteOneMoreForwards.current) {
136
+ shouldDeleteOneMoreBackwards.current = false;
137
+ shouldDeleteOneMoreForwards.current = false;
138
+ event.preventDefault();
139
+ event.stopPropagation();
140
+
141
+ // noinspection JSDeprecatedSymbols
142
+ document.execCommand('forwardDelete', false);
143
+ return;
144
+ }
145
+ handleUpdateHTML(editorRef.current.innerHTML);
146
+ const text = (0, _text.convertHTMLToText)(editorRef.current.innerHTML);
147
+ setPlainTextValue(text);
148
+ if (typeof onInput === 'function') {
149
+ onInput(event, text);
150
+ }
151
+ }, [handleUpdateHTML, isDisabled, onInput]);
152
+ const handleKeyDown = (0, _react.useCallback)(event => {
153
+ if (isDisabled) {
154
+ event.preventDefault();
155
+ event.stopPropagation();
156
+ return;
157
+ }
158
+ if (event.key === 'Enter' && isPopupVisible) {
159
+ event.preventDefault();
160
+ return;
161
+ }
162
+ if (typeof onKeyDown === 'function') {
163
+ onKeyDown(event);
164
+ }
165
+ if (event.key === 'Enter' && !event.isPropagationStopped() && editorRef.current) {
166
+ event.preventDefault();
167
+
168
+ // noinspection JSDeprecatedSymbols
169
+ document.execCommand('insertLineBreak', false);
170
+ }
171
+ if (event.key === 'Backspace' || event.key === 'Delete') {
172
+ const charCodeThatWillBeDeleted = (0, _selection.getCharCodeThatWillBeDeleted)(event);
173
+ if (charCodeThatWillBeDeleted === 8203) {
174
+ if (event.key === 'Backspace') {
175
+ shouldDeleteOneMoreBackwards.current = true;
176
+ } else {
177
+ shouldDeleteOneMoreForwards.current = true;
178
+ }
179
+ }
180
+ }
181
+ }, [isDisabled, isPopupVisible, onKeyDown]);
182
+ const handlePopupVisibility = isVisible => {
183
+ setIsPopupVisible(isVisible);
184
+ if (typeof onPopupVisibilityChange === 'function') {
185
+ onPopupVisibilityChange(isVisible);
186
+ }
187
+ };
188
+
189
+ /**
190
+ * This function prevents formatting from being adopted when texts are inserted. To do this, the
191
+ * plain text is read from the event after the default behavior has been prevented. The plain
192
+ * text is then inserted at the correct position in the input field using the
193
+ * 'insertTextAtCursorPosition' function.
194
+ */
195
+ const handlePaste = (0, _react.useCallback)(event => {
196
+ if (editorRef.current) {
197
+ event.preventDefault();
198
+ if (isDisabled) {
199
+ event.stopPropagation();
200
+ return;
201
+ }
202
+ let text = event.clipboardData.getData('text/plain');
203
+ text = (0, _emoji.convertEmojisToUnicode)(text);
204
+ (0, _insert.insertTextAtCursorPosition)({
205
+ editorElement: editorRef.current,
206
+ text
207
+ });
208
+ const newEvent = new Event('input', {
209
+ bubbles: true
210
+ });
211
+ editorRef.current.dispatchEvent(newEvent);
212
+ }
213
+ }, [isDisabled]);
214
+
215
+ /**
216
+ * This function uses the 'insertTextAtCursorPosition' function to insert the emoji at the
217
+ * correct position in the editor element.
218
+ *
219
+ * At the end an 'input' event is dispatched, so that the function 'handleInput' is triggered,
220
+ * which in turn executes the 'onInput' function from the props. So this serves to ensure that
221
+ * the event is also passed through to the top when inserting via the popup.
222
+ */
223
+ const handlePopupSelect = (0, _react.useCallback)(emoji => {
224
+ if (editorRef.current) {
225
+ (0, _insert.insertTextAtCursorPosition)({
226
+ editorElement: editorRef.current,
227
+ text: emoji
228
+ });
229
+ const event = new Event('input', {
230
+ bubbles: true
231
+ });
232
+ editorRef.current.dispatchEvent(event);
233
+ }
234
+ }, []);
235
+ (0, _react.useEffect)(() => {
236
+ var _editorRef$current;
237
+ if (typeof onPrefixElementRemove !== 'function') {
238
+ return;
239
+ }
240
+ if (!hasPrefixRendered.current) {
241
+ return;
242
+ }
243
+ const convertedText = (0, _text.convertHTMLToText)(((_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 ? void 0 : _editorRef$current.innerHTML) ?? '').replace('&nbsp;', ' ');
244
+ const convertedPrefix = prefixElement && prefixElement.replace('&nbsp;', ' ');
245
+ if (convertedPrefix && convertedText.includes(convertedPrefix) && convertedText.length > convertedPrefix.length || convertedPrefix === convertedText) {
246
+ return;
247
+ }
248
+ onPrefixElementRemove();
249
+ hasPrefixRendered.current = false;
250
+ }, [onPrefixElementRemove, plainTextValue.length, prefixElement]);
251
+ (0, _react.useEffect)(() => {
252
+ if (value !== plainTextValue) {
253
+ setPlainTextValue(value);
254
+ handleUpdateHTML(value);
255
+ }
256
+ }, [handleUpdateHTML, plainTextValue, value]);
257
+
258
+ // This effect is used to call the 'handleUpdateHTML' function once after the component has been
259
+ // rendered. This is necessary because the 'contentEditable' element otherwise does not display
260
+ // the HTML content correctly when the component is rendered for the first time.
261
+ (0, _react.useLayoutEffect)(() => {
262
+ handleUpdateHTML(valueRef.current);
263
+ }, [handleUpdateHTML]);
264
+ const handleInsertTextAtCursorPosition = (0, _react.useCallback)(text => {
265
+ if (editorRef.current) {
266
+ (0, _insert.insertTextAtCursorPosition)({
267
+ editorElement: editorRef.current,
268
+ text
269
+ });
270
+ const newEvent = new Event('input', {
271
+ bubbles: true
272
+ });
273
+ editorRef.current.dispatchEvent(newEvent);
274
+ }
275
+ }, []);
276
+ const handleReplaceText = (0, _react.useCallback)((searchText, pasteText) => {
277
+ if (editorRef.current) {
278
+ (0, _insert.replaceText)({
279
+ editorElement: editorRef.current,
280
+ searchText,
281
+ pasteText
282
+ });
283
+ const newEvent = new Event('input', {
284
+ bubbles: true
285
+ });
286
+ editorRef.current.dispatchEvent(newEvent);
287
+ }
288
+ }, []);
289
+ const handleStartProgress = (0, _react.useCallback)(duration => {
290
+ setProgressDuration(duration);
291
+ }, []);
292
+ const handleStopProgress = (0, _react.useCallback)(() => {
293
+ setProgressDuration(0);
294
+ }, []);
295
+ (0, _react.useImperativeHandle)(ref, () => ({
296
+ insertTextAtCursorPosition: handleInsertTextAtCursorPosition,
297
+ replaceText: handleReplaceText,
298
+ startProgress: handleStartProgress,
299
+ stopProgress: handleStopProgress
300
+ }), [handleInsertTextAtCursorPosition, handleReplaceText, handleStartProgress, handleStopProgress]);
301
+ (0, _react.useEffect)(() => {
302
+ /**
303
+ * This function ensures that the input field does not lose focus when the popup is opened
304
+ * or an emoji is selected in it. For this purpose the corresponding elements get the class
305
+ * 'prevent-lose-focus'.
306
+ *
307
+ * The class can also be set to any other elements that should also not cause the input
308
+ * field to lose focus.
309
+ */
310
+ const handlePreventLoseFocus = event => {
311
+ var _element$parentElemen, _element$parentElemen2;
312
+ const element = event.target;
313
+ if (element.classList.contains('prevent-lose-focus') || (_element$parentElemen = element.parentElement) !== null && _element$parentElemen !== void 0 && _element$parentElemen.classList.contains('prevent-lose-focus') || (_element$parentElemen2 = element.parentElement) !== null && _element$parentElemen2 !== void 0 && (_element$parentElemen2 = _element$parentElemen2.parentElement) !== null && _element$parentElemen2 !== void 0 && _element$parentElemen2.classList.contains('prevent-lose-focus')) {
314
+ event.preventDefault();
315
+ event.stopPropagation();
316
+ }
317
+ };
318
+ document.body.addEventListener('mousedown', handlePreventLoseFocus);
319
+ return () => {
320
+ document.body.removeEventListener('mousedown', handlePreventLoseFocus);
321
+ };
322
+ }, []);
323
+ const shouldShowPlaceholder = (0, _react.useMemo)(() => {
324
+ var _editorRef$current2;
325
+ if (!isPrefixAnimationFinished) {
326
+ return false;
327
+ }
328
+ const isJustPrefixElement = prefixElement && prefixElement === (0, _text.convertHTMLToText)(((_editorRef$current2 = editorRef.current) === null || _editorRef$current2 === void 0 ? void 0 : _editorRef$current2.innerHTML) ?? '');
329
+ const shouldRenderPlaceholder = prefixElement && !plainTextValue || (prefixElement ? prefixElementWidth && prefixElementWidth > 0 : true);
330
+ switch (true) {
331
+ case (!plainTextValue || isJustPrefixElement) && shouldHidePlaceholderOnFocus && !hasFocus:
332
+ case (!plainTextValue || isJustPrefixElement) && !shouldHidePlaceholderOnFocus:
333
+ return shouldRenderPlaceholder;
334
+ case (!plainTextValue || isJustPrefixElement) && shouldHidePlaceholderOnFocus && hasFocus:
335
+ return false;
336
+ default:
337
+ return false;
338
+ }
339
+ }, [isPrefixAnimationFinished, hasFocus, plainTextValue, prefixElement, shouldHidePlaceholderOnFocus, prefixElementWidth]);
340
+ (0, _react.useEffect)(() => {
341
+ if (prefixElement) {
342
+ setIsPrefixAnimationFinished(false);
343
+ }
344
+ }, [prefixElement]);
345
+ const handleFocus = event => {
346
+ if (typeof onFocus === 'function' && !isDisabled) {
347
+ onFocus(event);
348
+ }
349
+ setHasFocus(true);
350
+ };
351
+ const handleBlur = event => {
352
+ if (typeof onBlur === 'function' && !isDisabled) {
353
+ onBlur(event);
354
+ }
355
+ setHasFocus(false);
356
+ };
357
+ (0, _react.useEffect)(() => {
358
+ if (editorRef.current && prefixElement) {
359
+ const text = (0, _emoji.convertEmojisToUnicode)(prefixElement);
360
+ (0, _insert.insertTextAtCursorPosition)({
361
+ editorElement: editorRef.current,
362
+ text
363
+ });
364
+ handleUpdateHTML(prefixElement);
365
+ hasPrefixRendered.current = true;
366
+ }
367
+ }, [handleUpdateHTML, prefixElement]);
368
+ (0, _react.useEffect)(() => {
369
+ var _editorRef$current3;
370
+ if (prefixElementRef.current && prefixElement && prefixElement === (0, _text.convertHTMLToText)(((_editorRef$current3 = editorRef.current) === null || _editorRef$current3 === void 0 ? void 0 : _editorRef$current3.innerHTML) ?? '')) {
371
+ setPrefixElementWidth(prefixElementRef.current.offsetWidth + 2);
372
+ } else {
373
+ setPrefixElementWidth(undefined);
374
+ }
375
+ }, [plainTextValue, prefixElement]);
376
+ (0, _react.useEffect)(() => {
377
+ const handleResize = () => {
378
+ if (editorRef.current) {
379
+ setLabelWidth(editorRef.current.offsetWidth);
380
+ }
381
+ };
382
+ const resizeObserver = new ResizeObserver(handleResize);
383
+ if (editorRef.current) {
384
+ resizeObserver.observe(editorRef.current);
385
+ }
386
+ return () => {
387
+ resizeObserver.disconnect();
388
+ };
389
+ }, []);
390
+ (0, _react.useEffect)(() => {
391
+ const blurElement = () => {
392
+ if (editorRef.current && document.activeElement === editorRef.current && isDisabled) {
393
+ editorRef.current.blur();
394
+ }
395
+ };
396
+ document.addEventListener('focus', blurElement, true);
397
+ return () => {
398
+ document.removeEventListener('focus', blurElement, true);
399
+ };
400
+ }, [isDisabled]);
401
+ return /*#__PURE__*/_react.default.createElement(_EmojiInput.StyledEmojiInput, {
402
+ $isDisabled: isDisabled,
403
+ $shouldChangeColor: shouldChangeColor
404
+ }, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
405
+ initial: true
406
+ }, progressDuration > 0 && /*#__PURE__*/_react.default.createElement(_EmojiInput.StyledMotionEmojiInputProgress, {
407
+ animate: {
408
+ width: '100%'
409
+ },
410
+ exit: {
411
+ opacity: 0
412
+ },
413
+ initial: {
414
+ opacity: 1,
415
+ width: '0%'
416
+ },
417
+ transition: {
418
+ width: {
419
+ ease: 'linear',
420
+ duration: progressDuration
421
+ },
422
+ opacity: {
423
+ type: 'tween',
424
+ duration: 0.3
425
+ }
426
+ }
427
+ })), /*#__PURE__*/_react.default.createElement(_EmojiInput.StyledEmojiInputContent, {
428
+ $isRightElementGiven: !!rightElement
429
+ }, prefixElement && /*#__PURE__*/_react.default.createElement(_PrefixElement.default, {
430
+ element: prefixElement,
431
+ prefixElementRef: prefixElementRef,
432
+ setIsPrefixAnimationFinished: setIsPrefixAnimationFinished
433
+ }), /*#__PURE__*/_react.default.createElement(_EmojiInput.StyledMotionEmojiInputEditor, {
434
+ $browser: browser === null || browser === void 0 ? void 0 : browser.name,
435
+ animate: {
436
+ maxHeight: height ?? maxHeight,
437
+ minHeight: height ?? '26px'
438
+ },
439
+ contentEditable: !isDisabled,
440
+ id: inputId,
441
+ onBeforeInput: handleBeforeInput,
442
+ onBlur: handleBlur,
443
+ onFocus: handleFocus,
444
+ onInput: handleInput,
445
+ onKeyDown: handleKeyDown,
446
+ onPaste: handlePaste,
447
+ ref: editorRef,
448
+ $shouldShowContent: isPrefixAnimationFinished,
449
+ transition: {
450
+ type: 'tween',
451
+ duration: 0.2
452
+ }
453
+ }), shouldShowPlaceholder && /*#__PURE__*/_react.default.createElement(_EmojiInput.StyledEmojiInputLabel, {
454
+ $maxWidth: labelWidth,
455
+ $offsetWidth: prefixElementWidth
456
+ }, placeholder), !isMobile && !shouldPreventEmojiPicker && /*#__PURE__*/_react.default.createElement(_EmojiPickerPopup.default, {
457
+ accessToken: accessToken,
458
+ alignment: popupAlignment,
459
+ onSelect: handlePopupSelect,
460
+ onPopupVisibilityChange: handlePopupVisibility,
461
+ personId: personId
462
+ })), rightElement && /*#__PURE__*/_react.default.createElement(_EmojiInput.StyledEmojiInputRightWrapper, null, rightElement));
463
+ });
464
+ EmojiInput.displayName = 'EmojiInput';
465
+ var _default = exports.default = EmojiInput;
466
+ //# sourceMappingURL=EmojiInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiInput.js","names":["_core","require","_chaynsApi","_framerMotion","_react","_interopRequireWildcard","_emoji","_environment","_insert","_selection","_text","_EmojiPickerPopup","_interopRequireDefault","_EmojiInput","_PrefixElement","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","EmojiInput","forwardRef","accessToken","height","inputId","isDisabled","maxHeight","onBlur","onFocus","onInput","onKeyDown","onPrefixElementRemove","onPopupVisibilityChange","personId","placeholder","popupAlignment","prefixElement","rightElement","shouldHidePlaceholderOnFocus","shouldPreventEmojiPicker","value","ref","isMobile","useState","getIsMobile","plainTextValue","setPlainTextValue","hasFocus","setHasFocus","progressDuration","setProgressDuration","labelWidth","setLabelWidth","isPopupVisible","setIsPopupVisible","isPrefixAnimationFinished","setIsPrefixAnimationFinished","prefixElementWidth","setPrefixElementWidth","areaProvider","useContext","AreaContext","editorRef","useRef","prefixElementRef","hasPrefixRendered","shouldDeleteOneMoreBackwards","shouldDeleteOneMoreForwards","valueRef","browser","getDevice","shouldChangeColor","useMemo","handleUpdateHTML","useCallback","html","current","newInnerHTML","convertEmojisToUnicode","convertTextToHTML","innerHTML","saveSelection","shouldIgnoreEmptyTextNodes","restoreSelection","handleBeforeInput","event","preventDefault","stopPropagation","data","type","nativeEvent","includes","text","insertTextAtCursorPosition","editorElement","newEvent","Event","bubbles","dispatchEvent","handleInput","document","execCommand","convertHTMLToText","handleKeyDown","key","isPropagationStopped","charCodeThatWillBeDeleted","getCharCodeThatWillBeDeleted","handlePopupVisibility","isVisible","handlePaste","clipboardData","getData","handlePopupSelect","emoji","useEffect","_editorRef$current","convertedText","replace","convertedPrefix","length","useLayoutEffect","handleInsertTextAtCursorPosition","handleReplaceText","searchText","pasteText","replaceText","handleStartProgress","duration","handleStopProgress","useImperativeHandle","startProgress","stopProgress","handlePreventLoseFocus","_element$parentElemen","_element$parentElemen2","element","target","classList","contains","parentElement","body","addEventListener","removeEventListener","shouldShowPlaceholder","_editorRef$current2","isJustPrefixElement","shouldRenderPlaceholder","handleFocus","handleBlur","_editorRef$current3","offsetWidth","undefined","handleResize","resizeObserver","ResizeObserver","observe","disconnect","blurElement","activeElement","blur","createElement","StyledEmojiInput","$isDisabled","$shouldChangeColor","AnimatePresence","initial","StyledMotionEmojiInputProgress","animate","width","exit","opacity","transition","ease","StyledEmojiInputContent","$isRightElementGiven","StyledMotionEmojiInputEditor","$browser","name","minHeight","contentEditable","id","onBeforeInput","onPaste","$shouldShowContent","StyledEmojiInputLabel","$maxWidth","$offsetWidth","alignment","onSelect","StyledEmojiInputRightWrapper","displayName","_default","exports"],"sources":["../../../../src/components/emoji-input/EmojiInput.tsx"],"sourcesContent":["import { AreaContext } 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,\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 { getIsMobile } from '../../utils/environment';\nimport { insertTextAtCursorPosition, replaceText } from '../../utils/insert';\nimport {\n getCharCodeThatWillBeDeleted,\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\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 [isMobile] = useState(getIsMobile());\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\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 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 // noinspection JSDeprecatedSymbols\n document.execCommand('delete', false);\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: KeyboardEvent<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 (event.key === 'Backspace' || event.key === 'Delete') {\n const charCodeThatWillBeDeleted = getCharCodeThatWillBeDeleted(event);\n\n if (charCodeThatWillBeDeleted === 8203) {\n if (event.key === 'Backspace') {\n shouldDeleteOneMoreBackwards.current = true;\n } else {\n shouldDeleteOneMoreForwards.current = true;\n }\n }\n }\n },\n [isDisabled, isPopupVisible, onKeyDown],\n );\n\n const handlePopupVisibility = (isVisible: boolean) => {\n setIsPopupVisible(isVisible);\n\n if (typeof onPopupVisibilityChange === 'function') {\n onPopupVisibilityChange(isVisible);\n }\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 the\n * 'insertTextAtCursorPosition' function.\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 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 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({ editorElement: editorRef.current, text: emoji });\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 onPrefixElementRemove();\n hasPrefixRendered.current = false;\n }, [onPrefixElementRemove, plainTextValue.length, 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 useLayoutEffect(() => {\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 &&\n prefixElement === convertHTMLToText(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 prefixElement === convertHTMLToText(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 $isRightElementGiven={!!rightElement}>\n {prefixElement && (\n <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 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 {!isMobile && !shouldPreventEmojiPicker && (\n <EmojiPickerPopup\n accessToken={accessToken}\n alignment={popupAlignment}\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,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,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