react-input-emoji 5.6.2 → 5.6.3
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 +5 -10
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +5 -11
- 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
CHANGED
@@ -2,13 +2,11 @@
|
|
2
2
|
|
3
3
|
var React = require('react');
|
4
4
|
var ReactDOM = require('react-dom');
|
5
|
-
var t = require('prop-types');
|
6
5
|
|
7
6
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
8
7
|
|
9
8
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
10
9
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
11
|
-
var t__default = /*#__PURE__*/_interopDefaultLegacy(t);
|
12
10
|
|
13
11
|
function styleInject(css, ref) {
|
14
12
|
if (ref === void 0) ref = {};
|
@@ -523,7 +521,7 @@ function replaceAllTextEmojis(text) {
|
|
523
521
|
allEmojis = _toConsumableArray(new Set(allEmojis)); // remove duplicates
|
524
522
|
|
525
523
|
allEmojis.forEach(function (emoji) {
|
526
|
-
text = replaceAll(text, emoji, getInputEmojiHTML(emoji));
|
524
|
+
text = replaceAll(text, emoji, getInputEmojiHTML('', emoji));
|
527
525
|
});
|
528
526
|
}
|
529
527
|
return text;
|
@@ -767,7 +765,7 @@ function useExpose(_ref) {
|
|
767
765
|
textInputRef = _ref.textInputRef,
|
768
766
|
setValue = _ref.setValue,
|
769
767
|
emitChange = _ref.emitChange;
|
770
|
-
var _useSanitize = useSanitize(),
|
768
|
+
var _useSanitize = useSanitize(false),
|
771
769
|
sanitize = _useSanitize.sanitize,
|
772
770
|
sanitizedTextRef = _useSanitize.sanitizedTextRef;
|
773
771
|
React.useImperativeHandle(ref, function () {
|
@@ -3502,14 +3500,13 @@ function $e5534fc185f7111e$export$2e2bcd8739ae039(props) {
|
|
3502
3500
|
* @property {'light' | 'dark' | 'auto'} theme
|
3503
3501
|
* @property {function(import("../types/types").EmojiMartItem): void} onSelectEmoji
|
3504
3502
|
* @property {boolean} disableRecent
|
3505
|
-
* @property {
|
3503
|
+
* @property {any[]=} customEmojis
|
3506
3504
|
* @property {import('../types/types').Languages=} language
|
3507
3505
|
*/
|
3508
3506
|
|
3509
3507
|
/**
|
3510
3508
|
* Emoji Picker Component
|
3511
3509
|
* @param {Props} props
|
3512
|
-
* @return {React.FC}
|
3513
3510
|
*/
|
3514
3511
|
function EmojiPicker(props) {
|
3515
3512
|
var theme = props.theme,
|
@@ -3553,7 +3550,7 @@ var EmojiPicker$1 = /*#__PURE__*/React.memo(EmojiPicker);
|
|
3553
3550
|
* @property {'light' | 'dark' | 'auto'} theme
|
3554
3551
|
* @property {(emoji: import("../types/types").EmojiMartItem) => void} handleSelectEmoji
|
3555
3552
|
* @property {boolean} disableRecent
|
3556
|
-
* @property {
|
3553
|
+
* @property {any[]=} customEmojis
|
3557
3554
|
* @property {('above' | 'below')=} position
|
3558
3555
|
* @property {import('../types/types').Languages=} language
|
3559
3556
|
*/
|
@@ -3607,7 +3604,7 @@ var EMOJI_PICKER_CONTAINER_HEIGHT = 435;
|
|
3607
3604
|
* @property {'light' | 'dark' | 'auto'} theme
|
3608
3605
|
* @property {boolean} keepOpened
|
3609
3606
|
* @property {boolean} disableRecent
|
3610
|
-
* @property {
|
3607
|
+
* @property {any[]=} customEmojis
|
3611
3608
|
* @property {(fn: SanitizeFn) => void} addSanitizeFn
|
3612
3609
|
* @property {(fn: PolluteFn) => void} addPolluteFn
|
3613
3610
|
* @property {(html: string) => void} appendContent
|
@@ -4083,9 +4080,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
|
|
4083
4080
|
}));
|
4084
4081
|
};
|
4085
4082
|
var MentionUserListWithRef = /*#__PURE__*/React.forwardRef(MentionUserList);
|
4086
|
-
MentionUserListWithRef.propTypes = {
|
4087
|
-
users: t__default["default"].array.isRequired
|
4088
|
-
};
|
4089
4083
|
|
4090
4084
|
/**
|
4091
4085
|
* @typedef {import('../types/types').MentionUser} MetionUser
|