@chayns-components/emoji-input 5.0.0-beta.100

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 (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -0
  3. package/lib/api/item-storage/get.d.ts +8 -0
  4. package/lib/api/item-storage/get.js +37 -0
  5. package/lib/api/item-storage/get.js.map +1 -0
  6. package/lib/api/item-storage/put.d.ts +9 -0
  7. package/lib/api/item-storage/put.js +42 -0
  8. package/lib/api/item-storage/put.js.map +1 -0
  9. package/lib/components/emoji-input/EmojiInput.d.ts +49 -0
  10. package/lib/components/emoji-input/EmojiInput.js +157 -0
  11. package/lib/components/emoji-input/EmojiInput.js.map +1 -0
  12. package/lib/components/emoji-input/EmojiInput.styles.d.ts +13 -0
  13. package/lib/components/emoji-input/EmojiInput.styles.js +145 -0
  14. package/lib/components/emoji-input/EmojiInput.styles.js.map +1 -0
  15. package/lib/components/emoji-picker/EmojiPicker.d.ts +18 -0
  16. package/lib/components/emoji-picker/EmojiPicker.js +51 -0
  17. package/lib/components/emoji-picker/EmojiPicker.js.map +1 -0
  18. package/lib/components/emoji-picker/EmojiPicker.styles.d.ts +5 -0
  19. package/lib/components/emoji-picker/EmojiPicker.styles.js +25 -0
  20. package/lib/components/emoji-picker/EmojiPicker.styles.js.map +1 -0
  21. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.d.ts +9 -0
  22. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js +51 -0
  23. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.js.map +1 -0
  24. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.d.ts +2 -0
  25. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js +27 -0
  26. package/lib/components/emoji-picker/emoji-picker-categories/EmojiPickerCategories.styles.js.map +1 -0
  27. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.d.ts +11 -0
  28. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +131 -0
  29. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -0
  30. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.d.ts +7 -0
  31. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js +99 -0
  32. package/lib/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.styles.js.map +1 -0
  33. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.d.ts +9 -0
  34. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js +116 -0
  35. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.js.map +1 -0
  36. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.d.ts +1 -0
  37. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js +21 -0
  38. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.js.map +1 -0
  39. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.d.ts +18 -0
  40. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js +74 -0
  41. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.js.map +1 -0
  42. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.d.ts +11 -0
  43. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js +104 -0
  44. package/lib/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.js.map +1 -0
  45. package/lib/components/emoji-picker-popup/EmojiPickerPopup.d.ts +36 -0
  46. package/lib/components/emoji-picker-popup/EmojiPickerPopup.js +150 -0
  47. package/lib/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -0
  48. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.d.ts +7 -0
  49. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js +97 -0
  50. package/lib/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -0
  51. package/lib/constants/alignment.d.ts +10 -0
  52. package/lib/constants/alignment.js +21 -0
  53. package/lib/constants/alignment.js.map +1 -0
  54. package/lib/constants/categories.d.ts +12 -0
  55. package/lib/constants/categories.js +20 -0
  56. package/lib/constants/categories.js.map +1 -0
  57. package/lib/constants/emoji-de-DE.json +3827 -0
  58. package/lib/constants/emoji.d.ts +8 -0
  59. package/lib/constants/emoji.js +3808 -0
  60. package/lib/constants/emoji.js.map +1 -0
  61. package/lib/constants/externalServerUrl.d.ts +1 -0
  62. package/lib/constants/externalServerUrl.js +9 -0
  63. package/lib/constants/externalServerUrl.js.map +1 -0
  64. package/lib/hooks/emojiHistory.d.ts +22 -0
  65. package/lib/hooks/emojiHistory.js +91 -0
  66. package/lib/hooks/emojiHistory.js.map +1 -0
  67. package/lib/index.d.ts +5 -0
  68. package/lib/index.js +42 -0
  69. package/lib/index.js.map +1 -0
  70. package/lib/types/api.d.ts +4 -0
  71. package/lib/types/api.js +6 -0
  72. package/lib/types/api.js.map +1 -0
  73. package/lib/types/category.d.ts +1 -0
  74. package/lib/types/category.js +6 -0
  75. package/lib/types/category.js.map +1 -0
  76. package/lib/utils/emoji.d.ts +2 -0
  77. package/lib/utils/emoji.js +96 -0
  78. package/lib/utils/emoji.js.map +1 -0
  79. package/lib/utils/environment.d.ts +9 -0
  80. package/lib/utils/environment.js +33 -0
  81. package/lib/utils/environment.js.map +1 -0
  82. package/lib/utils/font.d.ts +1 -0
  83. package/lib/utils/font.js +17 -0
  84. package/lib/utils/font.js.map +1 -0
  85. package/lib/utils/insert.d.ts +19 -0
  86. package/lib/utils/insert.js +50 -0
  87. package/lib/utils/insert.js.map +1 -0
  88. package/lib/utils/selection.d.ts +2 -0
  89. package/lib/utils/selection.js +43 -0
  90. package/lib/utils/selection.js.map +1 -0
  91. package/package.json +72 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Emoji.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_alignment","_Emoji","_SkinTonePopup","_interopRequireDefault","_SkinTonePopup2","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Emoji","_ref","emoji","isSkinToneSupported","onPopupVisibilityChange","onSelect","shouldShowPopup","setShouldShowPopup","useState","skinTonePopupAnchorAlignment","setSkinTonePopupAnchorAlignment","AnchorAlignment","Top","skinTonePopupAnchorOffset","setSkinTonePopupAnchorOffset","skinTonePopupOverlayPosition","setSkinTonePopupOverlayPosition","top","skinTonePopupPosition","setSkinTonePopupPosition","left","handleClick","useCallback","handleContextMenu","event","preventDefault","stopPropagation","currentTarget","element","parentElement","height","elementHeight","elementLeft","elementTop","width","elementWidth","getBoundingClientRect","parentHeight","parentLeft","parentTop","parentWidth","scrollTop","anchorAlignment","anchorOffset","skinTonePopupContentSize","maxLeft","minLeft","Bottom","handleHidePopup","useEffect","createElement","StyledEmoji","className","onClick","onContextMenu","AnimatePresence","initial","onHidePopup","overlayPosition","position","displayName","_default","exports"],"sources":["../../../../../src/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, { FC, MouseEvent, useCallback, useEffect, useState } from 'react';\nimport { AnchorAlignment } from '../../../../constants/alignment';\nimport { StyledEmoji } from './Emoji.styles';\nimport SkinTonePopup, { SkinTonePopupProps } from './skin-tone-popup/SkinTonePopup';\nimport { skinTonePopupContentSize } from './skin-tone-popup/SkinTonePopup.styles';\n\nexport type EmojiProps = {\n emoji: string;\n isSkinToneSupported: boolean;\n onPopupVisibilityChange: (isVisible: boolean) => void;\n onSelect: (emoji: string) => void;\n};\n\nconst Emoji: FC<EmojiProps> = ({\n emoji,\n isSkinToneSupported,\n onPopupVisibilityChange,\n onSelect,\n}) => {\n const [shouldShowPopup, setShouldShowPopup] = useState(false);\n const [skinTonePopupAnchorAlignment, setSkinTonePopupAnchorAlignment] = useState(\n AnchorAlignment.Top\n );\n const [skinTonePopupAnchorOffset, setSkinTonePopupAnchorOffset] = useState(0);\n const [skinTonePopupOverlayPosition, setSkinTonePopupOverlayPosition] = useState<\n SkinTonePopupProps['overlayPosition']\n >({ top: 0 });\n const [skinTonePopupPosition, setSkinTonePopupPosition] = useState<\n SkinTonePopupProps['position']\n >({ left: 0, top: 0 });\n\n const handleClick = useCallback(() => {\n onSelect(emoji);\n }, [emoji, onSelect]);\n\n const handleContextMenu = useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n event.stopPropagation();\n\n const {\n currentTarget: element,\n currentTarget: { parentElement },\n } = event;\n\n if (parentElement) {\n const {\n height: elementHeight,\n left: elementLeft,\n top: elementTop,\n width: elementWidth,\n } = element.getBoundingClientRect();\n\n const {\n height: parentHeight,\n left: parentLeft,\n top: parentTop,\n width: parentWidth,\n } = parentElement.getBoundingClientRect();\n\n const { scrollTop } = parentElement;\n\n let anchorAlignment = AnchorAlignment.Top;\n let anchorOffset = 0;\n\n let left =\n elementLeft -\n parentLeft -\n skinTonePopupContentSize.width / 2 +\n elementWidth / 2;\n\n let top = elementTop - parentTop + elementHeight + scrollTop;\n\n const maxLeft = parentWidth - skinTonePopupContentSize.width - 12;\n const minLeft = 12;\n\n if (left < minLeft) {\n anchorOffset = left - minLeft;\n left = minLeft;\n } else if (left > maxLeft) {\n anchorOffset = left - maxLeft;\n left = maxLeft;\n }\n\n if (top + skinTonePopupContentSize.height > parentHeight + scrollTop) {\n anchorAlignment = AnchorAlignment.Bottom;\n top -= elementHeight + skinTonePopupContentSize.height;\n }\n\n if (isSkinToneSupported) {\n setSkinTonePopupAnchorAlignment(anchorAlignment);\n setSkinTonePopupAnchorOffset(anchorOffset);\n setSkinTonePopupPosition({ left, top });\n setSkinTonePopupOverlayPosition({ top: scrollTop });\n setShouldShowPopup(true);\n }\n }\n },\n [isSkinToneSupported]\n );\n\n const handleHidePopup = useCallback(() => setShouldShowPopup(false), []);\n\n useEffect(() => {\n onPopupVisibilityChange(shouldShowPopup);\n }, [onPopupVisibilityChange, shouldShowPopup]);\n\n return (\n <StyledEmoji\n className=\"prevent-lose-focus\"\n onClick={handleClick}\n onContextMenu={handleContextMenu}\n >\n {emoji}\n <AnimatePresence initial={false}>\n {shouldShowPopup && (\n <SkinTonePopup\n anchorAlignment={skinTonePopupAnchorAlignment}\n anchorOffset={skinTonePopupAnchorOffset}\n emoji={emoji}\n key={emoji}\n onHidePopup={handleHidePopup}\n onSelect={onSelect}\n overlayPosition={skinTonePopupOverlayPosition}\n position={skinTonePopupPosition}\n />\n )}\n </AnimatePresence>\n </StyledEmoji>\n );\n};\n\nEmoji.displayName = 'Emoji';\n\nexport default Emoji;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAAkF,SAAAM,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAM,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC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EhC,WAAY;IACrBiC,aAAa,EAAE/B;EAAkB,GAEhCrB,KAAK,eACN/B,MAAA,CAAAS,OAAA,CAAAsE,aAAA,CAACjF,aAAA,CAAAsF,eAAe;IAACC,OAAO,EAAE;EAAM,GAC3BlD,eAAe,iBACZnC,MAAA,CAAAS,OAAA,CAAAsE,aAAA,CAAC3E,cAAA,CAAAK,OAAa;IACV8D,eAAe,EAAEjC,4BAA6B;IAC9CkC,YAAY,EAAE9B,yBAA0B;IACxCX,KAAK,EAAEA,KAAM;IACbR,GAAG,EAAEQ,KAAM;IACXuD,WAAW,EAAET,eAAgB;IAC7B3C,QAAQ,EAAEA,QAAS;IACnBqD,eAAe,EAAE3C,4BAA6B;IAC9C4C,QAAQ,EAAEzC;EAAsB,EAEvC,CACa,CACR;AAEtB,CAAC;AAEDlB,KAAK,CAAC4D,WAAW,GAAG,OAAO;AAAC,IAAAC,QAAA,GAEb7D,KAAK;AAAA8D,OAAA,CAAAlF,OAAA,GAAAiF,QAAA"}
@@ -0,0 +1 @@
1
+ export declare const StyledEmoji: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledEmoji = void 0;
7
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
8
+ var _font = require("../../../../utils/font");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ const StyledEmoji = _styledComponents.default.div`
11
+ align-items: center;
12
+ cursor: pointer;
13
+ display: flex;
14
+ font-family: ${_font.getFontFamily};
15
+ font-size: 32px;
16
+ justify-content: center;
17
+ width: 48px;
18
+ height: 48px;
19
+ `;
20
+ exports.StyledEmoji = StyledEmoji;
21
+ //# sourceMappingURL=Emoji.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Emoji.styles.js","names":["_styledComponents","_interopRequireDefault","require","_font","obj","__esModule","default","StyledEmoji","styled","div","getFontFamily","exports"],"sources":["../../../../../src/components/emoji-picker/emoji-picker-emojis/emoji/Emoji.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { getFontFamily } from '../../../../utils/font';\n\nexport const StyledEmoji = styled.div`\n align-items: center;\n cursor: pointer;\n display: flex;\n font-family: ${getFontFamily};\n font-size: 32px;\n justify-content: center;\n width: 48px;\n height: 48px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAuD,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhD,MAAMG,WAAW,GAAGC,yBAAM,CAACC,GAAI;AACtC;AACA;AACA;AACA,mBAAmBC,mBAAc;AACjC;AACA;AACA;AACA;AACA,CAAC;AAACC,OAAA,CAAAJ,WAAA,GAAAA,WAAA"}
@@ -0,0 +1,18 @@
1
+ import { FC } from 'react';
2
+ import type { AnchorAlignment } from '../../../../../constants/alignment';
3
+ export type SkinTonePopupProps = {
4
+ anchorAlignment: AnchorAlignment;
5
+ anchorOffset: number;
6
+ emoji: string;
7
+ onHidePopup: VoidFunction;
8
+ onSelect: (emojiWithSkinTone: string) => void;
9
+ overlayPosition: {
10
+ top: number;
11
+ };
12
+ position: {
13
+ left: number;
14
+ top: number;
15
+ };
16
+ };
17
+ declare const SkinTonePopup: FC<SkinTonePopupProps>;
18
+ export default SkinTonePopup;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _dataEmojiComponents = _interopRequireDefault(require("unicode-emoji-json/data-emoji-components.json"));
9
+ var _emoji = require("../../../../../utils/emoji");
10
+ var _SkinTonePopup = require("./SkinTonePopup.styles");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
14
+ const SkinTonePopup = _ref => {
15
+ let {
16
+ anchorAlignment,
17
+ anchorOffset,
18
+ emoji,
19
+ onHidePopup,
20
+ onSelect,
21
+ overlayPosition,
22
+ position
23
+ } = _ref;
24
+ const handleOverlayClick = (0, _react.useCallback)(event => {
25
+ event.preventDefault();
26
+ event.stopPropagation();
27
+ onHidePopup();
28
+ }, [onHidePopup]);
29
+ const emojis = (0, _react.useMemo)(() => {
30
+ const result = [];
31
+ Object.entries(_dataEmojiComponents.default).forEach(_ref2 => {
32
+ let [key, value] = _ref2;
33
+ if (key.includes('skin_tone')) {
34
+ const emojiWithSkinTone = (0, _emoji.addSkinToneToEmoji)(emoji, value);
35
+ const handleClick = event => {
36
+ event.preventDefault();
37
+ event.stopPropagation();
38
+ onSelect(emojiWithSkinTone);
39
+ onHidePopup();
40
+ };
41
+ result.push( /*#__PURE__*/_react.default.createElement(_SkinTonePopup.StyledSkinTonePopupContentEmoji, {
42
+ key: key,
43
+ onClick: handleClick
44
+ }, emojiWithSkinTone));
45
+ }
46
+ });
47
+ return result;
48
+ }, [emoji, onHidePopup, onSelect]);
49
+ return /*#__PURE__*/_react.default.createElement(_SkinTonePopup.StyledMotionSkinTonePopup, {
50
+ animate: {
51
+ opacity: 1
52
+ },
53
+ exit: {
54
+ opacity: 0
55
+ },
56
+ initial: {
57
+ opacity: 0
58
+ },
59
+ transition: {
60
+ duration: 0.1
61
+ }
62
+ }, /*#__PURE__*/_react.default.createElement(_SkinTonePopup.StyledSkinTonePopupContent, {
63
+ anchorAlignment: anchorAlignment,
64
+ anchorOffset: anchorOffset,
65
+ style: position
66
+ }, emojis), /*#__PURE__*/_react.default.createElement(_SkinTonePopup.StyledSkinTonePopupOverlay, {
67
+ onClick: handleOverlayClick,
68
+ style: overlayPosition
69
+ }));
70
+ };
71
+ SkinTonePopup.displayName = 'SkinTonePopup';
72
+ var _default = SkinTonePopup;
73
+ exports.default = _default;
74
+ //# sourceMappingURL=SkinTonePopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkinTonePopup.js","names":["_react","_interopRequireWildcard","require","_dataEmojiComponents","_interopRequireDefault","_emoji","_SkinTonePopup","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SkinTonePopup","_ref","anchorAlignment","anchorOffset","emoji","onHidePopup","onSelect","overlayPosition","position","handleOverlayClick","useCallback","event","preventDefault","stopPropagation","emojis","useMemo","result","entries","emojiComponents","forEach","_ref2","value","includes","emojiWithSkinTone","addSkinToneToEmoji","handleClick","push","createElement","StyledSkinTonePopupContentEmoji","onClick","StyledMotionSkinTonePopup","animate","opacity","exit","initial","transition","duration","StyledSkinTonePopupContent","style","StyledSkinTonePopupOverlay","displayName","_default","exports"],"sources":["../../../../../../src/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.tsx"],"sourcesContent":["import React, { FC, MouseEvent, useCallback, useMemo } from 'react';\nimport emojiComponents from 'unicode-emoji-json/data-emoji-components.json';\nimport type { AnchorAlignment } from '../../../../../constants/alignment';\nimport { addSkinToneToEmoji } from '../../../../../utils/emoji';\nimport {\n StyledMotionSkinTonePopup,\n StyledSkinTonePopupContent,\n StyledSkinTonePopupContentEmoji,\n StyledSkinTonePopupOverlay,\n} from './SkinTonePopup.styles';\n\nexport type SkinTonePopupProps = {\n anchorAlignment: AnchorAlignment;\n anchorOffset: number;\n emoji: string;\n onHidePopup: VoidFunction;\n onSelect: (emojiWithSkinTone: string) => void;\n overlayPosition: { top: number };\n position: { left: number; top: number };\n};\n\nconst SkinTonePopup: FC<SkinTonePopupProps> = ({\n anchorAlignment,\n anchorOffset,\n emoji,\n onHidePopup,\n onSelect,\n overlayPosition,\n position,\n}) => {\n const handleOverlayClick = useCallback(\n (event: MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n onHidePopup();\n },\n [onHidePopup]\n );\n\n const emojis = useMemo(() => {\n const result: JSX.Element[] = [];\n\n Object.entries(emojiComponents).forEach(([key, value]) => {\n if (key.includes('skin_tone')) {\n const emojiWithSkinTone = addSkinToneToEmoji(emoji, value);\n\n const handleClick = (event: MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n event.stopPropagation();\n\n onSelect(emojiWithSkinTone);\n\n onHidePopup();\n };\n\n result.push(\n <StyledSkinTonePopupContentEmoji key={key} onClick={handleClick}>\n {emojiWithSkinTone}\n </StyledSkinTonePopupContentEmoji>\n );\n }\n });\n\n return result;\n }, [emoji, onHidePopup, onSelect]);\n\n return (\n <StyledMotionSkinTonePopup\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n initial={{ opacity: 0 }}\n transition={{ duration: 0.1 }}\n >\n <StyledSkinTonePopupContent\n anchorAlignment={anchorAlignment}\n anchorOffset={anchorOffset}\n style={position}\n >\n {emojis}\n </StyledSkinTonePopupContent>\n <StyledSkinTonePopupOverlay onClick={handleOverlayClick} style={overlayPosition} />\n </StyledMotionSkinTonePopup>\n );\n};\n\nSkinTonePopup.displayName = 'SkinTonePopup';\n\nexport default SkinTonePopup;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAKgC,SAAAE,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAV,wBAAAM,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA,CAAAC,WAAA,OAAAI,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAnB,GAAA,EAAAgB,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAf,GAAA,EAAAgB,GAAA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AAAS,OAAA,CAAA+C,aAAA,CAAClD,cAAA,CAAAmD,+BAA+B;UAAClC,GAAG,EAAEA,GAAI;UAACmC,OAAO,EAAEJ;QAAY,GAC3DF,iBAAiB,CACY,CACrC;MACL;IACJ,CAAC,CAAC;IAEF,OAAOP,MAAM;EACjB,CAAC,EAAE,CAACZ,KAAK,EAAEC,WAAW,EAAEC,QAAQ,CAAC,CAAC;EAElC,oBACInC,MAAA,CAAAS,OAAA,CAAA+C,aAAA,CAAClD,cAAA,CAAAqD,yBAAyB;IACtBC,OAAO,EAAE;MAAEC,OAAO,EAAE;IAAE,CAAE;IACxBC,IAAI,EAAE;MAAED,OAAO,EAAE;IAAE,CAAE;IACrBE,OAAO,EAAE;MAAEF,OAAO,EAAE;IAAE,CAAE;IACxBG,UAAU,EAAE;MAAEC,QAAQ,EAAE;IAAI;EAAE,gBAE9BjE,MAAA,CAAAS,OAAA,CAAA+C,aAAA,CAAClD,cAAA,CAAA4D,0BAA0B;IACvBnC,eAAe,EAAEA,eAAgB;IACjCC,YAAY,EAAEA,YAAa;IAC3BmC,KAAK,EAAE9B;EAAS,GAEfM,MAAM,CACkB,eAC7B3C,MAAA,CAAAS,OAAA,CAAA+C,aAAA,CAAClD,cAAA,CAAA8D,0BAA0B;IAACV,OAAO,EAAEpB,kBAAmB;IAAC6B,KAAK,EAAE/B;EAAgB,EAAG,CAC3D;AAEpC,CAAC;AAEDP,aAAa,CAACwC,WAAW,GAAG,eAAe;AAAC,IAAAC,QAAA,GAE7BzC,aAAa;AAAA0C,OAAA,CAAA9D,OAAA,GAAA6D,QAAA"}
@@ -0,0 +1,11 @@
1
+ import type { SkinTonePopupProps } from './SkinTonePopup';
2
+ export declare const StyledMotionSkinTonePopup: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {}, never>;
3
+ export declare const skinTonePopupContentSize: {
4
+ height: number;
5
+ width: number;
6
+ };
7
+ export declare const StyledSkinTonePopupContent: import("styled-components").StyledComponent<"div", any, Pick<SkinTonePopupProps, "anchorAlignment" | "anchorOffset"> & {
8
+ theme: import("@chayns-components/core/lib/components/color-scheme-provider/ColorSchemeProvider").Theme;
9
+ }, never>;
10
+ export declare const StyledSkinTonePopupContentEmoji: import("styled-components").StyledComponent<"div", any, {}, never>;
11
+ export declare const StyledSkinTonePopupOverlay: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.skinTonePopupContentSize = exports.StyledSkinTonePopupOverlay = exports.StyledSkinTonePopupContentEmoji = exports.StyledSkinTonePopupContent = exports.StyledMotionSkinTonePopup = void 0;
7
+ var _framerMotion = require("framer-motion");
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+ var _alignment = require("../../../../../constants/alignment");
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ const StyledMotionSkinTonePopup = (0, _styledComponents.default)(_framerMotion.motion.div)`
13
+ z-index: 1;
14
+ `;
15
+ exports.StyledMotionSkinTonePopup = StyledMotionSkinTonePopup;
16
+ const skinTonePopupContentSize = {
17
+ height: 48,
18
+ width: 200
19
+ };
20
+ exports.skinTonePopupContentSize = skinTonePopupContentSize;
21
+ const StyledSkinTonePopupContent = _styledComponents.default.div`
22
+ align-items: stretch;
23
+ background-color: ${_ref => {
24
+ let {
25
+ theme
26
+ } = _ref;
27
+ return theme['001'];
28
+ }};
29
+ border: 1px solid rgba(0, 0, 0, 0.1);
30
+ border-radius: 3px;
31
+ box-shadow: 1px 3px 8px rgb(0 0 0 / 30%);
32
+ display: flex;
33
+ height: ${skinTonePopupContentSize.height}px;
34
+ justify-content: stretch;
35
+ position: absolute;
36
+ width: ${skinTonePopupContentSize.width}px;
37
+ z-index: 2;
38
+
39
+ ::after {
40
+ background-color: inherit;
41
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
42
+ border-bottom-right-radius: 3px;
43
+ border-right: 1px solid rgba(0, 0, 0, 0.1);
44
+ box-shadow: 2px 2px 8px rgb(4 3 4 / 10%);
45
+ content: '';
46
+ height: 14px;
47
+ position: absolute;
48
+ width: 14px;
49
+ z-index: -2;
50
+
51
+ ${_ref2 => {
52
+ let {
53
+ anchorAlignment,
54
+ anchorOffset
55
+ } = _ref2;
56
+ switch (anchorAlignment) {
57
+ case _alignment.AnchorAlignment.Bottom:
58
+ return (0, _styledComponents.css)`
59
+ bottom: -7px;
60
+ left: calc(50% - 7px + ${anchorOffset}px);
61
+ transform: rotate(45deg);
62
+ `;
63
+ case _alignment.AnchorAlignment.Top:
64
+ return (0, _styledComponents.css)`
65
+ top: -7px;
66
+ left: calc(50% - 7px + ${anchorOffset}px);
67
+ transform: rotate(225deg);
68
+ `;
69
+ default:
70
+ return undefined;
71
+ }
72
+ }}
73
+ }
74
+
75
+ ::before {
76
+ background-color: inherit;
77
+ bottom: 0;
78
+ content: '';
79
+ left: 0;
80
+ position: absolute;
81
+ right: 0;
82
+ top: 0;
83
+ z-index: -1;
84
+ }
85
+ `;
86
+ exports.StyledSkinTonePopupContent = StyledSkinTonePopupContent;
87
+ const StyledSkinTonePopupContentEmoji = _styledComponents.default.div`
88
+ align-items: center;
89
+ display: flex;
90
+ flex: 1 1 auto;
91
+ font-size: 24px;
92
+ justify-content: center;
93
+ `;
94
+ exports.StyledSkinTonePopupContentEmoji = StyledSkinTonePopupContentEmoji;
95
+ const StyledSkinTonePopupOverlay = _styledComponents.default.div`
96
+ cursor: default;
97
+ height: 100%;
98
+ left: 0;
99
+ position: absolute;
100
+ width: 100%;
101
+ z-index: 1;
102
+ `;
103
+ exports.StyledSkinTonePopupOverlay = StyledSkinTonePopupOverlay;
104
+ //# sourceMappingURL=SkinTonePopup.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SkinTonePopup.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireWildcard","_alignment","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StyledMotionSkinTonePopup","styled","motion","div","exports","skinTonePopupContentSize","height","width","StyledSkinTonePopupContent","_ref","theme","_ref2","anchorAlignment","anchorOffset","AnchorAlignment","Bottom","css","Top","undefined","StyledSkinTonePopupContentEmoji","StyledSkinTonePopupOverlay"],"sources":["../../../../../../src/components/emoji-picker/emoji-picker-emojis/emoji/skin-tone-popup/SkinTonePopup.styles.ts"],"sourcesContent":["import type { WithTheme } from '@chayns-components/core';\nimport { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\nimport { AnchorAlignment } from '../../../../../constants/alignment';\nimport type { SkinTonePopupProps } from './SkinTonePopup';\n\nexport const StyledMotionSkinTonePopup = styled(motion.div)`\n z-index: 1;\n`;\n\nexport const skinTonePopupContentSize = {\n height: 48,\n width: 200,\n};\n\ntype StyledSkinTonePopupContentProps = WithTheme<\n Pick<SkinTonePopupProps, 'anchorAlignment' | 'anchorOffset'>\n>;\n\nexport const StyledSkinTonePopupContent = styled.div<StyledSkinTonePopupContentProps>`\n align-items: stretch;\n background-color: ${({ theme }: StyledSkinTonePopupContentProps) => theme['001']};\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n box-shadow: 1px 3px 8px rgb(0 0 0 / 30%);\n display: flex;\n height: ${skinTonePopupContentSize.height}px;\n justify-content: stretch;\n position: absolute;\n width: ${skinTonePopupContentSize.width}px;\n z-index: 2;\n\n ::after {\n background-color: inherit;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n border-bottom-right-radius: 3px;\n border-right: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow: 2px 2px 8px rgb(4 3 4 / 10%);\n content: '';\n height: 14px;\n position: absolute;\n width: 14px;\n z-index: -2;\n\n ${({ anchorAlignment, anchorOffset }) => {\n switch (anchorAlignment) {\n case AnchorAlignment.Bottom:\n return css`\n bottom: -7px;\n left: calc(50% - 7px + ${anchorOffset}px);\n transform: rotate(45deg);\n `;\n case AnchorAlignment.Top:\n return css`\n top: -7px;\n left: calc(50% - 7px + ${anchorOffset}px);\n transform: rotate(225deg);\n `;\n default:\n return undefined;\n }\n }}\n }\n\n ::before {\n background-color: inherit;\n bottom: 0;\n content: '';\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: -1;\n }\n`;\n\nexport const StyledSkinTonePopupContentEmoji = styled.div`\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n font-size: 24px;\n justify-content: center;\n`;\n\nexport const StyledSkinTonePopupOverlay = styled.div`\n cursor: default;\n height: 100%;\n left: 0;\n position: absolute;\n width: 100%;\n z-index: 1;\n`;\n"],"mappings":";;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAAqE,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kC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AE;EACVC,KAAK,EAAE;AACX,CAAC;AAACH,OAAA,CAAAC,wBAAA,GAAAA,wBAAA;AAMK,MAAMG,0BAA0B,GAAGP,yBAAM,CAACE,GAAqC;AACtF;AACA,wBAAwBM,IAAA;EAAA,IAAC;IAAEC;EAAuC,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AACrF;AACA;AACA;AACA;AACA,cAAcL,wBAAwB,CAACC,MAAO;AAC9C;AACA;AACA,aAAaD,wBAAwB,CAACE,KAAM;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAUI,KAAA,IAAuC;EAAA,IAAtC;IAAEC,eAAe;IAAEC;EAAa,CAAC,GAAAF,KAAA;EAChC,QAAQC,eAAe;IACnB,KAAKE,0BAAe,CAACC,MAAM;MACvB,OAAO,IAAAC,qBAAG,CAAC;AAC/B;AACA,iDAAiDH,YAAa;AAC9D;AACA,qBAAqB;IACL,KAAKC,0BAAe,CAACG,GAAG;MACpB,OAAO,IAAAD,qBAAG,CAAC;AAC/B;AACA,iDAAiDH,YAAa;AAC9D;AACA,qBAAqB;IACL;MACI,OAAOK,SAAS;EAAC;AAE7B,CAAE;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAACd,OAAA,CAAAI,0BAAA,GAAAA,0BAAA;AAEK,MAAMW,+BAA+B,GAAGlB,yBAAM,CAACE,GAAI;AAC1D;AACA;AACA;AACA;AACA;AACA,CAAC;AAACC,OAAA,CAAAe,+BAAA,GAAAA,+BAAA;AAEK,MAAMC,0BAA0B,GAAGnB,yBAAM,CAACE,GAAI;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAACC,OAAA,CAAAgB,0BAAA,GAAAA,0BAAA"}
@@ -0,0 +1,36 @@
1
+ import { FC } from 'react';
2
+ import { PopupAlignment } from '../../constants/alignment';
3
+ export type EmojiPickerPopupProps = {
4
+ /**
5
+ * Access token of the logged-in user. Is needed to load and save the history of the emojis.
6
+ */
7
+ accessToken?: string;
8
+ /**
9
+ * Sets the alignment of the popup to a fixed value. If this value is not set, the component
10
+ * calculates the best position on its own. Use the imported 'PopupAlignment' enum to set this
11
+ * value.
12
+ */
13
+ alignment?: PopupAlignment;
14
+ /**
15
+ * Function that is executed when the visibility of the popup changes.
16
+ * @param {boolean} isVisible - Whether the popup is visible or not
17
+ */
18
+ onPopupVisibilityChange?: (isVisible: boolean) => void;
19
+ /**
20
+ * Person id of the logged-in user. Is needed to load and save the history of the emojis.
21
+ */
22
+ personId?: string;
23
+ /**
24
+ * Function executed when an emoji is selected in the popup
25
+ * @param {string} emoji - Emoji that was selected
26
+ */
27
+ onSelect: (emoji: string) => void;
28
+ };
29
+ export type PopupPosition = {
30
+ bottom?: number;
31
+ left?: number;
32
+ right?: number;
33
+ top?: number;
34
+ };
35
+ declare const EmojiPickerPopup: FC<EmojiPickerPopupProps>;
36
+ export default EmojiPickerPopup;
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _Icon = _interopRequireDefault(require("@chayns-components/core/lib/components/icon/Icon"));
8
+ var _framerMotion = require("framer-motion");
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _alignment = require("../../constants/alignment");
11
+ var _EmojiPicker = _interopRequireDefault(require("../emoji-picker/EmojiPicker"));
12
+ var _EmojiPicker2 = require("../emoji-picker/EmojiPicker.styles");
13
+ var _EmojiPickerPopup = require("./EmojiPickerPopup.styles");
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+ const EmojiPickerPopup = _ref => {
18
+ let {
19
+ accessToken,
20
+ alignment,
21
+ onPopupVisibilityChange,
22
+ onSelect,
23
+ personId
24
+ } = _ref;
25
+ const [internalAlignment, setInternalAlignment] = (0, _react.useState)(_alignment.PopupAlignment.TopLeft);
26
+ const [shouldShowPopup, setShouldShowPopup] = (0, _react.useState)(false);
27
+ const [position, setPosition] = (0, _react.useState)({});
28
+ const contentRef = (0, _react.useRef)(null);
29
+ const handleHide = (0, _react.useCallback)(() => {
30
+ setShouldShowPopup(false);
31
+ }, []);
32
+ const handleDocumentClick = (0, _react.useCallback)(event => {
33
+ var _contentRef$current;
34
+ if (!((_contentRef$current = contentRef.current) !== null && _contentRef$current !== void 0 && _contentRef$current.contains(event.target))) {
35
+ event.preventDefault();
36
+ event.stopPropagation();
37
+ handleHide();
38
+ }
39
+ }, [handleHide]);
40
+ const handlePopupIconClick = (0, _react.useCallback)(event => {
41
+ if (shouldShowPopup) {
42
+ setShouldShowPopup(false);
43
+ return;
44
+ }
45
+ const {
46
+ height,
47
+ left,
48
+ top,
49
+ width
50
+ } = event.currentTarget.getBoundingClientRect();
51
+ let newInternalAlignment = alignment;
52
+ if (typeof newInternalAlignment !== 'number') {
53
+ if (top < _EmojiPicker2.emojiPickerSize.height + 16) {
54
+ if (left < _EmojiPicker2.emojiPickerSize.width + 16) {
55
+ newInternalAlignment = _alignment.PopupAlignment.BottomRight;
56
+ } else {
57
+ newInternalAlignment = _alignment.PopupAlignment.BottomLeft;
58
+ }
59
+ } else if (left < _EmojiPicker2.emojiPickerSize.width + 16) {
60
+ newInternalAlignment = _alignment.PopupAlignment.TopRight;
61
+ } else {
62
+ newInternalAlignment = _alignment.PopupAlignment.TopLeft;
63
+ }
64
+ }
65
+ let newPosition = {};
66
+ switch (newInternalAlignment) {
67
+ case _alignment.PopupAlignment.BottomLeft:
68
+ newPosition = {
69
+ left: 8 + width - _EmojiPicker2.emojiPickerSize.width,
70
+ top: 12 + height
71
+ };
72
+ break;
73
+ case _alignment.PopupAlignment.BottomRight:
74
+ newPosition = {
75
+ left: -10,
76
+ top: 12 + height
77
+ };
78
+ break;
79
+ case _alignment.PopupAlignment.TopLeft:
80
+ newPosition = {
81
+ left: 8 + width - _EmojiPicker2.emojiPickerSize.width,
82
+ top: -12 - _EmojiPicker2.emojiPickerSize.height
83
+ };
84
+ break;
85
+ case _alignment.PopupAlignment.TopRight:
86
+ newPosition = {
87
+ left: -10,
88
+ top: -12 - _EmojiPicker2.emojiPickerSize.height
89
+ };
90
+ break;
91
+ default:
92
+ break;
93
+ }
94
+ setInternalAlignment(newInternalAlignment);
95
+ setPosition(newPosition);
96
+ setShouldShowPopup(true);
97
+ }, [alignment, shouldShowPopup]);
98
+ (0, _react.useEffect)(() => {
99
+ if (shouldShowPopup) {
100
+ document.addEventListener('click', handleDocumentClick, true);
101
+ window.addEventListener('blur', handleHide);
102
+ }
103
+ return () => {
104
+ document.removeEventListener('click', handleDocumentClick, true);
105
+ window.removeEventListener('blur', handleHide);
106
+ };
107
+ }, [handleDocumentClick, handleHide, shouldShowPopup]);
108
+ (0, _react.useEffect)(() => {
109
+ if (typeof onPopupVisibilityChange === 'function') {
110
+ onPopupVisibilityChange(shouldShowPopup);
111
+ }
112
+ }, [onPopupVisibilityChange, shouldShowPopup]);
113
+ const exitAndInitialY = internalAlignment === _alignment.PopupAlignment.TopLeft || internalAlignment === _alignment.PopupAlignment.TopRight ? -16 : 16;
114
+ return /*#__PURE__*/_react.default.createElement(_EmojiPickerPopup.StyledEmojiPickerPopup, null, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
115
+ initial: false
116
+ }, shouldShowPopup && /*#__PURE__*/_react.default.createElement(_EmojiPickerPopup.StyledMotionEmojiPickerPopupContent, {
117
+ alignment: internalAlignment,
118
+ animate: {
119
+ opacity: 1,
120
+ y: 0
121
+ },
122
+ exit: {
123
+ opacity: 0,
124
+ y: exitAndInitialY
125
+ },
126
+ initial: {
127
+ opacity: 0,
128
+ y: exitAndInitialY
129
+ },
130
+ key: "emojiPickerPopupContent",
131
+ ref: contentRef,
132
+ style: position,
133
+ transition: {
134
+ type: 'tween'
135
+ }
136
+ }, /*#__PURE__*/_react.default.createElement(_EmojiPicker.default, {
137
+ accessToken: accessToken,
138
+ onSelect: onSelect,
139
+ personId: personId
140
+ }))), /*#__PURE__*/_react.default.createElement(_Icon.default, {
141
+ className: "prevent-lose-focus",
142
+ icons: ['far fa-smile'],
143
+ onClick: handlePopupIconClick,
144
+ size: 18
145
+ }));
146
+ };
147
+ EmojiPickerPopup.displayName = 'EmojiPickerPopup';
148
+ var _default = EmojiPickerPopup;
149
+ exports.default = _default;
150
+ //# sourceMappingURL=EmojiPickerPopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmojiPickerPopup.js","names":["_Icon","_interopRequireDefault","require","_framerMotion","_react","_interopRequireWildcard","_alignment","_EmojiPicker","_EmojiPicker2","_EmojiPickerPopup","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","EmojiPickerPopup","_ref","accessToken","alignment","onPopupVisibilityChange","onSelect","personId","internalAlignment","setInternalAlignment","useState","PopupAlignment","TopLeft","shouldShowPopup","setShouldShowPopup","position","setPosition","contentRef","useRef","handleHide","useCallback","handleDocumentClick","event","_contentRef$current","current","contains","target","preventDefault","stopPropagation","handlePopupIconClick","height","left","top","width","currentTarget","getBoundingClientRect","newInternalAlignment","emojiPickerSize","BottomRight","BottomLeft","TopRight","newPosition","useEffect","document","addEventListener","window","removeEventListener","exitAndInitialY","createElement","StyledEmojiPickerPopup","AnimatePresence","initial","StyledMotionEmojiPickerPopupContent","animate","opacity","y","exit","ref","style","transition","type","className","icons","onClick","size","displayName","_default","exports"],"sources":["../../../src/components/emoji-picker-popup/EmojiPickerPopup.tsx"],"sourcesContent":["import Icon from '@chayns-components/core/lib/components/icon/Icon';\nimport { AnimatePresence } from 'framer-motion';\nimport React, { FC, MouseEvent, useCallback, useEffect, useRef, useState } from 'react';\nimport { PopupAlignment } from '../../constants/alignment';\nimport EmojiPicker from '../emoji-picker/EmojiPicker';\nimport { emojiPickerSize } from '../emoji-picker/EmojiPicker.styles';\nimport {\n StyledEmojiPickerPopup,\n StyledMotionEmojiPickerPopupContent,\n} from './EmojiPickerPopup.styles';\n\nexport type EmojiPickerPopupProps = {\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 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 alignment?: PopupAlignment;\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 * Function executed when an emoji is selected in the popup\n * @param {string} emoji - Emoji that was selected\n */\n onSelect: (emoji: string) => void;\n};\n\nexport type PopupPosition = {\n bottom?: number;\n left?: number;\n right?: number;\n top?: number;\n};\n\nconst EmojiPickerPopup: FC<EmojiPickerPopupProps> = ({\n accessToken,\n alignment,\n onPopupVisibilityChange,\n onSelect,\n personId,\n}) => {\n const [internalAlignment, setInternalAlignment] = useState<PopupAlignment>(\n PopupAlignment.TopLeft\n );\n const [shouldShowPopup, setShouldShowPopup] = useState(false);\n const [position, setPosition] = useState({} as PopupPosition);\n\n const contentRef = useRef<HTMLDivElement>(null);\n\n const handleHide = useCallback(() => {\n setShouldShowPopup(false);\n }, []);\n\n const handleDocumentClick = useCallback<EventListener>(\n (event) => {\n if (!contentRef.current?.contains(event.target as Node)) {\n event.preventDefault();\n event.stopPropagation();\n\n handleHide();\n }\n },\n [handleHide]\n );\n\n const handlePopupIconClick = useCallback(\n (event: MouseEvent<HTMLSpanElement>) => {\n if (shouldShowPopup) {\n setShouldShowPopup(false);\n\n return;\n }\n\n const { height, left, top, width } = event.currentTarget.getBoundingClientRect();\n\n let newInternalAlignment: PopupAlignment | undefined = alignment;\n\n if (typeof newInternalAlignment !== 'number') {\n if (top < emojiPickerSize.height + 16) {\n if (left < emojiPickerSize.width + 16) {\n newInternalAlignment = PopupAlignment.BottomRight;\n } else {\n newInternalAlignment = PopupAlignment.BottomLeft;\n }\n } else if (left < emojiPickerSize.width + 16) {\n newInternalAlignment = PopupAlignment.TopRight;\n } else {\n newInternalAlignment = PopupAlignment.TopLeft;\n }\n }\n\n let newPosition: PopupPosition = {};\n\n switch (newInternalAlignment) {\n case PopupAlignment.BottomLeft:\n newPosition = { left: 8 + width - emojiPickerSize.width, top: 12 + height };\n break;\n case PopupAlignment.BottomRight:\n newPosition = { left: -10, top: 12 + height };\n break;\n case PopupAlignment.TopLeft:\n newPosition = {\n left: 8 + width - emojiPickerSize.width,\n top: -12 - emojiPickerSize.height,\n };\n break;\n case PopupAlignment.TopRight:\n newPosition = { left: -10, top: -12 - emojiPickerSize.height };\n break;\n default:\n break;\n }\n\n setInternalAlignment(newInternalAlignment);\n setPosition(newPosition);\n setShouldShowPopup(true);\n },\n [alignment, shouldShowPopup]\n );\n\n useEffect(() => {\n if (shouldShowPopup) {\n document.addEventListener('click', handleDocumentClick, true);\n window.addEventListener('blur', handleHide);\n }\n\n return () => {\n document.removeEventListener('click', handleDocumentClick, true);\n window.removeEventListener('blur', handleHide);\n };\n }, [handleDocumentClick, handleHide, shouldShowPopup]);\n\n useEffect(() => {\n if (typeof onPopupVisibilityChange === 'function') {\n onPopupVisibilityChange(shouldShowPopup);\n }\n }, [onPopupVisibilityChange, shouldShowPopup]);\n\n const exitAndInitialY =\n internalAlignment === PopupAlignment.TopLeft ||\n internalAlignment === PopupAlignment.TopRight\n ? -16\n : 16;\n\n return (\n <StyledEmojiPickerPopup>\n <AnimatePresence initial={false}>\n {shouldShowPopup && (\n <StyledMotionEmojiPickerPopupContent\n alignment={internalAlignment}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: exitAndInitialY }}\n initial={{ opacity: 0, y: exitAndInitialY }}\n key=\"emojiPickerPopupContent\"\n ref={contentRef}\n style={position}\n transition={{ type: 'tween' }}\n >\n <EmojiPicker\n accessToken={accessToken}\n onSelect={onSelect}\n personId={personId}\n />\n </StyledMotionEmojiPickerPopupContent>\n )}\n </AnimatePresence>\n <Icon\n className=\"prevent-lose-focus\"\n icons={['far fa-smile']}\n onClick={handlePopupIconClick}\n size={18}\n />\n </StyledEmojiPickerPopup>\n );\n};\n\nEmojiPickerPopup.displayName = 'EmojiPickerPopup';\n\nexport default EmojiPickerPopup;\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AAGmC,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,i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,EAAE;MAAEF,OAAO,EAAE,CAAC;MAAEC,CAAC,EAAER;IAAgB,CAAE;IACzCI,OAAO,EAAE;MAAEG,OAAO,EAAE,CAAC;MAAEC,CAAC,EAAER;IAAgB,CAAE;IAC5CpD,GAAG,EAAC,yBAAyB;IAC7B8D,GAAG,EAAExC,UAAW;IAChByC,KAAK,EAAE3C,QAAS;IAChB4C,UAAU,EAAE;MAAEC,IAAI,EAAE;IAAQ;EAAE,gBAE9BvF,MAAA,CAAAa,OAAA,CAAA8D,aAAA,CAACxE,YAAA,CAAAU,OAAW;IACRiB,WAAW,EAAEA,WAAY;IACzBG,QAAQ,EAAEA,QAAS;IACnBC,QAAQ,EAAEA;EAAS,EACrB,CAET,CACa,eAClBlC,MAAA,CAAAa,OAAA,CAAA8D,aAAA,CAAC/E,KAAA,CAAAiB,OAAI;IACD2E,SAAS,EAAC,oBAAoB;IAC9BC,KAAK,EAAE,CAAC,cAAc,CAAE;IACxBC,OAAO,EAAElC,oBAAqB;IAC9BmC,IAAI,EAAE;EAAG,EACX,CACmB;AAEjC,CAAC;AAED/D,gBAAgB,CAACgE,WAAW,GAAG,kBAAkB;AAAC,IAAAC,QAAA,GAEnCjE,gBAAgB;AAAAkE,OAAA,CAAAjF,OAAA,GAAAgF,QAAA"}
@@ -0,0 +1,7 @@
1
+ import { PopupAlignment } from '../../constants/alignment';
2
+ export declare const StyledEmojiPickerPopup: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const StyledMotionEmojiPickerPopupContent: import("styled-components").StyledComponent<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, any, {
4
+ alignment: PopupAlignment;
5
+ } & {
6
+ theme: import("@chayns-components/core/lib/components/color-scheme-provider/ColorSchemeProvider").Theme;
7
+ }, never>;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledMotionEmojiPickerPopupContent = exports.StyledEmojiPickerPopup = void 0;
7
+ var _framerMotion = require("framer-motion");
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+ var _alignment = require("../../constants/alignment");
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ const StyledEmojiPickerPopup = _styledComponents.default.div`
13
+ align-items: center;
14
+ display: flex;
15
+ height: ${() => getComputedStyle(document.body).getPropertyValue('line-height')};
16
+ position: relative;
17
+ `;
18
+ exports.StyledEmojiPickerPopup = StyledEmojiPickerPopup;
19
+ const StyledMotionEmojiPickerPopupContent = (0, _styledComponents.default)(_framerMotion.motion.div)`
20
+ background-color: ${_ref => {
21
+ let {
22
+ theme
23
+ } = _ref;
24
+ return theme['001'];
25
+ }};
26
+ border: 1px solid rgba(0, 0, 0, 0.1);
27
+ border-radius: 3px;
28
+ box-shadow: 1px 3px 8px rgb(0 0 0 / 30%);
29
+ color: ${_ref2 => {
30
+ let {
31
+ theme
32
+ } = _ref2;
33
+ return theme.text;
34
+ }};
35
+ position: absolute;
36
+ z-index: 2;
37
+
38
+ ::after {
39
+ background-color: inherit;
40
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
41
+ border-bottom-right-radius: 3px;
42
+ border-right: 1px solid rgba(0, 0, 0, 0.1);
43
+ box-shadow: 2px 2px 8px rgb(4 3 4 / 10%);
44
+ content: '';
45
+ height: 14px;
46
+ position: absolute;
47
+ width: 14px;
48
+ z-index: -2;
49
+
50
+ ${_ref3 => {
51
+ let {
52
+ alignment
53
+ } = _ref3;
54
+ switch (alignment) {
55
+ case _alignment.PopupAlignment.TopLeft:
56
+ return (0, _styledComponents.css)`
57
+ bottom: -7px;
58
+ right: 12px;
59
+ transform: rotate(45deg);
60
+ `;
61
+ case _alignment.PopupAlignment.BottomLeft:
62
+ return (0, _styledComponents.css)`
63
+ top: -7px;
64
+ right: 12px;
65
+ transform: rotate(225deg);
66
+ `;
67
+ case _alignment.PopupAlignment.TopRight:
68
+ return (0, _styledComponents.css)`
69
+ transform: rotate(45deg);
70
+ bottom: -7px;
71
+ left: 12px;
72
+ `;
73
+ case _alignment.PopupAlignment.BottomRight:
74
+ return (0, _styledComponents.css)`
75
+ transform: rotate(225deg);
76
+ top: -7px;
77
+ left: 12px;
78
+ `;
79
+ default:
80
+ return undefined;
81
+ }
82
+ }}
83
+ }
84
+
85
+ ::before {
86
+ background-color: inherit;
87
+ bottom: 0;
88
+ content: '';
89
+ left: 0;
90
+ position: absolute;
91
+ right: 0;
92
+ top: 0;
93
+ z-index: -1;
94
+ }
95
+ `;
96
+ exports.StyledMotionEmojiPickerPopupContent = StyledMotionEmojiPickerPopupContent;
97
+ //# sourceMappingURL=EmojiPickerPopup.styles.js.map