draft-js-mention-plugin
Advanced tools
Comparing version 3.1.3 to 3.1.4
@@ -6,2 +6,7 @@ # Change Log | ||
## 3.1.4 | ||
- Allow draft-js v0.11 | ||
- Remove unused dependencies | ||
## 3.1.3 | ||
@@ -8,0 +13,0 @@ - Force update regex's `lastIndex` to avoid infinite loop |
@@ -8,2 +8,5 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // eslint-disable-line import/no-named-as-default | ||
var _MentionSuggestions = require('./MentionSuggestions'); | ||
@@ -18,5 +21,5 @@ | ||
var _decorateComponentWithProps = require('decorate-component-with-props'); | ||
var _react = require('react'); | ||
var _decorateComponentWithProps2 = _interopRequireDefault(_decorateComponentWithProps); | ||
var _react2 = _interopRequireDefault(_react); | ||
@@ -171,3 +174,3 @@ var _immutable = require('immutable'); | ||
_config$mentionSugges = config.mentionSuggestionsComponent, | ||
mentionSuggestionsComponent = _config$mentionSugges === undefined ? _MentionSuggestions2.default : _config$mentionSugges, | ||
MentionSuggestionsComponent = _config$mentionSugges === undefined ? _MentionSuggestions2.default : _config$mentionSugges, | ||
_config$entityMutabil = config.entityMutability, | ||
@@ -192,10 +195,19 @@ entityMutability = _config$entityMutabil === undefined ? 'SEGMENTED' : _config$entityMutabil, | ||
}; | ||
var DecoratedMentionSuggestionsComponent = function DecoratedMentionSuggestionsComponent(props) { | ||
return _react2.default.createElement(MentionSuggestionsComponent, _extends({}, props, mentionSearchProps)); | ||
}; | ||
var DecoratedMention = function DecoratedMention(props) { | ||
return _react2.default.createElement(_Mention2.default, _extends({}, props, { theme: theme, mentionComponent: mentionComponent })); | ||
}; | ||
var DecoratedMentionSuggestionsPortal = function DecoratedMentionSuggestionsPortal(props) { | ||
return _react2.default.createElement(_MentionSuggestionsPortal2.default, _extends({}, props, { store: store })); | ||
}; | ||
return { | ||
MentionSuggestions: (0, _decorateComponentWithProps2.default)(mentionSuggestionsComponent, mentionSearchProps), | ||
MentionSuggestions: DecoratedMentionSuggestionsComponent, | ||
decorators: [{ | ||
strategy: (0, _mentionStrategy2.default)(mentionTrigger), | ||
component: (0, _decorateComponentWithProps2.default)(_Mention2.default, { theme: theme, mentionComponent: mentionComponent }) | ||
component: DecoratedMention | ||
}, { | ||
strategy: (0, _mentionSuggestionsStrategy2.default)(mentionTrigger, supportWhitespace, mentionRegExp), | ||
component: (0, _decorateComponentWithProps2.default)(_MentionSuggestionsPortal2.default, { store: store }) | ||
component: DecoratedMentionSuggestionsPortal | ||
}], | ||
@@ -202,0 +214,0 @@ getAccessibilityProps: function getAccessibilityProps() { |
@@ -11,5 +11,5 @@ 'use strict'; | ||
var _unionClassNames = require('union-class-names'); | ||
var _clsx = require('clsx'); | ||
var _unionClassNames2 = _interopRequireDefault(_unionClassNames); | ||
var _clsx2 = _interopRequireDefault(_clsx); | ||
@@ -57,3 +57,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var combinedClassName = (0, _unionClassNames2.default)(theme.mention, className); | ||
var combinedClassName = (0, _clsx2.default)(theme.mention, className); | ||
var mention = contentState.getEntity(entityKey).getData().mention; | ||
@@ -60,0 +60,0 @@ |
@@ -22,5 +22,5 @@ 'use strict'; | ||
var _lodash = require('lodash.escaperegexp'); | ||
var _escapeRegExp = require('lodash/escapeRegExp'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); | ||
@@ -163,3 +163,3 @@ var _Entry = require('./Entry'); | ||
end = _ref4.end; | ||
return start === 0 && anchorOffset === _this.props.mentionTrigger.length && plainText.charAt(anchorOffset) !== _this.props.mentionTrigger && new RegExp(String.raw({ raw: '' + (0, _lodash2.default)(_this.props.mentionTrigger) }), 'g').test(plainText) && anchorOffset <= end || // @ is the first character | ||
return start === 0 && anchorOffset === _this.props.mentionTrigger.length && plainText.charAt(anchorOffset) !== _this.props.mentionTrigger && new RegExp(String.raw({ raw: '' + (0, _escapeRegExp2.default)(_this.props.mentionTrigger) }), 'g').test(plainText) && anchorOffset <= end || // @ is the first character | ||
anchorOffset > start + _this.props.mentionTrigger.length && anchorOffset <= end // @ is in the text or at the end | ||
@@ -166,0 +166,0 @@ ; |
{ | ||
"name": "draft-js-mention-plugin", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "Mention Plugin for DraftJS", | ||
@@ -15,2 +15,5 @@ "author": { | ||
"main": "lib/index.js", | ||
"files": [ | ||
"lib" | ||
], | ||
"keywords": [ | ||
@@ -35,11 +38,10 @@ "editor", | ||
"dependencies": { | ||
"decorate-component-with-props": "^1.0.2", | ||
"find-with-regex": "^1.1.3", | ||
"clsx": "^1.0.4", | ||
"immutable": "~3.7.4", | ||
"lodash": "^4.17.14", | ||
"prop-types": "^15.5.8", | ||
"lodash.escaperegexp": "^4.1.2", | ||
"union-class-names": "^1.0.0" | ||
}, | ||
"peerDependencies": { | ||
"draft-js": "^0.10.1", | ||
"draft-js": "^0.10.1 || ^0.11.0", | ||
"react": "^15.5.0 || ^16.0.0-rc", | ||
@@ -46,0 +48,0 @@ "react-dom": "^15.5.0 || ^16.0.0-rc" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
1080
65644
22
+ Addedclsx@^1.0.4
+ Addedlodash@^4.17.14
+ Addedclsx@1.2.1(transitive)
+ Addedcore-js@3.38.1(transitive)
+ Addedcross-fetch@3.1.8(transitive)
+ Addeddraft-js@0.11.7(transitive)
+ Addedfbjs@2.0.0(transitive)
+ Addedfbjs-css-vars@1.0.2(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removeddecorate-component-with-props@^1.0.2
- Removedfind-with-regex@^1.1.3
- Removedlodash.escaperegexp@^4.1.2
- Removedcore-js@1.2.7(transitive)
- Removeddecorate-component-with-props@1.2.1(transitive)
- Removeddraft-js@0.10.5(transitive)
- Removedencoding@0.1.13(transitive)
- Removedfbjs@0.8.18(transitive)
- Removedfind-with-regex@1.1.3(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removedlodash.escaperegexp@4.1.2(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)