react-input-emoji 5.6.2 → 5.6.4
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +21 -21
- package/dist/__mocks__/getSelectionMock.d.ts +5 -0
- package/dist/fixtures/examples.d.ts +5 -0
- package/dist/index.es.js +24 -29
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +24 -30
- package/dist/index.js.map +1 -1
- package/dist/src/components/emoji-picker-button.d.ts +21 -0
- package/dist/src/components/emoji-picker-container.d.ts +26 -0
- package/dist/src/components/emoji-picker-wrapper.d.ts +37 -0
- package/dist/src/components/emoji-picker.d.ts +23 -0
- package/dist/src/components/mention-user-list.d.ts +15 -0
- package/dist/src/components/mention-wrapper.d.ts +29 -0
- package/dist/src/components/mention-wrapper.test.d.ts +1 -0
- package/dist/src/hooks/use-emit.d.ts +10 -0
- package/dist/src/hooks/use-event-listeners.d.ts +9 -0
- package/dist/src/hooks/use-event-listeners.test.d.ts +1 -0
- package/dist/src/hooks/use-expose.d.ts +18 -0
- package/dist/src/hooks/use-mention.d.ts +17 -0
- package/dist/src/hooks/use-mention.test.d.ts +1 -0
- package/dist/src/hooks/use-sanitize.d.ts +19 -0
- package/dist/src/hooks/user-pollute.d.ts +9 -0
- package/dist/src/index.d.ts +48 -0
- package/dist/src/text-input.d.ts +30 -0
- package/dist/src/utils/emoji-utils.d.ts +20 -0
- package/dist/src/utils/input-event-utils.d.ts +95 -0
- package/dist/src/utils/mention-utils.d.ts +15 -0
- package/dist/src/utils/observer.d.ts +5 -0
- package/dist/src/utils/use-debounce.d.ts +1 -0
- package/package.json +5 -5
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/emoji-utils.js","../src/utils/input-event-utils.js","../src/hooks/use-sanitize.js","../src/hooks/use-expose.js","../src/hooks/use-emit.js","../src/text-input.js","../src/components/emoji-picker-button.js","../node_modules/@emoji-mart/react/dist/module.js","../src/components/emoji-picker.js","../src/components/emoji-picker-container.js","../src/components/emoji-picker-wrapper.js","../src/utils/mention-utils.js","../src/hooks/use-mention.js","../src/components/mention-user-list.js","../src/components/mention-wrapper.js","../src/utils/observer.js","../src/hooks/use-event-listeners.js","../src/hooks/user-pollute.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/* eslint-disable valid-jsdoc */\n// @ts-check\n\nexport const TRANSPARENT_GIF =\n \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\n\nexport const EMOJI_STYLE = \"\";\n\n/**\n * Replace all text with emoji with an image html tag\n * @param {string} text\n * @return {string}\n */\nexport function replaceAllTextEmojis(text) {\n let allEmojis = getAllEmojisFromText(text);\n\n if (allEmojis) {\n allEmojis = [...new Set(allEmojis)]; // remove duplicates\n\n allEmojis.forEach(emoji => {\n text = replaceAll(text, emoji, getInputEmojiHTML(emoji));\n });\n }\n\n return text;\n}\n\n/**\n * Replace all occurrencies in a string\n * @param {string} str\n * @param {string} find\n * @param {string} replace\n * @return {string}\n */\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}\n\n/**\n * Get all emojis from the text\n * @param {string} text\n * @return {string[]}\n */\nfunction getAllEmojisFromText(text) {\n return text.match(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n );\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param { import(\"../types/types\").EmojiMartItem } emoji\n * @return {string}\n */\nexport function getImageEmoji(emoji) {\n /** @type {HTMLElement | null} */\n const emojiPickerEl = document.querySelector('em-emoji-picker')\n\n if (!emojiPickerEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n /** @type {HTMLSpanElement | null=} */\n const emojiSpanEl = emojiPickerEl?.shadowRoot?.querySelector(`[title=\"${emoji.name}\"] > span > span`)\n\n if (!emojiSpanEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n return getInputEmojiHTML(style, emoji.native);\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {string} style\n * @param {string} emoji\n * @returns\n */\nfunction getInputEmojiHTML(style, emoji) {\n return `<img style=\"${style}; display: inline-block\" data-emoji=\"${emoji}\" src=\"${TRANSPARENT_GIF}\" />`;\n}\n\n/**\n * \n * @param {string} emoji \n * @returns \n */\nfunction getInputEmojiNativeHTML(emoji) {\n return `<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">${emoji}</span>`;\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllTextEmojiToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n container.innerHTML = container.innerHTML.replace(\n image.outerHTML,\n image.dataset.emoji\n );\n });\n\n return container.innerHTML;\n}\n","// @ts-check\n\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"./emoji-utils\";\n\n/**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\nexport function handleCopy(event) {\n const selectedText = window.getSelection();\n\n if (selectedText === null) {\n return\n }\n\n let container = document.createElement(\"div\");\n\n for (let i = 0, len = selectedText.rangeCount; i < len; ++i) {\n container.appendChild(selectedText.getRangeAt(i).cloneContents());\n }\n\n container = replaceEmojiToString(container);\n\n event.clipboardData.setData(\"text\", container.innerText);\n event.preventDefault();\n}\n\n/**\n *\n * @param {string} html\n */\nexport function handlePasteHtmlAtCaret(html) {\n let sel;\n let range;\n if (window.getSelection) {\n // IE9 and non-IE\n sel = window.getSelection();\n\n if (sel === null) return\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = sel.getRangeAt(0);\n range.deleteContents();\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n const el = document.createElement(\"div\");\n el.innerHTML = html;\n const frag = document.createDocumentFragment();\n let node;\n let lastNode;\n while ((node = el.firstChild)) {\n lastNode = frag.appendChild(node);\n }\n range.insertNode(frag);\n\n // Preserve the selection\n if (lastNode) {\n range = range.cloneRange();\n range.setStartAfter(lastNode);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n}\n\n/**\n * Replace emoji img to its string value\n * @param {HTMLDivElement} container\n * @return {HTMLDivElement}\n */\nfunction replaceEmojiToString(container) {\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n image.outerHTML = image.dataset.emoji;\n });\n\n return container;\n}\n\n/**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\nexport function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = replaceAllTextEmojis(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n}\n\n/**\n * @typedef {object} HandleKeyDownOptions\n * @property {HTMLDivElement} placeholderEl\n * @property {number} maxLength\n * @property {HTMLDivElement} inputEl\n * @property {React.MutableRefObject<string>} cleanedTextRef\n * @property {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @property {boolean} cleanOnEnter\n * @property {function(): void} emitChange\n * @property {(function(string): void)=} onEnter\n * @property {(function(KeyboardEvent): void)=} onKeyDown\n * @property {(function(string): void)} updateHTML\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @typedef {Object} HandleSelectEmojiProps\n * @property {import(\"../types/types\").EmojiMartItem} emoji\n * @property {React.MutableRefObject<import('../text-input').Ref>} textInputRef\n * @property {boolean} keepOpened\n * @property {() => void} toggleShowPicker\n * @property {number=} maxLength\n */\n\n/**\n *\n * @param {HandleSelectEmojiProps} props\n */\nexport function handleSelectEmoji({\n emoji,\n textInputRef,\n keepOpened,\n toggleShowPicker,\n maxLength\n}) {\n if (\n typeof maxLength !== \"undefined\" &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n textInputRef.current.appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n toggleShowPicker();\n }\n}\n\n/**\n *\n * @param {{text: string, html: string}} props\n * @return {number}\n */\nexport function totalCharacters({ text, html }) {\n const textCount = text.length;\n const emojisCount = (html.match(/<img/g) || []).length;\n\n return textCount + emojisCount;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * Handle keyup event\n * @param {() => void} emitChange\n * @param {(event: KeyboardEvent) => void} onKeyDownMention\n * @param {React.MutableRefObject<string>} cleanedTextRef\n * @param {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @return {(event: KeyboardEvent) => void}\n */\nexport function handleKeyup(\n emitChange,\n onKeyDownMention,\n cleanedTextRef,\n textInputRef\n) {\n return event => {\n const text = replaceAllTextEmojiToString(textInputRef.current.innerHTML);\n cleanedTextRef.current = text;\n emitChange();\n onKeyDownMention(event);\n };\n}\n\n/**\n * Handle focus event\n * @param {function(FocusEvent): void} onFocus\n * @return {function(FocusEvent): void}\n */\nexport function handleFocus(onFocus) {\n return event => {\n onFocus(event);\n };\n}\n\n/**\n * Set caret to the end of text value\n * @param {React.MutableRefObject<HTMLDivElement| null>} input\n */\nexport function moveCaretToEnd(input) {\n let range\n let selection\n if(document.createRange && input.current) {\n range = document.createRange()\n range.selectNodeContents(input.current)\n range.collapse(false)\n selection = window.getSelection()\n if(selection) {\n selection.removeAllRanges()\n selection.addRange(range)\n }\n }\n}\n/**\n * \n * @param {HTMLDivElement} inputDiv \n * @return {string}\n */\nexport function removeHtmlExceptBr(inputDiv) {\n const temp = inputDiv.innerHTML.replace(/<br\\s*\\/?>/gi, '[BR]'); // temporarily replace <br> with placeholder\n const stripped = temp.replace(/<[^>]+>/g, ''); // strip all html tags\n const final = stripped.replace(/\\[BR\\]/gi, '</br>'); // replace placeholders with <br>\n return final;\n}","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\nimport { removeHtmlExceptBr } from \"../utils/input-event-utils\";\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @param {boolean} shouldReturn\n */\nexport function useSanitize(shouldReturn) {\n /** @type {React.MutableRefObject<SanitizeFn[]>} */\n const sanitizeFnsRef = useRef([]);\n\n const sanitizedTextRef = useRef(\"\");\n\n /** @type {(fn: SanitizeFn) => void} */\n const addSanitizeFn = useCallback(fn => {\n sanitizeFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const sanitize = useCallback(html => {\n let result = sanitizeFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, html);\n\n result = replaceAllHtmlToString(result, shouldReturn);\n\n sanitizedTextRef.current = result;\n\n return result;\n }, []);\n\n return { addSanitizeFn, sanitize, sanitizedTextRef };\n}\n\n/**\n *\n * @param {string} html\n * @param {boolean} shouldReturn\n * @return {string}\n */\nexport function replaceAllHtmlToString(html, shouldReturn) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n let text\n if(shouldReturn) {\n text = removeHtmlExceptBr(container)\n } else {\n text = container.innerText || \"\";\n }\n\n // remove all ↵ for safari\n text = text.replace(/\\n/gi, \"\");\n\n return text;\n}\n","// @ts-check\n\nimport { useImperativeHandle } from \"react\";\nimport { useSanitize } from \"./use-sanitize\";\n\n/**\n * @typedef {Object} Props\n * @property {React.Ref<any>} ref\n * @property {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @property {(value: string) => void} setValue\n * @property {() => void} emitChange\n */\n\n/**\n *\n * @param {Props} props\n */\nexport function useExpose({ ref, textInputRef, setValue, emitChange }) {\n const { sanitize, sanitizedTextRef } = useSanitize();\n\n useImperativeHandle(ref, () => ({\n get value() {\n return sanitizedTextRef.current;\n },\n set value(value) {\n setValue(value);\n },\n focus: () => {\n if (textInputRef.current === null) return\n textInputRef.current.focus();\n },\n blur: () => {\n if (textInputRef.current !== null) {\n sanitize(textInputRef.current.html);\n\n }\n\n emitChange();\n }\n }));\n}\n","// @ts-check\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * useEmit\n * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @param {(size: {width: number, height: number}) => void} onResize\n * @param {(text: string) => void} onChange\n */\nexport function useEmit(textInputRef, onResize, onChange) {\n /** @type {React.MutableRefObject<{width: number; height: number} | null>} */\n const currentSizeRef = useRef(null);\n const onChangeFn = useRef(onChange);\n\n const checkAndEmitResize = useCallback(() => {\n if (textInputRef.current !== null) {\n const currentSize = currentSizeRef.current;\n\n const nextSize = textInputRef.current.size;\n\n if (\n (!currentSize ||\n currentSize.width !== nextSize.width ||\n currentSize.height !== nextSize.height) &&\n typeof onResize === \"function\"\n ) {\n onResize(nextSize);\n }\n\n currentSizeRef.current = nextSize;\n }\n }, [onResize, textInputRef]);\n\n const emitChange = useCallback((sanitizedText) => {\n if (typeof onChangeFn.current === \"function\") {\n onChangeFn.current(sanitizedText);\n }\n\n if (typeof onResize === \"function\") {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, onResize]);\n\n useEffect(() => {\n if (textInputRef.current) {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, textInputRef]);\n\n return emitChange;\n}\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, { useImperativeHandle, forwardRef, useRef } from \"react\";\nimport { handlePasteHtmlAtCaret, moveCaretToEnd } from \"./utils/input-event-utils\";\nimport { replaceAllTextEmojiToString } from \"./utils/emoji-utils\";\n\n/**\n * @typedef {Object} Props\n * @property {(event: React.KeyboardEvent) => void} onKeyDown\n * @property {(event: React.KeyboardEvent) => void} onKeyUp\n * @property {() => void} onFocus\n * @property {() => void} onBlur\n * @property {(sanitizedText: string) => void=} onChange\n * @property {(event: React.KeyboardEvent) => void} onArrowUp\n * @property {(event: React.KeyboardEvent) => void} onArrowDown\n * @property {(event: React.KeyboardEvent) => void} onEnter\n * @property {boolean} shouldReturn\n * @property {(event: React.ClipboardEvent) => void} onCopy\n * @property {(event: React.ClipboardEvent) => void} onPaste\n * @property {string} placeholder\n * @property {React.CSSProperties} style\n * @property {number} tabIndex\n * @property {string} className\n * @property {(html: string) => void} onChange\n */\n\n/**\n * @typedef {{\n * appendContent: (html: string) => void;\n * html: string;\n * text: string;\n * size: { width: number; height: number;};\n * focus: () => void;\n * }} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst TextInput = (\n { placeholder, style, tabIndex, className, onChange, ...props },\n ref\n) => {\n useImperativeHandle(ref, () => ({\n appendContent: html => {\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n handlePasteHtmlAtCaret(html);\n\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else if (placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n\n if (textInputRef.current && typeof onChange === 'function') {\n onChange(textInputRef.current.innerHTML);\n }\n },\n set html(value) {\n if (textInputRef.current) {\n textInputRef.current.innerHTML = value;\n }\n \n if (placeholderRef.current) {\n const text = replaceAllTextEmojiToString(value)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n },\n get html() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerHTML;\n },\n get text() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerText;\n },\n get size() {\n if (!textInputRef.current) {\n return {\n width: 0,\n height: 0\n }\n }\n\n return {\n width: textInputRef.current.offsetWidth,\n height: textInputRef.current.offsetHeight\n };\n },\n focus() {\n if (!textInputRef.current) return\n\n textInputRef.current.focus();\n }\n }));\n\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const placeholderRef = useRef(null);\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const textInputRef = useRef(null);\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n if (event.key === \"Enter\" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {\n event.preventDefault();\n if(textInputRef.current) {\n textInputRef.current.innerHTML = `${textInputRef.current.innerHTML}</br></br>`\n moveCaretToEnd(textInputRef)\n return;\n }\n } \n if (event.key === \"Enter\") {\n props.onEnter(event);\n } else if (event.key === \"ArrowUp\") {\n props.onArrowUp(event);\n } else if (event.key === \"ArrowDown\") {\n props.onArrowDown(event);\n } else {\n if (event.key.length === 1 && placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n props.onKeyDown(event);\n }\n\n /** */\n function handleClick() {\n props.onFocus();\n }\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyUp(event) {\n props.onKeyUp(event);\n\n const input = textInputRef.current;\n\n if (placeholderRef.current && input) {\n const text = replaceAllTextEmojiToString(input.innerHTML)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n }\n\n return (\n <div className=\"react-input-emoji--container\" style={style}>\n <div className=\"react-input-emoji--wrapper\" onClick={handleClick}>\n <div ref={placeholderRef} className=\"react-input-emoji--placeholder\">\n {placeholder}\n </div>\n <div\n ref={textInputRef}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n tabIndex={tabIndex}\n contentEditable\n className={`react-input-emoji--input${className ? ` ${className}` : \"\"\n }`}\n onBlur={props.onBlur}\n onCopy={props.onCopy}\n onPaste={props.onPaste}\n data-testid=\"react-input-emoji--input\"\n />\n </div>\n </div>\n );\n};\n\nconst TextInputWithRef = forwardRef(TextInput);\n\nexport default TextInputWithRef;\n","/* eslint-disable react/prop-types */\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {(event: React.MouseEvent) => void} toggleShowPicker\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerButton({ showPicker, toggleShowPicker, buttonElement, buttonRef }) {\n \n const localButtonRef = useRef(null);\n const [showCustomButtonContent, setShowCustomButtonContent] = useState(false);\n\n useEffect(() => {\n if ((buttonRef?.current?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);\n setShowCustomButtonContent(true);\n } else if ((buttonElement?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonElement?.childNodes[0]);\n setShowCustomButtonContent(true);\n }\n }, [buttonElement?.childNodes]);\n\n return (\n <button\n ref={localButtonRef}\n type=\"button\"\n className={`react-input-emoji--button${\n showPicker ? \" react-input-emoji--button__show\" : \"\"\n }`}\n onClick={toggleShowPicker}\n >\n {!showCustomButtonContent && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n className=\"react-input-emoji--button--icon\"\n >\n {/* eslint-disable-next-line max-len */}\n <path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\" />\n {/* eslint-disable-next-line max-len */}\n <path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\" />\n </svg>\n )}\n </button>\n );\n}\n\nexport default EmojiPickerButton;\n","import $dvPge$react, {useRef as $dvPge$useRef, useEffect as $dvPge$useEffect} from \"react\";\nimport {Picker as $dvPge$Picker} from \"emoji-mart\";\n\n\n\nfunction $e5534fc185f7111e$export$2e2bcd8739ae039(props) {\n const ref = (0, $dvPge$useRef)(null);\n const instance = (0, $dvPge$useRef)(null);\n if (instance.current) instance.current.update(props);\n (0, $dvPge$useEffect)(()=>{\n instance.current = new (0, $dvPge$Picker)({\n ...props,\n ref: ref\n });\n return ()=>{\n instance.current = null;\n };\n }, []);\n return /*#__PURE__*/ (0, $dvPge$react).createElement(\"div\", {\n ref: ref\n });\n}\n\n\nexport {$e5534fc185f7111e$export$2e2bcd8739ae039 as default};\n//# sourceMappingURL=module.js.map\n","// vendors\nimport React, { memo, useMemo } from \"react\";\nimport Picker from \"@emoji-mart/react\";\n\n/**\n * @typedef {object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {function(import(\"../types/types\").EmojiMartItem): void} onSelectEmoji\n * @property {boolean} disableRecent\n * @property {import(\"emoji-mart\").CustomEmoji[]=} customEmojis\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Component\n * @param {Props} props\n * @return {React.FC}\n */\nfunction EmojiPicker(props) {\n const { theme, onSelectEmoji, disableRecent, customEmojis, language } = props;\n\n /** @type {string[]} */\n const categories = useMemo(() => {\n /** @type {string[]} */\n let categoryies = [];\n\n if (!disableRecent) {\n categoryies.push(\"frequent\");\n }\n\n categoryies = [\n ...categoryies,\n \"people\",\n \"nature\",\n \"foods\",\n \"activity\",\n \"places\",\n \"objects\",\n \"symbols\",\n \"flags\"\n ];\n\n return categoryies;\n }, [disableRecent]);\n\n const i18n = useMemo(() => {\n if (!language) {\n return undefined\n }\n\n return require(`@emoji-mart/data/i18n/${language ?? 'en'}.json`)\n }, [language])\n\n return (\n <Picker\n data={undefined}\n theme={theme}\n previewPosition=\"none\"\n onEmojiSelect={onSelectEmoji}\n custom={customEmojis}\n categories={categories}\n set=\"apple\"\n i18n={i18n}\n />\n );\n}\n\n\nexport default memo(EmojiPicker);\n","import React from \"react\";\nimport EmojiPicker from \"./emoji-picker\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {(emoji: import(\"../types/types\").EmojiMartItem) => void} handleSelectEmoji\n * @property {boolean} disableRecent\n * @property {import(\"emoji-mart\").CustomEmoji[]=} customEmojis\n * @property {('above' | 'below')=} position\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerContainer({\n showPicker,\n theme,\n handleSelectEmoji,\n disableRecent,\n customEmojis,\n position,\n language\n}) {\n return (\n <div className=\"react-emoji-picker--container\">\n {showPicker && (\n <div\n className=\"react-emoji-picker--wrapper\"\n onClick={evt => evt.stopPropagation()}\n style={position === 'below' ? {top: '40px'} : {}}\n >\n <div className=\"react-emoji-picker\">\n <EmojiPicker\n theme={theme}\n onSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n language={language}\n />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default EmojiPickerContainer;\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, { useEffect, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"../utils/emoji-utils\";\n\nimport EmojiPickerButton from \"./emoji-picker-button\";\nimport EmojiPickerContainer from \"./emoji-picker-container\";\n\nconst EMOJI_PICKER_CONTAINER_HEIGHT = 435;\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {boolean} keepOpened\n * @property {boolean} disableRecent\n * @property {import(\"emoji-mart\").CustomEmoji[]=} customEmojis\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n * @property {(fn: PolluteFn) => void} addPolluteFn\n * @property {(html: string) => void} appendContent\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {import('../types/types').Languages=} language\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst EmojiPickerWrapper = props => {\n const {\n theme,\n keepOpened,\n disableRecent,\n customEmojis,\n addSanitizeFn,\n addPolluteFn,\n appendContent,\n buttonElement,\n buttonRef,\n language\n } = props;\n\n const [showPicker, setShowPicker] = useState(false);\n /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */\n const [customButton, setCustomButton] = useState();\n /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */\n const [emojiPickerPosition, setEmojiPickerPosition] = useState()\n\n useEffect(() => {\n addSanitizeFn(replaceAllTextEmojiToString);\n }, [addSanitizeFn]);\n\n useEffect(() => {\n addPolluteFn(replaceAllTextEmojis);\n }, [addPolluteFn]);\n\n useEffect(() => {\n /**\n *\n * @param {MouseEvent} event\n */\n function checkClickOutside(event) {\n /** @type {HTMLElement} */\n // @ts-ignore\n const element = event.target;\n\n if (\n element.classList.contains(\"react-input-emoji--button\") ||\n element.classList.contains(\"react-input-emoji--button--icon\")\n ) {\n return;\n }\n\n setShowPicker(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n /**\n *\n * @param {React.MouseEvent} event\n */\n function toggleShowPicker(event) {\n event.stopPropagation();\n event.preventDefault();\n\n setEmojiPickerPosition(calcTopPosition(event))\n\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n\n /**\n * \n * @param {React.MouseEvent} event\n * @return {'above' | 'below'}\n */\n function calcTopPosition(event) {\n const btn = event.currentTarget\n const btnRect = btn.getBoundingClientRect();\n\n const popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;\n\n // Decide to display above or below based on available space\n if (btnRect.top >= popoverHeight) {\n // Display above\n return 'above'\n } else {\n // Display below\n return 'below'\n }\n }\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {import(\"../types/types\").EmojiMartItem} emoji\n */\n function handleSelectEmoji(emoji) {\n appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n }\n\n useEffect(() => {\n if (buttonRef?.current?.style) {\n buttonRef.current.style.position = \"relative\";\n setCustomButton(buttonRef.current);\n } else if (buttonElement?.style) {\n buttonElement.style.position = \"relative\";\n setCustomButton(buttonElement);\n }\n }, [buttonRef, buttonElement]);\n\n return customButton ? (\n (ReactDOM.createPortal(\n <>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n buttonElement={customButton}\n buttonRef={buttonRef}\n />\n </>,\n customButton\n ))\n ) : (\n (<>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n />\n </>)\n );\n};\n\nexport default EmojiPickerWrapper;\n","// @ts-check\n\n/**\n *\n * @return {string | null}\n */\nexport function getTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return null;\n\n const text = range.text.substring(range.begin, range.end);\n\n return text || null;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function deleteTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return;\n\n // @ts-ignore\n range.element.deleteData(range.begin, range.end - range.begin);\n}\n\n/**\n *\n * @return {{begin: number, end: number, text: string, element: Node} | null}\n */\nfunction getRangeFromAtToCaret() {\n const elementWithFocus = getElementWithFocus();\n\n if (!elementWithFocus) {\n return null;\n }\n\n const { element, caretOffset } = elementWithFocus;\n const text = element.textContent;\n const lastAt = text.lastIndexOf(\"@\");\n\n if (\n lastAt === -1 ||\n lastAt >= caretOffset ||\n (lastAt !== 0 && text[lastAt - 1] !== \" \")\n ) {\n return null;\n }\n\n return { begin: lastAt, end: caretOffset, text, element };\n}\n\n/**\n *\n * @return {{element: Node, caretOffset: number}}\n */\nexport function getElementWithFocus() {\n const element = getSelectionStart();\n\n if (element === null) {\n return null;\n }\n\n let caretOffset = 0;\n if (typeof window.getSelection != \"undefined\") {\n const range = window.getSelection().getRangeAt(0);\n const preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if (\n // @ts-ignore\n typeof document.selection != \"undefined\" &&\n // @ts-ignore\n document.selection.type != \"Control\"\n ) {\n // @ts-ignore\n const textRange = document.selection.createRange();\n // @ts-ignore\n const preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n\n return { element, caretOffset };\n}\n\n/**\n *\n * @return {Node | null}\n */\nfunction getSelectionStart() {\n const node = document.getSelection().anchorNode;\n return node?.nodeType == 3 ? node : null;\n}\n","// @ts-check\nimport { useCallback, useState } from \"react\";\nimport {\n deleteTextFromAtToCaret,\n getElementWithFocus,\n getTextFromAtToCaret\n} from \"../utils/mention-utils\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {(text: string) => Promise<MentionUser[]>=} searchMention\n * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}\n */\nexport function useMention(searchMention) {\n const [loading, setLoading] = useState(false);\n\n /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */\n const [mentionUsers, setMentionUsers] = useState([]);\n\n /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */\n const [mentionSearchText, setMentionSearchText] = useState(null);\n\n const onSelectUser = useCallback(() => {\n deleteTextFromAtToCaret();\n setMentionUsers([]);\n }, []);\n\n /** */\n const checkMentionText = useCallback(async () => {\n const metionText = getTextFromAtToCaret();\n\n setMentionSearchText(metionText);\n\n if (metionText === null) {\n setMentionUsers([]);\n } else {\n setLoading(true);\n const users = await searchMention(metionText);\n setLoading(false);\n setMentionUsers(users);\n }\n }, [searchMention]);\n\n /** @type {(event: React.KeyboardEvent) => void} */\n const onKeyUp = useCallback(\n async event => {\n if (typeof searchMention !== \"function\") return;\n\n if (\n event.key === \"Backspace\" &&\n getElementWithFocus()?.element.parentElement.hasAttribute(\n \"data-mention-id\"\n )\n ) {\n const elementWithFocus = getElementWithFocus();\n elementWithFocus.element.parentElement.remove();\n } else if (\n ![\"ArrowUp\", \"ArrowDown\", \"Esc\", \"Escape\"].includes(event.key)\n ) {\n checkMentionText();\n }\n },\n [checkMentionText, searchMention]\n );\n\n const onFocus = useCallback(() => {\n checkMentionText();\n }, [checkMentionText]);\n\n return {\n mentionSearchText,\n mentionUsers,\n onKeyUp,\n onFocus,\n onSelectUser,\n loading\n };\n}\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, {\n useImperativeHandle,\n useState,\n forwardRef,\n useMemo,\n useEffect\n} from \"react\";\nimport t from \"prop-types\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {Object} Props\n * @property {MentionUser[]} users\n * @property {string | null} mentionSearchText\n * @property {(user: MentionUser) => void} onSelect\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n */\n\n/**\n * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst MentionUserList = (\n { users, mentionSearchText, onSelect, addEventListener },\n ref\n) => {\n const [selectedUser, setSelectedUser] = useState(0);\n\n useImperativeHandle(ref, () => ({\n prevUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === 0) {\n return 0;\n }\n\n return currentSelectedUser - 1;\n });\n },\n nextUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === users.length - 1) {\n return users.length - 1;\n }\n\n return currentSelectedUser + 1;\n });\n }\n }));\n\n useEffect(() => {\n setSelectedUser(0);\n }, [users]);\n\n /**\n *\n * @param {string} selectedText\n * @param {string} rest\n * @return {string}\n */\n function getMentionSelectedNameEl(selectedText, rest) {\n return `<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">${selectedText}</span>${rest}`;\n }\n\n /** @type {(MentionUser & {nameHtml: string})[]} */\n const usersFiltered = useMemo(() => {\n const searchText = mentionSearchText\n ? mentionSearchText.substring(1).toLocaleLowerCase()\n : \"\";\n return users.map(user => {\n let nameHtml = user.name;\n\n if (mentionSearchText && mentionSearchText.length > 1) {\n if (user.name.toLowerCase().startsWith(searchText)) {\n nameHtml = getMentionSelectedNameEl(\n user.name.substring(0, searchText.length),\n user.name.substring(searchText.length)\n );\n } else {\n const names = user.name.split(\" \");\n\n nameHtml = names\n .map(name => {\n if (name.toLocaleLowerCase().startsWith(searchText)) {\n return getMentionSelectedNameEl(\n name.substring(0, searchText.length),\n name.substring(searchText.length)\n );\n }\n return name;\n })\n .join(\" \");\n }\n }\n\n return {\n ...user,\n nameHtml\n };\n });\n }, [mentionSearchText, users]);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {MentionUser} user\n * @returns {(event: React.MouseEvent) => void} event\n */\n function handleClick(user) {\n return event => {\n event.stopPropagation();\n event.preventDefault();\n\n onSelect(user);\n };\n }\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"enter\", event => {\n event.stopPropagation();\n event.preventDefault();\n onSelect(usersFiltered[selectedUser]);\n });\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onSelect, selectedUser, usersFiltered]);\n\n return (\n <ul\n className=\"react-input-emoji--mention--list\"\n data-testid=\"mention-user-list\"\n >\n {usersFiltered.map((user, index) => (\n <li key={user.id}>\n <button\n type=\"button\"\n onClick={handleClick(user)}\n className={`react-input-emoji--mention--item${\n selectedUser === index\n ? \" react-input-emoji--mention--item__selected\"\n : \"\"\n }`}\n onMouseOver={() => setSelectedUser(index)}\n >\n <img\n className=\"react-input-emoji--mention--item--img\"\n src={user.image}\n />\n <div\n className=\"react-input-emoji--mention--item--name\"\n dangerouslySetInnerHTML={{ __html: user.nameHtml }}\n />\n </button>\n </li>\n ))}\n </ul>\n );\n};\n\nconst MentionUserListWithRef = forwardRef(MentionUserList);\n\nMentionUserListWithRef.propTypes = {\n users: t.array.isRequired\n};\n\nexport default MentionUserListWithRef;\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n// hooks\nimport { useMention } from \"../hooks/use-mention\";\n\n// components\nimport MentionUserList from \"./mention-user-list\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n * @property {(html: string) => void} appendContent\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst MentionWrapper = ({\n searchMention,\n addEventListener,\n appendContent,\n addSanitizeFn\n}) => {\n /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */\n const metionUserListRef = useRef(null);\n const [showUserList, setShowUserList] = useState(false);\n\n const {\n mentionSearchText,\n mentionUsers,\n loading,\n onKeyUp,\n onFocus,\n onSelectUser\n } = useMention(searchMention);\n\n useEffect(() => {\n addSanitizeFn(html => {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const mentionsEl = Array.prototype.slice.call(\n container.querySelectorAll(\".react-input-emoji--mention--text\")\n );\n\n mentionsEl.forEach(mentionEl => {\n container.innerHTML = container.innerHTML.replace(\n mentionEl.outerHTML,\n `@[${mentionEl.dataset.mentionName}](userId:${mentionEl.dataset.mentionId})`\n );\n });\n\n return container.innerHTML;\n });\n }, [addSanitizeFn]);\n\n useEffect(() => {\n setShowUserList(mentionUsers.length > 0);\n }, [mentionUsers]);\n\n useEffect(() => {\n /** */\n function checkClickOutside() {\n setShowUserList(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"keyUp\", onKeyUp);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onKeyUp]);\n\n useEffect(() => {\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n switch (event.key) {\n case \"Esc\": // IE/Edge specific value\n case \"Escape\":\n setShowUserList(false);\n break;\n default:\n break;\n }\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeyDown);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener]);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"focus\", onFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onFocus]);\n\n useEffect(() => {\n if (showUserList) {\n const unsubscribeArrowUp = addEventListener(\"arrowUp\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.prevUser();\n });\n\n const unsubscribeArrowDown = addEventListener(\"arrowDown\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.nextUser();\n });\n\n return () => {\n unsubscribeArrowUp();\n unsubscribeArrowDown();\n };\n }\n }, [addEventListener, showUserList]);\n\n /**\n *\n * @param {MetionUser} user\n */\n function handleSelect(user) {\n onSelectUser();\n appendContent(\n `<span class=\"react-input-emoji--mention--text\" data-mention-id=\"${user.id}\" data-mention-name=\"${user.name}\">@${user.name}</span> `\n );\n }\n\n return (\n <>\n {loading ? (\n <div className=\"react-input-emoji--mention--container\">\n <div className=\"react-input-emoji--mention--loading\">\n <div className=\"react-input-emoji--mention--loading--spinner\">\n Loading...\n </div>\n </div>\n </div>\n ) : (\n showUserList && (\n <div\n className=\"react-input-emoji--mention--container\"\n onClick={evt => evt.stopPropagation()}\n >\n <MentionUserList\n ref={metionUserListRef}\n mentionSearchText={mentionSearchText}\n users={mentionUsers}\n onSelect={handleSelect}\n addEventListener={addEventListener}\n />\n </div>\n )\n )}\n </>\n );\n};\n\nexport default MentionWrapper;\n","// @ts-check\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @template T\n * @returns {import('../types/types').ListenerObj<T>}\n */\nexport function createObserver() {\n /** @type {import('../types/types').Listerner<T>[]} */\n let listeners = [];\n\n return {\n subscribe: listener => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n publish: event => {\n listeners.forEach(listener => listener(event));\n },\n get currentListerners() {\n return listeners;\n }\n };\n}\n","// @ts-check\n\nimport { useCallback, useMemo } from \"react\";\nimport { createObserver } from \"../utils/observer\";\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useEventListeners() {\n /** @type {TextInputListeners} */\n const listeners = useMemo(\n () => ({\n keyDown: createObserver(),\n keyUp: createObserver(),\n arrowUp: createObserver(),\n arrowDown: createObserver(),\n enter: createObserver(),\n focus: createObserver(),\n blur: createObserver()\n }),\n []\n );\n\n /**\n * @template {keyof TextInputListeners} T, K\n * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}\n */\n const addEventListener = useCallback(\n (event, fn) => {\n return listeners[event].subscribe(fn);\n },\n [listeners]\n );\n\n return { addEventListener, listeners };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function usePollute() {\n /** @type {React.MutableRefObject<PolluteFn[]>} */\n const polluteFnsRef = useRef([]);\n\n /** @type {(fn: PolluteFn) => void} */\n const addPolluteFn = useCallback(fn => {\n polluteFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const pollute = useCallback(text => {\n const result = polluteFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, text);\n\n return result;\n }, []);\n\n return { addPolluteFn, pollute };\n}\n","// @ts-check\n/* eslint-disable react/prop-types */\n// vendors\nimport React, { useEffect, useRef, forwardRef, useCallback } from \"react\";\n\n// css\nimport \"./styles.css\";\n\n// utils\nimport { replaceAllTextEmojiToString, replaceAllTextEmojis } from \"./utils/emoji-utils\";\nimport { totalCharacters } from \"./utils/input-event-utils\";\n\n// hooks\nimport { useExpose } from \"./hooks/use-expose\";\nimport { useEmit } from \"./hooks/use-emit\";\n\n// components\nimport TextInput from \"./text-input\";\nimport EmojiPickerWrapper from \"./components/emoji-picker-wrapper\";\nimport MentionWrapper from \"./components/mention-wrapper\";\nimport { useEventListeners } from \"./hooks/use-event-listeners\";\nimport { useSanitize } from \"./hooks/use-sanitize\";\nimport { usePollute } from \"./hooks/user-pollute\";\n\n/**\n * @typedef {import('./types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('./types/types').ListenerObj<any>} ListenerObj\n */\n\n/**\n * @typedef {object} Props\n * @property {string} value\n * @property {(value: string) => void} onChange\n * @property {\"light\" | \"dark\" | \"auto\"} theme\n * @property {boolean} cleanOnEnter\n * @property {(text: string) => void} onEnter\n * @property {string} placeholder\n * @property {(size: {width: number, height: number}) => void} onResize\n * @property {() => void} onClick\n * @property {() => void} onFocus\n * @property {() => void=} onBlur\n * @property {boolean} shouldReturn\n * @property {number} maxLength\n * @property {boolean} keepOpened\n * @property {(event: KeyboardEvent) => void} onKeyDown\n * @property {string} inputClass\n * @property {boolean} disableRecent\n * @property {number} tabIndex\n * @property {number} height\n * @property {number} borderRadius\n * @property {string} borderColor\n * @property {number} fontSize\n * @property {string} fontFamily\n * @property {{id: string; name: string; emojis: {id: string; name: string; keywords: string[], skins: {src: string}[]}}[]=} customEmojis\n * @property {import('./types/types').Languages=} language\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Input Emoji Component\n * @param {Props} props\n * @param {React.Ref<any>} ref\n * @return {JSX.Element}\n */\nfunction InputEmoji(props, ref) {\n const {\n onChange,\n onEnter,\n shouldReturn,\n onResize,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n theme,\n cleanOnEnter,\n placeholder,\n maxLength,\n keepOpened,\n inputClass,\n disableRecent,\n tabIndex,\n value,\n customEmojis,\n language,\n searchMention,\n buttonElement,\n buttonRef,\n // style\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n } = props;\n\n /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */\n const textInputRef = useRef(null);\n\n const { addEventListener, listeners } = useEventListeners();\n\n const { addSanitizeFn, sanitize, sanitizedTextRef } = useSanitize(props.shouldReturn);\n\n const { addPolluteFn, pollute } = usePollute();\n\n const updateHTML = useCallback(\n (nextValue = \"\") => {\n if (textInputRef.current === null) return;\n\n textInputRef.current.html = replaceAllTextEmojis(nextValue);\n sanitizedTextRef.current = nextValue;\n },\n [sanitizedTextRef]\n );\n\n const setValue = useCallback(\n /**\n * \n * @param {string} value\n */\n (value) => {\n updateHTML(value);\n },\n [updateHTML]\n );\n\n const emitChange = useEmit(textInputRef, onResize, onChange);\n\n useExpose({\n ref,\n setValue,\n textInputRef,\n emitChange\n });\n\n useEffect(() => {\n if (sanitizedTextRef.current !== value) {\n setValue(value);\n }\n }, [sanitizedTextRef, setValue, value]);\n\n // useEffect(() => {\n // updateHTML();\n // }, [updateHTML]);\n\n useEffect(() => {\n /**\n * Handle keydown event\n * @param {React.KeyboardEvent} event\n * @return {boolean}\n */\n function handleKeydown(event) {\n if (\n typeof maxLength !== \"undefined\" &&\n event.key !== \"Backspace\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n event.preventDefault();\n }\n\n if (event.key === \"Enter\" && textInputRef.current) {\n event.preventDefault();\n\n const text = sanitize(textInputRef.current.html);\n\n emitChange(sanitizedTextRef.current);\n\n if (\n typeof onEnter === \"function\" &&\n listeners.enter.currentListerners.length === 0\n ) {\n onEnter(text);\n }\n\n if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {\n updateHTML(\"\");\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return false;\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return true;\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeydown);\n\n return () => {\n unsubscribe();\n };\n }, [\n addEventListener,\n cleanOnEnter,\n emitChange,\n listeners.enter.currentListerners.length,\n maxLength,\n onEnter,\n onKeyDown,\n sanitize,\n sanitizedTextRef,\n updateHTML\n ]);\n\n useEffect(() => {\n /** */\n function handleFocus() {\n if (typeof onClick === \"function\") {\n onClick();\n }\n\n if (typeof onFocus === \"function\") {\n onFocus();\n }\n }\n\n const unsubscribe = addEventListener(\"focus\", handleFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onClick, onFocus]);\n\n useEffect(() => {\n /** */\n function handleBlur() {\n if (typeof onBlur === \"function\") {\n onBlur();\n }\n }\n\n const unsubscribe = addEventListener(\"blur\", handleBlur);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onBlur]);\n\n /**\n *\n * @param {string} html\n */\n function handleTextInputChange(html) {\n sanitize(html);\n\n if (value !== sanitizedTextRef.current) {\n emitChange(sanitizedTextRef.current);\n }\n }\n\n /**\n *\n * @param {string} html\n */\n function appendContent(html) {\n if (\n typeof maxLength !== \"undefined\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n if (textInputRef.current !== null) {\n textInputRef.current.appendContent(html);\n }\n }\n\n /**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\n function handleCopy(event) {\n const selection = window.getSelection()\n if (selection !== null) {\n let selectedText = ''\n if (selection.anchorNode && selection.anchorNode.nodeType === Node.ELEMENT_NODE) {\n // @ts-ignore\n selectedText = selection.anchorNode.innerHTML\n } else if (selection.anchorNode && selection.anchorNode.nodeType === Node.TEXT_NODE) {\n selectedText = selection.anchorNode.textContent ?? ''\n }\n\n const text = replaceAllTextEmojiToString(selectedText);\n event.clipboardData.setData(\"text\", text);\n event.preventDefault();\n }\n }\n\n /**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\n function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = pollute(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n }\n\n return (\n <div className=\"react-emoji\">\n <MentionWrapper\n searchMention={searchMention}\n addEventListener={addEventListener}\n appendContent={appendContent}\n addSanitizeFn={addSanitizeFn}\n />\n <TextInput\n ref={textInputRef}\n onCopy={handleCopy}\n onPaste={handlePaste}\n shouldReturn={shouldReturn}\n onBlur={listeners.blur.publish}\n onFocus={listeners.focus.publish}\n onArrowUp={listeners.arrowUp.publish}\n onArrowDown={listeners.arrowDown.publish}\n onKeyUp={listeners.keyUp.publish}\n onKeyDown={listeners.keyDown.publish}\n onEnter={listeners.enter.publish}\n placeholder={placeholder}\n style={{\n borderRadius,\n borderColor,\n fontSize,\n fontFamily\n }}\n tabIndex={tabIndex}\n className={inputClass}\n onChange={handleTextInputChange}\n />\n <EmojiPickerWrapper\n theme={theme}\n keepOpened={keepOpened}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n addSanitizeFn={addSanitizeFn}\n addPolluteFn={addPolluteFn}\n appendContent={appendContent}\n buttonElement={buttonElement}\n buttonRef={buttonRef}\n language={language}\n />\n </div>\n );\n}\n\nconst InputEmojiWithRef = forwardRef(InputEmoji);\n\nInputEmojiWithRef.defaultProps = {\n theme: /** @type {const} */ (\"auto\"),\n height: 30,\n placeholder: \"Type a message\",\n borderRadius: 21,\n borderColor: \"#EAEAEA\",\n fontSize: 15,\n fontFamily: \"sans-serif\",\n tabIndex: 0,\n shouldReturn: false,\n customEmojis: [],\n language: undefined,\n};\n\nexport default InputEmojiWithRef;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TRANSPARENT_GIF","replaceAllTextEmojis","text","allEmojis","getAllEmojisFromText","_toConsumableArray","Set","forEach","emoji","replaceAll","getInputEmojiHTML","str","find","replace","RegExp","match","getImageEmoji","_emojiPickerEl$shadow","emojiPickerEl","querySelector","getInputEmojiNativeHTML","emojiSpanEl","shadowRoot","concat","name","replaceAllTextEmojiToString","html","container","innerHTML","images","Array","prototype","slice","call","querySelectorAll","image","outerHTML","dataset","handlePasteHtmlAtCaret","sel","range","window","getSelection","getRangeAt","rangeCount","deleteContents","el","frag","createDocumentFragment","node","lastNode","insertNode","cloneRange","setStartAfter","collapse","removeAllRanges","addRange","totalCharacters","_ref2","textCount","length","emojisCount","moveCaretToEnd","input","selection","createRange","current","selectNodeContents","removeHtmlExceptBr","inputDiv","temp","stripped","final","useSanitize","shouldReturn","sanitizeFnsRef","useRef","sanitizedTextRef","addSanitizeFn","useCallback","fn","push","sanitize","result","reduce","acc","replaceAllHtmlToString","innerText","useExpose","_ref","textInputRef","setValue","emitChange","_useSanitize","useImperativeHandle","value","focus","blur","useEmit","onResize","onChange","currentSizeRef","onChangeFn","checkAndEmitResize","currentSize","nextSize","size","width","height","sanitizedText","useEffect","TextInput","placeholder","tabIndex","className","props","_objectWithoutProperties","_excluded","appendContent","placeholderRef","visibility","offsetWidth","offsetHeight","handleKeyDown","event","key","shiftKey","ctrlKey","preventDefault","onEnter","onArrowUp","onArrowDown","onKeyDown","handleClick","onFocus","handleKeyUp","onKeyUp","React","onClick","contentEditable","onBlur","onCopy","onPaste","TextInputWithRef","forwardRef","EmojiPickerButton","showPicker","toggleShowPicker","buttonElement","buttonRef","localButtonRef","_useState","useState","_useState2","_slicedToArray","showCustomButtonContent","setShowCustomButtonContent","_buttonRef$current$ch","_buttonRef$current","_buttonElement$childN","_buttonElement$childN2","childNodes","xmlns","viewBox","d","$e5534fc185f7111e$export$2e2bcd8739ae039","$dvPge$useRef","instance","update","$dvPge$useEffect","$dvPge$Picker","$dvPge$react","EmojiPicker","theme","onSelectEmoji","disableRecent","customEmojis","language","categories","useMemo","categoryies","i18n","undefined","require","Picker","data","previewPosition","onEmojiSelect","custom","set","memo","EmojiPickerContainer","handleSelectEmoji","position","evt","stopPropagation","top","EMOJI_PICKER_CONTAINER_HEIGHT","EmojiPickerWrapper","keepOpened","addPolluteFn","setShowPicker","_useState3","_useState4","customButton","setCustomButton","_useState5","_useState6","emojiPickerPosition","setEmojiPickerPosition","checkClickOutside","element","target","classList","contains","addEventListener","removeEventListener","calcTopPosition","currentShowPicker","btn","currentTarget","btnRect","getBoundingClientRect","popoverHeight","ReactDOM","createPortal","Fragment","getTextFromAtToCaret","getRangeFromAtToCaret","substring","begin","end","deleteTextFromAtToCaret","deleteData","elementWithFocus","getElementWithFocus","caretOffset","textContent","lastAt","lastIndexOf","getSelectionStart","preCaretRange","setEnd","endContainer","endOffset","toString","textRange","preCaretTextRange","body","createTextRange","moveToElementText","setEndPoint","anchorNode","nodeType","useMention","searchMention","loading","setLoading","mentionUsers","setMentionUsers","mentionSearchText","setMentionSearchText","onSelectUser","checkMentionText","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metionText","users","wrap","_callee$","_context","prev","next","sent","stop","_x","_callee2","_getElementWithFocus","_callee2$","_context2","abrupt","parentElement","hasAttribute","remove","includes","apply","arguments","MentionUserList","onSelect","selectedUser","setSelectedUser","prevUser","currentSelectedUser","nextUser","getMentionSelectedNameEl","selectedText","rest","usersFiltered","searchText","toLocaleLowerCase","map","user","nameHtml","toLowerCase","startsWith","names","split","join","_objectSpread","unsubscribe","index","id","onMouseOver","src","dangerouslySetInnerHTML","__html","MentionUserListWithRef","propTypes","t","array","isRequired","MentionWrapper","metionUserListRef","showUserList","setShowUserList","_useMention","mentionsEl","mentionEl","mentionName","mentionId","unsubscribeArrowUp","unsubscribeArrowDown","handleSelect","createObserver","listeners","subscribe","listener","filter","l","publish","currentListerners","useEventListeners","keyDown","keyUp","arrowUp","arrowDown","enter","usePollute","polluteFnsRef","pollute","InputEmoji","cleanOnEnter","maxLength","inputClass","borderRadius","borderColor","fontSize","fontFamily","_useEventListeners","_usePollute","updateHTML","nextValue","handleKeydown","nativeEvent","handleFocus","handleBlur","handleTextInputChange","handleCopy","Node","ELEMENT_NODE","TEXT_NODE","_selection$anchorNode","clipboardData","setData","handlePaste","content","getData","execCommand","InputEmojiWithRef","defaultProps"],"mappings":";;;;;;;;;;;;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7B,IAAKA,GAAG,KAAK,KAAK,CAAC,EAAGA,GAAG,GAAG,EAAE,CAAA;AAC9B,EAAA,IAAIC,QAAQ,GAAGD,GAAG,CAACC,QAAQ,CAAA;AAE3B,EAAA,IAAI,CAACF,GAAG,IAAI,OAAOG,QAAQ,KAAK,WAAW,EAAE;AAAE,IAAA,OAAA;AAAQ,GAAA;AAEvD,EAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpE,EAAA,IAAIC,KAAK,GAAGH,QAAQ,CAACI,aAAa,CAAC,OAAO,CAAC,CAAA;EAC3CD,KAAK,CAACE,IAAI,GAAG,UAAU,CAAA;EAEvB,IAAIN,QAAQ,KAAK,KAAK,EAAE;IACtB,IAAIE,IAAI,CAACK,UAAU,EAAE;MACnBL,IAAI,CAACM,YAAY,CAACJ,KAAK,EAAEF,IAAI,CAACK,UAAU,CAAC,CAAA;AAC3C,KAAC,MAAM;AACLL,MAAAA,IAAI,CAACO,WAAW,CAACL,KAAK,CAAC,CAAA;AACzB,KAAA;AACF,GAAC,MAAM;AACLF,IAAAA,IAAI,CAACO,WAAW,CAACL,KAAK,CAAC,CAAA;AACzB,GAAA;EAEA,IAAIA,KAAK,CAACM,UAAU,EAAE;AACpBN,IAAAA,KAAK,CAACM,UAAU,CAACC,OAAO,GAAGb,GAAG,CAAA;AAChC,GAAC,MAAM;IACLM,KA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CAAA;AAEV,CAAA;AAEA,IAAM2M,iBAAiB,gBAAG5O,gBAAU,CAACgN,UAAU,EAAC;AAEhD4B,iBAAiB,CAACC,YAAY,GAAG;EAC/BhN,KAAK,sBAAwB,MAAO;AACpCjE,EAAAA,MAAM,EAAE,EAAE;AACVI,EAAAA,WAAW,EAAE,gBAAgB;AAC7BoP,EAAAA,YAAY,EAAE,EAAE;AAChBC,EAAAA,WAAW,EAAE,SAAS;AACtBC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,UAAU,EAAE,YAAY;AACxBtP,EAAAA,QAAQ,EAAE,CAAC;AACXvC,EAAAA,YAAY,EAAE,KAAK;AACnBsG,EAAAA,YAAY,EAAE,EAAE;AAChBC,EAAAA,QAAQ,EAAEK,SAAAA;AACZ,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/emoji-utils.js","../src/utils/input-event-utils.js","../src/hooks/use-sanitize.js","../src/hooks/use-expose.js","../src/hooks/use-emit.js","../src/text-input.js","../src/components/emoji-picker-button.js","../node_modules/@emoji-mart/react/dist/module.js","../src/components/emoji-picker.js","../src/components/emoji-picker-container.js","../src/components/emoji-picker-wrapper.js","../src/utils/mention-utils.js","../src/hooks/use-mention.js","../src/components/mention-user-list.js","../src/components/mention-wrapper.js","../src/utils/observer.js","../src/hooks/use-event-listeners.js","../src/hooks/user-pollute.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/* eslint-disable valid-jsdoc */\n// @ts-check\n\nexport const TRANSPARENT_GIF =\n \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\n\nexport const EMOJI_STYLE = \"\";\n\n/**\n * Replace all text with emoji with an image html tag\n * @param {string} text\n * @return {string}\n */\nexport function replaceAllTextEmojis(text) {\n let allEmojis = getAllEmojisFromText(text);\n\n if (allEmojis) {\n allEmojis = [...new Set(allEmojis)]; // remove duplicates\n\n allEmojis.forEach(emoji => {\n text = replaceAll(text, emoji, getInputEmojiHTML('', emoji));\n });\n }\n\n return text;\n}\n\n/**\n * Replace all occurrencies in a string\n * @param {string} str\n * @param {string} find\n * @param {string} replace\n * @return {string}\n */\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}\n\n/**\n * Get all emojis from the text\n * @param {string} text\n * @return {string[]}\n */\nfunction getAllEmojisFromText(text) {\n return text.match(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n );\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param { import(\"../types/types\").EmojiMartItem } emoji\n * @return {string}\n */\nexport function getImageEmoji(emoji) {\n /** @type {HTMLElement | null} */\n const emojiPickerEl = document.querySelector('em-emoji-picker')\n\n if (!emojiPickerEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n /** @type {HTMLSpanElement | null=} */\n const emojiSpanEl = emojiPickerEl?.shadowRoot?.querySelector(`[title=\"${emoji.name}\"] > span > span`)\n\n if (!emojiSpanEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n return getInputEmojiHTML(style, emoji.native);\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {string} style\n * @param {string} emoji\n * @returns\n */\nfunction getInputEmojiHTML(style, emoji) {\n return `<img style=\"${style}; display: inline-block\" data-emoji=\"${emoji}\" src=\"${TRANSPARENT_GIF}\" />`;\n}\n\n/**\n * \n * @param {string} emoji \n * @returns \n */\nfunction getInputEmojiNativeHTML(emoji) {\n return `<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">${emoji}</span>`;\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllTextEmojiToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n container.innerHTML = container.innerHTML.replace(\n image.outerHTML,\n image.dataset.emoji\n );\n });\n\n return container.innerHTML;\n}\n","// @ts-check\n\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"./emoji-utils\";\n\n/**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\nexport function handleCopy(event) {\n const selectedText = window.getSelection();\n\n if (selectedText === null) {\n return\n }\n\n let container = document.createElement(\"div\");\n\n for (let i = 0, len = selectedText.rangeCount; i < len; ++i) {\n container.appendChild(selectedText.getRangeAt(i).cloneContents());\n }\n\n container = replaceEmojiToString(container);\n\n event.clipboardData.setData(\"text\", container.innerText);\n event.preventDefault();\n}\n\n/**\n *\n * @param {string} html\n */\nexport function handlePasteHtmlAtCaret(html) {\n let sel;\n let range;\n if (window.getSelection) {\n // IE9 and non-IE\n sel = window.getSelection();\n\n if (sel === null) return\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = sel.getRangeAt(0);\n range.deleteContents();\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n const el = document.createElement(\"div\");\n el.innerHTML = html;\n const frag = document.createDocumentFragment();\n let node;\n let lastNode;\n while ((node = el.firstChild)) {\n lastNode = frag.appendChild(node);\n }\n range.insertNode(frag);\n\n // Preserve the selection\n if (lastNode) {\n range = range.cloneRange();\n range.setStartAfter(lastNode);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n}\n\n/**\n * Replace emoji img to its string value\n * @param {HTMLDivElement} container\n * @return {HTMLDivElement}\n */\nfunction replaceEmojiToString(container) {\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n image.outerHTML = image.dataset.emoji;\n });\n\n return container;\n}\n\n/**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\nexport function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = replaceAllTextEmojis(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n}\n\n/**\n * @typedef {object} HandleKeyDownOptions\n * @property {HTMLDivElement} placeholderEl\n * @property {number} maxLength\n * @property {HTMLDivElement} inputEl\n * @property {React.MutableRefObject<string>} cleanedTextRef\n * @property {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @property {boolean} cleanOnEnter\n * @property {function(): void} emitChange\n * @property {(function(string): void)=} onEnter\n * @property {(function(KeyboardEvent): void)=} onKeyDown\n * @property {(function(string): void)} updateHTML\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @typedef {Object} HandleSelectEmojiProps\n * @property {import(\"../types/types\").EmojiMartItem} emoji\n * @property {React.MutableRefObject<import('../text-input').Ref>} textInputRef\n * @property {boolean} keepOpened\n * @property {() => void} toggleShowPicker\n * @property {number=} maxLength\n */\n\n/**\n *\n * @param {HandleSelectEmojiProps} props\n */\nexport function handleSelectEmoji({\n emoji,\n textInputRef,\n keepOpened,\n toggleShowPicker,\n maxLength\n}) {\n if (\n typeof maxLength !== \"undefined\" &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n textInputRef.current.appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n toggleShowPicker();\n }\n}\n\n/**\n *\n * @param {{text: string, html: string}} props\n * @return {number}\n */\nexport function totalCharacters({ text, html }) {\n const textCount = text.length;\n const emojisCount = (html.match(/<img/g) || []).length;\n\n return textCount + emojisCount;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * Handle keyup event\n * @param {() => void} emitChange\n * @param {(event: KeyboardEvent) => void} onKeyDownMention\n * @param {React.MutableRefObject<string>} cleanedTextRef\n * @param {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @return {(event: KeyboardEvent) => void}\n */\nexport function handleKeyup(\n emitChange,\n onKeyDownMention,\n cleanedTextRef,\n textInputRef\n) {\n return event => {\n const text = replaceAllTextEmojiToString(textInputRef.current.innerHTML);\n cleanedTextRef.current = text;\n emitChange();\n onKeyDownMention(event);\n };\n}\n\n/**\n * Handle focus event\n * @param {function(FocusEvent): void} onFocus\n * @return {function(FocusEvent): void}\n */\nexport function handleFocus(onFocus) {\n return event => {\n onFocus(event);\n };\n}\n\n/**\n * Set caret to the end of text value\n * @param {React.MutableRefObject<HTMLDivElement| null>} input\n */\nexport function moveCaretToEnd(input) {\n let range\n let selection\n if(document.createRange && input.current) {\n range = document.createRange()\n range.selectNodeContents(input.current)\n range.collapse(false)\n selection = window.getSelection()\n if(selection) {\n selection.removeAllRanges()\n selection.addRange(range)\n }\n }\n}\n/**\n * \n * @param {HTMLDivElement} inputDiv \n * @return {string}\n */\nexport function removeHtmlExceptBr(inputDiv) {\n const temp = inputDiv.innerHTML.replace(/<br\\s*\\/?>/gi, '[BR]'); // temporarily replace <br> with placeholder\n const stripped = temp.replace(/<[^>]+>/g, ''); // strip all html tags\n const final = stripped.replace(/\\[BR\\]/gi, '</br>'); // replace placeholders with <br>\n return final;\n}","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\nimport { removeHtmlExceptBr } from \"../utils/input-event-utils\";\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @param {boolean} shouldReturn\n */\nexport function useSanitize(shouldReturn) {\n /** @type {React.MutableRefObject<SanitizeFn[]>} */\n const sanitizeFnsRef = useRef([]);\n\n const sanitizedTextRef = useRef(\"\");\n\n /** @type {(fn: SanitizeFn) => void} */\n const addSanitizeFn = useCallback(fn => {\n sanitizeFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const sanitize = useCallback(html => {\n let result = sanitizeFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, html);\n\n result = replaceAllHtmlToString(result, shouldReturn);\n\n sanitizedTextRef.current = result;\n\n return result;\n }, []);\n\n return { addSanitizeFn, sanitize, sanitizedTextRef };\n}\n\n/**\n *\n * @param {string} html\n * @param {boolean} shouldReturn\n * @return {string}\n */\nexport function replaceAllHtmlToString(html, shouldReturn) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n let text\n if(shouldReturn) {\n text = removeHtmlExceptBr(container)\n } else {\n text = container.innerText || \"\";\n }\n\n // remove all ↵ for safari\n text = text.replace(/\\n/gi, \"\");\n\n return text;\n}\n","// @ts-check\n\nimport { useImperativeHandle } from \"react\";\nimport { useSanitize } from \"./use-sanitize\";\n\n/**\n * @typedef {Object} Props\n * @property {React.Ref<any>} ref\n * @property {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @property {(value: string) => void} setValue\n * @property {() => void} emitChange\n */\n\n/**\n *\n * @param {Props} props\n */\nexport function useExpose({ ref, textInputRef, setValue, emitChange }) {\n const { sanitize, sanitizedTextRef } = useSanitize(false);\n\n useImperativeHandle(ref, () => ({\n get value() {\n return sanitizedTextRef.current;\n },\n set value(value) {\n setValue(value);\n },\n focus: () => {\n if (textInputRef.current === null) return\n textInputRef.current.focus();\n },\n blur: () => {\n if (textInputRef.current !== null) {\n sanitize(textInputRef.current.html);\n\n }\n\n emitChange();\n }\n }));\n}\n","// @ts-check\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * useEmit\n * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @param {(size: {width: number, height: number}) => void} onResize\n * @param {(text: string) => void} onChange\n */\nexport function useEmit(textInputRef, onResize, onChange) {\n /** @type {React.MutableRefObject<{width: number; height: number} | null>} */\n const currentSizeRef = useRef(null);\n const onChangeFn = useRef(onChange);\n\n const checkAndEmitResize = useCallback(() => {\n if (textInputRef.current !== null) {\n const currentSize = currentSizeRef.current;\n\n const nextSize = textInputRef.current.size;\n\n if (\n (!currentSize ||\n currentSize.width !== nextSize.width ||\n currentSize.height !== nextSize.height) &&\n typeof onResize === \"function\"\n ) {\n onResize(nextSize);\n }\n\n currentSizeRef.current = nextSize;\n }\n }, [onResize, textInputRef]);\n\n const emitChange = useCallback((sanitizedText) => {\n if (typeof onChangeFn.current === \"function\") {\n onChangeFn.current(sanitizedText);\n }\n\n if (typeof onResize === \"function\") {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, onResize]);\n\n useEffect(() => {\n if (textInputRef.current) {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, textInputRef]);\n\n return emitChange;\n}\n","// @ts-check\n// vendors\nimport React, { useImperativeHandle, forwardRef, useRef } from \"react\";\nimport { handlePasteHtmlAtCaret, moveCaretToEnd } from \"./utils/input-event-utils\";\nimport { replaceAllTextEmojiToString } from \"./utils/emoji-utils\";\n\n/**\n * @typedef {Object} Props\n * @property {(event: React.KeyboardEvent) => void} onKeyDown\n * @property {(event: React.KeyboardEvent) => void} onKeyUp\n * @property {() => void} onFocus\n * @property {() => void} onBlur\n * @property {(sanitizedText: string) => void=} onChange\n * @property {(event: React.KeyboardEvent) => void} onArrowUp\n * @property {(event: React.KeyboardEvent) => void} onArrowDown\n * @property {(event: React.KeyboardEvent) => void} onEnter\n * @property {boolean} shouldReturn\n * @property {(event: React.ClipboardEvent) => void} onCopy\n * @property {(event: React.ClipboardEvent) => void} onPaste\n * @property {string} placeholder\n * @property {React.CSSProperties} style\n * @property {number} tabIndex\n * @property {string} className\n * @property {(html: string) => void} onChange\n */\n\n/**\n * @typedef {{\n * appendContent: (html: string) => void;\n * html: string;\n * text: string;\n * size: { width: number; height: number;};\n * focus: () => void;\n * }} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst TextInput = (\n { placeholder, style, tabIndex, className, onChange, ...props },\n ref\n) => {\n useImperativeHandle(ref, () => ({\n appendContent: html => {\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n handlePasteHtmlAtCaret(html);\n\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else if (placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n\n if (textInputRef.current && typeof onChange === 'function') {\n onChange(textInputRef.current.innerHTML);\n }\n },\n set html(value) {\n if (textInputRef.current) {\n textInputRef.current.innerHTML = value;\n }\n \n if (placeholderRef.current) {\n const text = replaceAllTextEmojiToString(value)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n },\n get html() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerHTML;\n },\n get text() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerText;\n },\n get size() {\n if (!textInputRef.current) {\n return {\n width: 0,\n height: 0\n }\n }\n\n return {\n width: textInputRef.current.offsetWidth,\n height: textInputRef.current.offsetHeight\n };\n },\n focus() {\n if (!textInputRef.current) return\n\n textInputRef.current.focus();\n }\n }));\n\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const placeholderRef = useRef(null);\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const textInputRef = useRef(null);\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n if (event.key === \"Enter\" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {\n event.preventDefault();\n if(textInputRef.current) {\n textInputRef.current.innerHTML = `${textInputRef.current.innerHTML}</br></br>`\n moveCaretToEnd(textInputRef)\n return;\n }\n } \n if (event.key === \"Enter\") {\n props.onEnter(event);\n } else if (event.key === \"ArrowUp\") {\n props.onArrowUp(event);\n } else if (event.key === \"ArrowDown\") {\n props.onArrowDown(event);\n } else {\n if (event.key.length === 1 && placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n props.onKeyDown(event);\n }\n\n /** */\n function handleClick() {\n props.onFocus();\n }\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyUp(event) {\n props.onKeyUp(event);\n\n const input = textInputRef.current;\n\n if (placeholderRef.current && input) {\n const text = replaceAllTextEmojiToString(input.innerHTML)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n }\n\n return (\n <div className=\"react-input-emoji--container\" style={style}>\n <div className=\"react-input-emoji--wrapper\" onClick={handleClick}>\n <div ref={placeholderRef} className=\"react-input-emoji--placeholder\">\n {placeholder}\n </div>\n <div\n ref={textInputRef}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n tabIndex={tabIndex}\n contentEditable\n className={`react-input-emoji--input${className ? ` ${className}` : \"\"\n }`}\n onBlur={props.onBlur}\n onCopy={props.onCopy}\n onPaste={props.onPaste}\n data-testid=\"react-input-emoji--input\"\n />\n </div>\n </div>\n );\n};\n\nconst TextInputWithRef = forwardRef(TextInput);\n\nexport default TextInputWithRef;\n","// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {(event: React.MouseEvent) => void} toggleShowPicker\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerButton({ showPicker, toggleShowPicker, buttonElement, buttonRef }) {\n \n const localButtonRef = useRef(null);\n const [showCustomButtonContent, setShowCustomButtonContent] = useState(false);\n\n useEffect(() => {\n if ((buttonRef?.current?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);\n setShowCustomButtonContent(true);\n } else if ((buttonElement?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonElement?.childNodes[0]);\n setShowCustomButtonContent(true);\n }\n }, [buttonElement?.childNodes]);\n\n return (\n <button\n ref={localButtonRef}\n type=\"button\"\n className={`react-input-emoji--button${\n showPicker ? \" react-input-emoji--button__show\" : \"\"\n }`}\n onClick={toggleShowPicker}\n >\n {!showCustomButtonContent && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n className=\"react-input-emoji--button--icon\"\n >\n {/* eslint-disable-next-line max-len */}\n <path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\" />\n {/* eslint-disable-next-line max-len */}\n <path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\" />\n </svg>\n )}\n </button>\n );\n}\n\nexport default EmojiPickerButton;\n","import $dvPge$react, {useRef as $dvPge$useRef, useEffect as $dvPge$useEffect} from \"react\";\nimport {Picker as $dvPge$Picker} from \"emoji-mart\";\n\n\n\nfunction $e5534fc185f7111e$export$2e2bcd8739ae039(props) {\n const ref = (0, $dvPge$useRef)(null);\n const instance = (0, $dvPge$useRef)(null);\n if (instance.current) instance.current.update(props);\n (0, $dvPge$useEffect)(()=>{\n instance.current = new (0, $dvPge$Picker)({\n ...props,\n ref: ref\n });\n return ()=>{\n instance.current = null;\n };\n }, []);\n return /*#__PURE__*/ (0, $dvPge$react).createElement(\"div\", {\n ref: ref\n });\n}\n\n\nexport {$e5534fc185f7111e$export$2e2bcd8739ae039 as default};\n//# sourceMappingURL=module.js.map\n","// vendors\nimport React, { memo, useMemo } from \"react\";\nimport Picker from \"@emoji-mart/react\";\n\n/**\n * @typedef {object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {function(import(\"../types/types\").EmojiMartItem): void} onSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Component\n * @param {Props} props\n */\nfunction EmojiPicker(props) {\n const { theme, onSelectEmoji, disableRecent, customEmojis, language } = props;\n\n /** @type {string[]} */\n const categories = useMemo(() => {\n /** @type {string[]} */\n let categoryies = [];\n\n if (!disableRecent) {\n categoryies.push(\"frequent\");\n }\n\n categoryies = [\n ...categoryies,\n \"people\",\n \"nature\",\n \"foods\",\n \"activity\",\n \"places\",\n \"objects\",\n \"symbols\",\n \"flags\"\n ];\n\n return categoryies;\n }, [disableRecent]);\n\n const i18n = useMemo(() => {\n if (!language) {\n return undefined\n }\n\n return require(`@emoji-mart/data/i18n/${language ?? 'en'}.json`)\n }, [language])\n\n return (\n <Picker\n data={undefined}\n theme={theme}\n previewPosition=\"none\"\n onEmojiSelect={onSelectEmoji}\n custom={customEmojis}\n categories={categories}\n set=\"apple\"\n i18n={i18n}\n />\n );\n}\n\n\nexport default memo(EmojiPicker);\n","import React from \"react\";\nimport EmojiPicker from \"./emoji-picker\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {(emoji: import(\"../types/types\").EmojiMartItem) => void} handleSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {('above' | 'below')=} position\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerContainer({\n showPicker,\n theme,\n handleSelectEmoji,\n disableRecent,\n customEmojis,\n position,\n language\n}) {\n return (\n <div className=\"react-emoji-picker--container\">\n {showPicker && (\n <div\n className=\"react-emoji-picker--wrapper\"\n onClick={evt => evt.stopPropagation()}\n style={position === 'below' ? {top: '40px'} : {}}\n >\n <div className=\"react-emoji-picker\">\n <EmojiPicker\n theme={theme}\n onSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n language={language}\n />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default EmojiPickerContainer;\n","// @ts-check\n// vendors\nimport React, { useEffect, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"../utils/emoji-utils\";\n\nimport EmojiPickerButton from \"./emoji-picker-button\";\nimport EmojiPickerContainer from \"./emoji-picker-container\";\n\nconst EMOJI_PICKER_CONTAINER_HEIGHT = 435;\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {boolean} keepOpened\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n * @property {(fn: PolluteFn) => void} addPolluteFn\n * @property {(html: string) => void} appendContent\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {import('../types/types').Languages=} language\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst EmojiPickerWrapper = props => {\n const {\n theme,\n keepOpened,\n disableRecent,\n customEmojis,\n addSanitizeFn,\n addPolluteFn,\n appendContent,\n buttonElement,\n buttonRef,\n language\n } = props;\n\n const [showPicker, setShowPicker] = useState(false);\n /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */\n const [customButton, setCustomButton] = useState();\n /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */\n const [emojiPickerPosition, setEmojiPickerPosition] = useState()\n\n useEffect(() => {\n addSanitizeFn(replaceAllTextEmojiToString);\n }, [addSanitizeFn]);\n\n useEffect(() => {\n addPolluteFn(replaceAllTextEmojis);\n }, [addPolluteFn]);\n\n useEffect(() => {\n /**\n *\n * @param {MouseEvent} event\n */\n function checkClickOutside(event) {\n /** @type {HTMLElement} */\n // @ts-ignore\n const element = event.target;\n\n if (\n element.classList.contains(\"react-input-emoji--button\") ||\n element.classList.contains(\"react-input-emoji--button--icon\")\n ) {\n return;\n }\n\n setShowPicker(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n /**\n *\n * @param {React.MouseEvent} event\n */\n function toggleShowPicker(event) {\n event.stopPropagation();\n event.preventDefault();\n\n setEmojiPickerPosition(calcTopPosition(event))\n\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n\n /**\n * \n * @param {React.MouseEvent} event\n * @return {'above' | 'below'}\n */\n function calcTopPosition(event) {\n const btn = event.currentTarget\n const btnRect = btn.getBoundingClientRect();\n\n const popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;\n\n // Decide to display above or below based on available space\n if (btnRect.top >= popoverHeight) {\n // Display above\n return 'above'\n } else {\n // Display below\n return 'below'\n }\n }\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {import(\"../types/types\").EmojiMartItem} emoji\n */\n function handleSelectEmoji(emoji) {\n appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n }\n\n useEffect(() => {\n if (buttonRef?.current?.style) {\n buttonRef.current.style.position = \"relative\";\n setCustomButton(buttonRef.current);\n } else if (buttonElement?.style) {\n buttonElement.style.position = \"relative\";\n setCustomButton(buttonElement);\n }\n }, [buttonRef, buttonElement]);\n\n return customButton ? (\n (ReactDOM.createPortal(\n <>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n buttonElement={customButton}\n buttonRef={buttonRef}\n />\n </>,\n customButton\n ))\n ) : (\n (<>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n />\n </>)\n );\n};\n\nexport default EmojiPickerWrapper;\n","// @ts-check\n\n/**\n *\n * @return {string | null}\n */\nexport function getTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return null;\n\n const text = range.text.substring(range.begin, range.end);\n\n return text || null;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function deleteTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return;\n\n // @ts-ignore\n range.element.deleteData(range.begin, range.end - range.begin);\n}\n\n/**\n *\n * @return {{begin: number, end: number, text: string, element: Node} | null}\n */\nfunction getRangeFromAtToCaret() {\n const elementWithFocus = getElementWithFocus();\n\n if (!elementWithFocus) {\n return null;\n }\n\n const { element, caretOffset } = elementWithFocus;\n const text = element.textContent;\n const lastAt = text.lastIndexOf(\"@\");\n\n if (\n lastAt === -1 ||\n lastAt >= caretOffset ||\n (lastAt !== 0 && text[lastAt - 1] !== \" \")\n ) {\n return null;\n }\n\n return { begin: lastAt, end: caretOffset, text, element };\n}\n\n/**\n *\n * @return {{element: Node, caretOffset: number}}\n */\nexport function getElementWithFocus() {\n const element = getSelectionStart();\n\n if (element === null) {\n return null;\n }\n\n let caretOffset = 0;\n if (typeof window.getSelection != \"undefined\") {\n const range = window.getSelection().getRangeAt(0);\n const preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if (\n // @ts-ignore\n typeof document.selection != \"undefined\" &&\n // @ts-ignore\n document.selection.type != \"Control\"\n ) {\n // @ts-ignore\n const textRange = document.selection.createRange();\n // @ts-ignore\n const preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n\n return { element, caretOffset };\n}\n\n/**\n *\n * @return {Node | null}\n */\nfunction getSelectionStart() {\n const node = document.getSelection().anchorNode;\n return node?.nodeType == 3 ? node : null;\n}\n","// @ts-check\nimport { useCallback, useState } from \"react\";\nimport {\n deleteTextFromAtToCaret,\n getElementWithFocus,\n getTextFromAtToCaret\n} from \"../utils/mention-utils\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {(text: string) => Promise<MentionUser[]>=} searchMention\n * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}\n */\nexport function useMention(searchMention) {\n const [loading, setLoading] = useState(false);\n\n /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */\n const [mentionUsers, setMentionUsers] = useState([]);\n\n /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */\n const [mentionSearchText, setMentionSearchText] = useState(null);\n\n const onSelectUser = useCallback(() => {\n deleteTextFromAtToCaret();\n setMentionUsers([]);\n }, []);\n\n /** */\n const checkMentionText = useCallback(async () => {\n const metionText = getTextFromAtToCaret();\n\n setMentionSearchText(metionText);\n\n if (metionText === null) {\n setMentionUsers([]);\n } else {\n setLoading(true);\n const users = await searchMention(metionText);\n setLoading(false);\n setMentionUsers(users);\n }\n }, [searchMention]);\n\n /** @type {(event: React.KeyboardEvent) => void} */\n const onKeyUp = useCallback(\n async event => {\n if (typeof searchMention !== \"function\") return;\n\n if (\n event.key === \"Backspace\" &&\n getElementWithFocus()?.element.parentElement.hasAttribute(\n \"data-mention-id\"\n )\n ) {\n const elementWithFocus = getElementWithFocus();\n elementWithFocus.element.parentElement.remove();\n } else if (\n ![\"ArrowUp\", \"ArrowDown\", \"Esc\", \"Escape\"].includes(event.key)\n ) {\n checkMentionText();\n }\n },\n [checkMentionText, searchMention]\n );\n\n const onFocus = useCallback(() => {\n checkMentionText();\n }, [checkMentionText]);\n\n return {\n mentionSearchText,\n mentionUsers,\n onKeyUp,\n onFocus,\n onSelectUser,\n loading\n };\n}\n","// @ts-check\n// vendors\nimport React, {\n useImperativeHandle,\n useState,\n forwardRef,\n useMemo,\n useEffect\n} from \"react\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {Object} Props\n * @property {MentionUser[]} users\n * @property {string | null} mentionSearchText\n * @property {(user: MentionUser) => void} onSelect\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n */\n\n/**\n * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst MentionUserList = (\n { users, mentionSearchText, onSelect, addEventListener },\n ref\n) => {\n const [selectedUser, setSelectedUser] = useState(0);\n\n useImperativeHandle(ref, () => ({\n prevUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === 0) {\n return 0;\n }\n\n return currentSelectedUser - 1;\n });\n },\n nextUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === users.length - 1) {\n return users.length - 1;\n }\n\n return currentSelectedUser + 1;\n });\n }\n }));\n\n useEffect(() => {\n setSelectedUser(0);\n }, [users]);\n\n /**\n *\n * @param {string} selectedText\n * @param {string} rest\n * @return {string}\n */\n function getMentionSelectedNameEl(selectedText, rest) {\n return `<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">${selectedText}</span>${rest}`;\n }\n\n /** @type {(MentionUser & {nameHtml: string})[]} */\n const usersFiltered = useMemo(() => {\n const searchText = mentionSearchText\n ? mentionSearchText.substring(1).toLocaleLowerCase()\n : \"\";\n return users.map(user => {\n let nameHtml = user.name;\n\n if (mentionSearchText && mentionSearchText.length > 1) {\n if (user.name.toLowerCase().startsWith(searchText)) {\n nameHtml = getMentionSelectedNameEl(\n user.name.substring(0, searchText.length),\n user.name.substring(searchText.length)\n );\n } else {\n const names = user.name.split(\" \");\n\n nameHtml = names\n .map(name => {\n if (name.toLocaleLowerCase().startsWith(searchText)) {\n return getMentionSelectedNameEl(\n name.substring(0, searchText.length),\n name.substring(searchText.length)\n );\n }\n return name;\n })\n .join(\" \");\n }\n }\n\n return {\n ...user,\n nameHtml\n };\n });\n }, [mentionSearchText, users]);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {MentionUser} user\n * @returns {(event: React.MouseEvent) => void} event\n */\n function handleClick(user) {\n return event => {\n event.stopPropagation();\n event.preventDefault();\n\n onSelect(user);\n };\n }\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"enter\", event => {\n event.stopPropagation();\n event.preventDefault();\n onSelect(usersFiltered[selectedUser]);\n });\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onSelect, selectedUser, usersFiltered]);\n\n return (\n <ul\n className=\"react-input-emoji--mention--list\"\n data-testid=\"mention-user-list\"\n >\n {usersFiltered.map((user, index) => (\n <li key={user.id}>\n <button\n type=\"button\"\n onClick={handleClick(user)}\n className={`react-input-emoji--mention--item${\n selectedUser === index\n ? \" react-input-emoji--mention--item__selected\"\n : \"\"\n }`}\n onMouseOver={() => setSelectedUser(index)}\n >\n <img\n className=\"react-input-emoji--mention--item--img\"\n src={user.image}\n />\n <div\n className=\"react-input-emoji--mention--item--name\"\n dangerouslySetInnerHTML={{ __html: user.nameHtml }}\n />\n </button>\n </li>\n ))}\n </ul>\n );\n};\n\nconst MentionUserListWithRef = forwardRef(MentionUserList);\n\nexport default MentionUserListWithRef;\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n// hooks\nimport { useMention } from \"../hooks/use-mention\";\n\n// components\nimport MentionUserList from \"./mention-user-list\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n * @property {(html: string) => void} appendContent\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst MentionWrapper = ({\n searchMention,\n addEventListener,\n appendContent,\n addSanitizeFn\n}) => {\n /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */\n const metionUserListRef = useRef(null);\n const [showUserList, setShowUserList] = useState(false);\n\n const {\n mentionSearchText,\n mentionUsers,\n loading,\n onKeyUp,\n onFocus,\n onSelectUser\n } = useMention(searchMention);\n\n useEffect(() => {\n addSanitizeFn(html => {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const mentionsEl = Array.prototype.slice.call(\n container.querySelectorAll(\".react-input-emoji--mention--text\")\n );\n\n mentionsEl.forEach(mentionEl => {\n container.innerHTML = container.innerHTML.replace(\n mentionEl.outerHTML,\n `@[${mentionEl.dataset.mentionName}](userId:${mentionEl.dataset.mentionId})`\n );\n });\n\n return container.innerHTML;\n });\n }, [addSanitizeFn]);\n\n useEffect(() => {\n setShowUserList(mentionUsers.length > 0);\n }, [mentionUsers]);\n\n useEffect(() => {\n /** */\n function checkClickOutside() {\n setShowUserList(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"keyUp\", onKeyUp);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onKeyUp]);\n\n useEffect(() => {\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n switch (event.key) {\n case \"Esc\": // IE/Edge specific value\n case \"Escape\":\n setShowUserList(false);\n break;\n default:\n break;\n }\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeyDown);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener]);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"focus\", onFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onFocus]);\n\n useEffect(() => {\n if (showUserList) {\n const unsubscribeArrowUp = addEventListener(\"arrowUp\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.prevUser();\n });\n\n const unsubscribeArrowDown = addEventListener(\"arrowDown\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.nextUser();\n });\n\n return () => {\n unsubscribeArrowUp();\n unsubscribeArrowDown();\n };\n }\n }, [addEventListener, showUserList]);\n\n /**\n *\n * @param {MetionUser} user\n */\n function handleSelect(user) {\n onSelectUser();\n appendContent(\n `<span class=\"react-input-emoji--mention--text\" data-mention-id=\"${user.id}\" data-mention-name=\"${user.name}\">@${user.name}</span> `\n );\n }\n\n return (\n <>\n {loading ? (\n <div className=\"react-input-emoji--mention--container\">\n <div className=\"react-input-emoji--mention--loading\">\n <div className=\"react-input-emoji--mention--loading--spinner\">\n Loading...\n </div>\n </div>\n </div>\n ) : (\n showUserList && (\n <div\n className=\"react-input-emoji--mention--container\"\n onClick={evt => evt.stopPropagation()}\n >\n <MentionUserList\n ref={metionUserListRef}\n mentionSearchText={mentionSearchText}\n users={mentionUsers}\n onSelect={handleSelect}\n addEventListener={addEventListener}\n />\n </div>\n )\n )}\n </>\n );\n};\n\nexport default MentionWrapper;\n","// @ts-check\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @template T\n * @returns {import('../types/types').ListenerObj<T>}\n */\nexport function createObserver() {\n /** @type {import('../types/types').Listerner<T>[]} */\n let listeners = [];\n\n return {\n subscribe: listener => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n publish: event => {\n listeners.forEach(listener => listener(event));\n },\n get currentListerners() {\n return listeners;\n }\n };\n}\n","// @ts-check\n\nimport { useCallback, useMemo } from \"react\";\nimport { createObserver } from \"../utils/observer\";\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useEventListeners() {\n /** @type {TextInputListeners} */\n const listeners = useMemo(\n () => ({\n keyDown: createObserver(),\n keyUp: createObserver(),\n arrowUp: createObserver(),\n arrowDown: createObserver(),\n enter: createObserver(),\n focus: createObserver(),\n blur: createObserver()\n }),\n []\n );\n\n /**\n * @template {keyof TextInputListeners} T, K\n * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}\n */\n const addEventListener = useCallback(\n (event, fn) => {\n return listeners[event].subscribe(fn);\n },\n [listeners]\n );\n\n return { addEventListener, listeners };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function usePollute() {\n /** @type {React.MutableRefObject<PolluteFn[]>} */\n const polluteFnsRef = useRef([]);\n\n /** @type {(fn: PolluteFn) => void} */\n const addPolluteFn = useCallback(fn => {\n polluteFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const pollute = useCallback(text => {\n const result = polluteFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, text);\n\n return result;\n }, []);\n\n return { addPolluteFn, pollute };\n}\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, forwardRef, useCallback } from \"react\";\n\n// css\nimport \"./styles.css\";\n\n// utils\nimport { replaceAllTextEmojiToString, replaceAllTextEmojis } from \"./utils/emoji-utils\";\nimport { totalCharacters } from \"./utils/input-event-utils\";\n\n// hooks\nimport { useExpose } from \"./hooks/use-expose\";\nimport { useEmit } from \"./hooks/use-emit\";\n\n// components\nimport TextInput from \"./text-input\";\nimport EmojiPickerWrapper from \"./components/emoji-picker-wrapper\";\nimport MentionWrapper from \"./components/mention-wrapper\";\nimport { useEventListeners } from \"./hooks/use-event-listeners\";\nimport { useSanitize } from \"./hooks/use-sanitize\";\nimport { usePollute } from \"./hooks/user-pollute\";\n\n/**\n * @typedef {import('./types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('./types/types').ListenerObj<any>} ListenerObj\n */\n\n/**\n * @typedef {object} Props\n * @property {string} value\n * @property {(value: string) => void} onChange\n * @property {\"light\" | \"dark\" | \"auto\"=} theme\n * @property {boolean=} cleanOnEnter\n * @property {(text: string) => void=} onEnter\n * @property {string=} placeholder\n * @property {(size: {width: number, height: number}) => void=} onResize\n * @property {() => void=} onClick\n * @property {() => void=} onFocus\n * @property {() => void=} onBlur\n * @property {boolean=} shouldReturn\n * @property {number=} maxLength\n * @property {boolean=} keepOpened\n * @property {(event: KeyboardEvent) => void=} onKeyDown\n * @property {string=} inputClass\n * @property {boolean=} disableRecent\n * @property {number=} tabIndex\n * @property {number=} height\n * @property {number=} borderRadius\n * @property {string=} borderColor\n * @property {number=} fontSize\n * @property {string=} fontFamily\n * @property {{id: string; name: string; emojis: {id: string; name: string; keywords: string[], skins: {src: string}[]}}[]=} customEmojis\n * @property {import('./types/types').Languages=} language\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Input Emoji Component\n * @param {Props} props\n * @param {React.Ref<any>} ref\n * @return {JSX.Element}\n */\nfunction InputEmoji(props, ref) {\n const {\n onChange,\n onEnter,\n shouldReturn,\n onResize,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n theme,\n cleanOnEnter,\n placeholder,\n maxLength,\n keepOpened,\n inputClass,\n disableRecent,\n tabIndex,\n value,\n customEmojis,\n language,\n searchMention,\n buttonElement,\n buttonRef,\n // style\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n } = props;\n\n /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */\n const textInputRef = useRef(null);\n\n const { addEventListener, listeners } = useEventListeners();\n\n const { addSanitizeFn, sanitize, sanitizedTextRef } = useSanitize(props.shouldReturn);\n\n const { addPolluteFn, pollute } = usePollute();\n\n const updateHTML = useCallback(\n (nextValue = \"\") => {\n if (textInputRef.current === null) return;\n\n textInputRef.current.html = replaceAllTextEmojis(nextValue);\n sanitizedTextRef.current = nextValue;\n },\n [sanitizedTextRef]\n );\n\n const setValue = useCallback(\n /**\n * \n * @param {string} value\n */\n (value) => {\n updateHTML(value);\n },\n [updateHTML]\n );\n\n const emitChange = useEmit(textInputRef, onResize, onChange);\n\n useExpose({\n ref,\n setValue,\n textInputRef,\n emitChange\n });\n\n useEffect(() => {\n if (sanitizedTextRef.current !== value) {\n setValue(value);\n }\n }, [sanitizedTextRef, setValue, value]);\n\n // useEffect(() => {\n // updateHTML();\n // }, [updateHTML]);\n\n useEffect(() => {\n /**\n * Handle keydown event\n * @param {React.KeyboardEvent} event\n * @return {boolean}\n */\n function handleKeydown(event) {\n if (\n typeof maxLength !== \"undefined\" &&\n event.key !== \"Backspace\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n event.preventDefault();\n }\n\n if (event.key === \"Enter\" && textInputRef.current) {\n event.preventDefault();\n\n const text = sanitize(textInputRef.current.html);\n\n emitChange(sanitizedTextRef.current);\n\n if (\n typeof onEnter === \"function\" &&\n listeners.enter.currentListerners.length === 0\n ) {\n onEnter(text);\n }\n\n if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {\n updateHTML(\"\");\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return false;\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return true;\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeydown);\n\n return () => {\n unsubscribe();\n };\n }, [\n addEventListener,\n cleanOnEnter,\n emitChange,\n listeners.enter.currentListerners.length,\n maxLength,\n onEnter,\n onKeyDown,\n sanitize,\n sanitizedTextRef,\n updateHTML\n ]);\n\n useEffect(() => {\n /** */\n function handleFocus() {\n if (typeof onClick === \"function\") {\n onClick();\n }\n\n if (typeof onFocus === \"function\") {\n onFocus();\n }\n }\n\n const unsubscribe = addEventListener(\"focus\", handleFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onClick, onFocus]);\n\n useEffect(() => {\n /** */\n function handleBlur() {\n if (typeof onBlur === \"function\") {\n onBlur();\n }\n }\n\n const unsubscribe = addEventListener(\"blur\", handleBlur);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onBlur]);\n\n /**\n *\n * @param {string} html\n */\n function handleTextInputChange(html) {\n sanitize(html);\n\n if (value !== sanitizedTextRef.current) {\n emitChange(sanitizedTextRef.current);\n }\n }\n\n /**\n *\n * @param {string} html\n */\n function appendContent(html) {\n if (\n typeof maxLength !== \"undefined\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n if (textInputRef.current !== null) {\n textInputRef.current.appendContent(html);\n }\n }\n\n /**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\n function handleCopy(event) {\n const selection = window.getSelection()\n if (selection !== null) {\n let selectedText = ''\n if (selection.anchorNode && selection.anchorNode.nodeType === Node.ELEMENT_NODE) {\n // @ts-ignore\n selectedText = selection.anchorNode.innerHTML\n } else if (selection.anchorNode && selection.anchorNode.nodeType === Node.TEXT_NODE) {\n selectedText = selection.anchorNode.textContent ?? ''\n }\n\n const text = replaceAllTextEmojiToString(selectedText);\n event.clipboardData.setData(\"text\", text);\n event.preventDefault();\n }\n }\n\n /**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\n function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = pollute(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n }\n\n return (\n <div className=\"react-emoji\">\n <MentionWrapper\n searchMention={searchMention}\n addEventListener={addEventListener}\n appendContent={appendContent}\n addSanitizeFn={addSanitizeFn}\n />\n <TextInput\n ref={textInputRef}\n onCopy={handleCopy}\n onPaste={handlePaste}\n shouldReturn={shouldReturn}\n onBlur={listeners.blur.publish}\n onFocus={listeners.focus.publish}\n onArrowUp={listeners.arrowUp.publish}\n onArrowDown={listeners.arrowDown.publish}\n onKeyUp={listeners.keyUp.publish}\n onKeyDown={listeners.keyDown.publish}\n onEnter={listeners.enter.publish}\n placeholder={placeholder}\n style={{\n borderRadius,\n borderColor,\n fontSize,\n fontFamily\n }}\n tabIndex={tabIndex}\n className={inputClass}\n onChange={handleTextInputChange}\n />\n <EmojiPickerWrapper\n theme={theme}\n keepOpened={keepOpened}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n addSanitizeFn={addSanitizeFn}\n addPolluteFn={addPolluteFn}\n appendContent={appendContent}\n buttonElement={buttonElement}\n buttonRef={buttonRef}\n language={language}\n />\n </div>\n );\n}\n\nconst InputEmojiWithRef = forwardRef(InputEmoji);\n\nInputEmojiWithRef.defaultProps = {\n theme: /** @type {const} */ (\"auto\"),\n height: 30,\n placeholder: \"Type a message\",\n borderRadius: 21,\n borderColor: \"#EAEAEA\",\n fontSize: 15,\n fontFamily: \"sans-serif\",\n tabIndex: 0,\n shouldReturn: false,\n customEmojis: [],\n language: undefined,\n};\n\nexport default InputEmojiWithRef;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TRANSPARENT_GIF","replaceAllTextEmojis","text","allEmojis","getAllEmojisFromText","_toConsumableArray","Set","forEach","emoji","replaceAll","getInputEmojiHTML","str","find","replace","RegExp","match","getImageEmoji","_emojiPickerEl$shadow","emojiPickerEl","querySelector","getInputEmojiNativeHTML","emojiSpanEl","shadowRoot","concat","name","replaceAllTextEmojiToString","html","container","innerHTML","images","Array","prototype","slice","call","querySelectorAll","image","outerHTML","dataset","handlePasteHtmlAtCaret","sel","range","window","getSelection","getRangeAt","rangeCount","deleteContents","el","frag","createDocumentFragment","node","lastNode","insertNode","cloneRange","setStartAfter","collapse","removeAllRanges","addRange","totalCharacters","_ref2","textCount","length","emojisCount","moveCaretToEnd","input","selection","createRange","current","selectNodeContents","removeHtmlExceptBr","inputDiv","temp","stripped","final","useSanitize","shouldReturn","sanitizeFnsRef","useRef","sanitizedTextRef","addSanitizeFn","useCallback","fn","push","sanitize","result","reduce","acc","replaceAllHtmlToString","innerText","useExpose","_ref","textInputRef","setValue","emitChange","_useSanitize","useImperativeHandle","value","focus","blur","useEmit","onResize","onChange","currentSizeRef","onChangeFn","checkAndEmitResize","currentSize","nextSize","size","width","height","sanitizedText","useEffect","TextInput","placeholder","tabIndex","className","props","_objectWithoutProperties","_excluded","appendContent","placeholderRef","visibility","offsetWidth","offsetHeight","handleKeyDown","event","key","shiftKey","ctrlKey","preventDefault","onEnter","onArrowUp","onArrowDown","onKeyDown","handleClick","onFocus","handleKeyUp","onKeyUp","React","onClick","contentEditable","onBlur","onCopy","onPaste","TextInputWithRef","forwardRef","EmojiPickerButton","showPicker","toggleShowPicker","buttonElement","buttonRef","localButtonRef","_useState","useState","_useState2","_slicedToArray","showCustomButtonContent","setShowCustomButtonContent","_buttonRef$current$ch","_buttonRef$current","_buttonElement$childN","_buttonElement$childN2","childNodes","xmlns","viewBox","d","$e5534fc185f7111e$export$2e2bcd8739ae039","$dvPge$useRef","instance","update","$dvPge$useEffect","$dvPge$Picker","$dvPge$react","EmojiPicker","theme","onSelectEmoji","disableRecent","customEmojis","language","categories","useMemo","categoryies","i18n","undefined","require","Picker","data","previewPosition","onEmojiSelect","custom","set","memo","EmojiPickerContainer","handleSelectEmoji","position","evt","stopPropagation","top","EMOJI_PICKER_CONTAINER_HEIGHT","EmojiPickerWrapper","keepOpened","addPolluteFn","setShowPicker","_useState3","_useState4","customButton","setCustomButton","_useState5","_useState6","emojiPickerPosition","setEmojiPickerPosition","checkClickOutside","element","target","classList","contains","addEventListener","removeEventListener","calcTopPosition","currentShowPicker","btn","currentTarget","btnRect","getBoundingClientRect","popoverHeight","ReactDOM","createPortal","Fragment","getTextFromAtToCaret","getRangeFromAtToCaret","substring","begin","end","deleteTextFromAtToCaret","deleteData","elementWithFocus","getElementWithFocus","caretOffset","textContent","lastAt","lastIndexOf","getSelectionStart","preCaretRange","setEnd","endContainer","endOffset","toString","textRange","preCaretTextRange","body","createTextRange","moveToElementText","setEndPoint","anchorNode","nodeType","useMention","searchMention","loading","setLoading","mentionUsers","setMentionUsers","mentionSearchText","setMentionSearchText","onSelectUser","checkMentionText","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metionText","users","wrap","_callee$","_context","prev","next","sent","stop","_x","_callee2","_getElementWithFocus","_callee2$","_context2","abrupt","parentElement","hasAttribute","remove","includes","apply","arguments","MentionUserList","onSelect","selectedUser","setSelectedUser","prevUser","currentSelectedUser","nextUser","getMentionSelectedNameEl","selectedText","rest","usersFiltered","searchText","toLocaleLowerCase","map","user","nameHtml","toLowerCase","startsWith","names","split","join","_objectSpread","unsubscribe","index","id","onMouseOver","src","dangerouslySetInnerHTML","__html","MentionUserListWithRef","MentionWrapper","metionUserListRef","showUserList","setShowUserList","_useMention","mentionsEl","mentionEl","mentionName","mentionId","unsubscribeArrowUp","unsubscribeArrowDown","handleSelect","createObserver","listeners","subscribe","listener","filter","l","publish","currentListerners","useEventListeners","keyDown","keyUp","arrowUp","arrowDown","enter","usePollute","polluteFnsRef","pollute","InputEmoji","cleanOnEnter","maxLength","inputClass","borderRadius","borderColor","fontSize","fontFamily","_useEventListeners","_usePollute","updateHTML","nextValue","handleKeydown","nativeEvent","handleFocus","handleBlur","handleTextInputChange","handleCopy","Node","ELEMENT_NODE","TEXT_NODE","_selection$anchorNode","clipboardData","setData","handlePaste","content","getData","execCommand","InputEmojiWithRef","defaultProps"],"mappings":";;;;;;;;;;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7B,IAAKA,GAAG,KAAK,KAAK,CAAC,EAAGA,GAAG,GAAG,EAAE,CAAA;AAC9B,EAAA,IAAIC,QAAQ,GAAGD,GAAG,CAACC,QAAQ,CAAA;AAE3B,EAAA,IAAI,CAACF,GAAG,IAAI,OAAOG,QAAQ,KAAK,WAAW,EAAE;AAAE,IAAA,OAAA;AAAQ,GAAA;AAEvD,EAAA,IAAIC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACpE,EAAA,IAAIC,KAAK,GAAGH,QAAQ,CAACI,aAAa,CAAC,OAAO,CAAC,CAAA;EAC3CD,KAAK,C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