react-input-emoji 5.6.9 → 5.6.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +11 -7
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/src/utils/input-event-utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
@@ -688,9 +688,11 @@ function totalCharacters(_ref2) {
|
|
688
688
|
* @return {string}
|
689
689
|
*/
|
690
690
|
function removeHtmlExceptBr(inputDiv) {
|
691
|
-
var temp = inputDiv.innerHTML.
|
692
|
-
var
|
693
|
-
|
691
|
+
var temp = inputDiv.innerHTML.replaceAll(/<br\s*\/?>/gi, "[BR]"); // temporarily replace <br> with placeholder
|
692
|
+
var tempContainer = document.createElement("div");
|
693
|
+
tempContainer.innerHTML = temp;
|
694
|
+
var stripped = tempContainer.innerText; // strip all html tags
|
695
|
+
var _final = stripped.replaceAll(/\[BR\]/gi, "</br>"); // replace placeholders with <br>
|
694
696
|
return _final;
|
695
697
|
}
|
696
698
|
|
@@ -725,7 +727,7 @@ function getSelectionStart$1(range) {
|
|
725
727
|
|
726
728
|
/**
|
727
729
|
*
|
728
|
-
* @
|
730
|
+
* @return {Object} cursor
|
729
731
|
*/
|
730
732
|
function getCursor() {
|
731
733
|
var selection = window.getSelection();
|
@@ -832,9 +834,7 @@ function replaceAllHtmlToString(html, shouldReturn) {
|
|
832
834
|
|
833
835
|
// remove all ↵ for safari
|
834
836
|
text = text.replace(/\n/gi, "");
|
835
|
-
|
836
|
-
tempContainer.innerHTML = text;
|
837
|
-
return tempContainer.innerText || "";
|
837
|
+
return text;
|
838
838
|
}
|
839
839
|
|
840
840
|
// @ts-check
|
@@ -3655,6 +3655,10 @@ function EmojiPicker(props) {
|
|
3655
3655
|
});
|
3656
3656
|
return;
|
3657
3657
|
}
|
3658
|
+
if (cacheI18n[language]) {
|
3659
|
+
setI18n(cacheI18n[language]);
|
3660
|
+
return;
|
3661
|
+
}
|
3658
3662
|
|
3659
3663
|
// @ts-ignore
|
3660
3664
|
fetch("".concat(EMOJI_MART_DATA_URL, "/i18n/").concat(language, ".json")).then(function (_x2) {
|