react-mentions 4.4.5 → 4.4.6
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/CHANGELOG.md +6 -0
- package/dist/react-mentions.cjs.dev.js +55 -77
- package/dist/react-mentions.cjs.prod.js +28 -70
- package/dist/react-mentions.esm.js +55 -77
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -892,89 +892,68 @@ var styled = createDefaultStyle({
|
|
892
892
|
});
|
893
893
|
var Highlighter$1 = styled(Highlighter);
|
894
894
|
|
895
|
-
function
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
895
|
+
function Suggestion(_ref) {
|
896
|
+
var id = _ref.id,
|
897
|
+
focused = _ref.focused,
|
898
|
+
ignoreAccents = _ref.ignoreAccents,
|
899
|
+
index = _ref.index,
|
900
|
+
onClick = _ref.onClick,
|
901
|
+
onMouseEnter = _ref.onMouseEnter,
|
902
|
+
query = _ref.query,
|
903
|
+
renderSuggestion = _ref.renderSuggestion,
|
904
|
+
suggestion = _ref.suggestion,
|
905
|
+
style = _ref.style,
|
906
|
+
className = _ref.className,
|
907
|
+
classNames = _ref.classNames;
|
908
|
+
var rest = {
|
909
|
+
onClick: onClick,
|
910
|
+
onMouseEnter: onMouseEnter
|
911
|
+
};
|
901
912
|
|
902
|
-
var
|
913
|
+
var renderContent = function renderContent() {
|
914
|
+
var display = getDisplay();
|
915
|
+
var highlightedDisplay = renderHighlightedDisplay(display);
|
903
916
|
|
904
|
-
|
905
|
-
|
917
|
+
if (renderSuggestion) {
|
918
|
+
return renderSuggestion(suggestion, query, highlightedDisplay, index, focused);
|
919
|
+
}
|
906
920
|
|
907
|
-
return
|
908
|
-
}
|
921
|
+
return highlightedDisplay;
|
922
|
+
};
|
909
923
|
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
var rest = omit(this.props, ['style', 'classNames', 'className'], // substyle props
|
914
|
-
keys(Suggestion.propTypes));
|
915
|
-
return /*#__PURE__*/React__default.createElement("li", _extends({
|
916
|
-
id: this.props.id,
|
917
|
-
role: "option",
|
918
|
-
"aria-selected": this.props.focused
|
919
|
-
}, rest, this.props.style), this.renderContent());
|
924
|
+
var getDisplay = function getDisplay() {
|
925
|
+
if (typeof suggestion === 'string') {
|
926
|
+
return suggestion;
|
920
927
|
}
|
921
|
-
}, {
|
922
|
-
key: "renderContent",
|
923
|
-
value: function renderContent() {
|
924
|
-
var _this$props = this.props,
|
925
|
-
query = _this$props.query,
|
926
|
-
renderSuggestion = _this$props.renderSuggestion,
|
927
|
-
suggestion = _this$props.suggestion,
|
928
|
-
index = _this$props.index,
|
929
|
-
focused = _this$props.focused;
|
930
|
-
var display = this.getDisplay();
|
931
|
-
var highlightedDisplay = this.renderHighlightedDisplay(display, query);
|
932
|
-
|
933
|
-
if (renderSuggestion) {
|
934
|
-
return renderSuggestion(suggestion, query, highlightedDisplay, index, focused);
|
935
|
-
}
|
936
928
|
|
937
|
-
|
938
|
-
|
939
|
-
}, {
|
940
|
-
key: "getDisplay",
|
941
|
-
value: function getDisplay() {
|
942
|
-
var suggestion = this.props.suggestion;
|
929
|
+
var id = suggestion.id,
|
930
|
+
display = suggestion.display;
|
943
931
|
|
944
|
-
|
945
|
-
|
946
|
-
|
932
|
+
if (id === undefined || !display) {
|
933
|
+
return id;
|
934
|
+
}
|
947
935
|
|
948
|
-
|
949
|
-
|
936
|
+
return display;
|
937
|
+
};
|
950
938
|
|
951
|
-
|
952
|
-
|
953
|
-
}
|
939
|
+
var renderHighlightedDisplay = function renderHighlightedDisplay(display) {
|
940
|
+
var i = getSubstringIndex(display, query, ignoreAccents);
|
954
941
|
|
955
|
-
|
942
|
+
if (i === -1) {
|
943
|
+
return /*#__PURE__*/React__default.createElement("span", style('display'), display);
|
956
944
|
}
|
957
|
-
}, {
|
958
|
-
key: "renderHighlightedDisplay",
|
959
|
-
value: function renderHighlightedDisplay(display) {
|
960
|
-
var _this$props2 = this.props,
|
961
|
-
ignoreAccents = _this$props2.ignoreAccents,
|
962
|
-
query = _this$props2.query,
|
963
|
-
style = _this$props2.style;
|
964
|
-
var i = getSubstringIndex(display, query, ignoreAccents);
|
965
|
-
|
966
|
-
if (i === -1) {
|
967
|
-
return /*#__PURE__*/React__default.createElement("span", style('display'), display);
|
968
|
-
}
|
969
945
|
|
970
|
-
|
971
|
-
|
972
|
-
}]);
|
946
|
+
return /*#__PURE__*/React__default.createElement("span", style('display'), display.substring(0, i), /*#__PURE__*/React__default.createElement("b", style('highlight'), display.substring(i, i + query.length)), display.substring(i + query.length));
|
947
|
+
};
|
973
948
|
|
974
|
-
return
|
975
|
-
|
949
|
+
return /*#__PURE__*/React__default.createElement("li", _extends({
|
950
|
+
id: id,
|
951
|
+
role: "option",
|
952
|
+
"aria-selected": focused
|
953
|
+
}, rest, style), renderContent());
|
954
|
+
}
|
976
955
|
|
977
|
-
|
956
|
+
Suggestion.propTypes = {
|
978
957
|
id: PropTypes.string.isRequired,
|
979
958
|
query: PropTypes.string.isRequired,
|
980
959
|
index: PropTypes.number.isRequired,
|
@@ -985,8 +964,7 @@ _defineProperty(Suggestion, "propTypes", {
|
|
985
964
|
})]).isRequired,
|
986
965
|
renderSuggestion: PropTypes.func,
|
987
966
|
focused: PropTypes.bool
|
988
|
-
}
|
989
|
-
|
967
|
+
};
|
990
968
|
var styled$1 = createDefaultStyle({
|
991
969
|
cursor: 'pointer'
|
992
970
|
}, function (props) {
|
@@ -1011,14 +989,14 @@ function LoadingIndicator(_ref) {
|
|
1011
989
|
|
1012
990
|
var defaultstyle = {};
|
1013
991
|
|
1014
|
-
function _createSuper$
|
992
|
+
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
1015
993
|
|
1016
|
-
function _isNativeReflectConstruct$
|
994
|
+
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
1017
995
|
|
1018
996
|
var SuggestionsOverlay = /*#__PURE__*/function (_Component) {
|
1019
997
|
_inherits(SuggestionsOverlay, _Component);
|
1020
998
|
|
1021
|
-
var _super = _createSuper$
|
999
|
+
var _super = _createSuper$1(SuggestionsOverlay);
|
1022
1000
|
|
1023
1001
|
function SuggestionsOverlay() {
|
1024
1002
|
var _this;
|
@@ -1218,9 +1196,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
1218
1196
|
|
1219
1197
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
1220
1198
|
|
1221
|
-
function _createSuper$
|
1199
|
+
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
1222
1200
|
|
1223
|
-
function _isNativeReflectConstruct$
|
1201
|
+
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
1224
1202
|
var makeTriggerRegex = function makeTriggerRegex(trigger) {
|
1225
1203
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1226
1204
|
|
@@ -1292,7 +1270,7 @@ var propTypes = {
|
|
1292
1270
|
var MentionsInput = /*#__PURE__*/function (_React$Component) {
|
1293
1271
|
_inherits(MentionsInput, _React$Component);
|
1294
1272
|
|
1295
|
-
var _super = _createSuper$
|
1273
|
+
var _super = _createSuper$2(MentionsInput);
|
1296
1274
|
|
1297
1275
|
function MentionsInput(_props) {
|
1298
1276
|
var _this;
|
@@ -585,70 +585,28 @@ var styled = createDefaultStyle({
|
|
585
585
|
};
|
586
586
|
}), Highlighter$1 = styled(Highlighter);
|
587
587
|
|
588
|
-
function
|
589
|
-
var
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
return
|
588
|
+
function Suggestion(_ref) {
|
589
|
+
var display, highlightedDisplay, id = _ref.id, focused = _ref.focused, ignoreAccents = _ref.ignoreAccents, index = _ref.index, onClick = _ref.onClick, onMouseEnter = _ref.onMouseEnter, query = _ref.query, renderSuggestion = _ref.renderSuggestion, suggestion = _ref.suggestion, style = _ref.style, rest = (_ref.className,
|
590
|
+
_ref.classNames, {
|
591
|
+
onClick: onClick,
|
592
|
+
onMouseEnter: onMouseEnter
|
593
|
+
}), getDisplay = function() {
|
594
|
+
if ("string" == typeof suggestion) return suggestion;
|
595
|
+
var id = suggestion.id, display = suggestion.display;
|
596
|
+
return void 0 !== id && display ? display : id;
|
597
|
+
}, renderHighlightedDisplay = function(display) {
|
598
|
+
var i = getSubstringIndex(display, query, ignoreAccents);
|
599
|
+
return -1 === i ? React__default.createElement("span", style("display"), display) : React__default.createElement("span", style("display"), display.substring(0, i), React__default.createElement("b", style("highlight"), display.substring(i, i + query.length)), display.substring(i + query.length));
|
597
600
|
};
|
601
|
+
return React__default.createElement("li", _extends({
|
602
|
+
id: id,
|
603
|
+
role: "option",
|
604
|
+
"aria-selected": focused
|
605
|
+
}, rest, style), (display = getDisplay(), highlightedDisplay = renderHighlightedDisplay(display),
|
606
|
+
renderSuggestion ? renderSuggestion(suggestion, query, highlightedDisplay, index, focused) : highlightedDisplay));
|
598
607
|
}
|
599
608
|
|
600
|
-
|
601
|
-
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
602
|
-
if (Reflect.construct.sham) return !1;
|
603
|
-
if ("function" == typeof Proxy) return !0;
|
604
|
-
try {
|
605
|
-
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})),
|
606
|
-
!0;
|
607
|
-
} catch (e) {
|
608
|
-
return !1;
|
609
|
-
}
|
610
|
-
}
|
611
|
-
|
612
|
-
var Suggestion = function(_Component) {
|
613
|
-
_inherits(Suggestion, _Component);
|
614
|
-
var _super = _createSuper$1(Suggestion);
|
615
|
-
function Suggestion() {
|
616
|
-
return _classCallCheck(this, Suggestion), _super.apply(this, arguments);
|
617
|
-
}
|
618
|
-
return _createClass(Suggestion, [ {
|
619
|
-
key: "render",
|
620
|
-
value: function() {
|
621
|
-
var rest = omit(this.props, [ "style", "classNames", "className" ], keys(Suggestion.propTypes));
|
622
|
-
return React__default.createElement("li", _extends({
|
623
|
-
id: this.props.id,
|
624
|
-
role: "option",
|
625
|
-
"aria-selected": this.props.focused
|
626
|
-
}, rest, this.props.style), this.renderContent());
|
627
|
-
}
|
628
|
-
}, {
|
629
|
-
key: "renderContent",
|
630
|
-
value: function() {
|
631
|
-
var _this$props = this.props, query = _this$props.query, renderSuggestion = _this$props.renderSuggestion, suggestion = _this$props.suggestion, index = _this$props.index, focused = _this$props.focused, display = this.getDisplay(), highlightedDisplay = this.renderHighlightedDisplay(display, query);
|
632
|
-
return renderSuggestion ? renderSuggestion(suggestion, query, highlightedDisplay, index, focused) : highlightedDisplay;
|
633
|
-
}
|
634
|
-
}, {
|
635
|
-
key: "getDisplay",
|
636
|
-
value: function() {
|
637
|
-
var suggestion = this.props.suggestion;
|
638
|
-
if ("string" == typeof suggestion) return suggestion;
|
639
|
-
var id = suggestion.id, display = suggestion.display;
|
640
|
-
return void 0 !== id && display ? display : id;
|
641
|
-
}
|
642
|
-
}, {
|
643
|
-
key: "renderHighlightedDisplay",
|
644
|
-
value: function(display) {
|
645
|
-
var _this$props2 = this.props, ignoreAccents = _this$props2.ignoreAccents, query = _this$props2.query, style = _this$props2.style, i = getSubstringIndex(display, query, ignoreAccents);
|
646
|
-
return -1 === i ? React__default.createElement("span", style("display"), display) : React__default.createElement("span", style("display"), display.substring(0, i), React__default.createElement("b", style("highlight"), display.substring(i, i + query.length)), display.substring(i + query.length));
|
647
|
-
}
|
648
|
-
} ]), Suggestion;
|
649
|
-
}(React.Component);
|
650
|
-
|
651
|
-
_defineProperty(Suggestion, "propTypes", {
|
609
|
+
Suggestion.propTypes = {
|
652
610
|
id: PropTypes.string.isRequired,
|
653
611
|
query: PropTypes.string.isRequired,
|
654
612
|
index: PropTypes.number.isRequired,
|
@@ -659,7 +617,7 @@ _defineProperty(Suggestion, "propTypes", {
|
|
659
617
|
}) ]).isRequired,
|
660
618
|
renderSuggestion: PropTypes.func,
|
661
619
|
focused: PropTypes.bool
|
662
|
-
}
|
620
|
+
};
|
663
621
|
|
664
622
|
var styled$1 = createDefaultStyle({
|
665
623
|
cursor: "pointer"
|
@@ -680,8 +638,8 @@ function LoadingIndicator(_ref) {
|
|
680
638
|
|
681
639
|
var defaultstyle = {};
|
682
640
|
|
683
|
-
function _createSuper$
|
684
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct$
|
641
|
+
function _createSuper$1(Derived) {
|
642
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct$1();
|
685
643
|
return function() {
|
686
644
|
var result, Super = _getPrototypeOf(Derived);
|
687
645
|
if (hasNativeReflectConstruct) {
|
@@ -692,7 +650,7 @@ function _createSuper$2(Derived) {
|
|
692
650
|
};
|
693
651
|
}
|
694
652
|
|
695
|
-
function _isNativeReflectConstruct$
|
653
|
+
function _isNativeReflectConstruct$1() {
|
696
654
|
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
697
655
|
if (Reflect.construct.sham) return !1;
|
698
656
|
if ("function" == typeof Proxy) return !0;
|
@@ -706,7 +664,7 @@ function _isNativeReflectConstruct$2() {
|
|
706
664
|
|
707
665
|
var SuggestionsOverlay = function(_Component) {
|
708
666
|
_inherits(SuggestionsOverlay, _Component);
|
709
|
-
var _super = _createSuper$
|
667
|
+
var _super = _createSuper$1(SuggestionsOverlay);
|
710
668
|
function SuggestionsOverlay() {
|
711
669
|
var _this;
|
712
670
|
_classCallCheck(this, SuggestionsOverlay);
|
@@ -851,8 +809,8 @@ function _objectSpread(target) {
|
|
851
809
|
return target;
|
852
810
|
}
|
853
811
|
|
854
|
-
function _createSuper$
|
855
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct$
|
812
|
+
function _createSuper$2(Derived) {
|
813
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct$2();
|
856
814
|
return function() {
|
857
815
|
var result, Super = _getPrototypeOf(Derived);
|
858
816
|
if (hasNativeReflectConstruct) {
|
@@ -863,7 +821,7 @@ function _createSuper$3(Derived) {
|
|
863
821
|
};
|
864
822
|
}
|
865
823
|
|
866
|
-
function _isNativeReflectConstruct$
|
824
|
+
function _isNativeReflectConstruct$2() {
|
867
825
|
if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
|
868
826
|
if (Reflect.construct.sham) return !1;
|
869
827
|
if ("function" == typeof Proxy) return !0;
|
@@ -914,7 +872,7 @@ var makeTriggerRegex = function(trigger) {
|
|
914
872
|
children: PropTypes.oneOfType([ PropTypes.element, PropTypes.arrayOf(PropTypes.element) ]).isRequired
|
915
873
|
}, MentionsInput = function(_React$Component) {
|
916
874
|
_inherits(MentionsInput, _React$Component);
|
917
|
-
var _super = _createSuper$
|
875
|
+
var _super = _createSuper$2(MentionsInput);
|
918
876
|
function MentionsInput(_props) {
|
919
877
|
var _this;
|
920
878
|
return _classCallCheck(this, MentionsInput), _this = _super.call(this, _props),
|
@@ -884,89 +884,68 @@ var styled = createDefaultStyle({
|
|
884
884
|
});
|
885
885
|
var Highlighter$1 = styled(Highlighter);
|
886
886
|
|
887
|
-
function
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
887
|
+
function Suggestion(_ref) {
|
888
|
+
var id = _ref.id,
|
889
|
+
focused = _ref.focused,
|
890
|
+
ignoreAccents = _ref.ignoreAccents,
|
891
|
+
index = _ref.index,
|
892
|
+
onClick = _ref.onClick,
|
893
|
+
onMouseEnter = _ref.onMouseEnter,
|
894
|
+
query = _ref.query,
|
895
|
+
renderSuggestion = _ref.renderSuggestion,
|
896
|
+
suggestion = _ref.suggestion,
|
897
|
+
style = _ref.style,
|
898
|
+
className = _ref.className,
|
899
|
+
classNames = _ref.classNames;
|
900
|
+
var rest = {
|
901
|
+
onClick: onClick,
|
902
|
+
onMouseEnter: onMouseEnter
|
903
|
+
};
|
893
904
|
|
894
|
-
var
|
905
|
+
var renderContent = function renderContent() {
|
906
|
+
var display = getDisplay();
|
907
|
+
var highlightedDisplay = renderHighlightedDisplay(display);
|
895
908
|
|
896
|
-
|
897
|
-
|
909
|
+
if (renderSuggestion) {
|
910
|
+
return renderSuggestion(suggestion, query, highlightedDisplay, index, focused);
|
911
|
+
}
|
898
912
|
|
899
|
-
return
|
900
|
-
}
|
913
|
+
return highlightedDisplay;
|
914
|
+
};
|
901
915
|
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
var rest = omit(this.props, ['style', 'classNames', 'className'], // substyle props
|
906
|
-
keys(Suggestion.propTypes));
|
907
|
-
return /*#__PURE__*/React.createElement("li", _extends({
|
908
|
-
id: this.props.id,
|
909
|
-
role: "option",
|
910
|
-
"aria-selected": this.props.focused
|
911
|
-
}, rest, this.props.style), this.renderContent());
|
916
|
+
var getDisplay = function getDisplay() {
|
917
|
+
if (typeof suggestion === 'string') {
|
918
|
+
return suggestion;
|
912
919
|
}
|
913
|
-
}, {
|
914
|
-
key: "renderContent",
|
915
|
-
value: function renderContent() {
|
916
|
-
var _this$props = this.props,
|
917
|
-
query = _this$props.query,
|
918
|
-
renderSuggestion = _this$props.renderSuggestion,
|
919
|
-
suggestion = _this$props.suggestion,
|
920
|
-
index = _this$props.index,
|
921
|
-
focused = _this$props.focused;
|
922
|
-
var display = this.getDisplay();
|
923
|
-
var highlightedDisplay = this.renderHighlightedDisplay(display, query);
|
924
|
-
|
925
|
-
if (renderSuggestion) {
|
926
|
-
return renderSuggestion(suggestion, query, highlightedDisplay, index, focused);
|
927
|
-
}
|
928
920
|
|
929
|
-
|
930
|
-
|
931
|
-
}, {
|
932
|
-
key: "getDisplay",
|
933
|
-
value: function getDisplay() {
|
934
|
-
var suggestion = this.props.suggestion;
|
921
|
+
var id = suggestion.id,
|
922
|
+
display = suggestion.display;
|
935
923
|
|
936
|
-
|
937
|
-
|
938
|
-
|
924
|
+
if (id === undefined || !display) {
|
925
|
+
return id;
|
926
|
+
}
|
939
927
|
|
940
|
-
|
941
|
-
|
928
|
+
return display;
|
929
|
+
};
|
942
930
|
|
943
|
-
|
944
|
-
|
945
|
-
}
|
931
|
+
var renderHighlightedDisplay = function renderHighlightedDisplay(display) {
|
932
|
+
var i = getSubstringIndex(display, query, ignoreAccents);
|
946
933
|
|
947
|
-
|
934
|
+
if (i === -1) {
|
935
|
+
return /*#__PURE__*/React.createElement("span", style('display'), display);
|
948
936
|
}
|
949
|
-
}, {
|
950
|
-
key: "renderHighlightedDisplay",
|
951
|
-
value: function renderHighlightedDisplay(display) {
|
952
|
-
var _this$props2 = this.props,
|
953
|
-
ignoreAccents = _this$props2.ignoreAccents,
|
954
|
-
query = _this$props2.query,
|
955
|
-
style = _this$props2.style;
|
956
|
-
var i = getSubstringIndex(display, query, ignoreAccents);
|
957
|
-
|
958
|
-
if (i === -1) {
|
959
|
-
return /*#__PURE__*/React.createElement("span", style('display'), display);
|
960
|
-
}
|
961
937
|
|
962
|
-
|
963
|
-
|
964
|
-
}]);
|
938
|
+
return /*#__PURE__*/React.createElement("span", style('display'), display.substring(0, i), /*#__PURE__*/React.createElement("b", style('highlight'), display.substring(i, i + query.length)), display.substring(i + query.length));
|
939
|
+
};
|
965
940
|
|
966
|
-
return
|
967
|
-
|
941
|
+
return /*#__PURE__*/React.createElement("li", _extends({
|
942
|
+
id: id,
|
943
|
+
role: "option",
|
944
|
+
"aria-selected": focused
|
945
|
+
}, rest, style), renderContent());
|
946
|
+
}
|
968
947
|
|
969
|
-
|
948
|
+
Suggestion.propTypes = {
|
970
949
|
id: PropTypes.string.isRequired,
|
971
950
|
query: PropTypes.string.isRequired,
|
972
951
|
index: PropTypes.number.isRequired,
|
@@ -977,8 +956,7 @@ _defineProperty(Suggestion, "propTypes", {
|
|
977
956
|
})]).isRequired,
|
978
957
|
renderSuggestion: PropTypes.func,
|
979
958
|
focused: PropTypes.bool
|
980
|
-
}
|
981
|
-
|
959
|
+
};
|
982
960
|
var styled$1 = createDefaultStyle({
|
983
961
|
cursor: 'pointer'
|
984
962
|
}, function (props) {
|
@@ -1003,14 +981,14 @@ function LoadingIndicator(_ref) {
|
|
1003
981
|
|
1004
982
|
var defaultstyle = {};
|
1005
983
|
|
1006
|
-
function _createSuper$
|
984
|
+
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
1007
985
|
|
1008
|
-
function _isNativeReflectConstruct$
|
986
|
+
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
1009
987
|
|
1010
988
|
var SuggestionsOverlay = /*#__PURE__*/function (_Component) {
|
1011
989
|
_inherits(SuggestionsOverlay, _Component);
|
1012
990
|
|
1013
|
-
var _super = _createSuper$
|
991
|
+
var _super = _createSuper$1(SuggestionsOverlay);
|
1014
992
|
|
1015
993
|
function SuggestionsOverlay() {
|
1016
994
|
var _this;
|
@@ -1210,9 +1188,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
1210
1188
|
|
1211
1189
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
1212
1190
|
|
1213
|
-
function _createSuper$
|
1191
|
+
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
1214
1192
|
|
1215
|
-
function _isNativeReflectConstruct$
|
1193
|
+
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
1216
1194
|
var makeTriggerRegex = function makeTriggerRegex(trigger) {
|
1217
1195
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1218
1196
|
|
@@ -1284,7 +1262,7 @@ var propTypes = {
|
|
1284
1262
|
var MentionsInput = /*#__PURE__*/function (_React$Component) {
|
1285
1263
|
_inherits(MentionsInput, _React$Component);
|
1286
1264
|
|
1287
|
-
var _super = _createSuper$
|
1265
|
+
var _super = _createSuper$2(MentionsInput);
|
1288
1266
|
|
1289
1267
|
function MentionsInput(_props) {
|
1290
1268
|
var _this;
|