react-input-emoji 5.6.2 → 5.6.4
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/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
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
|
@@ -4337,26 +4331,26 @@ function usePollute() {
|
|
4337
4331
|
* @typedef {object} Props
|
4338
4332
|
* @property {string} value
|
4339
4333
|
* @property {(value: string) => void} onChange
|
4340
|
-
* @property {"light" | "dark" | "auto"} theme
|
4341
|
-
* @property {boolean} cleanOnEnter
|
4342
|
-
* @property {(text: string) => void} onEnter
|
4343
|
-
* @property {string} placeholder
|
4344
|
-
* @property {(size: {width: number, height: number}) => void} onResize
|
4345
|
-
* @property {() => void} onClick
|
4346
|
-
* @property {() => void} onFocus
|
4334
|
+
* @property {"light" | "dark" | "auto"=} theme
|
4335
|
+
* @property {boolean=} cleanOnEnter
|
4336
|
+
* @property {(text: string) => void=} onEnter
|
4337
|
+
* @property {string=} placeholder
|
4338
|
+
* @property {(size: {width: number, height: number}) => void=} onResize
|
4339
|
+
* @property {() => void=} onClick
|
4340
|
+
* @property {() => void=} onFocus
|
4347
4341
|
* @property {() => void=} onBlur
|
4348
|
-
* @property {boolean} shouldReturn
|
4349
|
-
* @property {number} maxLength
|
4350
|
-
* @property {boolean} keepOpened
|
4351
|
-
* @property {(event: KeyboardEvent) => void} onKeyDown
|
4352
|
-
* @property {string} inputClass
|
4353
|
-
* @property {boolean} disableRecent
|
4354
|
-
* @property {number} tabIndex
|
4355
|
-
* @property {number} height
|
4356
|
-
* @property {number} borderRadius
|
4357
|
-
* @property {string} borderColor
|
4358
|
-
* @property {number} fontSize
|
4359
|
-
* @property {string} fontFamily
|
4342
|
+
* @property {boolean=} shouldReturn
|
4343
|
+
* @property {number=} maxLength
|
4344
|
+
* @property {boolean=} keepOpened
|
4345
|
+
* @property {(event: KeyboardEvent) => void=} onKeyDown
|
4346
|
+
* @property {string=} inputClass
|
4347
|
+
* @property {boolean=} disableRecent
|
4348
|
+
* @property {number=} tabIndex
|
4349
|
+
* @property {number=} height
|
4350
|
+
* @property {number=} borderRadius
|
4351
|
+
* @property {string=} borderColor
|
4352
|
+
* @property {number=} fontSize
|
4353
|
+
* @property {string=} fontFamily
|
4360
4354
|
* @property {{id: string; name: string; emojis: {id: string; name: string; keywords: string[], skins: {src: string}[]}}[]=} customEmojis
|
4361
4355
|
* @property {import('./types/types').Languages=} language
|
4362
4356
|
* @property {(text: string) => Promise<MetionUser[]>=} searchMention
|