react-mentions 3.3.0 → 4.0.1
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 +2 -2
- package/dist/react-mentions.cjs.dev.js +273 -199
- package/dist/react-mentions.cjs.prod.js +178 -195
- package/dist/react-mentions.esm.js +272 -198
- package/package.json +5 -7
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: !0
|
9
9
|
});
|
10
10
|
|
11
|
-
var _toConsumableArray = _interopDefault(require("@babel/runtime/helpers/toConsumableArray")), _extends = _interopDefault(require("@babel/runtime/helpers/extends")), _classCallCheck = _interopDefault(require("@babel/runtime/helpers/classCallCheck")), _createClass = _interopDefault(require("@babel/runtime/helpers/createClass")), _possibleConstructorReturn = _interopDefault(require("@babel/runtime/helpers/possibleConstructorReturn")), _getPrototypeOf = _interopDefault(require("@babel/runtime/helpers/getPrototypeOf")), _assertThisInitialized = _interopDefault(require("@babel/runtime/helpers/assertThisInitialized")), _inherits = _interopDefault(require("@babel/runtime/helpers/inherits")), _defineProperty = _interopDefault(require("@babel/runtime/helpers/defineProperty")),
|
11
|
+
var _toConsumableArray = _interopDefault(require("@babel/runtime/helpers/toConsumableArray")), _extends = _interopDefault(require("@babel/runtime/helpers/extends")), _classCallCheck = _interopDefault(require("@babel/runtime/helpers/classCallCheck")), _createClass = _interopDefault(require("@babel/runtime/helpers/createClass")), _possibleConstructorReturn = _interopDefault(require("@babel/runtime/helpers/possibleConstructorReturn")), _getPrototypeOf = _interopDefault(require("@babel/runtime/helpers/getPrototypeOf")), _assertThisInitialized = _interopDefault(require("@babel/runtime/helpers/assertThisInitialized")), _inherits = _interopDefault(require("@babel/runtime/helpers/inherits")), _defineProperty = _interopDefault(require("@babel/runtime/helpers/defineProperty")), React = require("react"), React__default = _interopDefault(React), invariant = _interopDefault(require("invariant")), _slicedToArray = _interopDefault(require("@babel/runtime/helpers/slicedToArray")), _objectWithoutProperties = _interopDefault(require("@babel/runtime/helpers/objectWithoutProperties")), useStyles = require("substyle"), useStyles__default = _interopDefault(useStyles), PropTypes = _interopDefault(require("prop-types")), ReactDOM = _interopDefault(require("react-dom")), escapeRegex = function(str) {
|
12
12
|
return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
13
13
|
}, PLACEHOLDERS = {
|
14
14
|
id: "__id__",
|
@@ -403,29 +403,34 @@ var _toConsumableArray = _interopDefault(require("@babel/runtime/helpers/toConsu
|
|
403
403
|
return removeAccents(str).toLowerCase();
|
404
404
|
}, getSubstringIndex = function(str, substr, ignoreAccents) {
|
405
405
|
return ignoreAccents ? normalizeString(str).indexOf(normalizeString(substr)) : str.toLowerCase().indexOf(substr.toLowerCase());
|
406
|
+
}, isNumber = function(val) {
|
407
|
+
return "number" == typeof val;
|
408
|
+
}, keys = function(obj) {
|
409
|
+
return obj === Object(obj) ? Object.keys(obj) : [];
|
410
|
+
}, omit = function(obj) {
|
411
|
+
for (var _ref, _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) rest[_key - 1] = arguments[_key];
|
412
|
+
var keys = (_ref = []).concat.apply(_ref, rest);
|
413
|
+
return Object.keys(obj).reduce(function(acc, k) {
|
414
|
+
return obj.hasOwnProperty(k) && !keys.includes(k) && void 0 !== obj[k] && (acc[k] = obj[k]),
|
415
|
+
acc;
|
416
|
+
}, {});
|
406
417
|
};
|
407
418
|
|
408
|
-
function
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
_defineProperty(target, key, source[key]);
|
424
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) {
|
425
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
426
|
-
});
|
427
|
-
}
|
428
|
-
return target;
|
419
|
+
function createDefaultStyle(defaultStyle, getModifiers) {
|
420
|
+
return function(ComponentToWrap) {
|
421
|
+
var DefaultStyleEnhancer = function(_ref) {
|
422
|
+
var style = _ref.style, className = _ref.className, classNames = _ref.classNames, rest = _objectWithoutProperties(_ref, [ "style", "className", "classNames" ]), modifiers = getModifiers ? getModifiers(rest) : void 0, styles = useStyles__default(defaultStyle, {
|
423
|
+
style: style,
|
424
|
+
className: className,
|
425
|
+
classNames: classNames
|
426
|
+
}, modifiers);
|
427
|
+
return React__default.createElement(ComponentToWrap, _extends({}, rest, {
|
428
|
+
style: styles
|
429
|
+
}));
|
430
|
+
}, displayName = ComponentToWrap.displayName || ComponentToWrap.name || "Component";
|
431
|
+
return DefaultStyleEnhancer.displayName = "defaultStyle(".concat(displayName, ")"),
|
432
|
+
DefaultStyleEnhancer;
|
433
|
+
};
|
429
434
|
}
|
430
435
|
|
431
436
|
var _generateComponentKey = function(usedKeys, id) {
|
@@ -433,8 +438,12 @@ var _generateComponentKey = function(usedKeys, id) {
|
|
433
438
|
}, Highlighter = function(_Component) {
|
434
439
|
function Highlighter() {
|
435
440
|
var _this;
|
436
|
-
return _classCallCheck(this, Highlighter),
|
437
|
-
|
441
|
+
return _classCallCheck(this, Highlighter), _this = _possibleConstructorReturn(this, _getPrototypeOf(Highlighter).apply(this, arguments)),
|
442
|
+
_defineProperty(_assertThisInitialized(_this), "setCaretElement", function(el) {
|
443
|
+
_this.caretElement = el;
|
444
|
+
}), _this.state = {
|
445
|
+
left: void 0,
|
446
|
+
top: void 0
|
438
447
|
}, _this;
|
439
448
|
}
|
440
449
|
return _inherits(Highlighter, _Component), _createClass(Highlighter, [ {
|
@@ -450,21 +459,22 @@ var _generateComponentKey = function(usedKeys, id) {
|
|
450
459
|
}, {
|
451
460
|
key: "notifyCaretPosition",
|
452
461
|
value: function() {
|
453
|
-
if (this.
|
454
|
-
var
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
462
|
+
if (this.caretElement) {
|
463
|
+
var _this$caretElement = this.caretElement, offsetLeft = _this$caretElement.offsetLeft, offsetTop = _this$caretElement.offsetTop;
|
464
|
+
if (this.state.left !== offsetLeft || this.state.top !== offsetTop) {
|
465
|
+
var newPosition = {
|
466
|
+
left: offsetLeft,
|
467
|
+
top: offsetTop
|
468
|
+
};
|
469
|
+
this.setState(newPosition), this.props.onCaretPositionChange(newPosition);
|
470
|
+
}
|
461
471
|
}
|
462
472
|
}
|
463
473
|
}, {
|
464
474
|
key: "render",
|
465
475
|
value: function() {
|
466
|
-
var caretPositionInMarkup, _this2 = this, _this$props = this.props,
|
467
|
-
|
476
|
+
var caretPositionInMarkup, _this2 = this, _this$props = this.props, selectionStart = _this$props.selectionStart, selectionEnd = _this$props.selectionEnd, value = _this$props.value, style = _this$props.style, children = _this$props.children, containerRef = _this$props.containerRef, config = readConfigFromChildren(children);
|
477
|
+
selectionStart === selectionEnd && (caretPositionInMarkup = mapPlainTextIndex(value, config, selectionStart, "START"));
|
468
478
|
var resultComponents = [], componentKeys = {}, components = resultComponents, substringComponentKey = 0;
|
469
479
|
return iterateMentionsMarkup(value, config, function(markup, index, indexInPlainText, id, display, mentionChildIndex, lastMentionEndIndex) {
|
470
480
|
var key = _generateComponentKey(componentKeys, id);
|
@@ -478,7 +488,7 @@ var _generateComponentKey = function(usedKeys, id) {
|
|
478
488
|
substringComponentKey++;
|
479
489
|
}), components.push(" "), components !== resultComponents && resultComponents.push(this.renderHighlighterCaret(components)),
|
480
490
|
React__default.createElement("div", _extends({}, style, {
|
481
|
-
|
491
|
+
ref: containerRef
|
482
492
|
}), resultComponents);
|
483
493
|
}
|
484
494
|
}, {
|
@@ -501,11 +511,8 @@ var _generateComponentKey = function(usedKeys, id) {
|
|
501
511
|
}, {
|
502
512
|
key: "renderHighlighterCaret",
|
503
513
|
value: function(children) {
|
504
|
-
var _this3 = this;
|
505
514
|
return React__default.createElement("span", _extends({}, this.props.style("caret"), {
|
506
|
-
ref:
|
507
|
-
_this3.caretRef = el;
|
508
|
-
},
|
515
|
+
ref: this.setCaretElement,
|
509
516
|
key: "caret"
|
510
517
|
}), children);
|
511
518
|
}
|
@@ -513,26 +520,28 @@ var _generateComponentKey = function(usedKeys, id) {
|
|
513
520
|
}(React.Component);
|
514
521
|
|
515
522
|
_defineProperty(Highlighter, "propTypes", {
|
516
|
-
|
517
|
-
|
518
|
-
end: PropTypes.number
|
519
|
-
}).isRequired,
|
523
|
+
selectionStart: PropTypes.number,
|
524
|
+
selectionEnd: PropTypes.number,
|
520
525
|
value: PropTypes.string.isRequired,
|
521
526
|
onCaretPositionChange: PropTypes.func.isRequired,
|
522
|
-
|
527
|
+
containerRef: PropTypes.oneOfType([ PropTypes.func, PropTypes.shape({
|
528
|
+
current: "undefined" == typeof Element ? PropTypes.any : PropTypes.instanceOf(Element)
|
529
|
+
}) ]),
|
523
530
|
children: PropTypes.oneOfType([ PropTypes.element, PropTypes.arrayOf(PropTypes.element) ]).isRequired
|
524
531
|
}), _defineProperty(Highlighter, "defaultProps", {
|
525
|
-
value: ""
|
526
|
-
inputStyle: {}
|
532
|
+
value: ""
|
527
533
|
});
|
528
534
|
|
529
|
-
var styled =
|
535
|
+
var styled = createDefaultStyle({
|
530
536
|
position: "relative",
|
531
|
-
|
537
|
+
boxSizing: "border-box",
|
538
|
+
width: "100%",
|
532
539
|
color: "transparent",
|
533
540
|
overflow: "hidden",
|
534
541
|
whiteSpace: "pre-wrap",
|
535
542
|
wordWrap: "break-word",
|
543
|
+
border: "1px solid transparent",
|
544
|
+
textAlign: "start",
|
536
545
|
"&singleLine": {
|
537
546
|
whiteSpace: "pre",
|
538
547
|
wordWrap: null
|
@@ -551,7 +560,7 @@ var styled = substyle.defaultStyle({
|
|
551
560
|
return _inherits(Suggestion, _Component), _createClass(Suggestion, [ {
|
552
561
|
key: "render",
|
553
562
|
value: function() {
|
554
|
-
var rest = omit(this.props, "style", keys(Suggestion.propTypes));
|
563
|
+
var rest = omit(this.props, [ "style", "classNames", "className" ], keys(Suggestion.propTypes));
|
555
564
|
return React__default.createElement("li", _extends({}, rest, this.props.style), this.renderContent());
|
556
565
|
}
|
557
566
|
}, {
|
@@ -590,7 +599,7 @@ _defineProperty(Suggestion, "propTypes", {
|
|
590
599
|
focused: PropTypes.bool
|
591
600
|
});
|
592
601
|
|
593
|
-
var styled$1 =
|
602
|
+
var styled$1 = createDefaultStyle({
|
594
603
|
cursor: "pointer"
|
595
604
|
}, function(props) {
|
596
605
|
return {
|
@@ -598,58 +607,46 @@ var styled$1 = substyle.defaultStyle({
|
|
598
607
|
};
|
599
608
|
}), Suggestion$1 = styled$1(Suggestion);
|
600
609
|
|
601
|
-
function LoadingIndicator(
|
602
|
-
var
|
603
|
-
return React__default.createElement("div",
|
604
|
-
}
|
605
|
-
|
606
|
-
var LoadingIndicator$1 = substyle__default(LoadingIndicator);
|
607
|
-
|
608
|
-
function ownKeys$1(object, enumerableOnly) {
|
609
|
-
var keys = Object.keys(object);
|
610
|
-
if (Object.getOwnPropertySymbols) {
|
611
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
612
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
613
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
614
|
-
})), keys.push.apply(keys, symbols);
|
615
|
-
}
|
616
|
-
return keys;
|
617
|
-
}
|
618
|
-
|
619
|
-
function _objectSpread$1(target) {
|
620
|
-
for (var i = 1; i < arguments.length; i++) {
|
621
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
622
|
-
i % 2 ? ownKeys$1(source, !0).forEach(function(key) {
|
623
|
-
_defineProperty(target, key, source[key]);
|
624
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(source).forEach(function(key) {
|
625
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
626
|
-
});
|
627
|
-
}
|
628
|
-
return target;
|
610
|
+
function LoadingIndicator() {
|
611
|
+
var styles = useStyles__default(), spinnerStyles = styles("spinner");
|
612
|
+
return React__default.createElement("div", styles, React__default.createElement("div", spinnerStyles, React__default.createElement("div", spinnerStyles([ "element", "element1" ])), React__default.createElement("div", spinnerStyles([ "element", "element2" ])), React__default.createElement("div", spinnerStyles([ "element", "element3" ])), React__default.createElement("div", spinnerStyles([ "element", "element4" ])), React__default.createElement("div", spinnerStyles([ "element", "element5" ]))));
|
629
613
|
}
|
630
614
|
|
631
615
|
var SuggestionsOverlay = function(_Component) {
|
632
616
|
function SuggestionsOverlay() {
|
633
|
-
|
617
|
+
var _getPrototypeOf2, _this;
|
618
|
+
_classCallCheck(this, SuggestionsOverlay);
|
619
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
620
|
+
return _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SuggestionsOverlay)).call.apply(_getPrototypeOf2, [ this ].concat(args))),
|
621
|
+
_defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function(index, ev) {
|
622
|
+
_this.props.onMouseEnter && _this.props.onMouseEnter(index);
|
623
|
+
}), _defineProperty(_assertThisInitialized(_this), "select", function(suggestion, queryInfo) {
|
624
|
+
_this.props.onSelect(suggestion, queryInfo);
|
625
|
+
}), _defineProperty(_assertThisInitialized(_this), "setUlElement", function(el) {
|
626
|
+
_this.ulElement = el;
|
627
|
+
}), _this;
|
634
628
|
}
|
635
629
|
return _inherits(SuggestionsOverlay, _Component), _createClass(SuggestionsOverlay, [ {
|
636
630
|
key: "componentDidUpdate",
|
637
631
|
value: function() {
|
638
|
-
if (this.
|
639
|
-
var scrollTop = this.
|
640
|
-
bottom = bottom - topContainer + scrollTop, (top = top - topContainer + scrollTop) < scrollTop ? this.
|
632
|
+
if (this.ulElement && !(this.ulElement.offsetHeight >= this.ulElement.scrollHeight) && this.props.scrollFocusedIntoView) {
|
633
|
+
var scrollTop = this.ulElement.scrollTop, _this$ulElement$child = this.ulElement.children[this.props.focusIndex].getBoundingClientRect(), top = _this$ulElement$child.top, bottom = _this$ulElement$child.bottom, topContainer = this.ulElement.getBoundingClientRect().top;
|
634
|
+
bottom = bottom - topContainer + scrollTop, (top = top - topContainer + scrollTop) < scrollTop ? this.ulElement.scrollTop = top : bottom > this.ulElement.offsetHeight && (this.ulElement.scrollTop = bottom - this.ulElement.offsetHeight);
|
641
635
|
}
|
642
636
|
}
|
643
637
|
}, {
|
644
638
|
key: "render",
|
645
639
|
value: function() {
|
646
|
-
var _this
|
647
|
-
return 0 !== countSuggestions(suggestions) || isLoading ? React__default.createElement("div", _extends({},
|
648
|
-
|
640
|
+
var _this$props = this.props, suggestions = _this$props.suggestions, isLoading = _this$props.isLoading, style = _this$props.style, onMouseDown = _this$props.onMouseDown, containerRef = _this$props.containerRef, position = _this$props.position, left = _this$props.left, top = _this$props.top;
|
641
|
+
return 0 !== countSuggestions(suggestions) || isLoading ? React__default.createElement("div", _extends({}, useStyles.inline({
|
642
|
+
position: position || "absolute",
|
643
|
+
left: left,
|
644
|
+
top: top
|
645
|
+
}, style), {
|
646
|
+
onMouseDown: onMouseDown,
|
647
|
+
ref: containerRef
|
649
648
|
}), React__default.createElement("ul", _extends({
|
650
|
-
ref:
|
651
|
-
_this.suggestionsRef = el;
|
652
|
-
}
|
649
|
+
ref: this.setUlElement
|
653
650
|
}, style("list")), this.renderSuggestions()), this.renderLoadingIndicator()) : null;
|
654
651
|
}
|
655
652
|
}, {
|
@@ -666,7 +663,7 @@ var SuggestionsOverlay = function(_Component) {
|
|
666
663
|
}, {
|
667
664
|
key: "renderSuggestion",
|
668
665
|
value: function(result, queryInfo, index) {
|
669
|
-
var _this3 = this, id =
|
666
|
+
var _this3 = this, id = getID(result), isFocused = index === this.props.focusIndex, childIndex = queryInfo.childIndex, query = queryInfo.query, renderSuggestion = React.Children.toArray(this.props.children)[childIndex].props.renderSuggestion, ignoreAccents = this.props.ignoreAccents;
|
670
667
|
return React__default.createElement(Suggestion$1, {
|
671
668
|
style: this.props.style("item"),
|
672
669
|
key: "".concat(childIndex, "-").concat(id),
|
@@ -685,38 +682,29 @@ var SuggestionsOverlay = function(_Component) {
|
|
685
682
|
}
|
686
683
|
});
|
687
684
|
}
|
688
|
-
}, {
|
689
|
-
key: "getID",
|
690
|
-
value: function(suggestion) {
|
691
|
-
return suggestion instanceof String ? suggestion : suggestion.id;
|
692
|
-
}
|
693
685
|
}, {
|
694
686
|
key: "renderLoadingIndicator",
|
695
687
|
value: function() {
|
696
|
-
if (this.props.isLoading) return React__default.createElement(LoadingIndicator
|
688
|
+
if (this.props.isLoading) return React__default.createElement(LoadingIndicator, {
|
697
689
|
style: this.props.style("loadingIndicator")
|
698
690
|
});
|
699
691
|
}
|
700
|
-
}, {
|
701
|
-
key: "handleMouseEnter",
|
702
|
-
value: function(index, ev) {
|
703
|
-
this.props.onMouseEnter && this.props.onMouseEnter(index);
|
704
|
-
}
|
705
|
-
}, {
|
706
|
-
key: "select",
|
707
|
-
value: function(suggestion, queryInfo) {
|
708
|
-
this.props.onSelect(suggestion, queryInfo);
|
709
|
-
}
|
710
692
|
} ]), SuggestionsOverlay;
|
711
693
|
}(React.Component);
|
712
694
|
|
713
695
|
_defineProperty(SuggestionsOverlay, "propTypes", {
|
714
696
|
suggestions: PropTypes.object.isRequired,
|
715
697
|
focusIndex: PropTypes.number,
|
698
|
+
position: PropTypes.string,
|
699
|
+
left: PropTypes.number,
|
700
|
+
top: PropTypes.number,
|
716
701
|
scrollFocusedIntoView: PropTypes.bool,
|
717
702
|
isLoading: PropTypes.bool,
|
718
703
|
onSelect: PropTypes.func,
|
719
704
|
ignoreAccents: PropTypes.bool,
|
705
|
+
containerRef: PropTypes.oneOfType([ PropTypes.func, PropTypes.shape({
|
706
|
+
current: "undefined" == typeof Element ? PropTypes.any : PropTypes.instanceOf(Element)
|
707
|
+
}) ]),
|
720
708
|
children: PropTypes.oneOfType([ PropTypes.element, PropTypes.arrayOf(PropTypes.element) ]).isRequired
|
721
709
|
}), _defineProperty(SuggestionsOverlay, "defaultProps", {
|
722
710
|
suggestions: {},
|
@@ -725,23 +713,21 @@ _defineProperty(SuggestionsOverlay, "propTypes", {
|
|
725
713
|
}
|
726
714
|
});
|
727
715
|
|
728
|
-
var
|
729
|
-
return
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
}
|
741
|
-
});
|
716
|
+
var getID = function(suggestion) {
|
717
|
+
return suggestion instanceof String ? suggestion : suggestion.id;
|
718
|
+
}, styled$2 = createDefaultStyle({
|
719
|
+
zIndex: 1,
|
720
|
+
backgroundColor: "white",
|
721
|
+
marginTop: 14,
|
722
|
+
minWidth: 100,
|
723
|
+
list: {
|
724
|
+
margin: 0,
|
725
|
+
padding: 0,
|
726
|
+
listStyleType: "none"
|
727
|
+
}
|
742
728
|
}), SuggestionsOverlay$1 = styled$2(SuggestionsOverlay);
|
743
729
|
|
744
|
-
function ownKeys
|
730
|
+
function ownKeys(object, enumerableOnly) {
|
745
731
|
var keys = Object.keys(object);
|
746
732
|
if (Object.getOwnPropertySymbols) {
|
747
733
|
var symbols = Object.getOwnPropertySymbols(object);
|
@@ -752,12 +738,12 @@ function ownKeys$2(object, enumerableOnly) {
|
|
752
738
|
return keys;
|
753
739
|
}
|
754
740
|
|
755
|
-
function _objectSpread
|
741
|
+
function _objectSpread(target) {
|
756
742
|
for (var i = 1; i < arguments.length; i++) {
|
757
743
|
var source = null != arguments[i] ? arguments[i] : {};
|
758
|
-
i % 2 ? ownKeys
|
744
|
+
i % 2 ? ownKeys(source, !0).forEach(function(key) {
|
759
745
|
_defineProperty(target, key, source[key]);
|
760
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys
|
746
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(source).forEach(function(key) {
|
761
747
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
762
748
|
});
|
763
749
|
}
|
@@ -786,7 +772,6 @@ var makeTriggerRegex = function(trigger) {
|
|
786
772
|
}, isComposing = !1, propTypes = {
|
787
773
|
singleLine: PropTypes.bool,
|
788
774
|
allowSpaceInQuery: PropTypes.bool,
|
789
|
-
EXPERIMENTAL_cutCopyPaste: PropTypes.bool,
|
790
775
|
allowSuggestionsAboveCursor: PropTypes.bool,
|
791
776
|
ignoreAccents: PropTypes.bool,
|
792
777
|
value: PropTypes.string,
|
@@ -803,9 +788,11 @@ var makeTriggerRegex = function(trigger) {
|
|
803
788
|
function MentionsInput(_props) {
|
804
789
|
var _this;
|
805
790
|
return _classCallCheck(this, MentionsInput), _this = _possibleConstructorReturn(this, _getPrototypeOf(MentionsInput).call(this, _props)),
|
806
|
-
_defineProperty(_assertThisInitialized(_this), "
|
791
|
+
_defineProperty(_assertThisInitialized(_this), "setContainerElement", function(el) {
|
792
|
+
_this.containerElement = el;
|
793
|
+
}), _defineProperty(_assertThisInitialized(_this), "getInputProps", function() {
|
807
794
|
var _this$props = _this.props, readOnly = _this$props.readOnly, disabled = _this$props.disabled, style = _this$props.style;
|
808
|
-
return _objectSpread
|
795
|
+
return _objectSpread({}, omit(_this.props, [ "style", "classNames", "className" ], keys(propTypes)), {}, style("input"), {
|
809
796
|
value: _this.getPlainText()
|
810
797
|
}, !readOnly && !disabled && {
|
811
798
|
onChange: _this.handleChange,
|
@@ -817,8 +804,8 @@ var makeTriggerRegex = function(trigger) {
|
|
817
804
|
onScroll: _this.updateHighlighterScroll
|
818
805
|
});
|
819
806
|
}), _defineProperty(_assertThisInitialized(_this), "renderControl", function() {
|
820
|
-
var _this$props2 = _this.props, singleLine = _this$props2.singleLine, style = _this$props2.style, inputProps = _this.getInputProps(
|
821
|
-
return React__default.createElement("div", style("control"), _this.renderHighlighter(
|
807
|
+
var _this$props2 = _this.props, singleLine = _this$props2.singleLine, style = _this$props2.style, inputProps = _this.getInputProps();
|
808
|
+
return React__default.createElement("div", style("control"), _this.renderHighlighter(), singleLine ? _this.renderInput(inputProps) : _this.renderTextarea(inputProps));
|
822
809
|
}), _defineProperty(_assertThisInitialized(_this), "renderInput", function(props) {
|
823
810
|
return React__default.createElement("input", _extends({
|
824
811
|
type: "text",
|
@@ -829,52 +816,46 @@ var makeTriggerRegex = function(trigger) {
|
|
829
816
|
ref: _this.setInputRef
|
830
817
|
}, props));
|
831
818
|
}), _defineProperty(_assertThisInitialized(_this), "setInputRef", function(el) {
|
832
|
-
_this.
|
819
|
+
_this.inputElement = el;
|
833
820
|
var inputRef = _this.props.inputRef;
|
834
821
|
"function" == typeof inputRef ? inputRef(el) : inputRef && (inputRef.current = el);
|
822
|
+
}), _defineProperty(_assertThisInitialized(_this), "setSuggestionsElement", function(el) {
|
823
|
+
_this.suggestionsElement = el;
|
835
824
|
}), _defineProperty(_assertThisInitialized(_this), "renderSuggestionsOverlay", function() {
|
836
825
|
if (!isNumber(_this.state.selectionStart)) return null;
|
837
|
-
var suggestionsNode = React__default.createElement(SuggestionsOverlay$1, {
|
826
|
+
var _this$state$suggestio = _this.state.suggestionsPosition, position = _this$state$suggestio.position, left = _this$state$suggestio.left, top = _this$state$suggestio.top, suggestionsNode = React__default.createElement(SuggestionsOverlay$1, {
|
838
827
|
style: _this.props.style("suggestions"),
|
839
|
-
position:
|
828
|
+
position: position,
|
829
|
+
left: left,
|
830
|
+
top: top,
|
840
831
|
focusIndex: _this.state.focusIndex,
|
841
832
|
scrollFocusedIntoView: _this.state.scrollFocusedIntoView,
|
842
|
-
|
843
|
-
_this.suggestionsRef = el;
|
844
|
-
},
|
833
|
+
containerRef: _this.setSuggestionsElement,
|
845
834
|
suggestions: _this.state.suggestions,
|
846
835
|
onSelect: _this.addMention,
|
847
836
|
onMouseDown: _this.handleSuggestionsMouseDown,
|
848
|
-
onMouseEnter:
|
849
|
-
return _this.setState({
|
850
|
-
focusIndex: focusIndex,
|
851
|
-
scrollFocusedIntoView: !1
|
852
|
-
});
|
853
|
-
},
|
837
|
+
onMouseEnter: _this.handleSuggestionsMouseEnter,
|
854
838
|
isLoading: _this.isLoading(),
|
855
839
|
ignoreAccents: _this.props.ignoreAccents
|
856
840
|
}, _this.props.children);
|
857
841
|
return _this.props.suggestionsPortalHost ? ReactDOM.createPortal(suggestionsNode, _this.props.suggestionsPortalHost) : suggestionsNode;
|
858
|
-
}), _defineProperty(_assertThisInitialized(_this), "renderHighlighter", function(
|
842
|
+
}), _defineProperty(_assertThisInitialized(_this), "renderHighlighter", function() {
|
859
843
|
var _this$state = _this.state, selectionStart = _this$state.selectionStart, selectionEnd = _this$state.selectionEnd, _this$props3 = _this.props, singleLine = _this$props3.singleLine, children = _this$props3.children, value = _this$props3.value, style = _this$props3.style;
|
860
844
|
return React__default.createElement(Highlighter$1, {
|
861
|
-
|
862
|
-
_this.highlighterRef = el;
|
863
|
-
},
|
845
|
+
containerRef: _this.setHighlighterElement,
|
864
846
|
style: style("highlighter"),
|
865
|
-
inputStyle: inputStyle,
|
866
847
|
value: value,
|
867
848
|
singleLine: singleLine,
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
},
|
872
|
-
onCaretPositionChange: function(position) {
|
873
|
-
return _this.setState({
|
874
|
-
caretPosition: position
|
875
|
-
});
|
876
|
-
}
|
849
|
+
selectionStart: selectionStart,
|
850
|
+
selectionEnd: selectionEnd,
|
851
|
+
onCaretPositionChange: _this.handleCaretPositionChange
|
877
852
|
}, children);
|
853
|
+
}), _defineProperty(_assertThisInitialized(_this), "setHighlighterElement", function(el) {
|
854
|
+
_this.highlighterElement = el;
|
855
|
+
}), _defineProperty(_assertThisInitialized(_this), "handleCaretPositionChange", function(position) {
|
856
|
+
_this.setState({
|
857
|
+
caretPosition: position
|
858
|
+
});
|
878
859
|
}), _defineProperty(_assertThisInitialized(_this), "getPlainText", function() {
|
879
860
|
return getPlainText(_this.props.value || "", readConfigFromChildren(_this.props.children));
|
880
861
|
}), _defineProperty(_assertThisInitialized(_this), "executeOnChange", function(event) {
|
@@ -882,7 +863,7 @@ var makeTriggerRegex = function(trigger) {
|
|
882
863
|
var _this$props4, _this$props$valueLink;
|
883
864
|
return _this.props.onChange ? (_this$props4 = _this.props).onChange.apply(_this$props4, [ event ].concat(args)) : _this.props.valueLink ? (_this$props$valueLink = _this.props.valueLink).requestChange.apply(_this$props$valueLink, [ event.target.value ].concat(args)) : void 0;
|
884
865
|
}), _defineProperty(_assertThisInitialized(_this), "handleChange", function(ev) {
|
885
|
-
if ((document.activeElement && document.activeElement.contentDocument || document).activeElement === ev.target) {
|
866
|
+
if (isComposing = !1, (document.activeElement && document.activeElement.contentDocument || document).activeElement === ev.target) {
|
886
867
|
var value = _this.props.value || "", config = readConfigFromChildren(_this.props.children), newPlainTextValue = ev.target.value, newValue = applyChangeToValue(value, newPlainTextValue, {
|
887
868
|
selectionStartBefore: _this.state.selectionStart,
|
888
869
|
selectionEndBefore: _this.state.selectionEnd,
|
@@ -908,13 +889,12 @@ var makeTriggerRegex = function(trigger) {
|
|
908
889
|
selectionStart: ev.target.selectionStart,
|
909
890
|
selectionEnd: ev.target.selectionEnd
|
910
891
|
}), !isComposing) {
|
911
|
-
var el = _this.
|
892
|
+
var el = _this.inputElement;
|
912
893
|
ev.target.selectionStart === ev.target.selectionEnd ? _this.updateMentionsQueries(el.value, ev.target.selectionStart) : _this.clearSuggestions(),
|
913
894
|
_this.updateHighlighterScroll(), _this.props.onSelect(ev);
|
914
895
|
}
|
915
896
|
}), _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function(ev) {
|
916
|
-
|
917
|
-
if (0 !== suggestionsCount && suggestionsComp) switch (values(KEY).indexOf(ev.keyCode) >= 0 && ev.preventDefault(),
|
897
|
+
if (0 !== countSuggestions(_this.state.suggestions) && _this.suggestionsElement) switch (Object.values(KEY).indexOf(ev.keyCode) >= 0 && ev.preventDefault(),
|
918
898
|
ev.keyCode) {
|
919
899
|
case KEY.ESC:
|
920
900
|
return void _this.clearSuggestions();
|
@@ -961,10 +941,15 @@ var makeTriggerRegex = function(trigger) {
|
|
961
941
|
}, 1), _this.props.onBlur(ev, clickedSuggestion);
|
962
942
|
}), _defineProperty(_assertThisInitialized(_this), "handleSuggestionsMouseDown", function(ev) {
|
963
943
|
_this._suggestionsMouseDown = !0;
|
944
|
+
}), _defineProperty(_assertThisInitialized(_this), "handleSuggestionsMouseEnter", function(focusIndex) {
|
945
|
+
_this.setState({
|
946
|
+
focusIndex: focusIndex,
|
947
|
+
scrollFocusedIntoView: !1
|
948
|
+
});
|
964
949
|
}), _defineProperty(_assertThisInitialized(_this), "updateSuggestionsPosition", function() {
|
965
950
|
var caretPosition = _this.state.caretPosition, _this$props5 = _this.props, suggestionsPortalHost = _this$props5.suggestionsPortalHost, allowSuggestionsAboveCursor = _this$props5.allowSuggestionsAboveCursor;
|
966
|
-
if (caretPosition && _this.
|
967
|
-
var suggestions =
|
951
|
+
if (caretPosition && _this.suggestionsElement) {
|
952
|
+
var suggestions = _this.suggestionsElement, highlighter = _this.highlighterElement, caretOffsetParentRect = highlighter.getBoundingClientRect(), caretHeight = getComputedStyleLengthProp(highlighter, "font-size"), viewportRelative = {
|
968
953
|
left: caretOffsetParentRect.left + caretPosition.left,
|
969
954
|
top: caretOffsetParentRect.top + caretPosition.top + caretHeight
|
970
955
|
}, viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
@@ -980,27 +965,25 @@ var makeTriggerRegex = function(trigger) {
|
|
980
965
|
allowSuggestionsAboveCursor && top + suggestions.offsetHeight > viewportHeight && suggestions.offsetHeight < top - caretHeight ? position.top = Math.max(0, top - suggestions.offsetHeight - caretHeight) : position.top = top;
|
981
966
|
} else {
|
982
967
|
var _left = caretPosition.left - highlighter.scrollLeft, _top = caretPosition.top - highlighter.scrollTop;
|
983
|
-
_left + suggestions.offsetWidth > _this.
|
968
|
+
_left + suggestions.offsetWidth > _this.containerElement.offsetWidth ? position.right = 0 : position.left = _left,
|
984
969
|
allowSuggestionsAboveCursor && viewportRelative.top - highlighter.scrollTop + suggestions.offsetHeight > viewportHeight && suggestions.offsetHeight < caretOffsetParentRect.top - caretHeight - highlighter.scrollTop ? position.top = _top - suggestions.offsetHeight - caretHeight : position.top = _top;
|
985
970
|
}
|
986
|
-
|
971
|
+
position.left === _this.state.suggestionsPosition.left && position.top === _this.state.suggestionsPosition.top && position.position === _this.state.suggestionsPosition.position || _this.setState({
|
987
972
|
suggestionsPosition: position
|
988
973
|
});
|
989
974
|
}
|
990
975
|
}
|
991
976
|
}), _defineProperty(_assertThisInitialized(_this), "updateHighlighterScroll", function() {
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
highlighter.height = input.height;
|
996
|
-
}
|
977
|
+
var input = _this.inputElement, highlighter = _this.highlighterElement;
|
978
|
+
input && highlighter && (highlighter.scrollLeft = input.scrollLeft, highlighter.scrollTop = input.scrollTop,
|
979
|
+
highlighter.height = input.height);
|
997
980
|
}), _defineProperty(_assertThisInitialized(_this), "handleCompositionStart", function() {
|
998
981
|
isComposing = !0;
|
999
982
|
}), _defineProperty(_assertThisInitialized(_this), "handleCompositionEnd", function() {
|
1000
983
|
isComposing = !1;
|
1001
984
|
}), _defineProperty(_assertThisInitialized(_this), "setSelection", function(selectionStart, selectionEnd) {
|
1002
985
|
if (null !== selectionStart && null !== selectionEnd) {
|
1003
|
-
var el = _this.
|
986
|
+
var el = _this.inputElement;
|
1004
987
|
if (el.setSelectionRange) el.setSelectionRange(selectionStart, selectionEnd); else if (el.createTextRange) {
|
1005
988
|
var range = el.createTextRange();
|
1006
989
|
range.collapse(!0), range.moveEnd("character", selectionEnd), range.moveStart("character", selectionStart),
|
@@ -1034,7 +1017,7 @@ var makeTriggerRegex = function(trigger) {
|
|
1034
1017
|
syncResult instanceof Array && _this.updateSuggestions(_this._queryId, childIndex, query, querySequenceStart, querySequenceEnd, plainTextValue, syncResult);
|
1035
1018
|
}), _defineProperty(_assertThisInitialized(_this), "updateSuggestions", function(queryId, childIndex, query, querySequenceStart, querySequenceEnd, plainTextValue, results) {
|
1036
1019
|
if (queryId === _this._queryId) {
|
1037
|
-
_this.suggestions = _objectSpread
|
1020
|
+
_this.suggestions = _objectSpread({}, _this.suggestions, _defineProperty({}, childIndex, {
|
1038
1021
|
queryInfo: {
|
1039
1022
|
childIndex: childIndex,
|
1040
1023
|
query: query,
|
@@ -1054,7 +1037,7 @@ var makeTriggerRegex = function(trigger) {
|
|
1054
1037
|
var id = _ref2.id, display = _ref2.display, childIndex = _ref3.childIndex, querySequenceStart = _ref3.querySequenceStart, querySequenceEnd = _ref3.querySequenceEnd, plainTextValue = _ref3.plainTextValue, value = _this.props.value || "", config = readConfigFromChildren(_this.props.children), _mentionsChild$props = React.Children.toArray(_this.props.children)[childIndex].props, markup = _mentionsChild$props.markup, displayTransform = _mentionsChild$props.displayTransform, appendSpaceOnAdd = _mentionsChild$props.appendSpaceOnAdd, onAdd = _mentionsChild$props.onAdd, start = mapPlainTextIndex(value, config, querySequenceStart, "START"), end = start + querySequenceEnd - querySequenceStart, insert = makeMentionsMarkup(markup, id, display);
|
1055
1038
|
appendSpaceOnAdd && (insert += " ");
|
1056
1039
|
var newValue = spliceString(value, start, end, insert);
|
1057
|
-
_this.
|
1040
|
+
_this.inputElement.focus();
|
1058
1041
|
var displayValue = displayTransform(id, display);
|
1059
1042
|
appendSpaceOnAdd && (displayValue += " ");
|
1060
1043
|
var newCaretPosition = querySequenceStart + displayValue.length;
|
@@ -1083,15 +1066,14 @@ var makeTriggerRegex = function(trigger) {
|
|
1083
1066
|
selectionEnd: null,
|
1084
1067
|
suggestions: {},
|
1085
1068
|
caretPosition: null,
|
1086
|
-
suggestionsPosition:
|
1069
|
+
suggestionsPosition: {}
|
1087
1070
|
}, _this;
|
1088
1071
|
}
|
1089
1072
|
return _inherits(MentionsInput, _React$Component), _createClass(MentionsInput, [ {
|
1090
1073
|
key: "componentDidMount",
|
1091
1074
|
value: function() {
|
1092
|
-
this.
|
1093
|
-
document.addEventListener("
|
1094
|
-
this.updateSuggestionsPosition();
|
1075
|
+
document.addEventListener("copy", this.handleCopy), document.addEventListener("cut", this.handleCut),
|
1076
|
+
document.addEventListener("paste", this.handlePaste), this.updateSuggestionsPosition();
|
1095
1077
|
}
|
1096
1078
|
}, {
|
1097
1079
|
key: "componentDidUpdate",
|
@@ -1104,26 +1086,23 @@ var makeTriggerRegex = function(trigger) {
|
|
1104
1086
|
}, {
|
1105
1087
|
key: "componentWillUnmount",
|
1106
1088
|
value: function() {
|
1107
|
-
this.
|
1108
|
-
document.removeEventListener("
|
1089
|
+
document.removeEventListener("copy", this.handleCopy), document.removeEventListener("cut", this.handleCut),
|
1090
|
+
document.removeEventListener("paste", this.handlePaste);
|
1109
1091
|
}
|
1110
1092
|
}, {
|
1111
1093
|
key: "render",
|
1112
1094
|
value: function() {
|
1113
|
-
var _this2 = this;
|
1114
1095
|
return React__default.createElement("div", _extends({
|
1115
|
-
ref:
|
1116
|
-
_this2.containerRef = el;
|
1117
|
-
}
|
1096
|
+
ref: this.setContainerElement
|
1118
1097
|
}, this.props.style), this.renderControl(), this.renderSuggestionsOverlay());
|
1119
1098
|
}
|
1120
1099
|
}, {
|
1121
1100
|
key: "handlePaste",
|
1122
1101
|
value: function(event) {
|
1123
|
-
if (event.target === this.
|
1102
|
+
if (event.target === this.inputElement && this.supportsClipboardActions(event)) {
|
1124
1103
|
event.preventDefault();
|
1125
|
-
var _this$state3 = this.state, selectionStart = _this$state3.selectionStart, selectionEnd = _this$state3.selectionEnd, _this$props7 = this.props, value = _this$props7.value, children = _this$props7.children, config = readConfigFromChildren(children), markupStartIndex = mapPlainTextIndex(value, config, selectionStart, "START"), markupEndIndex = mapPlainTextIndex(value, config, selectionEnd, "END"), pastedMentions = event.clipboardData.getData("text/react-mentions"), pastedData = event.clipboardData.getData("text/plain"), newValue = spliceString(value, markupStartIndex, markupEndIndex, pastedMentions || pastedData), newPlainTextValue = getPlainText(newValue, config), eventMock = {
|
1126
|
-
target: _objectSpread
|
1104
|
+
var _this$state3 = this.state, selectionStart = _this$state3.selectionStart, selectionEnd = _this$state3.selectionEnd, _this$props7 = this.props, value = _this$props7.value, children = _this$props7.children, config = readConfigFromChildren(children), markupStartIndex = mapPlainTextIndex(value, config, selectionStart, "START"), markupEndIndex = mapPlainTextIndex(value, config, selectionEnd, "END"), pastedMentions = event.clipboardData.getData("text/react-mentions"), pastedData = event.clipboardData.getData("text/plain"), newValue = spliceString(value, markupStartIndex, markupEndIndex, pastedMentions || pastedData).replace(/\r/g, ""), newPlainTextValue = getPlainText(newValue, config), eventMock = {
|
1105
|
+
target: _objectSpread({}, event.target, {
|
1127
1106
|
value: newValue
|
1128
1107
|
})
|
1129
1108
|
};
|
@@ -1145,16 +1124,16 @@ var makeTriggerRegex = function(trigger) {
|
|
1145
1124
|
}, {
|
1146
1125
|
key: "handleCopy",
|
1147
1126
|
value: function(event) {
|
1148
|
-
event.target === this.
|
1127
|
+
event.target === this.inputElement && this.supportsClipboardActions(event) && (event.preventDefault(),
|
1149
1128
|
this.saveSelectionToClipboard(event));
|
1150
1129
|
}
|
1151
1130
|
}, {
|
1152
1131
|
key: "handleCut",
|
1153
1132
|
value: function(event) {
|
1154
|
-
if (event.target === this.
|
1133
|
+
if (event.target === this.inputElement && this.supportsClipboardActions(event)) {
|
1155
1134
|
event.preventDefault(), this.saveSelectionToClipboard(event);
|
1156
1135
|
var _this$state5 = this.state, selectionStart = _this$state5.selectionStart, selectionEnd = _this$state5.selectionEnd, _this$props9 = this.props, children = _this$props9.children, value = _this$props9.value, config = readConfigFromChildren(children), markupStartIndex = mapPlainTextIndex(value, config, selectionStart, "START"), markupEndIndex = mapPlainTextIndex(value, config, selectionEnd, "END"), newValue = [ value.slice(0, markupStartIndex), value.slice(markupEndIndex) ].join(""), newPlainTextValue = getPlainText(newValue, config), eventMock = {
|
1157
|
-
target: _objectSpread
|
1136
|
+
target: _objectSpread({}, event.target, {
|
1158
1137
|
value: newPlainTextValue
|
1159
1138
|
})
|
1160
1139
|
};
|
@@ -1182,24 +1161,24 @@ _defineProperty(MentionsInput, "propTypes", propTypes), _defineProperty(Mentions
|
|
1182
1161
|
var getComputedStyleLengthProp = function(forElement, propertyName) {
|
1183
1162
|
var length = parseFloat(window.getComputedStyle(forElement, null).getPropertyValue(propertyName));
|
1184
1163
|
return isFinite(length) ? length : 0;
|
1185
|
-
}, isMobileSafari = "undefined" != typeof navigator && /iPhone|iPad|iPod/i.test(navigator.userAgent), styled$3 =
|
1164
|
+
}, isMobileSafari = "undefined" != typeof navigator && /iPhone|iPad|iPod/i.test(navigator.userAgent), styled$3 = createDefaultStyle({
|
1186
1165
|
position: "relative",
|
1187
1166
|
overflowY: "visible",
|
1188
1167
|
input: {
|
1189
1168
|
display: "block",
|
1169
|
+
width: "100%",
|
1190
1170
|
position: "absolute",
|
1171
|
+
margin: 0,
|
1191
1172
|
top: 0,
|
1192
1173
|
left: 0,
|
1193
1174
|
boxSizing: "border-box",
|
1194
1175
|
backgroundColor: "transparent",
|
1195
|
-
width: "inherit",
|
1196
1176
|
fontFamily: "inherit",
|
1197
1177
|
fontSize: "inherit",
|
1198
1178
|
letterSpacing: "inherit"
|
1199
1179
|
},
|
1200
1180
|
"&multiLine": {
|
1201
|
-
input: _objectSpread
|
1202
|
-
width: "100%",
|
1181
|
+
input: _objectSpread({
|
1203
1182
|
height: "100%",
|
1204
1183
|
bottom: 0,
|
1205
1184
|
overflow: "hidden",
|
@@ -1215,12 +1194,16 @@ var getComputedStyleLengthProp = function(forElement, propertyName) {
|
|
1215
1194
|
"&singleLine": singleLine,
|
1216
1195
|
"&multiLine": !singleLine
|
1217
1196
|
};
|
1218
|
-
}), MentionsInput$1 = styled$3(MentionsInput),
|
1197
|
+
}), MentionsInput$1 = styled$3(MentionsInput), defaultStyle = {
|
1219
1198
|
fontWeight: "inherit"
|
1220
|
-
}
|
1221
|
-
var display = _ref.display, style = _ref.style
|
1222
|
-
|
1223
|
-
|
1199
|
+
}, Mention = function(_ref) {
|
1200
|
+
var display = _ref.display, style = _ref.style, className = _ref.className, classNames = _ref.classNames, styles = useStyles__default(defaultStyle, {
|
1201
|
+
style: style,
|
1202
|
+
className: className,
|
1203
|
+
classNames: classNames
|
1204
|
+
});
|
1205
|
+
return React__default.createElement("strong", styles, display);
|
1206
|
+
};
|
1224
1207
|
|
1225
1208
|
Mention.propTypes = {
|
1226
1209
|
onAdd: PropTypes.func,
|