Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-mentions

Package Overview
Dependencies
Maintainers
3
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-mentions - npm Package Compare versions

Comparing version 1.6.2 to 1.6.3

6

es/DropdownMenu.js

@@ -23,4 +23,8 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";

_this = _super.apply(this, arguments);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_this.renderDropdown = function (_ref) {

@@ -27,0 +31,0 @@ var notFoundContent = _ref.notFoundContent,

@@ -14,2 +14,3 @@ import * as React from 'react';

getPopupContainer?: () => HTMLElement;
dropdownClassName?: string;
}

@@ -16,0 +17,0 @@ declare class KeywordTrigger extends React.Component<KeywordTriggerProps, {}> {

9

es/KeywordTrigger.js

@@ -8,2 +8,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";

import DropdownMenu from './DropdownMenu';
import classNames from 'classnames';
var BUILT_IN_PLACEMENTS = {

@@ -54,6 +55,10 @@ bottomRight: {

_this = _super.apply(this, arguments);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_this.getDropdownPrefix = function () {
return "".concat(_this.props.prefixCls, "-dropdown");
return classNames("".concat(_this.props.prefixCls, "-dropdown"), _this.props.dropdownClassName);
};

@@ -60,0 +65,0 @@

@@ -29,2 +29,3 @@ import * as React from 'react';

getPopupContainer?: () => HTMLElement;
dropdownClassName?: string;
}

@@ -31,0 +32,0 @@ interface MentionsState {

@@ -8,2 +8,3 @@ import _extends from "@babel/runtime/helpers/esm/extends";

import _createSuper from "@babel/runtime/helpers/esm/createSuper";
var _excluded = ["prefixCls", "placement", "direction", "transitionName", "className", "style", "autoFocus", "notFoundContent", "getPopupContainer", "dropdownClassName"];
import classNames from 'classnames';

@@ -24,3 +25,3 @@ import toArray from "rc-util/es/Children/toArray";

function Mentions(props) {
function Mentions(_props) {
var _this;

@@ -30,3 +31,5 @@

_this = _super.call(this, props);
_this = _super.call(this, _props);
_this.textarea = void 0;
_this.measure = void 0;
_this.focusId = undefined;

@@ -52,5 +55,4 @@

_this.triggerChange(value);
}; // Check if hit the measure keyword
};
_this.onKeyDown = function (event) {

@@ -103,16 +105,3 @@ var which = event.which;

};
/**
* When to start measure:
* 1. When user press `prefix`
* 2. When measureText !== prevMeasureText
* - If measure hit
* - If measuring
*
* When to stop measure:
* 1. Selection is out of range
* 2. Contains `space`
* 3. ESC or select one
*/
_this.onKeyUp = function (event) {

@@ -301,3 +290,3 @@ var key = event.key,

_this.state = {
value: props.defaultValue || props.value || '',
value: _props.defaultValue || _props.value || '',
measuring: false,

@@ -372,3 +361,4 @@ measureLocation: 0,

getPopupContainer = _this$props4.getPopupContainer,
restProps = _objectWithoutProperties(_this$props4, ["prefixCls", "placement", "direction", "transitionName", "className", "style", "autoFocus", "notFoundContent", "getPopupContainer"]);
dropdownClassName = _this$props4.dropdownClassName,
restProps = _objectWithoutProperties(_this$props4, _excluded);

@@ -410,3 +400,4 @@ var inputProps = omit(restProps, 'value', 'defaultValue', 'prefix', 'split', 'children', 'validateSearch', 'filterOption', 'onSelect', 'onSearch');

visible: true,
getPopupContainer: getPopupContainer
getPopupContainer: getPopupContainer,
dropdownClassName: dropdownClassName
}, /*#__PURE__*/React.createElement("span", null, measurePrefix))), value.slice(measureLocation + measurePrefix.length)));

@@ -413,0 +404,0 @@ }

@@ -39,4 +39,9 @@ "use strict";

(0, _classCallCheck2.default)(this, DropdownMenu);
_this = _super.apply(this, arguments);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_this.renderDropdown = function (_ref) {

@@ -43,0 +48,0 @@ var notFoundContent = _ref.notFoundContent,

@@ -14,2 +14,3 @@ import * as React from 'react';

getPopupContainer?: () => HTMLElement;
dropdownClassName?: string;
}

@@ -16,0 +17,0 @@ declare class KeywordTrigger extends React.Component<KeywordTriggerProps, {}> {

@@ -26,2 +26,4 @@ "use strict";

var _classnames = _interopRequireDefault(require("classnames"));
var BUILT_IN_PLACEMENTS = {

@@ -71,6 +73,11 @@ bottomRight: {

(0, _classCallCheck2.default)(this, KeywordTrigger);
_this = _super.apply(this, arguments);
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _super.call.apply(_super, [this].concat(args));
_this.getDropdownPrefix = function () {
return "".concat(_this.props.prefixCls, "-dropdown");
return (0, _classnames.default)("".concat(_this.props.prefixCls, "-dropdown"), _this.props.dropdownClassName);
};

@@ -77,0 +84,0 @@

@@ -29,2 +29,3 @@ import * as React from 'react';

getPopupContainer?: () => HTMLElement;
dropdownClassName?: string;
}

@@ -31,0 +32,0 @@ interface MentionsState {

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -44,2 +44,4 @@ value: true

var _excluded = ["prefixCls", "placement", "direction", "transitionName", "className", "style", "autoFocus", "notFoundContent", "getPopupContainer", "dropdownClassName"];
var Mentions = /*#__PURE__*/function (_React$Component) {

@@ -50,7 +52,9 @@ (0, _inherits2.default)(Mentions, _React$Component);

function Mentions(props) {
function Mentions(_props) {
var _this;
(0, _classCallCheck2.default)(this, Mentions);
_this = _super.call(this, props);
_this = _super.call(this, _props);
_this.textarea = void 0;
_this.measure = void 0;
_this.focusId = undefined;

@@ -76,5 +80,4 @@

_this.triggerChange(value);
}; // Check if hit the measure keyword
};
_this.onKeyDown = function (event) {

@@ -127,16 +130,3 @@ var which = event.which;

};
/**
* When to start measure:
* 1. When user press `prefix`
* 2. When measureText !== prevMeasureText
* - If measure hit
* - If measuring
*
* When to stop measure:
* 1. Selection is out of range
* 2. Contains `space`
* 3. ESC or select one
*/
_this.onKeyUp = function (event) {

@@ -325,3 +315,3 @@ var key = event.key,

_this.state = {
value: props.defaultValue || props.value || '',
value: _props.defaultValue || _props.value || '',
measuring: false,

@@ -395,3 +385,4 @@ measureLocation: 0,

getPopupContainer = _this$props4.getPopupContainer,
restProps = (0, _objectWithoutProperties2.default)(_this$props4, ["prefixCls", "placement", "direction", "transitionName", "className", "style", "autoFocus", "notFoundContent", "getPopupContainer"]);
dropdownClassName = _this$props4.dropdownClassName,
restProps = (0, _objectWithoutProperties2.default)(_this$props4, _excluded);
var inputProps = (0, _util.omit)(restProps, 'value', 'defaultValue', 'prefix', 'split', 'children', 'validateSearch', 'filterOption', 'onSelect', 'onSearch');

@@ -432,3 +423,4 @@ var options = measuring ? this.getOptions() : [];

visible: true,
getPopupContainer: getPopupContainer
getPopupContainer: getPopupContainer,
dropdownClassName: dropdownClassName
}, /*#__PURE__*/React.createElement("span", null, measurePrefix))), value.slice(measureLocation + measurePrefix.length)));

@@ -435,0 +427,0 @@ }

@@ -8,3 +8,3 @@ "use strict";

});
exports.MentionsContextConsumer = exports.MentionsContextProvider = void 0;
exports.MentionsContextProvider = exports.MentionsContextConsumer = void 0;

@@ -11,0 +11,0 @@ var React = _interopRequireWildcard(require("react"));

@@ -8,9 +8,9 @@ "use strict";

});
exports.filterOption = filterOption;
exports.getBeforeSelectionText = getBeforeSelectionText;
exports.getLastMeasureIndex = getLastMeasureIndex;
exports.omit = void 0;
exports.replaceWithMeasure = replaceWithMeasure;
exports.setInputSelection = setInputSelection;
exports.validateSearch = validateSearch;
exports.filterOption = filterOption;
exports.omit = void 0;

@@ -17,0 +17,0 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

{
"name": "rc-mentions",
"version": "1.6.2",
"version": "1.6.3",
"description": "React Mentions",

@@ -50,7 +50,9 @@ "keywords": [

"enzyme-to-json": "^3.1.4",
"eslint": "^8.9.0",
"eslint": "^7.0.0",
"father": "^2.13.6",
"jest": "^24.9.0",
"lodash.debounce": "^4.0.8",
"np": "^7.0.0",
"react": "^17.0.2",
"prettier": "^2.0.5",
"react": "^16.0.0",
"react-dom": "^16.0.0",

@@ -57,0 +59,0 @@ "typescript": "^4.0.3"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc