react-input-emoji 5.6.9 → 5.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.js
CHANGED
|
@@ -695,9 +695,11 @@ function totalCharacters(_ref2) {
|
|
|
695
695
|
* @return {string}
|
|
696
696
|
*/
|
|
697
697
|
function removeHtmlExceptBr(inputDiv) {
|
|
698
|
-
var temp = inputDiv.innerHTML.
|
|
699
|
-
var
|
|
700
|
-
|
|
698
|
+
var temp = inputDiv.innerHTML.replaceAll(/<br\s*\/?>/gi, "[BR]"); // temporarily replace <br> with placeholder
|
|
699
|
+
var tempContainer = document.createElement("div");
|
|
700
|
+
tempContainer.innerHTML = temp;
|
|
701
|
+
var stripped = tempContainer.innerText; // strip all html tags
|
|
702
|
+
var _final = stripped.replaceAll(/\[BR\]/gi, "</br>"); // replace placeholders with <br>
|
|
701
703
|
return _final;
|
|
702
704
|
}
|
|
703
705
|
|
|
@@ -732,7 +734,7 @@ function getSelectionStart$1(range) {
|
|
|
732
734
|
|
|
733
735
|
/**
|
|
734
736
|
*
|
|
735
|
-
* @
|
|
737
|
+
* @return {Object} cursor
|
|
736
738
|
*/
|
|
737
739
|
function getCursor() {
|
|
738
740
|
var selection = window.getSelection();
|
|
@@ -839,9 +841,7 @@ function replaceAllHtmlToString(html, shouldReturn) {
|
|
|
839
841
|
|
|
840
842
|
// remove all ↵ for safari
|
|
841
843
|
text = text.replace(/\n/gi, "");
|
|
842
|
-
|
|
843
|
-
tempContainer.innerHTML = text;
|
|
844
|
-
return tempContainer.innerText || "";
|
|
844
|
+
return text;
|
|
845
845
|
}
|
|
846
846
|
|
|
847
847
|
// @ts-check
|
|
@@ -3662,6 +3662,10 @@ function EmojiPicker(props) {
|
|
|
3662
3662
|
});
|
|
3663
3663
|
return;
|
|
3664
3664
|
}
|
|
3665
|
+
if (cacheI18n[language]) {
|
|
3666
|
+
setI18n(cacheI18n[language]);
|
|
3667
|
+
return;
|
|
3668
|
+
}
|
|
3665
3669
|
|
|
3666
3670
|
// @ts-ignore
|
|
3667
3671
|
fetch("".concat(EMOJI_MART_DATA_URL, "/i18n/").concat(language, ".json")).then(function (_x2) {
|